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

Merge pull request #15 from YunoHost-Apps/datadir

Datadir
This commit is contained in:
oufmilo 2023-01-22 19:38:40 +01:00 committed by GitHub
commit 5386057994
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 18 deletions

View file

@ -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

View file

@ -8,7 +8,7 @@ location __PATH__/ {
}
location /images/ {
alias __FINALPATH__/images/;
alias __DATADIR__/images/;
}
location /static/ {

View file

@ -105,6 +105,21 @@ 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
#=================================================
@ -143,20 +158,6 @@ 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
#=================================================

View file

@ -25,6 +25,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#db_user=$(ynh_app_setting_get --app=$app --key=db_user)
#db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
port=$(ynh_app_setting_get --app=$app --key=port)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
admin_mail=$(ynh_user_get_info --username=$admin --key=username)