1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/funkwhale_ynh.git synced 2024-09-03 18:36:24 +02:00

fix data_dir/data/

This commit is contained in:
Thomas 2023-03-30 20:59:37 +02:00 committed by GitHub
parent 14449adb37
commit 6d58ed46fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 15 deletions

View file

@ -64,8 +64,6 @@ ram.runtime = "50M"
[resources.install_dir] [resources.install_dir]
[resources.data_dir] [resources.data_dir]
dir = "/home/yunohost.app/__APP__/data"
owner = "__APP__:www-data"
[resources.permissions] [resources.permissions]
main.url = "/" main.url = "/"

View file

@ -45,11 +45,12 @@ ynh_add_nginx_config
#================================================= #=================================================
ynh_script_progression --message="Creating a data directory..." --weight=1 ynh_script_progression --message="Creating a data directory..." --weight=1
mkdir -p $data_dir/{static,media,music} mkdir -p $data_dir/data
mkdir -p $data_dir/data/{static,media,music}
chmod 750 "$data_dir" chmod 750 "$data_dir/data/"
chmod -R o-rwx "$data_dir" chmod -R o-rwx "$data_dir/data/"
chown -R $app:www-data "$data_dir" chown -R $app:www-data "$data_dir/data/"
#================================================= #=================================================
# ADD A CONFIGURATION # ADD A CONFIGURATION

View file

@ -25,13 +25,13 @@ chown -R $app:www-data "$install_dir"
#================================================= #=================================================
ynh_script_progression --message="Restoring the data directory..." --weight=1 ynh_script_progression --message="Restoring the data directory..." --weight=1
ynh_restore_file --origin_path="$data_dir" --not_mandatory ynh_restore_file --origin_path="$data_dir/data/" --not_mandatory
mkdir -p $data_dir/{static,media,music} mkdir -p $data_dir/data/{static,media,music}
chmod 750 "$data_dir" chmod 750 "$data_dir/data/"
chmod -R o-rwx "$data_dir" chmod -R o-rwx "$data_dir/data/"
chown -R $app:www-data "$data_dir" chown -R $app:www-data "$data_dir/data/"
#================================================= #=================================================
# RESTORE THE NGINX CONFIGURATION # RESTORE THE NGINX CONFIGURATION

View file

@ -31,7 +31,7 @@ ynh_systemd_action --action="stop" --service_name="${app}-worker" --log_path="sy
#================================================= #=================================================
# If data_dir doesn't exist, create it # If data_dir doesn't exist, create it
if [ -z "$data_dir" ]; then if [ -z "$data_dir/data/" ]; then
# Do a full backup before moving datas # Do a full backup before moving datas
yunohost backup create --apps $app yunohost backup create --apps $app
@ -74,9 +74,9 @@ if [ -z "$data_dir" ]; then
ynh_secure_remove --file="$install_dir/import" ynh_secure_remove --file="$install_dir/import"
ynh_secure_remove --file="$install_dir/code/data/music" ynh_secure_remove --file="$install_dir/code/data/music"
chmod 750 "$data_dir" chmod 750 "$data_dir/data/"
chmod -R o-rwx "$data_dir" chmod -R o-rwx "$data_dir/data/"
chown -R $app:www-data "$data_dir" chown -R $app:www-data "$data_dir/data/"
upgrade_type="UPGRADE_APP" upgrade_type="UPGRADE_APP"
fi fi