diff --git a/Olympiad-Back b/Olympiad-Back index d183bdc..7a803c9 160000 --- a/Olympiad-Back +++ b/Olympiad-Back @@ -1 +1 @@ -Subproject commit d183bdcbbb1009be62f540bb2aeae83e04ad183c +Subproject commit 7a803c97a4595c59a7ba4cd5d8fcd5fba3d50389 diff --git a/Olympiad-Front b/Olympiad-Front index d60ee05..8b5ab53 160000 --- a/Olympiad-Front +++ b/Olympiad-Front @@ -1 +1 @@ -Subproject commit d60ee05ffc7d69c01d04ad3f6c4f434ef6bf6de5 +Subproject commit 8b5ab53c23e5ddc2a6dc7b20a43f3516ba5d05ae diff --git a/Proxy/Dockerfile b/Proxy/Dockerfile index b4a678f..596ae05 100644 --- a/Proxy/Dockerfile +++ b/Proxy/Dockerfile @@ -1,16 +1,6 @@ FROM nginx:alpine -RUN apk add --no-cache --update apache2-utils - COPY proxy.conf /etc/nginx/conf.d/proxy.conf COPY 502.html /usr/share/nginx/html/502.html COPY 404.html /usr/share/nginx/html/404.html COPY 401.html /usr/share/nginx/html/401.html - -COPY run.sh /run.sh -RUN sed -i $'s/\r$//' /run.sh -RUN chmod +x /run.sh - -STOPSIGNAL SIGQUIT - -ENTRYPOINT ["/run.sh"] \ No newline at end of file diff --git a/Proxy/proxy.conf b/Proxy/proxy.conf index c80f0f4..1ae975b 100644 --- a/Proxy/proxy.conf +++ b/Proxy/proxy.conf @@ -34,40 +34,6 @@ server { proxy_set_header Host $host; } - location /admin { - set $upstream_admin 'admin:5503'; - proxy_pass http://$upstream_admin; - - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "Upgrade"; - proxy_set_header Host $host; - - auth_basic "Administrator’s Area"; - auth_basic_user_file /etc/nginx/admin.htpasswd; - } - - location /results-viewer { - location /results-viewer { - set $upstream_results_viewer 'results-viewer:5504'; - proxy_pass http://$upstream_results_viewer; - } - - location /results-viewer/pdfprint { - set $upstream_pdf_printer 'pdf-printer:80'; - proxy_pass http://$upstream_pdf_printer/print; - client_max_body_size 10M; - } - - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "Upgrade"; - proxy_set_header Host $host; - - auth_basic "Result viewer Area"; - auth_basic_user_file /etc/nginx/results-viewer.htpasswd; - } - location /control-panel { set $upstream_control_panel 'control-panel:5505'; proxy_pass http://$upstream_control_panel; diff --git a/Proxy/run.sh b/Proxy/run.sh deleted file mode 100644 index adda31c..0000000 --- a/Proxy/run.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -set -e - -if [ -z $BASIC_AUTH_USERNAME_ADMIN ]; then - echo >&2 "BASIC_AUTH_USERNAME_ADMIN must be set" - exit 1 -fi - -if [ -z $BASIC_AUTH_PASSWORD_ADMIN ]; then - echo >&2 "BASIC_AUTH_PASSWORD_ADMIN must be set" - exit 1 -fi - -htpasswd -bBc /etc/nginx/admin.htpasswd $BASIC_AUTH_USERNAME_ADMIN $BASIC_AUTH_PASSWORD_ADMIN - - -if [ -z $BASIC_AUTH_USERNAME_RESULTS_VIEWER ]; then - echo >&2 "BASIC_AUTH_USERNAME_ADMIN must be set" - exit 1 -fi - -if [ -z $BASIC_AUTH_PASSWORD_RESULTS_VIEWER ]; then - echo >&2 "BASIC_AUTH_PASSWORD_ADMIN must be set" - exit 1 -fi - -htpasswd -bBc /etc/nginx/results-viewer.htpasswd $BASIC_AUTH_USERNAME_RESULTS_VIEWER $BASIC_AUTH_PASSWORD_RESULTS_VIEWER - - -exec nginx -g "daemon off;" \ No newline at end of file diff --git a/README.md b/README.md index 0d5e3d0..5483696 100644 --- a/README.md +++ b/README.md @@ -73,19 +73,25 @@ odc up -d Create file `environment.ps1` (already in `.gitignore`) ```powershell $Env:JWT_SECRET_KEY="key for jwt" -$Env:SECRET_ADMIN_KEY="adminservice key for api requests" $Env:OLYMPIAD_DOMAIN="target domain" $Env:OLYMPIAD_PRIVATE_REGISTRY_ADDRESS="your private registry for executor domain" $Env:OLYMPIAD_PRIVATE_REGISTRY_LOGIN="your private registry for executor login" $Env:OLYMPIAD_PRIVATE_REGISTRY_PASSWORD="your private registry for executor password" -$Env:BASIC_AUTH_USERNAME="login for admin service" -$Env:BASIC_AUTH_PASSWORD="password for admin service" -$Env:POSTGRES_CONNECTION_STRING="Connection string for peoduction database" +$Env:RABBITMQ_PASSWORD="password for internal communication in rabbitmq" +$Env:GENERATE_USER_EMAIL_DOMAIN="domain to generate user accounts, like localhost.ru" +$Env:POSTGRES_CONNECTION_STRING="Connection string for production database" +$Env:EXECUTOR_USER_LOGIN="executor account login" +$Env:EXECUTOR_USER_PASSWORD="executor account password. CHANGE PASSWORD AFTER AUTO CREATING!" +$Env:S3_SERVICE_URL="s3 service address like storage.yandexcloud.net" +$Env:S3_SERVICE_ACCESS_KEY_ID="s3 key id" +$Env:S3_SERVICE_SECRET_ACCESS_KEY="s3 key secret" +$Env:S3_SERVICE_FORCE_PATH_STYLE="true if local like zenko, false id provider accepts bucket as subdomain" +$Env:S3_SERVICE_BUCKET_NAME="s3 bucket name" ``` Invoke ```powershell -. .\environment.ps1 ;; .\genStack.ps1 +. .\alias.ps1 ;; . .\environment.ps1 ;; .\genStack.ps1 ``` Use `stack.yml` file to publish service to `docker swarm` \ No newline at end of file diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 0321df5..acfe30f 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -3,15 +3,6 @@ version: "3.8" services: proxy: build: Proxy - environment: - - BASIC_AUTH_USERNAME=admin - - BASIC_AUTH_PASSWORD=VeryStrongPassword1 - - BASIC_AUTH_USERNAME_ADMIN=admin - - BASIC_AUTH_PASSWORD_ADMIN=VeryStrongPassword1 - - - BASIC_AUTH_USERNAME_RESULTS_VIEWER=results-viewer - - BASIC_AUTH_PASSWORD_RESULTS_VIEWER=VeryStrongPassword1 - ports: - 5500:5500 restart: on-failure diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 5f23a31..cea7789 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -2,35 +2,20 @@ version: "3.8" services: proxy: - environment: - - BASIC_AUTH_USERNAME_ADMIN=${BASIC_AUTH_USERNAME_ADMIN?Create basic auth username for admin service BASIC_AUTH_USERNAME_ADMIN} - - BASIC_AUTH_PASSWORD_ADMIN=${BASIC_AUTH_PASSWORD_ADMIN?Create basic auth password for admin service BASIC_AUTH_PASSWORD_ADMIN} - - - BASIC_AUTH_USERNAME_RESULTS_VIEWER=${BASIC_AUTH_USERNAME_RESULTS_VIEWER?Create basic auth username for results viewer service BASIC_AUTH_USERNAME_RESULTS_VIEWER} - - BASIC_AUTH_PASSWORD_RESULTS_VIEWER=${BASIC_AUTH_PASSWORD_RESULTS_VIEWER?Create basic auth password for results viewer service BASIC_AUTH_PASSWORD_RESULTS_VIEWER} networks: - net api: networks: - net - admin: - networks: - - net front: networks: - net executor: networks: - net - results-viewer: - networks: - - net control-panel: networks: - net - pdf-printer: - networks: - - net rabbitmq: networks: - net