1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/fittrackee_ynh.git synced 2024-09-03 18:36:16 +02:00
This commit is contained in:
Thomas 2023-03-02 20:27:53 +01:00 committed by GitHub
parent 35fd7388c6
commit 4f3c368b0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 46 deletions

View file

@ -2,40 +2,40 @@
# (can overwrite variables present in Makefile.config)
# Application
export FLASK_APP=fittrackee
export FLASK_SKIP_DOTENV=1
# export HOST=
export PORT=__PORT__
# export APP_SETTINGS=fittrackee.config.ProductionConfig
export APP_SECRET_KEY='__KEY__'
# export APP_WORKERS=
export APP_LOG=/var/log/__APP__/__APP__.log
export UPLOAD_FOLDER=/home/yunohost.app/__APP__/data
FLASK_APP=fittrackee
FLASK_SKIP_DOTENV=1
# HOST=
PORT=__PORT__
# APP_SETTINGS=fittrackee.config.ProductionConfig
APP_SECRET_KEY='__KEY__'
# APP_WORKERS=
APP_LOG=/var/log/__APP__/__APP__.log
UPLOAD_FOLDER=/home/yunohost.app/__APP__/data
# PostgreSQL
export DATABASE_URL=postgresql://__DB_USER__:__DB_PWD__@:5432/__DB_NAME__
# export DATABASE_DISABLE_POOLING=
DATABASE_URL=postgresql://__DB_USER__:__DB_PWD__@:5432/__DB_NAME__
# DATABASE_DISABLE_POOLING=
# Redis (required for API rate limits and email sending)
export REDIS_URL=redis://
REDIS_URL=redis://
# API rate limits
# export API_RATE_LIMITS="300 per 5 minutes"
# API_RATE_LIMITS="300 per 5 minutes"
# Emails
export UI_URL=__DOMAIN__
export EMAIL_URL=__ADMIN_MAIL__
export SENDER_EMAIL=__ADMIN_MAIL__
# export WORKERS_PROCESSES=
UI_URL=__DOMAIN__
EMAIL_URL=__ADMIN_MAIL__
SENDER_EMAIL=__ADMIN_MAIL__
# WORKERS_PROCESSES=
# Workouts
# export TILE_SERVER_URL=
# export STATICMAP_SUBDOMAINS=
# export MAP_ATTRIBUTION=
# export DEFAULT_STATICMAP=False
# TILE_SERVER_URL=
# STATICMAP_SUBDOMAINS=
# MAP_ATTRIBUTION=
# DEFAULT_STATICMAP=False
# Weather
# available weather API providers: darksky, visualcrossing
# export WEATHER_API_PROVIDER=visualcrossing
# export WEATHER_API_KEY=
# WEATHER_API_PROVIDER=visualcrossing
# WEATHER_API_KEY=

View file

@ -12,11 +12,20 @@ Restart=always
RestartSec=1
User=__APP__
Group=__APP__
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=fittrackee
SyslogIdentifier=__APP__
EnvironmentFile=/etc/systemd/system/__APP__.service.d/variables.conf
Environment="APP_SECRET_KEY="
Environment="APP_LOG="
Environment="UPLOAD_FOLDER="
Environment="DATABASE_URL="
Environment="UI_URL="
Environment="EMAIL_URL="
Environment="SENDER_EMAIL="
Environment="REDIS_URL="
Environment="TILE_SERVER_URL="
Environment="STATICMAP_SUBDOMAINS="
Environment="MAP_ATTRIBUTION="
Environment="WEATHER_API_KEY="
WorkingDirectory=__INSTALL_DIR__/
ExecStart=__INSTALL_DIR__/.venv/bin/gunicorn -b 127.0.0.1:__PORT__ "fittrackee:create_app()" --error-logfile /var/log/__APP__/__APP__.log
Restart=always

View file

@ -12,10 +12,17 @@ Restart=always
RestartSec=1
User=__APP__
Group=__APP__
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=__APP___workers
EnvironmentFile=/etc/systemd/system/__APP___workers.service.d/variables.conf
Environment="FLASK_APP=fittrackee"
Environment="APP_SECRET_KEY="
Environment="APP_LOG="
Environment="UPLOAD_FOLDER="
Environment="DATABASE_URL="
Environment="UI_URL="
Environment="EMAIL_URL="
Environment="SENDER_EMAIL="
Environment="REDIS_URL="
WorkingDirectory=__INSTALL_DIR__/
ExecStart=__INSTALL_DIR__/.venv/bin/flask worker --processes 2
Restart=always

View file

@ -98,24 +98,6 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=1
ynh_add_systemd_config --service="${app}" --template="${app}.service"
ynh_add_systemd_config --service="${app}_workers" --template="${app}_workers.service"
mkdir /etc/systemd/system/${app}.service.d/
chown $app: /etc/systemd/system/${app}.service.d/
ynh_add_config --template="../conf/variables_fittrackee_workers.conf" --destination="/etc/systemd/system/${app}.service.d/variables.conf"
chmod 600 /etc/systemd/system/${app}.service.d/variables.conf
chown $app: "/etc/systemd/system/${app}.service.d/variables.conf"
mkdir /etc/systemd/system/${app}_workers.service.d/
chown $app: /etc/systemd/system/${app}_workers.service.d/
ynh_add_config --template="../conf/variables_fittrackee_workers.conf" --destination="/etc/systemd/system/${app}_workers.service.d/variables.conf"
chmod 600 /etc/systemd/system/${app}_workers.service.d/variables.conf
chown $app: "/etc/systemd/system/${app}_workers.service.d/variables.conf"
systemctl daemon-reload
#=================================================
# GENERIC FINALIZATION
#=================================================