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:
parent
14449adb37
commit
6d58ed46fd
4 changed files with 14 additions and 15 deletions
|
@ -64,8 +64,6 @@ ram.runtime = "50M"
|
|||
[resources.install_dir]
|
||||
|
||||
[resources.data_dir]
|
||||
dir = "/home/yunohost.app/__APP__/data"
|
||||
owner = "__APP__:www-data"
|
||||
|
||||
[resources.permissions]
|
||||
main.url = "/"
|
||||
|
|
|
@ -45,11 +45,12 @@ ynh_add_nginx_config
|
|||
#=================================================
|
||||
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 -R o-rwx "$data_dir"
|
||||
chown -R $app:www-data "$data_dir"
|
||||
chmod 750 "$data_dir/data/"
|
||||
chmod -R o-rwx "$data_dir/data/"
|
||||
chown -R $app:www-data "$data_dir/data/"
|
||||
|
||||
#=================================================
|
||||
# ADD A CONFIGURATION
|
||||
|
|
|
@ -25,13 +25,13 @@ chown -R $app:www-data "$install_dir"
|
|||
#=================================================
|
||||
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 -R o-rwx "$data_dir"
|
||||
chown -R $app:www-data "$data_dir"
|
||||
chmod 750 "$data_dir/data/"
|
||||
chmod -R o-rwx "$data_dir/data/"
|
||||
chown -R $app:www-data "$data_dir/data/"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE NGINX CONFIGURATION
|
||||
|
|
|
@ -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 [ -z "$data_dir" ]; then
|
||||
if [ -z "$data_dir/data/" ]; then
|
||||
# Do a full backup before moving datas
|
||||
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/code/data/music"
|
||||
|
||||
chmod 750 "$data_dir"
|
||||
chmod -R o-rwx "$data_dir"
|
||||
chown -R $app:www-data "$data_dir"
|
||||
chmod 750 "$data_dir/data/"
|
||||
chmod -R o-rwx "$data_dir/data/"
|
||||
chown -R $app:www-data "$data_dir/data/"
|
||||
|
||||
upgrade_type="UPGRADE_APP"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue