diff --git a/conf/.env.production b/conf/.env.production index b02f964..89703b3 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=__DATADIR__/images/ +MEDIA_ROOT=images/ # Database configuration PGPORT=5432 diff --git a/conf/nginx.conf b/conf/nginx.conf index b8a9f6a..ca2032b 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -8,7 +8,7 @@ location __PATH__/ { } location /images/ { - alias __DATADIR__/images/; + alias __FINALPATH__/images/; } location /static/ { diff --git a/scripts/install b/scripts/install index 745c2ff..03b297e 100755 --- a/scripts/install +++ b/scripts/install @@ -106,21 +106,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# CREATE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Creating a data directory..." --weight=1 - -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" -chown -R $app:www-data "$datadir" - #================================================= # CONFIGURE THEN INSTALL SCRIPT AND DEPENDENCIES #================================================= @@ -159,6 +144,20 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config +#================================================= +# CREATE DATA DIRECTORY +#================================================= +ynh_script_progression --message="Creating a data directory..." --weight=1 + +datadir=/home/yunohost.app/$app +ynh_app_setting_set --app=$app --key=datadir --value=$datadir + +mkdir -p $datadir + +chmod 750 "$datadir" +chmod -R o-rwx "$datadir" +chown -R $app:www-data "$datadir" + #================================================= # SETUP SYSTEMD #=================================================