From ed1b8e2ce18ef8b9b4dba59b22eb2e39722c8e9a Mon Sep 17 00:00:00 2001 From: ChiefSoft works Date: Sat, 3 Sep 2022 23:17:41 +0000 Subject: [PATCH 1/2] Environment and health/status fix --- wrenchboard/.env | 4 ++-- wrenchboard/Dockerfile | 5 ++++- wrenchboard/configs/cron | 1 + wrenchboard/configs/job.sh | 2 ++ wrenchboard/configs/pools/test1.conf | 0 wrenchboard/configs/pools/test2.conf | 0 wrenchboard/configs/pools/test3-pool.conf | 0 wrenchboard/configs/pools/test4-pool.conf | 0 wrenchboard/configs/start.sh | 2 ++ wrenchboard/configs/www.conf | 1 + wrenchboard/docker-compose.yml | 2 ++ 11 files changed, 14 insertions(+), 3 deletions(-) create mode 100755 wrenchboard/configs/cron create mode 100755 wrenchboard/configs/job.sh create mode 100644 wrenchboard/configs/pools/test1.conf create mode 100644 wrenchboard/configs/pools/test2.conf create mode 100644 wrenchboard/configs/pools/test3-pool.conf create mode 100644 wrenchboard/configs/pools/test4-pool.conf create mode 100644 wrenchboard/configs/start.sh diff --git a/wrenchboard/.env b/wrenchboard/.env index 31843a5f..dae002a5 100644 --- a/wrenchboard/.env +++ b/wrenchboard/.env @@ -2,7 +2,7 @@ PHP_UID=1000 PHP_GID=1000 PHP_HOME=/opt/mainsite/wrenchboard/www PHP_USER=php-fpm -# PHP_INI_SCAN_DIR=/cfgs:/usr/local/etc/php/conf.d +PHP_INI_SCAN_DIR=/cfgs:/usr/local/etc/php/conf.d PHP_INI_PATH=/cfgs/php.ini PHP_POOL_PATH=/cfgs/*/*-pool.conf PHP_BOOT_SCRIPTS=/cfgs/start.sh @@ -11,6 +11,6 @@ PHP_CRONTABS_PATH=/cfgs/cron #PHP_SESSION_PATH=tcp://redis.host:6379 # private -TEST_EMAIL=name@domain.com +TEST_EMAIL=support@wrenchboard.com #NEWRELIC_LICENSE=newrelic_license #SENDGRID_API_KEY=sendgrid_api_key \ No newline at end of file diff --git a/wrenchboard/Dockerfile b/wrenchboard/Dockerfile index 76f69e3e..2b5d8789 100644 --- a/wrenchboard/Dockerfile +++ b/wrenchboard/Dockerfile @@ -8,6 +8,9 @@ RUN apt -y update RUN apt -y install libconfig++-dev libconfig++9v5 libconfig-dev libconfig9 libpq-dev libpq5 libjson-c-dev libjson-c3 \ libpcrecpp0v5 unixodbc-dev postgresql-server-dev-11 libgsoap-dev libgsoap-2.8.75 +ADD scripts/* /usr/local/bin/ +ADD configs/* /cfgs/ + RUN mkdir -p /opt/mainsite/wrenchboard/ ADD build /opt/mainsite/wrenchboard/build ADD email /opt/mainsite/wrenchboard/email @@ -20,4 +23,4 @@ RUN cd /opt/mainsite/wrenchboard/src && make RUN ln -s /opt/mainsite/wrenchboard/src/modules/wrenchboard_api_root.so /usr/local/lib/php/extensions/no-debug-non-zts-20170718/wrenchboard_api_root.so -RUN echo "extension=wrenchboard_api_root.so" > /usr/local/etc/php/conf.d/docker-php-ext-wrenchboard.ini \ No newline at end of file +RUN echo "extension=wrenchboard_api_root.so" > /usr/local/etc/php/conf.d/docker-php-ext-wrenchboard.ini diff --git a/wrenchboard/configs/cron b/wrenchboard/configs/cron new file mode 100755 index 00000000..f4981282 --- /dev/null +++ b/wrenchboard/configs/cron @@ -0,0 +1 @@ +* * * * * root /cfgs/job.sh diff --git a/wrenchboard/configs/job.sh b/wrenchboard/configs/job.sh new file mode 100755 index 00000000..8e7600a1 --- /dev/null +++ b/wrenchboard/configs/job.sh @@ -0,0 +1,2 @@ +#!/bin/bash +echo "[ cronjob task ] executed at `date`" > /proc/1/fd/2 diff --git a/wrenchboard/configs/pools/test1.conf b/wrenchboard/configs/pools/test1.conf new file mode 100644 index 00000000..e69de29b diff --git a/wrenchboard/configs/pools/test2.conf b/wrenchboard/configs/pools/test2.conf new file mode 100644 index 00000000..e69de29b diff --git a/wrenchboard/configs/pools/test3-pool.conf b/wrenchboard/configs/pools/test3-pool.conf new file mode 100644 index 00000000..e69de29b diff --git a/wrenchboard/configs/pools/test4-pool.conf b/wrenchboard/configs/pools/test4-pool.conf new file mode 100644 index 00000000..e69de29b diff --git a/wrenchboard/configs/start.sh b/wrenchboard/configs/start.sh new file mode 100644 index 00000000..c26deb28 --- /dev/null +++ b/wrenchboard/configs/start.sh @@ -0,0 +1,2 @@ +#!/bin/bash +echo "[ start.sh ] Boot script test..." > /proc/1/fd/2 diff --git a/wrenchboard/configs/www.conf b/wrenchboard/configs/www.conf index bc2a60b4..00176bdf 100644 --- a/wrenchboard/configs/www.conf +++ b/wrenchboard/configs/www.conf @@ -60,6 +60,7 @@ listen = 9000 ; accepted from any ip address. ; Default Value: any ;listen.allowed_clients = 127.0.0.1 +;listen.allowed_clients = 10.20.30.32,127.0.0.1,172.17.0.1,172.18.0.1,172.19.0.1,172.20.0.1,172.21.0.1,172.27.0.1,172.28.0.1,172.30.0.1,192.168.112.1 ; Specify the nice(2) priority to apply to the pool processes (only if set) ; The value can vary from -19 (highest priority) to 20 (lower priority) diff --git a/wrenchboard/docker-compose.yml b/wrenchboard/docker-compose.yml index 5318202a..b5196cec 100644 --- a/wrenchboard/docker-compose.yml +++ b/wrenchboard/docker-compose.yml @@ -8,6 +8,8 @@ services: dockerfile: Dockerfile hostname: wrenchboard-backend-php72 container_name: wrenchboard-backend-php72 + ports: + - 9999:9000 volumes: - ./configs:/cfgs - ../www:/app From b73fdd07f7c11e5e28eb9c25f834b71c4a3a4995 Mon Sep 17 00:00:00 2001 From: ChiefSoft works Date: Sun, 4 Sep 2022 01:05:37 +0000 Subject: [PATCH 2/2] environment fixed --- wrenchboard/configs/php.ini | 7 ++++--- wrenchboard/configs/www.conf | 4 ++++ wrenchboard/docker-compose.yml | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/wrenchboard/configs/php.ini b/wrenchboard/configs/php.ini index 76b7a417..b8556812 100644 --- a/wrenchboard/configs/php.ini +++ b/wrenchboard/configs/php.ini @@ -13,6 +13,7 @@ ; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) ; 4. Current working directory (except CLI) ; 5. The web server's directory (for SAPI modules), or directory of PHP + ; (otherwise in Windows) ; 6. The directory from the --with-config-file-path compile time option, or the ; Windows directory (C:\windows or C:\winnt) @@ -194,7 +195,7 @@ engine = On ; Development Value: Off ; Production Value: Off ; http://php.net/short-open-tag -short_open_tag = Off +short_open_tag = On ; The number of significant digits displayed in floating point numbers. ; http://php.net/precision @@ -727,7 +728,7 @@ default_charset = "UTF-8" ; see documentation for security issues. The alternate is to use the ; cgi.force_redirect configuration below ; http://php.net/doc-root -doc_root = +;doc_root = /opt/mainsite/wrenchboard/www ; The directory under which PHP opens the script using /~username used only ; if nonempty. @@ -775,7 +776,7 @@ enable_dl = Off ; of zero causes PHP to behave as before. Default is 1. You should fix your scripts ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. ; http://php.net/cgi.fix-pathinfo -;cgi.fix_pathinfo=1 +cgi.fix_pathinfo=1 ; if cgi.discard_path is enabled, the PHP CGI binary can safely be placed outside ; of the web tree and people will not be able to circumvent .htaccess security. diff --git a/wrenchboard/configs/www.conf b/wrenchboard/configs/www.conf index 00176bdf..efa7b8dc 100644 --- a/wrenchboard/configs/www.conf +++ b/wrenchboard/configs/www.conf @@ -1,3 +1,6 @@ +[global] +error_log = /proc/self/fd/2 + ; Start a new pool named 'www'. ; the variable $pool can be used in any directive and will be replaced by the ; pool name ('www' here) @@ -258,6 +261,7 @@ ping.response = OK ; The access log file ; Default: not set ;access.log = log/$pool.access.log +access.log = /proc/self/fd/2 ; The access log format. ; The following syntax is allowed diff --git a/wrenchboard/docker-compose.yml b/wrenchboard/docker-compose.yml index b5196cec..b3c29bf0 100644 --- a/wrenchboard/docker-compose.yml +++ b/wrenchboard/docker-compose.yml @@ -13,4 +13,5 @@ services: volumes: - ./configs:/cfgs - ../www:/app + - ../www:/opt/mainsite/wrenchboard/www env_file: .env