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

change the order of e

This commit is contained in:
Robles Rodolphe 2021-05-10 18:30:41 +02:00
parent 428ab977c2
commit 66ffadc742
2 changed files with 26 additions and 23 deletions

View file

@ -64,6 +64,8 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" ynh_setup_source --dest_dir="$final_path"
chown -R $app:$app $final_path
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
@ -83,19 +85,10 @@ ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependenc
#================================================= #=================================================
# SETUP SSOWAT # ADD A CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring permissions..." --weight=8 ynh_script_progression --message="Adding a configuration file..." --weight=5
# Make app public if necessary
if [ $is_public -eq 1 ]
then
ynh_permission_update --permission "main" --add "visitors"
fi
#=================================================
# MODIFY A CONFIG FILE
#=================================================
# copy config.dist.php creating config.local.php # copy config.dist.php creating config.local.php
cp -a $final_path/config.dist.php $final_path/config.local.php cp -a $final_path/config.dist.php $final_path/config.local.php
# create a key for the secret key CSFR; # create a key for the secret key CSFR;
@ -108,11 +101,7 @@ else
ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php"
fi fi
#================================================= # permissions on files and directories
# Files owned by user app
#=================================================
chown -R $app:$app $final_path
chmod 400 $final_path/config.dist.php $final_path/index.php $final_path/sous-domaine.html $final_path/VERSION chmod 400 $final_path/config.dist.php $final_path/index.php $final_path/sous-domaine.html $final_path/VERSION
chmod 644 $final_path/config.local.php chmod 644 $final_path/config.local.php
find $final_path/scripts -type d -exec chmod 500 {} + find $final_path/scripts -type d -exec chmod 500 {} +
@ -126,6 +115,17 @@ find $final_path/data -type f -exec chmod 600 {} +
find /var/www/garradin/www -type d -exec chmod 755 {} + find /var/www/garradin/www -type d -exec chmod 755 {} +
find /var/www/garradin/www -type f -exec chmod 644 {} + find /var/www/garradin/www -type f -exec chmod 644 {} +
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Configuring permissions..." --weight=8
# Make app public if necessary
if [ $is_public -eq 1 ]
then
ynh_permission_update --permission "main" --add "visitors"
fi
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================

View file

@ -111,6 +111,8 @@ then
ynh_secure_remove $backup_bdd ynh_secure_remove $backup_bdd
fi fi
chown -R $app:$app $final_path
key=$(ynh_string_random --length=50) key=$(ynh_string_random --length=50)
cp -a $final_path/config.dist.php $final_path/config.local.php cp -a $final_path/config.dist.php $final_path/config.local.php
ynh_replace_string --match_string="const SECRET_KEY = '3xUhIgGwuovRKOjVsVPQ5yUMfXUSIOX2GKzcebsz5OINrYC50r';" --replace_string="const SECRET_KEY = '$key';" --target_file="$final_path/config.local.php" ynh_replace_string --match_string="const SECRET_KEY = '3xUhIgGwuovRKOjVsVPQ5yUMfXUSIOX2GKzcebsz5OINrYC50r';" --replace_string="const SECRET_KEY = '$key';" --target_file="$final_path/config.local.php"
@ -119,12 +121,11 @@ then
else else
ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php"
fi fi
chown -R $app:$app $final_path
chmod 755 $final_path chmod 755 $final_path
# Create the visitors permission if needed # Create the visitors permission if needed
if [ $is_public -eq 1 ] if [ $is_public -eq 1 ]
then then
ynh_permission_update --permission="main" --add="visitors" ynh_permission_update --permission "main" --add "visitors"
fi fi
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
@ -192,6 +193,13 @@ then
ynh_secure_remove $backup_bdd ynh_secure_remove $backup_bdd
fi fi
chown -R $app:$app $final_path
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=5
key=$(ynh_string_random --length=50) key=$(ynh_string_random --length=50)
cp -a $final_path/config.dist.php $final_path/config.local.php cp -a $final_path/config.dist.php $final_path/config.local.php
ynh_replace_string --match_string="const SECRET_KEY = '3xUhIgGwuovRKOjVsVPQ5yUMfXUSIOX2GKzcebsz5OINrYC50r';" --replace_string="const SECRET_KEY = '$key';" --target_file="$final_path/config.local.php" ynh_replace_string --match_string="const SECRET_KEY = '3xUhIgGwuovRKOjVsVPQ5yUMfXUSIOX2GKzcebsz5OINrYC50r';" --replace_string="const SECRET_KEY = '$key';" --target_file="$final_path/config.local.php"
@ -201,12 +209,7 @@ else
ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php"
fi fi
#=================================================
# Files owned by user app
#=================================================
# Set permissions on app files # Set permissions on app files
chown -R $app:$app $final_path
chmod 400 $final_path/config.dist.php $final_path/index.php $final_path/sous-domaine.html $final_path/VERSION chmod 400 $final_path/config.dist.php $final_path/index.php $final_path/sous-domaine.html $final_path/VERSION
chmod 644 $final_path/config.local.php chmod 644 $final_path/config.local.php
find $final_path/scripts -type d -exec chmod 500 {} + find $final_path/scripts -type d -exec chmod 500 {} +