diff --git a/conf/.env.production b/conf/.env.production index 89703b3..b02f964 100644 --- a/conf/.env.production +++ b/conf/.env.production @@ -15,7 +15,7 @@ DEFAULT_LANGUAGE="English" ## Leave unset to allow all hosts ALLOWED_HOSTS="localhost,127.0.0.1,[::1]" -MEDIA_ROOT=images/ +MEDIA_ROOT=__DATADIR__/images/ # Database configuration PGPORT=5432 diff --git a/conf/nginx.conf b/conf/nginx.conf index ca2032b..b8a9f6a 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -8,7 +8,7 @@ location __PATH__/ { } location /images/ { - alias __FINALPATH__/images/; + alias __DATADIR__/images/; } location /static/ { diff --git a/scripts/install b/scripts/install index 03b297e..9036cb9 100755 --- a/scripts/install +++ b/scripts/install @@ -153,6 +153,7 @@ datadir=/home/yunohost.app/$app ynh_app_setting_set --app=$app --key=datadir --value=$datadir mkdir -p $datadir +mkdir -p $datadir/images chmod 750 "$datadir" chmod -R o-rwx "$datadir"