diff --git a/conf/env.prod b/conf/env.prod index ae37480..0ea9385 100644 --- a/conf/env.prod +++ b/conf/env.prod @@ -110,12 +110,12 @@ CACHE_URL=redis://127.0.0.1:6379/__REDIS_DB__ # Where media files (such as album covers or audio tracks) should be stored # on your system? # (Ensure this directory actually exists) -MEDIA_ROOT=__DATA_DIR__/data/media +MEDIA_ROOT=__DATA_DIR__/media # Where static files (such as API css or icons) should be compiled # on your system? # (Ensure this directory actually exists) -STATIC_ROOT=__DATA_DIR__/data/static +STATIC_ROOT=__DATA_DIR__/static # which settings module should django use? # You don't have to touch this unless you really know what you're doing @@ -138,8 +138,8 @@ DJANGO_SECRET_KEY=__KEY__ # MUSIC_DIRECTORY_PATH=/srv/funkwhale/data/music # # MUSIC_DIRECTORY_SERVE_PATH= # stays commented, not needed -MUSIC_DIRECTORY_PATH=__DATA_DIR__/data/music -#MUSIC_DIRECTORY_SERVE_PATH=__DATA_DIR__/data/import +MUSIC_DIRECTORY_PATH=__DATA_DIR__/music +#MUSIC_DIRECTORY_SERVE_PATH=__DATA_DIR__/import # LDAP settings # Use the following options to allow authentication on your Funkwhale instance diff --git a/conf/nginx.conf b/conf/nginx.conf index e01ed0f..d1db0de 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -102,11 +102,11 @@ location /.well-known/ { } location /media/__sized__/ { - alias __DATA_DIR__/data/media/__sized__/; + alias __DATA_DIR__/media/__sized__/; } location /media/attachments/ { - alias __DATA_DIR__/data/media/attachments/; + alias __DATA_DIR__/media/attachments/; } location /_protected/media/ { @@ -114,7 +114,7 @@ location /_protected/media/ { # audio files once correct permission / authentication # has been checked on API side internal; - alias __DATA_DIR__/data/media/; + alias __DATA_DIR__/media/; } # Comment the previous location and uncomment this one if you're storing @@ -132,10 +132,10 @@ location /_protected/music/ { # has been checked on API side # Set this to the same value as your MUSIC_DIRECTORY_PATH setting internal; - alias __DATA_DIR__/data/music/; + alias __DATA_DIR__/music/; } location /staticfiles/ { # django static files - alias __DATA_DIR__/data/static/; + alias __DATA_DIR__/static/; } diff --git a/manifest.toml b/manifest.toml index 1e82b33..70abc87 100644 --- a/manifest.toml +++ b/manifest.toml @@ -18,7 +18,7 @@ userdoc = "https://docs.funkwhale.audio/users/index.html" code = "https://dev.funkwhale.audio/funkwhale/funkwhale" [integration] -yunohost = ">= 11.1.15" +yunohost = ">= 11.1.16" architectures = "all" multi_instance = true ldap = false @@ -64,6 +64,7 @@ ram.runtime = "50M" [resources.install_dir] [resources.data_dir] + subdirs = "data" group = "www-data:rx" [resources.permissions] diff --git a/scripts/install b/scripts/install index b267235..801a1c5 100644 --- a/scripts/install +++ b/scripts/install @@ -45,7 +45,6 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Creating a data directory..." --weight=1 -mkdir -p $data_dir/data mkdir -p $data_dir/{static,media,music} chmod 750 "$data_dir" diff --git a/scripts/restore b/scripts/restore index 66c9940..6563e9d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -27,7 +27,6 @@ ynh_script_progression --message="Restoring the data directory..." --weight=1 ynh_restore_file --origin_path="$data_dir/" --not_mandatory -mkdir -p $data_dir/data mkdir -p $data_dir/{static,media,music} chmod 750 "$data_dir/" diff --git a/scripts/upgrade b/scripts/upgrade index 28b57ca..2bd07b2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -75,9 +75,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/data/" - chmod -R o-rwx "$data_dir/data/" - chown -R $app:www-data "$data_dir/data/" + chmod 750 "$data_dir/" + chmod -R o-rwx "$data_dir/" + chown -R $app:www-data "$data_dir/" upgrade_type="UPGRADE_APP" fi