mirror of
https://github.com/Faridik/Carolyn.git
synced 2026-07-08 05:11:52 +00:00
Сервис переименован: SpreadsheetsService→GoogleService (#18)
* Переименовал SpreadsheetsService→GoogleService * кэш тестов
This commit is contained in:
parent
82ea404e30
commit
892fa7b87b
15
.gitignore
vendored
15
.gitignore
vendored
@ -1,10 +1,11 @@
|
|||||||
.vscode
|
.vscode
|
||||||
SpreadsheetsService/models/__pycache__
|
GoogleService/models/__pycache__
|
||||||
SpreadsheetsService/utils/__pycache__
|
GoogleService/utils/__pycache__
|
||||||
SpreadsheetsService/tests/__pycache__
|
GoogleService/tests/__pycache__
|
||||||
SpreadsheetsService/manager/__pycache__
|
GoogleService/manager/__pycache__
|
||||||
SpreadsheetsService/manager/client_secret.json
|
GoogleService/manager/client_secret.json
|
||||||
SpreadsheetsService/manager/token.json
|
GoogleService/manager/token.json
|
||||||
TelegramBot/.secrets
|
TelegramBot/.secrets
|
||||||
SpreadsheetsService/.secrets
|
GoogleService/.secrets
|
||||||
TelegramBot/messages/__pycache__
|
TelegramBot/messages/__pycache__
|
||||||
|
.pytest_cache
|
||||||
@ -1,24 +1,24 @@
|
|||||||
# For more information, please refer to https://aka.ms/vscode-docker-python
|
# For more information, please refer to https://aka.ms/vscode-docker-python
|
||||||
FROM python:3.8-slim-buster
|
FROM python:3.8-slim-buster
|
||||||
|
|
||||||
# Keeps Python from generating .pyc files in the container
|
# Keeps Python from generating .pyc files in the container
|
||||||
ENV PYTHONDONTWRITEBYTECODE=1
|
ENV PYTHONDONTWRITEBYTECODE=1
|
||||||
|
|
||||||
# Turns off buffering for easier container logging
|
# Turns off buffering for easier container logging
|
||||||
ENV PYTHONUNBUFFERED=1
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
# Install pip requirements
|
# Install pip requirements
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN python -m pip install -r requirements.txt
|
RUN python -m pip install -r requirements.txt
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ADD . /app
|
ADD . /app
|
||||||
|
|
||||||
# Не работает, права не знаю как дать больше, аппюзер ограничен
|
# Не работает, права не знаю как дать больше, аппюзер ограничен
|
||||||
# Creates a non-root user with an explicit UID and adds permission to access the /app folder
|
# Creates a non-root user with an explicit UID and adds permission to access the /app folder
|
||||||
# For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers
|
# For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers
|
||||||
# RUN useradd appuser && chown -R appuser /app
|
# RUN useradd appuser && chown -R appuser /app
|
||||||
# USER appuser
|
# USER appuser
|
||||||
|
|
||||||
# During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug
|
# During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug
|
||||||
CMD ["python", "app.py"]
|
CMD ["python", "app.py"]
|
||||||
@ -28,7 +28,7 @@ from utils.inline_keyboard import *
|
|||||||
from messages import Messages
|
from messages import Messages
|
||||||
|
|
||||||
ADMIN = "admin"
|
ADMIN = "admin"
|
||||||
HOST = "http://carolyn-spreadsheets:5000"
|
HOST = "http://carolyn-google:5000"
|
||||||
MESSAGES = Messages()
|
MESSAGES = Messages()
|
||||||
SUB_TIME_DELTA = datetime.timedelta(minutes=30)
|
SUB_TIME_DELTA = datetime.timedelta(minutes=30)
|
||||||
TOKEN = Path(".secrets/bot_token.txt").read_text()
|
TOKEN = Path(".secrets/bot_token.txt").read_text()
|
||||||
@ -69,7 +69,7 @@ def start(update: Update, context: CallbackContext):
|
|||||||
)
|
)
|
||||||
data = req.json()
|
data = req.json()
|
||||||
except requests.exceptions.RequestException:
|
except requests.exceptions.RequestException:
|
||||||
LOG.exception("@{username} вызвал: Ошибка подключения к сервису Spreadsheets.")
|
LOG.exception("@{username} вызвал: Ошибка подключения к сервису Google.")
|
||||||
update.message.reply_sticker(MESSAGES.Stickers.DEAD)
|
update.message.reply_sticker(MESSAGES.Stickers.DEAD)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -321,7 +321,7 @@ def sub(update: Update, context: CallbackContext):
|
|||||||
)
|
)
|
||||||
data = req.json()
|
data = req.json()
|
||||||
except requests.exceptions.RequestException:
|
except requests.exceptions.RequestException:
|
||||||
LOG.exception("@{user_id} вызвал: Ошибка подключения к сервису Spreadsheets.")
|
LOG.exception("@{user_id} вызвал: Ошибка подключения к сервису Google.")
|
||||||
update.message.reply_sticker(MESSAGES.Stickers.DEAD)
|
update.message.reply_sticker(MESSAGES.Stickers.DEAD)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -351,7 +351,7 @@ def unsub(update: Update, context: CallbackContext):
|
|||||||
)
|
)
|
||||||
data = req.json()
|
data = req.json()
|
||||||
except requests.exceptions.RequestException:
|
except requests.exceptions.RequestException:
|
||||||
LOG.exception("@{user_id} вызвал: Ошибка подключения к сервису Spreadsheets.")
|
LOG.exception("@{user_id} вызвал: Ошибка подключения к сервису Google.")
|
||||||
update.message.reply_sticker(MESSAGES.Stickers.DEAD)
|
update.message.reply_sticker(MESSAGES.Stickers.DEAD)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -381,7 +381,7 @@ def variant(update: Update, context: CallbackContext):
|
|||||||
)
|
)
|
||||||
data = req.json()
|
data = req.json()
|
||||||
except requests.exceptions.RequestException:
|
except requests.exceptions.RequestException:
|
||||||
LOG.exception("@{user_id} вызвал: Ошибка подключения к сервису Spreadsheets.")
|
LOG.exception("@{user_id} вызвал: Ошибка подключения к сервису Google.")
|
||||||
update.message.reply_sticker(MESSAGES.Stickers.DEAD)
|
update.message.reply_sticker(MESSAGES.Stickers.DEAD)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@ -116,7 +116,7 @@ class Messages:
|
|||||||
def about(commit_id: str, git_describe):
|
def about(commit_id: str, git_describe):
|
||||||
return f"ℹ️ Версия сборки:\n<a href='https://github.com/Faridik/Carolyn/commit/{commit_id}'>{git_describe}</a>"
|
return f"ℹ️ Версия сборки:\n<a href='https://github.com/Faridik/Carolyn/commit/{commit_id}'>{git_describe}</a>"
|
||||||
|
|
||||||
class Spreadsheets:
|
class Google:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class Stickers:
|
class Stickers:
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
version: "3.9"
|
version: "3.9"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
spreadsheets:
|
google:
|
||||||
container_name: "carolyn-spreadsheets"
|
container_name: "carolyn-google"
|
||||||
restart: always
|
restart: always
|
||||||
build: ./SpreadsheetsService
|
build: ./GoogleService
|
||||||
ports:
|
ports:
|
||||||
- "5000:5000"
|
- "5000:5000"
|
||||||
volumes:
|
volumes:
|
||||||
- ./SpreadsheetsService:/app
|
- ./GoogleService:/app
|
||||||
telegrambot:
|
telegrambot:
|
||||||
container_name: "carolyn-telegrambot"
|
container_name: "carolyn-telegrambot"
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user