mirror of
https://github.com/YunoHost-Apps/fittrackee_ynh.git
synced 2024-09-03 18:36:16 +02:00
Test
This commit is contained in:
parent
11895af7d5
commit
5ea51757ad
5 changed files with 77 additions and 14 deletions
|
@ -15,20 +15,8 @@ Group=__APP__
|
||||||
StandardOutput=syslog
|
StandardOutput=syslog
|
||||||
StandardError=syslog
|
StandardError=syslog
|
||||||
SyslogIdentifier=__APP__
|
SyslogIdentifier=__APP__
|
||||||
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__/
|
||||||
EnvironmentFile=__INSTALL_DIR__/.env
|
EnvironmentFile=/etc/systemd/system/${app}.service.d/variables.conf
|
||||||
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
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ Environment="EMAIL_URL="
|
||||||
Environment="SENDER_EMAIL="
|
Environment="SENDER_EMAIL="
|
||||||
Environment="REDIS_URL="
|
Environment="REDIS_URL="
|
||||||
WorkingDirectory=__INSTALL_DIR__/
|
WorkingDirectory=__INSTALL_DIR__/
|
||||||
EnvironmentFile=__INSTALL_DIR__/.env
|
EnvironmentFile=/etc/systemd/system/${app}_workers.service.d/variables.conf
|
||||||
ExecStart=__INSTALL_DIR__/.venv/bin/flask worker --processes 2
|
ExecStart=__INSTALL_DIR__/.venv/bin/flask worker --processes 2
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
||||||
|
|
31
conf/variables_fittrackee.conf
Normal file
31
conf/variables_fittrackee.conf
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
APP_SECRET_KEY='__KEY__'
|
||||||
|
# APP_WORKERS=
|
||||||
|
APP_LOG=/var/log/__APP__/__APP__.log
|
||||||
|
UPLOAD_FOLDER=/home/yunohost.app/__APP__/data
|
||||||
|
|
||||||
|
# PostgreSQL
|
||||||
|
DATABASE_URL=postgresql://__DB_USER__:__DB_PWD__@:5432/__DB_NAME__
|
||||||
|
# export DATABASE_DISABLE_POOLING=
|
||||||
|
|
||||||
|
# Redis (required for API rate limits and email sending)
|
||||||
|
REDIS_URL=redis://127.0.0.1:6379/__REDIS_DB__
|
||||||
|
|
||||||
|
# API rate limits
|
||||||
|
# export API_RATE_LIMITS="300 per 5 minutes"
|
||||||
|
|
||||||
|
# Emails
|
||||||
|
UI_URL=__DOMAIN__
|
||||||
|
EMAIL_URL=
|
||||||
|
SENDER_EMAIL=
|
||||||
|
# export WORKERS_PROCESSES=
|
||||||
|
|
||||||
|
# Workouts
|
||||||
|
TILE_SERVER_URL=
|
||||||
|
STATICMAP_SUBDOMAINS=
|
||||||
|
MAP_ATTRIBUTION=
|
||||||
|
# export DEFAULT_STATICMAP=False
|
||||||
|
|
||||||
|
# Weather
|
||||||
|
# available weather API providers: darksky, visualcrossing
|
||||||
|
# export WEATHER_API_PROVIDER=visualcrossing
|
||||||
|
WEATHER_API_KEY=
|
31
conf/variables_fittrackee_workers.conf
Normal file
31
conf/variables_fittrackee_workers.conf
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
FLASK_APP=fittrackee
|
||||||
|
APP_SECRET_KEY='__KEY__'
|
||||||
|
APP_LOG=/var/log/__APP__/__APP__.log
|
||||||
|
UPLOAD_FOLDER=/home/yunohost.app/__APP__/data
|
||||||
|
|
||||||
|
# PostgreSQL
|
||||||
|
DATABASE_URL=postgresql://__DB_USER__:__DB_PWD__@:5432/__DB_NAME__
|
||||||
|
# export DATABASE_DISABLE_POOLING=
|
||||||
|
|
||||||
|
# Redis (required for API rate limits and email sending)
|
||||||
|
REDIS_URL=redis://127.0.0.1:6379/__REDIS_DB__
|
||||||
|
|
||||||
|
# API rate limits
|
||||||
|
# export API_RATE_LIMITS="300 per 5 minutes"
|
||||||
|
|
||||||
|
# Emails
|
||||||
|
UI_URL=__DOMAIN__
|
||||||
|
EMAIL_URL=
|
||||||
|
SENDER_EMAIL=
|
||||||
|
# export WORKERS_PROCESSES=
|
||||||
|
|
||||||
|
# Workouts
|
||||||
|
# export TILE_SERVER_URL=
|
||||||
|
# export STATICMAP_SUBDOMAINS=
|
||||||
|
# export MAP_ATTRIBUTION=
|
||||||
|
# export DEFAULT_STATICMAP=False
|
||||||
|
|
||||||
|
# Weather
|
||||||
|
# available weather API providers: darksky, visualcrossing
|
||||||
|
# export WEATHER_API_PROVIDER=visualcrossing
|
||||||
|
# export WEATHER_API_KEY=
|
|
@ -100,6 +100,19 @@ 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:www-data /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:www-data "/etc/systemd/system/${app}.service.d/variables.conf"
|
||||||
|
|
||||||
|
mkdir /etc/systemd/system/${app}_workers.service.d/
|
||||||
|
chown $app:www-data /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:www-data "/etc/systemd/system/${app}_workers.service.d/variables.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
|
Loading…
Reference in a new issue