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

fix datadir

This commit is contained in:
Thomas 2023-04-02 21:06:46 +02:00 committed by GitHub
parent b5b2012c70
commit a558ac8549
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 15 deletions

View file

@ -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 # Where media files (such as album covers or audio tracks) should be stored
# on your system? # on your system?
# (Ensure this directory actually exists) # (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 # Where static files (such as API css or icons) should be compiled
# on your system? # on your system?
# (Ensure this directory actually exists) # (Ensure this directory actually exists)
STATIC_ROOT=__DATA_DIR__/data/static STATIC_ROOT=__DATA_DIR__/static
# which settings module should django use? # which settings module should django use?
# You don't have to touch this unless you really know what you're doing # 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_PATH=/srv/funkwhale/data/music
# # MUSIC_DIRECTORY_SERVE_PATH= # stays commented, not needed # # MUSIC_DIRECTORY_SERVE_PATH= # stays commented, not needed
MUSIC_DIRECTORY_PATH=__DATA_DIR__/data/music MUSIC_DIRECTORY_PATH=__DATA_DIR__/music
#MUSIC_DIRECTORY_SERVE_PATH=__DATA_DIR__/data/import #MUSIC_DIRECTORY_SERVE_PATH=__DATA_DIR__/import
# LDAP settings # LDAP settings
# Use the following options to allow authentication on your Funkwhale instance # Use the following options to allow authentication on your Funkwhale instance

View file

@ -102,11 +102,11 @@ location /.well-known/ {
} }
location /media/__sized__/ { location /media/__sized__/ {
alias __DATA_DIR__/data/media/__sized__/; alias __DATA_DIR__/media/__sized__/;
} }
location /media/attachments/ { location /media/attachments/ {
alias __DATA_DIR__/data/media/attachments/; alias __DATA_DIR__/media/attachments/;
} }
location /_protected/media/ { location /_protected/media/ {
@ -114,7 +114,7 @@ location /_protected/media/ {
# audio files once correct permission / authentication # audio files once correct permission / authentication
# has been checked on API side # has been checked on API side
internal; internal;
alias __DATA_DIR__/data/media/; alias __DATA_DIR__/media/;
} }
# Comment the previous location and uncomment this one if you're storing # 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 # has been checked on API side
# Set this to the same value as your MUSIC_DIRECTORY_PATH setting # Set this to the same value as your MUSIC_DIRECTORY_PATH setting
internal; internal;
alias __DATA_DIR__/data/music/; alias __DATA_DIR__/music/;
} }
location /staticfiles/ { location /staticfiles/ {
# django static files # django static files
alias __DATA_DIR__/data/static/; alias __DATA_DIR__/static/;
} }

View file

@ -18,7 +18,7 @@ userdoc = "https://docs.funkwhale.audio/users/index.html"
code = "https://dev.funkwhale.audio/funkwhale/funkwhale" code = "https://dev.funkwhale.audio/funkwhale/funkwhale"
[integration] [integration]
yunohost = ">= 11.1.15" yunohost = ">= 11.1.16"
architectures = "all" architectures = "all"
multi_instance = true multi_instance = true
ldap = false ldap = false
@ -64,6 +64,7 @@ ram.runtime = "50M"
[resources.install_dir] [resources.install_dir]
[resources.data_dir] [resources.data_dir]
subdirs = "data"
group = "www-data:rx" group = "www-data:rx"
[resources.permissions] [resources.permissions]

View file

@ -45,7 +45,6 @@ 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/data
mkdir -p $data_dir/{static,media,music} mkdir -p $data_dir/{static,media,music}
chmod 750 "$data_dir" chmod 750 "$data_dir"

View file

@ -27,7 +27,6 @@ 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/" --not_mandatory
mkdir -p $data_dir/data
mkdir -p $data_dir/{static,media,music} mkdir -p $data_dir/{static,media,music}
chmod 750 "$data_dir/" chmod 750 "$data_dir/"

View file

@ -75,9 +75,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/data/" chmod 750 "$data_dir/"
chmod -R o-rwx "$data_dir/data/" chmod -R o-rwx "$data_dir/"
chown -R $app:www-data "$data_dir/data/" chown -R $app:www-data "$data_dir/"
upgrade_type="UPGRADE_APP" upgrade_type="UPGRADE_APP"
fi fi