1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ihatemoney_ynh.git synced 2024-09-03 19:26:15 +02:00

Configure logging to /var/log/ihatemoney

This commit is contained in:
Salamandar 2023-06-12 16:53:23 +02:00 committed by Salamandar
parent 37854138f3
commit cde4364797
5 changed files with 27 additions and 0 deletions

View file

@ -6,10 +6,14 @@ After=network.target mysql.service
[Service]
Type=simple
User=__APP__
Group=__APP__
Environment=IHATEMONEY_SETTINGS_FILE_PATH=__FINALPATH__/ihatemoney.cfg
ExecStart=__FINALPATH__/venv/bin/gunicorn -c __FINALPATH__/gunicorn.conf.py ihatemoney.wsgi:application
Restart=always
RestartSec=2
StandardOutput=append:/var/log/__APP__/__APP__.log
StandardError=inherit
[Install]
WantedBy=multi-user.target

View file

@ -53,6 +53,12 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# BACKUP LOG
#=================================================
ynh_backup --src_path="/var/log/$app" --is_big=1
#=================================================
# BACKUP THE MYSQL DATABASE
#=================================================

View file

@ -134,6 +134,10 @@ ynh_add_config --template="../conf/ihatemoney.cfg" --destination="$final_path/ih
chmod 640 "$final_path/ihatemoney.cfg"
chown $app:$app "$final_path/ihatemoney.cfg"
# Configure log directory
mkdir -p "/var/log/$app"
chown -R $app:$app "/var/log/$app"
#=================================================
# SETUP SYSTEMD
#=================================================

View file

@ -96,6 +96,12 @@ ynh_script_progression --message="Restoring the systemd configuration..." --weig
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet
#=================================================
# RESTORE LOG
#=================================================
ynh_restore_file --origin_path="/var/log/$app"
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================

View file

@ -130,6 +130,13 @@ if [ -z "$hashed_password" ] && [ test -f "${final_path}/venv/bin/activate" ]; t
ynh_send_readme_to_admin --app_message="../conf/upgrade.msg" --type="upgrade"
fi
if [ ! -d "/var/log/$app" ]; then
# Configure log directory
mkdir -p "/var/log/$app"
chown -R $app:$app "/var/log/$app"
fi
#=================================================
# CREATE DEDICATED USER
#=================================================