Skip to content

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
iljavaleev committed Jul 8, 2024
1 parent a361644 commit f9e8d42
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 40 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Django
ALLOWED_HOSTS=0.0.0.0 127.0.0.1 localhost # Список разрешённых хостов. Используется для деплоя на сервер. Можно не менять.
CSRF_TRUSTED_ORIGINS=http://0.0.0.0 http://localhost http://127.0.0.1 # Список разрешенных источников CSRF. Используется для деплоя на сервер. Можно не менять.
ALLOWED_HOSTS=0.0.0.0 localhost host.docker.internal 127.0.0.1 158.160.127.29 chatbothighed.sytes.net # Список разрешённых хостов. Используется для деплоя на сервер. Можно не менять.
CSRF_TRUSTED_ORIGINS=http://0.0.0.0 http://localhost http://host.docker.internal http://127.0.0.1 http://194.113.34.204 https://iljavaleev.hopto.org # Список разрешенных источников CSRF. Используется для деплоя на сервер. Можно не менять.
SECRET_KEY=my_secret_key # SECRET_KEY для настроек Django. Можно передать любую строку.
DJANGO_SUPERUSER_USERNAME=admin # Дефолтные данные для входа в админку
DJANGO_SUPERUSER_PASSWORD=admin123
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ jobs:
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.TEST_SERVER_USERNAME }}
key: ${{ secrets.TEST_SERVER_SSH_KEY }}
passphrase: ${{ secrets.TEST_SERVER_SSH_PASSPHRASE }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_SSH_KEY }}
passphrase: ${{ secrets.SERVER_SSH_PASSPHRASE }}
source: "infra/docker-compose.yml,infra/swag_nginx.conf"
target: ${{ secrets.DEPLOY_PATH }}
overwrite: true
Expand All @@ -98,9 +98,9 @@ jobs:
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.TEST_SERVER_USERNAME }}
key: ${{ secrets.TEST_SERVER_SSH_KEY }}
passphrase: ${{ secrets.TEST_SERVER_SSH_PASSPHRASE }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_SSH_KEY }}
passphrase: ${{ secrets.SERVER_SSH_PASSPHRASE }}
script: |
cd ${{ secrets.DEPLOY_PATH }}
echo "SECRET_KEY=${{ secrets.SECRET_KEY }}" > .env
Expand All @@ -120,6 +120,8 @@ jobs:
echo WEB_SERVER_HOST=${{ secrets.WEB_SERVER_HOST }} >> .env
echo WEB_SERVER_PORT=${{ secrets.WEB_SERVER_PORT }} >> .env
echo WEB_SERVER_URL=${{ secrets.WEB_SERVER_URL }} >> .env
echo ALLOWED_HOSTS=${{ secrets.ALLOWED_HOSTS }} >> .env
echo CSRF_TRUSTED_ORIGINS=${{ secrets.CSRF_TRUSTED_ORIGINS }} >> .env
sudo docker compose stop django
sudo docker compose stop bot
sudo docker compose stop celery
Expand Down
13 changes: 3 additions & 10 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 4 additions & 20 deletions admin_panel/admin_panel/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,23 +133,7 @@ class Test(Dev):

class Prod(Dev):
DEBUG = values.BooleanValue(False)

ALLOWED_HOSTS = os.getenv(
'ALLOWED_HOSTS',
default=('0.0.0.0 '
'localhost '
'host.docker.internal '
'127.0.0.1 '
'158.160.127.29 '
'chatbothighed.sytes.net').split()
)

CSRF_TRUSTED_ORIGINS = os.getenv(
'CSRF_TRUSTED_ORIGINS',
default=('http://0.0.0.0 '
'http://localhost '
'http://host.docker.internal '
'http://127.0.0.1 '
'http://158.160.127.29 '
'https://chatbothighed.sytes.net').split()
)
allowed_hosts: str = os.environ.get("ALLOWED_HOSTS")
ALLOWED_HOSTS = allowed_hosts.split()
allowed_csrf: str = os.environ.get("CSRF_TRUSTED_ORIGINS")
CSRF_TRUSTED_ORIGINS = allowed_csrf.split()
2 changes: 0 additions & 2 deletions bots/telegram/keyboards/utils/paginator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import logging
from typing import Any

from aiogram import F, Router, types
Expand Down Expand Up @@ -26,7 +25,6 @@ def __init__(
it=data.inline_keyboard,
size=self.size
)
logging.error(self.list_kb)
elif isinstance(data, InlineKeyboardBuilder):
self.list_kb = self.chunk(
it=data.export(),
Expand Down
Binary file modified infra/data/db/base/13468/16722
Binary file not shown.
Binary file modified infra/data/db/base/13468/16736
Binary file not shown.
Binary file modified infra/data/db/base/13468/16747
Binary file not shown.
Binary file modified infra/data/db/base/13468/pg_internal.init
Binary file not shown.
Binary file modified infra/data/db/global/pg_control
Binary file not shown.
Binary file modified infra/data/db/global/pg_internal.init
Binary file not shown.
Binary file modified infra/data/db/pg_multixact/members/0000
Binary file not shown.
Binary file modified infra/data/db/pg_multixact/offsets/0000
Binary file not shown.
Binary file modified infra/data/db/pg_subtrans/0000
Binary file not shown.
Binary file modified infra/data/db/pg_wal/000000010000000000000001
Binary file not shown.
Binary file modified infra/data/db/pg_xact/0000
Binary file not shown.

0 comments on commit f9e8d42

Please sign in to comment.