mirror of
https://github.com/YunoHost-Apps/garradin_ynh.git
synced 2024-09-03 18:36:17 +02:00
update nginx.conf to protect against path traversal issue and remove a replace string in config.local.php
This commit is contained in:
parent
5ef8789758
commit
b4cfaa5b18
5 changed files with 4 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
||||||
location __PATH__ {
|
location __PATH__/ {
|
||||||
|
|
||||||
# Protecting sensibles urls
|
# Protecting sensibles urls
|
||||||
location ~ 403 {
|
location ~ 403 {
|
||||||
|
|
|
@ -122,7 +122,6 @@ cp -a $final_path/config.dist.php $final_path/config.local.php
|
||||||
key=$(ynh_string_random --length=50)
|
key=$(ynh_string_random --length=50)
|
||||||
# edit config.local.php
|
# edit 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"
|
||||||
ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = '/var/www/garradin';" --target_file="$final_path/config.local.php"
|
|
||||||
if [ "$path_url" == "/" ]; then
|
if [ "$path_url" == "/" ]; then
|
||||||
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"
|
||||||
else
|
else
|
||||||
|
|
|
@ -22,7 +22,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE DEPENDENCIES
|
# REMOVE DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Removing dependencies..." --time --weight=10
|
ynh_script_progression --message="Removing dependencies..." --weight=10
|
||||||
|
|
||||||
# Remove metapackage and its dependencies
|
# Remove metapackage and its dependencies
|
||||||
ynh_remove_app_dependencies
|
ynh_remove_app_dependencies
|
||||||
|
|
|
@ -170,7 +170,6 @@ fi
|
||||||
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"
|
||||||
ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="'/var/www/garradin';" --target_file="$final_path/config.local.php"
|
|
||||||
if [ "$path_url" == "/" ]; then
|
if [ "$path_url" == "/" ]; then
|
||||||
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"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue