mirror of
https://github.com/Faridik/Carolyn.git
synced 2026-05-08 13:21:51 +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
|
||||
SpreadsheetsService/models/__pycache__
|
||||
SpreadsheetsService/utils/__pycache__
|
||||
SpreadsheetsService/tests/__pycache__
|
||||
SpreadsheetsService/manager/__pycache__
|
||||
SpreadsheetsService/manager/client_secret.json
|
||||
SpreadsheetsService/manager/token.json
|
||||
GoogleService/models/__pycache__
|
||||
GoogleService/utils/__pycache__
|
||||
GoogleService/tests/__pycache__
|
||||
GoogleService/manager/__pycache__
|
||||
GoogleService/manager/client_secret.json
|
||||
GoogleService/manager/token.json
|
||||
TelegramBot/.secrets
|
||||
SpreadsheetsService/.secrets
|
||||
GoogleService/.secrets
|
||||
TelegramBot/messages/__pycache__
|
||||
.pytest_cache
|
||||
@ -1,24 +1,24 @@
|
||||
# For more information, please refer to https://aka.ms/vscode-docker-python
|
||||
FROM python:3.8-slim-buster
|
||||
|
||||
# Keeps Python from generating .pyc files in the container
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
|
||||
# Turns off buffering for easier container logging
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
# Install pip requirements
|
||||
COPY requirements.txt .
|
||||
RUN python -m pip install -r requirements.txt
|
||||
|
||||
WORKDIR /app
|
||||
ADD . /app
|
||||
|
||||
# Не работает, права не знаю как дать больше, аппюзер ограничен
|
||||
# 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
|
||||
# RUN useradd appuser && chown -R appuser /app
|
||||
# USER appuser
|
||||
|
||||
# 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"]
|
||||
# For more information, please refer to https://aka.ms/vscode-docker-python
|
||||
FROM python:3.8-slim-buster
|
||||
|
||||
# Keeps Python from generating .pyc files in the container
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
|
||||
# Turns off buffering for easier container logging
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
# Install pip requirements
|
||||
COPY requirements.txt .
|
||||
RUN python -m pip install -r requirements.txt
|
||||
|
||||
WORKDIR /app
|
||||
ADD . /app
|
||||
|
||||
# Не работает, права не знаю как дать больше, аппюзер ограничен
|
||||
# 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
|
||||
# RUN useradd appuser && chown -R appuser /app
|
||||
# USER appuser
|
||||
|
||||
# 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"]
|
||||
@ -28,7 +28,7 @@ from utils.inline_keyboard import *
|
||||
from messages import Messages
|
||||
|
||||
ADMIN = "admin"
|
||||
HOST = "http://carolyn-spreadsheets:5000"
|
||||
HOST = "http://carolyn-google:5000"
|
||||
MESSAGES = Messages()
|
||||
SUB_TIME_DELTA = datetime.timedelta(minutes=30)
|
||||
TOKEN = Path(".secrets/bot_token.txt").read_text()
|
||||
@ -69,7 +69,7 @@ def start(update: Update, context: CallbackContext):
|
||||
)
|
||||
data = req.json()
|
||||
except requests.exceptions.RequestException:
|
||||
LOG.exception("@{username} вызвал: Ошибка подключения к сервису Spreadsheets.")
|
||||
LOG.exception("@{username} вызвал: Ошибка подключения к сервису Google.")
|
||||
update.message.reply_sticker(MESSAGES.Stickers.DEAD)
|
||||
return
|
||||
|
||||
@ -321,7 +321,7 @@ def sub(update: Update, context: CallbackContext):
|
||||
)
|
||||
data = req.json()
|
||||
except requests.exceptions.RequestException:
|
||||
LOG.exception("@{user_id} вызвал: Ошибка подключения к сервису Spreadsheets.")
|
||||
LOG.exception("@{user_id} вызвал: Ошибка подключения к сервису Google.")
|
||||
update.message.reply_sticker(MESSAGES.Stickers.DEAD)
|
||||
return
|
||||
|
||||
@ -351,7 +351,7 @@ def unsub(update: Update, context: CallbackContext):
|
||||
)
|
||||
data = req.json()
|
||||
except requests.exceptions.RequestException:
|
||||
LOG.exception("@{user_id} вызвал: Ошибка подключения к сервису Spreadsheets.")
|
||||
LOG.exception("@{user_id} вызвал: Ошибка подключения к сервису Google.")
|
||||
update.message.reply_sticker(MESSAGES.Stickers.DEAD)
|
||||
return
|
||||
|
||||
@ -381,7 +381,7 @@ def variant(update: Update, context: CallbackContext):
|
||||
)
|
||||
data = req.json()
|
||||
except requests.exceptions.RequestException:
|
||||
LOG.exception("@{user_id} вызвал: Ошибка подключения к сервису Spreadsheets.")
|
||||
LOG.exception("@{user_id} вызвал: Ошибка подключения к сервису Google.")
|
||||
update.message.reply_sticker(MESSAGES.Stickers.DEAD)
|
||||
return
|
||||
|
||||
|
||||
@ -116,7 +116,7 @@ class Messages:
|
||||
def about(commit_id: str, git_describe):
|
||||
return f"ℹ️ Версия сборки:\n<a href='https://github.com/Faridik/Carolyn/commit/{commit_id}'>{git_describe}</a>"
|
||||
|
||||
class Spreadsheets:
|
||||
class Google:
|
||||
pass
|
||||
|
||||
class Stickers:
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
spreadsheets:
|
||||
container_name: "carolyn-spreadsheets"
|
||||
google:
|
||||
container_name: "carolyn-google"
|
||||
restart: always
|
||||
build: ./SpreadsheetsService
|
||||
build: ./GoogleService
|
||||
ports:
|
||||
- "5000:5000"
|
||||
volumes:
|
||||
- ./SpreadsheetsService:/app
|
||||
- ./GoogleService:/app
|
||||
telegrambot:
|
||||
container_name: "carolyn-telegrambot"
|
||||
environment:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user