Compare commits

..

No commits in common. "a071a8d71a0247e21228d3cec1157b646ebba470" and "6ec8613b7ff0cb7346b4102a72f581b5c5bd8f5c" have entirely different histories.

6 changed files with 8 additions and 38 deletions

1
.gitignore vendored
View File

@ -162,4 +162,3 @@ app/run_venv.sh
# Local History for Visual Studio Code
.history/
/reference config/

View File

@ -222,16 +222,3 @@ This should also mean that the sign-up prompts should persist over reboots.
Other developers for Discord Components recommended the use of dynamic call-backs, however these do not persist after reboots so are not suitable for this purpose.
Discord will need to make substantial API updates in the future for rolling out the Threads feature.
The bot will need updating again then.
## Remote Deployment to docker server
Configure local env to know about the server
- ` docker context create remote --docker "host=tcp://<hostname>:2376,ca=<full path>/ca.pem,cert=<full path>/cert.pem,key=<full path>/key.pem"`
- create a folder on the server to use for the config
- create/amend a docker compose for that env (eg docker-compose-nas)
- put the config in that folder
- deploy using that config `docker compose -f docker-compose-nas.yml up -d`
- hope
- if its a QNAP nas, manually copy the docker compose file to `/share/CACHEDEV1_DATA/VMs/container-station-data/application/geas-bot` because its stupid
-

View File

@ -1,10 +1,7 @@
FROM python:slim
COPY . /app
WORKDIR /app
RUN apt-get update -y
RUN apt-get upgrade -y
RUN apt-get install libopus0 -y
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
RUN apt-get autoremove -y
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN apt-get update -y && apt-get upgrade -y && apt-get install libopus0 -y && \
pip install --upgrade pip && pip install -r requirements.txt && \
apt-get autoremove -y
CMD python3 -u ./bot.py

View File

@ -25,13 +25,9 @@ def yaml_dump(data:dict, filepath:str):
yaml.dump(data, file)
# Locate or create config file. Read from environment variables to locate file, and if missing or not valid then use default location.
configFile = './data/config.yml'
if os.getenv('CONFIG'):
if os.getenv('CONFIG').endswith(('.yml','.yaml')) and not os.getenv('CONFIG').endswith('config_blueprint.yml'):
configFile = os.getenv('CONFIG')
configFile = os.getenv('CONFIG') if ((os.getenv('CONFIG').endswith('.yml') or os.getenv('CONFIG').endswith('.yaml')) and not os.getenv('CONFIG').endswith('config_blueprint.yml')) else './data/config.yml'
if not os.path.exists(configFile):
yaml_dump({},configFile)
if not os.path.exists(configFile): yaml_dump({},configFile)
# Locate or create data file. Same as above.
dataFile = os.getenv('DATA') if ((os.getenv('DATA').endswith('.yml') or os.getenv('DATA').endswith('.yaml')) and not os.getenv('DATA').endswith('data_blueprint.yml')) else './data/data.yml'

View File

@ -1,9 +0,0 @@
version: '3.5'
services:
geasbot-app:
build: ./app
container_name: geas_bot
volumes:
- /share/Public/geasbot/data:/app/data
restart: unless-stopped

View File

@ -5,5 +5,5 @@ services:
build: ./app
container_name: geas_bot
volumes:
- ./app:/app
- ./app:/usr/src/app
restart: unless-stopped