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

use $data_dir

This commit is contained in:
Éric Gaspar 2023-05-25 19:39:15 +02:00
parent 305e7f5281
commit a1458f1ace
6 changed files with 13 additions and 24 deletions

View file

@ -6,7 +6,7 @@ Type=simple
User=__APP__
Group=__APP__
WorkingDirectory=__INSTALL_DIR__/
ExecStart=__INSTALL_DIR__/venv/bin/python3 __INSTALL_DIR__/Headphones.py --config /etc/__APP__/headphones.ini --datadir __DATA_DIR__ --nolaunch
ExecStart=__INSTALL_DIR__/venv/bin/python3 __INSTALL_DIR__/Headphones.py --config __DATA_DIR__/headphones.ini --datadir __DATA_DIR__ --nolaunch
# Sandboxing options to harden security
# Depending on specificities of your service/app, you may need to tweak these

1
doc/ADMIN.md Normal file
View file

@ -0,0 +1 @@
the configuration file is located : __DATA_DIR__/headphones.ini

View file

@ -34,10 +34,10 @@ ynh_script_progression --message="Updating a configuration file..."
path=$new_path
domain=$new_domain
ynh_add_config --template="../conf/headphones.ini" --destination="/etc/$app/headphones.ini"
ynh_add_config --template="../conf/headphones.ini" --destination="$data_dir/headphones.ini"
chmod 600 "/etc/$app/headphones.ini"
chown $app:$app "/etc/$app/headphones.ini"
chmod 600 "$data_dir/headphones.ini"
chown $app:$app "$data_dir/headphones.ini"
#=================================================
# GENERIC FINALISATION

View file

@ -43,11 +43,10 @@ python3 -m venv $install_dir/venv
#=================================================
ynh_script_progression --message="Adding a configuration file..."
mkdir -p "/etc/$app"
ynh_add_config --template="../conf/headphones.ini" --destination="/etc/$app/headphones.ini"
ynh_add_config --template="../conf/headphones.ini" --destination="$data_dir/headphones.ini"
chmod 600 "/etc/$app/headphones.ini"
chown $app:$app "/etc/$app/headphones.ini"
chmod 600 "$data_dir/headphones.ini"
chown $app:$app "$data_dir/headphones.ini"
#=================================================
# SETUP SYSTEMD

View file

@ -26,7 +26,6 @@ ynh_script_progression --message="Restoring the app main directory..."
ynh_restore_file --origin_path="$install_dir"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:$app "$install_dir"
chmod +x "$install_dir/Headphones.py"
@ -40,16 +39,6 @@ ynh_restore_file --origin_path="$data_dir" --not_mandatory
chown -R $app:$app "$data_dir"
#=================================================
# RESTORE VARIOUS FILES
#=================================================
ynh_script_progression --message="Restoring various files..."
ynh_restore_file --origin_path="/etc/$app/"
chmod 600 "/etc/$app/headphones.ini"
chown $app:$app "/etc/$app/headphones.ini"
#=================================================
# RESTORE SYSTEMD
#=================================================

View file

@ -53,7 +53,7 @@ ynh_add_nginx_config
#=================================================
# INSTALL PYTHON DEPENDENCIES
#=================================================
#REMOVEME? ynh_script_progression --message="Installing Python dependencies..."
ynh_script_progression --message="Installing Python dependencies..."
ynh_secure_remove --file="$install_dir/venv"
python3 -m venv $install_dir/venv
@ -63,11 +63,11 @@ python3 -m venv $install_dir/venv
#=================================================
ynh_script_progression --message="Updating a configuration file..."
mkdir -p "/etc/$app"
ynh_add_config --template="../conf/headphones.ini" --destination="/etc/$app/headphones.ini"
ynh_secure_remove --file="/etc/$app"
ynh_add_config --template="../conf/headphones.ini" --destination="$data_dir/headphones.ini"
chmod 600 "/etc/$app/headphones.ini"
chown $app:$app "/etc/$app/headphones.ini"
chmod 600 "$data_dir/headphones.ini"
chown $app:$app "$data_dir/headphones.ini"
#=================================================
# SETUP SYSTEMD