1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/phpmyadmin_ynh.git synced 2024-09-03 19:56:46 +02:00
This commit is contained in:
ericgaspar 2021-07-10 08:39:55 +02:00
parent 1a911be9f8
commit cea88cc29b
3 changed files with 14 additions and 13 deletions

View file

@ -88,6 +88,10 @@ 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"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
@ -125,7 +129,7 @@ ynh_script_progression --message="Configuring phpMyAdmin..."
ynh_add_config --template="../conf/config.inc.php" --destination="$final_path/config.inc.php" ynh_add_config --template="../conf/config.inc.php" --destination="$final_path/config.inc.php"
# config.inc.php contains sensitive data, restrict its access # config.inc.php contains sensitive data, restrict its access
chown root:$app $final_path/config.inc.php chown $app: $final_path/config.inc.php
chmod 640 $final_path/config.inc.php chmod 640 $final_path/config.inc.php
#================================================= #=================================================
@ -146,9 +150,6 @@ ynh_composer_exec --commands="update --no-dev"
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
#================================================= #=================================================
# Set permissions to app files
chown -R root: $final_path
# Setup phpMyAdmin temporary folder # Setup phpMyAdmin temporary folder
mkdir -p $final_path/tmp mkdir -p $final_path/tmp
chown $app: $final_path/tmp chown $app: $final_path/tmp
@ -159,7 +160,7 @@ chown $app: $final_path/tmp
ynh_script_progression --message="Configuring permissions..." --weight=3 ynh_script_progression --message="Configuring permissions..." --weight=3
# Restrict access to admin only # Restrict access to admin only
ynh_permission_update --permission="main" --remove="all_users" --add=$admin #--protected=true ynh_permission_update --permission="main" --remove="all_users" --add=$admin
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX

View file

@ -62,6 +62,10 @@ ynh_script_progression --message="Restoring phpMyAdmin main directory..."
ynh_restore_file --origin_path="$final_path" ynh_restore_file --origin_path="$final_path"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#================================================= #=================================================
# RESTORE THE MYSQL DATABASE # RESTORE THE MYSQL DATABASE
#================================================= #=================================================
@ -86,9 +90,6 @@ fi
# RESTORE USER RIGHTS # RESTORE USER RIGHTS
#================================================= #=================================================
# config.inc.php contains sensitive data, restrict its access
chown root:$app $final_path/config.inc.php
chown $app: $final_path/tmp chown $app: $final_path/tmp
#================================================= #=================================================

View file

@ -113,6 +113,10 @@ then
ynh_setup_source --dest_dir="$final_path" --keep="$final_path/config.inc.php" ynh_setup_source --dest_dir="$final_path" --keep="$final_path/config.inc.php"
fi fi
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
@ -163,11 +167,6 @@ fi
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
#================================================= #=================================================
# Set permissions to app files
chown -R root: $final_path
# config.inc.php contains sensitive data, restrict its access
chown root:$app $final_path/config.inc.php
chmod 640 $final_path/config.inc.php
# Setup phpMyAdmin temporary folder # Setup phpMyAdmin temporary folder
mkdir -p $final_path/tmp mkdir -p $final_path/tmp
chown -R $app: $final_path/tmp chown -R $app: $final_path/tmp