From ec4b0c0551df2167fc1e022403f26ca3dc0a708b Mon Sep 17 00:00:00 2001 From: Sam ONeill Date: Tue, 8 Feb 2022 10:29:14 +1300 Subject: [PATCH 01/12] Adds volume and static files for logging from socket --- development/docker-compose.development.yml | 2 ++ docker-compose.yml | 2 ++ logs/map_1.log | 1 + logs/map_1.log.1.gz | Bin 0 -> 534 bytes static/socket/logrotate | 8 ++++++++ 5 files changed, 13 insertions(+) create mode 100644 logs/map_1.log create mode 100644 logs/map_1.log.1.gz create mode 100644 static/socket/logrotate diff --git a/development/docker-compose.development.yml b/development/docker-compose.development.yml index a51a1c1..97f537d 100644 --- a/development/docker-compose.development.yml +++ b/development/docker-compose.development.yml @@ -35,6 +35,8 @@ services: hostname: socket volumes: - ${PROJECT_ROOT}/websocket:/app + - ${PROJECT_ROOT}/logs:/var/www/html/pathfinder/history/map + - ${PROJECT_ROOT}/static/socket/logrotate:/etc/logrotate.d/pathfinder networks: pf: aliases: diff --git a/docker-compose.yml b/docker-compose.yml index 5b1fca3..c70086b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,6 +35,8 @@ services: hostname: socket volumes: - ${PROJECT_ROOT}/websocket:/app + - ${PROJECT_ROOT}/logs:/var/www/html/pathfinder/history/map + - ${PROJECT_ROOT}/static/socket/logrotate:/etc/logrotate.d/pathfinder networks: pf: aliases: diff --git a/logs/map_1.log b/logs/map_1.log new file mode 100644 index 0000000..8deaed1 --- /dev/null +++ b/logs/map_1.log @@ -0,0 +1 @@ +{"message":"system 'Ichoriya'","context":{"data":{"object":{"objId":9,"objName":"Ichoriya"},"character":{"id":525344969,"name":"atrophocy"},"channel":{"channelId":1,"channelName":"erw"},"main":[],"formatted":"Deleted system 'Ichoriya' #9"},"tag":"danger"},"level":200,"level_name":"INFO","channel":"map_1","datetime":"2022-02-07T12:26:24.171333+00:00","extra":{"path":"/api/rest/System/9","ip":"172.20.0.1","thumb":{"url":"https://images.evetech.net/Character/525344969_128.jpg"}}} diff --git a/logs/map_1.log.1.gz b/logs/map_1.log.1.gz new file mode 100644 index 0000000000000000000000000000000000000000..e88226e242f09f450a5abbe2ad7e418e603c1547 GIT binary patch literal 534 zcmV+x0_pu9iwFP!000001MO1FZqq;%-SZWr=^_h)J$C$vy$wQ&RD}hwYO82Enc6OX zX?)#a1^)@+Bn>E&}qE^nF6I`E+?netiE%EHWp3`4PzUXuuA74VxLv&@CXYvs;~1E8RH;D67yklML-p88{_K z5gWM#bM+{sc~o#~*-PWTjA+}ouMQ&@p<{CNM^fZuwvV6dA%EOv+e<| zA_-H`0Hc*C%E{DW18B~Kudb1?y+eWGYkEV^8S%*}$%T(L><4~g!+y>Y7$De Date: Tue, 8 Feb 2022 10:31:24 +1300 Subject: [PATCH 02/12] adds logs to gitignore --- .gitignore | 3 ++- logs/map_1.log | 1 - logs/map_1.log.1.gz | Bin 534 -> 0 bytes 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 logs/map_1.log delete mode 100644 logs/map_1.log.1.gz diff --git a/.gitignore b/.gitignore index 48ec249..1ab10d9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ .vscode letsencrypt *.production* -static/php/xdebug.ini \ No newline at end of file +static/php/xdebug.ini +logging/* \ No newline at end of file diff --git a/logs/map_1.log b/logs/map_1.log deleted file mode 100644 index 8deaed1..0000000 --- a/logs/map_1.log +++ /dev/null @@ -1 +0,0 @@ -{"message":"system 'Ichoriya'","context":{"data":{"object":{"objId":9,"objName":"Ichoriya"},"character":{"id":525344969,"name":"atrophocy"},"channel":{"channelId":1,"channelName":"erw"},"main":[],"formatted":"Deleted system 'Ichoriya' #9"},"tag":"danger"},"level":200,"level_name":"INFO","channel":"map_1","datetime":"2022-02-07T12:26:24.171333+00:00","extra":{"path":"/api/rest/System/9","ip":"172.20.0.1","thumb":{"url":"https://images.evetech.net/Character/525344969_128.jpg"}}} diff --git a/logs/map_1.log.1.gz b/logs/map_1.log.1.gz deleted file mode 100644 index e88226e242f09f450a5abbe2ad7e418e603c1547..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 534 zcmV+x0_pu9iwFP!000001MO1FZqq;%-SZWr=^_h)J$C$vy$wQ&RD}hwYO82Enc6OX zX?)#a1^)@+Bn>E&}qE^nF6I`E+?netiE%EHWp3`4PzUXuuA74VxLv&@CXYvs;~1E8RH;D67yklML-p88{_K z5gWM#bM+{sc~o#~*-PWTjA+}ouMQ&@p<{CNM^fZuwvV6dA%EOv+e<| zA_-H`0Hc*C%E{DW18B~Kudb1?y+eWGYkEV^8S%*}$%T(L><4~g!+y>Y7$De Date: Tue, 8 Feb 2022 10:31:56 +1300 Subject: [PATCH 03/12] adds logs to gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1ab10d9..de8442a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ letsencrypt *.production* static/php/xdebug.ini -logging/* \ No newline at end of file +logs/* \ No newline at end of file From 5285ac63d351c9ddc1bed780d34d8d37060a48c2 Mon Sep 17 00:00:00 2001 From: Sam ONeill Date: Tue, 8 Feb 2022 10:45:53 +1300 Subject: [PATCH 04/12] adds logs to gitignore --- .gitignore | 3 +-- logs/.gitignore | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 logs/.gitignore diff --git a/.gitignore b/.gitignore index de8442a..48ec249 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,4 @@ .vscode letsencrypt *.production* -static/php/xdebug.ini -logs/* \ No newline at end of file +static/php/xdebug.ini \ No newline at end of file diff --git a/logs/.gitignore b/logs/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/logs/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore From bc27392df954ddf75260b64a4333c13e7ad037fb Mon Sep 17 00:00:00 2001 From: Sam ONeill Date: Tue, 8 Feb 2022 11:12:15 +1300 Subject: [PATCH 05/12] fixes logrotate conf --- static/socket/logrotate | 1 - 1 file changed, 1 deletion(-) diff --git a/static/socket/logrotate b/static/socket/logrotate index ef59927..837d33a 100644 --- a/static/socket/logrotate +++ b/static/socket/logrotate @@ -4,5 +4,4 @@ rotate 14 compress notifempty - endscript } \ No newline at end of file From c62062f956f3997572c474c997a83877a00d20b9 Mon Sep 17 00:00:00 2001 From: Sam ONeill Date: Tue, 8 Feb 2022 13:37:06 +1300 Subject: [PATCH 06/12] Adds logs mount to pf service and adds logrotate --- Dockerfile | 4 +++- development/development.sh | 3 ++- development/docker-compose.development.yml | 2 +- docker-compose.yml | 2 +- static/{socket/logrotate => logrotate/pathfinder} | 0 5 files changed, 7 insertions(+), 4 deletions(-) rename static/{socket/logrotate => logrotate/pathfinder} (100%) diff --git a/Dockerfile b/Dockerfile index e149c2e..dc27a2f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,8 +13,10 @@ RUN composer self-update 2.1.8 RUN composer install FROM trafex/alpine-nginx-php7:ba1dd422 -RUN apk update && apk add --no-cache busybox-suid sudo php7-redis php7-pdo php7-pdo_mysql php7-fileinfo shadow gettext bash apache2-utils +RUN apk update && apk add --no-cache busybox-suid sudo php7-redis php7-pdo php7-pdo_mysql php7-fileinfo shadow gettext bash apache2-utils logrotate + +COPY static/logrotate/pathfinder /etc/logrotate.d/pathfinder COPY static/nginx/nginx.conf /etc/nginx/templateNginx.conf # we need to create sites_enabled directory in order for entrypoint.sh being able to copy file after envsubst RUN mkdir -p /etc/nginx/sites_enabled/ diff --git a/development/development.sh b/development/development.sh index 40b7e4f..6aad8f7 100755 --- a/development/development.sh +++ b/development/development.sh @@ -17,5 +17,6 @@ cp ./development/xdebug.ini ./static/php/xdebug.ini mkdir -p .vscode && cp ./development/launch.json ./.vscode/launch.json # seed .env file with dev presets -echo "path=\"$(pwd)\"" > ./.env +echo "PROJECT_ROOT=\"$(pwd)\"" > ./.env cat ./development/.env.development >> ./.env +echo "Remember to set your CCP SSO Client and Secret keys" diff --git a/development/docker-compose.development.yml b/development/docker-compose.development.yml index 97f537d..c0b3710 100644 --- a/development/docker-compose.development.yml +++ b/development/docker-compose.development.yml @@ -36,7 +36,6 @@ services: volumes: - ${PROJECT_ROOT}/websocket:/app - ${PROJECT_ROOT}/logs:/var/www/html/pathfinder/history/map - - ${PROJECT_ROOT}/static/socket/logrotate:/etc/logrotate.d/pathfinder networks: pf: aliases: @@ -68,6 +67,7 @@ services: - ${PROJECT_ROOT}/config/pathfinder/config.ini:/var/www/html/pathfinder/app/templateConfig.ini - ${PROJECT_ROOT}/config/pathfinder/pathfinder.ini:/var/www/html/pathfinder/app/pathfinder.ini - ${PROJECT_ROOT}/config/pathfinder/plugin.ini:/var/www/html/pathfinder/app/plugin.ini + - ${PROJECT_ROOT}/logs:/var/www/html/pathfinder/history/map depends_on: - pfdb - pf-redis diff --git a/docker-compose.yml b/docker-compose.yml index c70086b..9b8245b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -36,7 +36,6 @@ services: volumes: - ${PROJECT_ROOT}/websocket:/app - ${PROJECT_ROOT}/logs:/var/www/html/pathfinder/history/map - - ${PROJECT_ROOT}/static/socket/logrotate:/etc/logrotate.d/pathfinder networks: pf: aliases: @@ -69,6 +68,7 @@ services: - ${PROJECT_ROOT}/config/pathfinder/config.ini:/var/www/html/pathfinder/app/templateConfig.ini - ${PROJECT_ROOT}/config/pathfinder/pathfinder.ini:/var/www/html/pathfinder/app/pathfinder.ini - ${PROJECT_ROOT}/config/pathfinder/plugin.ini:/var/www/html/pathfinder/app/plugin.ini + - ${PROJECT_ROOT}/logs:/var/www/html/pathfinder/history/map depends_on: - pfdb - pf-redis diff --git a/static/socket/logrotate b/static/logrotate/pathfinder similarity index 100% rename from static/socket/logrotate rename to static/logrotate/pathfinder From 9a4d9c75bd2f27c166cf2ad8bf79c85a123ca085 Mon Sep 17 00:00:00 2001 From: Sam ONeill Date: Tue, 8 Feb 2022 13:47:18 +1300 Subject: [PATCH 07/12] Adds logs mount to pf service and adds logrotate --- development/Dockerfile.development | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/development/Dockerfile.development b/development/Dockerfile.development index a97ac3b..3a061d9 100644 --- a/development/Dockerfile.development +++ b/development/Dockerfile.development @@ -13,8 +13,10 @@ RUN composer self-update 2.1.8 RUN composer install FROM trafex/alpine-nginx-php7:ba1dd422 -RUN apk update && apk add --no-cache busybox-suid sudo php7-redis php7-pdo php7-pdo_mysql php7-fileinfo shadow gettext bash apache2-utils +RUN apk update && apk add --no-cache busybox-suid sudo php7-redis php7-pdo php7-pdo_mysql php7-fileinfo shadow gettext bash apache2-utils logrotate + +COPY static/logrotate/pathfinder /etc/logrotate.d/pathfinder COPY static/nginx/nginx.conf /etc/nginx/templateNginx.conf # we need to create sites_enabled directory in order for entrypoint.sh being able to copy file after envsubst RUN mkdir -p /etc/nginx/sites_enabled/ From 45a3fc595f058fa19469fc7c5817e4764123359b Mon Sep 17 00:00:00 2001 From: Sam ONeill Date: Tue, 8 Feb 2022 14:15:45 +1300 Subject: [PATCH 08/12] Updates development.sh --- Dockerfile | 9 ++++++++- development/development.sh | 16 ++++++++++++---- docker-compose.yml | 10 +--------- static/pathfinder/environment.ini | 6 +++--- static/php/php.ini | 1 + 5 files changed, 25 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index dc27a2f..3a061d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.2.11-fpm-alpine3.7 as build +FROM php:7.2.5-fpm-alpine3.7 as build RUN apk update \ && apk add --no-cache libpng-dev zeromq-dev git \ @@ -25,6 +25,12 @@ COPY static/nginx/site.conf /etc/nginx/templateSite.conf # Configure PHP-FPM COPY static/php/fpm-pool.conf /etc/php7/php-fpm.d/zzz_custom.conf +# DEBUG +RUN apk add php7-xdebug --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ +COPY static/php/xdebug.ini /etc/php7/conf.d/xdebug.ini +COPY static/php/error_reporting.ini /etc/php7/conf.d/error_reporting.ini +RUN echo "zend_extension=/usr/lib/php7/modules/xdebug.so" >> /etc/php7/php.ini + COPY static/php/php.ini /etc/zzz_custom.ini # configure cron COPY static/crontab.txt /var/crontab.txt @@ -35,6 +41,7 @@ COPY static/entrypoint.sh / WORKDIR /var/www/html COPY --chown=nobody --from=build /app pathfinder + RUN chmod 0766 pathfinder/logs pathfinder/tmp/ && rm index.php && touch /etc/nginx/.setup_pass && chmod +x /entrypoint.sh COPY static/pathfinder/routes.ini /var/www/html/pathfinder/app/ COPY static/pathfinder/environment.ini /var/www/html/pathfinder/app/templateEnvironment.ini diff --git a/development/development.sh b/development/development.sh index 6aad8f7..14a327f 100755 --- a/development/development.sh +++ b/development/development.sh @@ -16,7 +16,15 @@ cp ./development/xdebug.ini ./static/php/xdebug.ini # set up launch file for vscode mkdir -p .vscode && cp ./development/launch.json ./.vscode/launch.json -# seed .env file with dev presets -echo "PROJECT_ROOT=\"$(pwd)\"" > ./.env -cat ./development/.env.development >> ./.env -echo "Remember to set your CCP SSO Client and Secret keys" +# seed .env unless --noenv flag is set +while true; do + case "$1" in + --noenv ) NO_ENV=true; shift ;; + * ) break ;; + esac +done +if [ ! "$NO_ENV" == "true" ]; then + echo "PROJECT_ROOT=\"$(pwd)\"" > ./.env + cat ./development/.env.development >> ./.env + echo "WARNING: .env has been replaced, remember to fill any required variables" +fi diff --git a/docker-compose.yml b/docker-compose.yml index 9b8245b..c0b3710 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -55,8 +55,7 @@ services: - "traefik.http.routers.pf.entrypoints=web" - "traefik.http.routers.pf-secure.rule=Host(`${DOMAIN}`)" - "traefik.http.routers.pf-secure.entrypoints=websecure" - - "traefik.http.routers.pf-secure.tls=true" - - "traefik.http.routers.pf-secure.tls.certresolver=letsencrypt" + - "traefik.http.routers.pf-secure.tls=true" - "traefik.http.middlewares.redirecthttps.redirectscheme.scheme=https" - "traefik.http.routers.pf.middlewares=redirecthttps" networks: @@ -84,19 +83,12 @@ services: - "--providers.docker.exposedbydefault=false" - "--entrypoints.web.address=:80" - "--entrypoints.websecure.address=:443" - - "--certificatesresolvers.letsencrypt.acme.httpchallenge=true" - - "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web" - - "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json" - # Remove below line when ready for production - - "--certificatesresolvers.letsencrypt.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory" - - "--certificatesresolvers.letsencrypt.acme.email=MYEMAIL@someemailprobablygmail.com" ports: - "80:80" - "443:443" - "8080:8080" volumes: - "/var/run/docker.sock:/var/run/docker.sock:ro" - - "${PROJECT_ROOT}/letsencrypt:/letsencrypt" networks: - web restart: always diff --git a/static/pathfinder/environment.ini b/static/pathfinder/environment.ini index 64628f6..c65ced1 100644 --- a/static/pathfinder/environment.ini +++ b/static/pathfinder/environment.ini @@ -4,16 +4,16 @@ ; project environment (DEVELOP || PRODUCTION). ; This effects: DB connection, Mail-Server, SSO, ESI configurations in this file ; configuration below -SERVER = PRODUCTION +SERVER = DEVELOPMENT -[ENVIRONMENT.PRODUCTION] +[ENVIRONMENT.DEVELOPMENT] ; path to index.php (Default: leave blank == "auto-detect") ; -> e.g. set /pathfinder if your URL looks like https://www.[YOUR_DOMAIN]/pathfinder (subfolder) BASE = ; deployment URL (e.g. https://www.pathfinder-w.space) URL = {{@SCHEME}}://$DOMAIN ; level of debug/error stack trace -DEBUG = 0 +DEBUG = 3 ; Pathfinder database DB_PF_DNS = mysql:host=${CONTAINER_NAME}db;port=3306;dbname= DB_PF_NAME = pf diff --git a/static/php/php.ini b/static/php/php.ini index 0b403a3..5919688 100755 --- a/static/php/php.ini +++ b/static/php/php.ini @@ -10,6 +10,7 @@ fastcgi.logging=0 request_terminate_timeout = 300 session.save_handler = redis session.save_path = "tcp://${CONTAINER_NAME}-redis:6379" +zend_extension=/usr/lib/php7/modules/xdebug.so [Date] date.timezone="UTC" From 16b90596c9ff97d9984658afed8d64662b05f197 Mon Sep 17 00:00:00 2001 From: Sam ONeill Date: Tue, 8 Feb 2022 14:20:14 +1300 Subject: [PATCH 09/12] Updates development.sh --- development/development.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/development/development.sh b/development/development.sh index 6aad8f7..14a327f 100755 --- a/development/development.sh +++ b/development/development.sh @@ -16,7 +16,15 @@ cp ./development/xdebug.ini ./static/php/xdebug.ini # set up launch file for vscode mkdir -p .vscode && cp ./development/launch.json ./.vscode/launch.json -# seed .env file with dev presets -echo "PROJECT_ROOT=\"$(pwd)\"" > ./.env -cat ./development/.env.development >> ./.env -echo "Remember to set your CCP SSO Client and Secret keys" +# seed .env unless --noenv flag is set +while true; do + case "$1" in + --noenv ) NO_ENV=true; shift ;; + * ) break ;; + esac +done +if [ ! "$NO_ENV" == "true" ]; then + echo "PROJECT_ROOT=\"$(pwd)\"" > ./.env + cat ./development/.env.development >> ./.env + echo "WARNING: .env has been replaced, remember to fill any required variables" +fi From 5dc422619bd8f9747c2c3522ef74ac4dfd9a478d Mon Sep 17 00:00:00 2001 From: Sam ONeill Date: Tue, 8 Feb 2022 14:27:26 +1300 Subject: [PATCH 10/12] Updates development.sh --- Dockerfile | 9 +-------- development/Dockerfile.development | 3 +-- docker-compose.yml | 8 ++++++++ static/pathfinder/environment.ini | 6 +++--- static/php/php.ini | 1 - 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3a061d9..dc27a2f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.2.5-fpm-alpine3.7 as build +FROM php:7.2.11-fpm-alpine3.7 as build RUN apk update \ && apk add --no-cache libpng-dev zeromq-dev git \ @@ -25,12 +25,6 @@ COPY static/nginx/site.conf /etc/nginx/templateSite.conf # Configure PHP-FPM COPY static/php/fpm-pool.conf /etc/php7/php-fpm.d/zzz_custom.conf -# DEBUG -RUN apk add php7-xdebug --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ -COPY static/php/xdebug.ini /etc/php7/conf.d/xdebug.ini -COPY static/php/error_reporting.ini /etc/php7/conf.d/error_reporting.ini -RUN echo "zend_extension=/usr/lib/php7/modules/xdebug.so" >> /etc/php7/php.ini - COPY static/php/php.ini /etc/zzz_custom.ini # configure cron COPY static/crontab.txt /var/crontab.txt @@ -41,7 +35,6 @@ COPY static/entrypoint.sh / WORKDIR /var/www/html COPY --chown=nobody --from=build /app pathfinder - RUN chmod 0766 pathfinder/logs pathfinder/tmp/ && rm index.php && touch /etc/nginx/.setup_pass && chmod +x /entrypoint.sh COPY static/pathfinder/routes.ini /var/www/html/pathfinder/app/ COPY static/pathfinder/environment.ini /var/www/html/pathfinder/app/templateEnvironment.ini diff --git a/development/Dockerfile.development b/development/Dockerfile.development index 3a061d9..6e7ee25 100644 --- a/development/Dockerfile.development +++ b/development/Dockerfile.development @@ -1,4 +1,4 @@ -FROM php:7.2.5-fpm-alpine3.7 as build +FROM php:7.2.11-fpm-alpine3.7 as build RUN apk update \ && apk add --no-cache libpng-dev zeromq-dev git \ @@ -41,7 +41,6 @@ COPY static/entrypoint.sh / WORKDIR /var/www/html COPY --chown=nobody --from=build /app pathfinder - RUN chmod 0766 pathfinder/logs pathfinder/tmp/ && rm index.php && touch /etc/nginx/.setup_pass && chmod +x /entrypoint.sh COPY static/pathfinder/routes.ini /var/www/html/pathfinder/app/ COPY static/pathfinder/environment.ini /var/www/html/pathfinder/app/templateEnvironment.ini diff --git a/docker-compose.yml b/docker-compose.yml index c0b3710..882528b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -55,6 +55,7 @@ services: - "traefik.http.routers.pf.entrypoints=web" - "traefik.http.routers.pf-secure.rule=Host(`${DOMAIN}`)" - "traefik.http.routers.pf-secure.entrypoints=websecure" + - "traefik.http.routers.pf-secure.tls.certresolver=letsencrypt" - "traefik.http.routers.pf-secure.tls=true" - "traefik.http.middlewares.redirecthttps.redirectscheme.scheme=https" - "traefik.http.routers.pf.middlewares=redirecthttps" @@ -83,12 +84,19 @@ services: - "--providers.docker.exposedbydefault=false" - "--entrypoints.web.address=:80" - "--entrypoints.websecure.address=:443" + - "--certificatesresolvers.letsencrypt.acme.httpchallenge=true" + - "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web" + - "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json" + # Remove below line when ready for production + - "--certificatesresolvers.letsencrypt.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory" + - "--certificatesresolvers.letsencrypt.acme.email=MYEMAIL@someemailprobablygmail.com" ports: - "80:80" - "443:443" - "8080:8080" volumes: - "/var/run/docker.sock:/var/run/docker.sock:ro" + - "${PROJECT_ROOT}/letsencrypt:/letsencrypt" networks: - web restart: always diff --git a/static/pathfinder/environment.ini b/static/pathfinder/environment.ini index c65ced1..64628f6 100644 --- a/static/pathfinder/environment.ini +++ b/static/pathfinder/environment.ini @@ -4,16 +4,16 @@ ; project environment (DEVELOP || PRODUCTION). ; This effects: DB connection, Mail-Server, SSO, ESI configurations in this file ; configuration below -SERVER = DEVELOPMENT +SERVER = PRODUCTION -[ENVIRONMENT.DEVELOPMENT] +[ENVIRONMENT.PRODUCTION] ; path to index.php (Default: leave blank == "auto-detect") ; -> e.g. set /pathfinder if your URL looks like https://www.[YOUR_DOMAIN]/pathfinder (subfolder) BASE = ; deployment URL (e.g. https://www.pathfinder-w.space) URL = {{@SCHEME}}://$DOMAIN ; level of debug/error stack trace -DEBUG = 3 +DEBUG = 0 ; Pathfinder database DB_PF_DNS = mysql:host=${CONTAINER_NAME}db;port=3306;dbname= DB_PF_NAME = pf diff --git a/static/php/php.ini b/static/php/php.ini index 5919688..0b403a3 100755 --- a/static/php/php.ini +++ b/static/php/php.ini @@ -10,7 +10,6 @@ fastcgi.logging=0 request_terminate_timeout = 300 session.save_handler = redis session.save_path = "tcp://${CONTAINER_NAME}-redis:6379" -zend_extension=/usr/lib/php7/modules/xdebug.so [Date] date.timezone="UTC" From 0cf720fb197c474cde7fad415798b66e2671096a Mon Sep 17 00:00:00 2001 From: Sam ONeill Date: Tue, 8 Feb 2022 14:29:10 +1300 Subject: [PATCH 11/12] Updates development.sh --- development/docker-compose.development.yml | 2 +- docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/development/docker-compose.development.yml b/development/docker-compose.development.yml index c0b3710..128bea9 100644 --- a/development/docker-compose.development.yml +++ b/development/docker-compose.development.yml @@ -55,7 +55,7 @@ services: - "traefik.http.routers.pf.entrypoints=web" - "traefik.http.routers.pf-secure.rule=Host(`${DOMAIN}`)" - "traefik.http.routers.pf-secure.entrypoints=websecure" - - "traefik.http.routers.pf-secure.tls=true" + - "traefik.http.routers.pf-secure.tls=true" - "traefik.http.middlewares.redirecthttps.redirectscheme.scheme=https" - "traefik.http.routers.pf.middlewares=redirecthttps" networks: diff --git a/docker-compose.yml b/docker-compose.yml index 882528b..9b8245b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -55,8 +55,8 @@ services: - "traefik.http.routers.pf.entrypoints=web" - "traefik.http.routers.pf-secure.rule=Host(`${DOMAIN}`)" - "traefik.http.routers.pf-secure.entrypoints=websecure" + - "traefik.http.routers.pf-secure.tls=true" - "traefik.http.routers.pf-secure.tls.certresolver=letsencrypt" - - "traefik.http.routers.pf-secure.tls=true" - "traefik.http.middlewares.redirecthttps.redirectscheme.scheme=https" - "traefik.http.routers.pf.middlewares=redirecthttps" networks: From edbbff304484538d63c40fff15b6dbc8dd7b64ff Mon Sep 17 00:00:00 2001 From: Sam ONeill Date: Tue, 8 Feb 2022 14:30:38 +1300 Subject: [PATCH 12/12] updates readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ccdfa6b..d53f69f 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ Development configs and docker files can be quickly restored using: chmod +x ./development/development.sh && ./development/development.sh ``` -This creates a partial `.env` file, but you will need to add your CCP SSO client and keys manually. +This creates a partial `.env` file, but you will need to add your CCP SSO client and keys manually, if you want to copy development files without overwriting your .env file add the flag `--noenv` when running the script. It's best to create a new SSO application for development work, so that you can set the callback url to `https://localhost/sso/callbackAuthorization`.