mirror of
https://github.com/YunoHost-Apps/fittrackee_ynh.git
synced 2024-09-03 18:36:16 +02:00
fix
This commit is contained in:
parent
35fd7388c6
commit
4f3c368b0e
4 changed files with 44 additions and 46 deletions
|
@ -2,40 +2,40 @@
|
||||||
# (can overwrite variables present in Makefile.config)
|
# (can overwrite variables present in Makefile.config)
|
||||||
|
|
||||||
# Application
|
# Application
|
||||||
export FLASK_APP=fittrackee
|
FLASK_APP=fittrackee
|
||||||
export FLASK_SKIP_DOTENV=1
|
FLASK_SKIP_DOTENV=1
|
||||||
# export HOST=
|
# HOST=
|
||||||
export PORT=__PORT__
|
PORT=__PORT__
|
||||||
# export APP_SETTINGS=fittrackee.config.ProductionConfig
|
# APP_SETTINGS=fittrackee.config.ProductionConfig
|
||||||
export APP_SECRET_KEY='__KEY__'
|
APP_SECRET_KEY='__KEY__'
|
||||||
# export APP_WORKERS=
|
# APP_WORKERS=
|
||||||
export APP_LOG=/var/log/__APP__/__APP__.log
|
APP_LOG=/var/log/__APP__/__APP__.log
|
||||||
export UPLOAD_FOLDER=/home/yunohost.app/__APP__/data
|
UPLOAD_FOLDER=/home/yunohost.app/__APP__/data
|
||||||
|
|
||||||
# PostgreSQL
|
# PostgreSQL
|
||||||
export DATABASE_URL=postgresql://__DB_USER__:__DB_PWD__@:5432/__DB_NAME__
|
DATABASE_URL=postgresql://__DB_USER__:__DB_PWD__@:5432/__DB_NAME__
|
||||||
# export DATABASE_DISABLE_POOLING=
|
# DATABASE_DISABLE_POOLING=
|
||||||
|
|
||||||
# Redis (required for API rate limits and email sending)
|
# Redis (required for API rate limits and email sending)
|
||||||
export REDIS_URL=redis://
|
REDIS_URL=redis://
|
||||||
|
|
||||||
# API rate limits
|
# API rate limits
|
||||||
# export API_RATE_LIMITS="300 per 5 minutes"
|
# API_RATE_LIMITS="300 per 5 minutes"
|
||||||
|
|
||||||
# Emails
|
# Emails
|
||||||
export UI_URL=__DOMAIN__
|
UI_URL=__DOMAIN__
|
||||||
export EMAIL_URL=__ADMIN_MAIL__
|
EMAIL_URL=__ADMIN_MAIL__
|
||||||
export SENDER_EMAIL=__ADMIN_MAIL__
|
SENDER_EMAIL=__ADMIN_MAIL__
|
||||||
# export WORKERS_PROCESSES=
|
# WORKERS_PROCESSES=
|
||||||
|
|
||||||
# Workouts
|
# Workouts
|
||||||
# export TILE_SERVER_URL=
|
# TILE_SERVER_URL=
|
||||||
# export STATICMAP_SUBDOMAINS=
|
# STATICMAP_SUBDOMAINS=
|
||||||
# export MAP_ATTRIBUTION=
|
# MAP_ATTRIBUTION=
|
||||||
# export DEFAULT_STATICMAP=False
|
# DEFAULT_STATICMAP=False
|
||||||
|
|
||||||
# Weather
|
# Weather
|
||||||
# available weather API providers: darksky, visualcrossing
|
# available weather API providers: darksky, visualcrossing
|
||||||
# export WEATHER_API_PROVIDER=visualcrossing
|
# WEATHER_API_PROVIDER=visualcrossing
|
||||||
# export WEATHER_API_KEY=
|
# WEATHER_API_KEY=
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,20 @@ Restart=always
|
||||||
RestartSec=1
|
RestartSec=1
|
||||||
User=__APP__
|
User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
StandardOutput=syslog
|
|
||||||
StandardError=syslog
|
StandardError=syslog
|
||||||
SyslogIdentifier=fittrackee
|
|
||||||
SyslogIdentifier=__APP__
|
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__/
|
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
|
ExecStart=__INSTALL_DIR__/.venv/bin/gunicorn -b 127.0.0.1:__PORT__ "fittrackee:create_app()" --error-logfile /var/log/__APP__/__APP__.log
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
|
@ -12,10 +12,17 @@ Restart=always
|
||||||
RestartSec=1
|
RestartSec=1
|
||||||
User=__APP__
|
User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
StandardOutput=syslog
|
|
||||||
StandardError=syslog
|
StandardError=syslog
|
||||||
SyslogIdentifier=__APP___workers
|
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__/
|
WorkingDirectory=__INSTALL_DIR__/
|
||||||
ExecStart=__INSTALL_DIR__/.venv/bin/flask worker --processes 2
|
ExecStart=__INSTALL_DIR__/.venv/bin/flask worker --processes 2
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
|
@ -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}" --template="${app}.service"
|
||||||
ynh_add_systemd_config --service="${app}_workers" --template="${app}_workers.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
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue