From 3c8aef294b0d2fae6d6d1c3817233a25ab72dd36 Mon Sep 17 00:00:00 2001 From: Kozin Date: Fri, 27 Oct 2023 14:16:20 +0300 Subject: [PATCH 1/4] Added description about PYTHON_VERSION_BUILD to .env.exemple --- infra_bt/.env.example | 2 ++ 1 file changed, 2 insertions(+) diff --git a/infra_bt/.env.example b/infra_bt/.env.example index 4f4e3ef..6f8b4e6 100644 --- a/infra_bt/.env.example +++ b/infra_bt/.env.example @@ -9,3 +9,5 @@ DB_PORT=5432 - порт на котором postgre принимает соед SECRET_KEY='django-insecure' - секретный ключ для Django DEBUG=False - флаг, активирующий/деактивирующий дебаг-режим ALLOWED_HOSTS=80.87.109.180,127.0.0.1,localhost,better-together.acceleratorpracticum.ru + +PYTHON_VERSION_BUILD=python:3.10.6-alpine3.16 - tag Docker образа для сборки бэкэнда From d152dc409ba4b3f1f0cff0074959bf5b9948440b Mon Sep 17 00:00:00 2001 From: Kozin Date: Fri, 27 Oct 2023 22:53:04 +0300 Subject: [PATCH 2/4] Fixed nginx.conf --- infra_bt/nginx.conf | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/infra_bt/nginx.conf b/infra_bt/nginx.conf index f29f83e..bb1c4a5 100644 --- a/infra_bt/nginx.conf +++ b/infra_bt/nginx.conf @@ -23,15 +23,8 @@ server { } location / { - try_files $uri $uri/ =404; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; + if (!-e $request_filename){ + rewrite ^(.*)$ /index.html break; + } } - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /var/html/frontend/; - } - } From 56fe2279a87541f5b87ad777688acd739da17824 Mon Sep 17 00:00:00 2001 From: Kozin Date: Sat, 28 Oct 2023 02:01:47 +0300 Subject: [PATCH 3/4] Added creation .env file on the production server --- .github/workflows/deploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a741e54..d70a82d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -34,6 +34,9 @@ jobs: passphrase: ${{ secrets.SSH_PASSPHRASE }} script: | cd better-together + echo GMAIL_API_CLIENT_ID=${{ secrets.GMAIL_API_CLIENT_ID }} > .env + echo GMAIL_API_CLIENT_SECRET=${{ secrets.GMAIL_API_CLIENT_SECRET }} >> .env + echo GMAIL_API_REFRESH_TOKEN=${{ secrets.GMAIL_API_REFRESH_TOKEN }} >> .env sudo docker compose -f docker-compose.production.yml pull sudo docker compose -f docker-compose.production.yml down sudo docker compose -f docker-compose.production.yml up -d From a48152f307e094def4965153f37bbe1d2a3c3a32 Mon Sep 17 00:00:00 2001 From: Kozin Date: Sat, 28 Oct 2023 02:40:20 +0300 Subject: [PATCH 4/4] Resolved conflict and added settings for django-gmail-api-backend --- infra_bt/.env.example | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/infra_bt/.env.example b/infra_bt/.env.example index 6f8b4e6..11a13a2 100644 --- a/infra_bt/.env.example +++ b/infra_bt/.env.example @@ -10,4 +10,8 @@ SECRET_KEY='django-insecure' - секретный ключ для Django DEBUG=False - флаг, активирующий/деактивирующий дебаг-режим ALLOWED_HOSTS=80.87.109.180,127.0.0.1,localhost,better-together.acceleratorpracticum.ru -PYTHON_VERSION_BUILD=python:3.10.6-alpine3.16 - tag Docker образа для сборки бэкэнда +PYTHON_VERSION_BUILD=python:3.10.6-alpine3.16 # версия Python при билде образа + +GMAIL_API_CLIENT_ID='' # Авторизационные данные для работы django-gmail-api-backend +GMAIL_API_CLIENT_SECRET='' # Авторизационные данные для работы django-gmail-api-backend +GMAIL_API_REFRESH_TOKEN='' # Авторизационные данные для работы django-gmail-api-backend