1
0
Fork 0
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:
Robles Rodolphe 2020-10-27 13:01:28 +01:00
parent 5ef8789758
commit b4cfaa5b18
5 changed files with 4 additions and 6 deletions

View file

@ -1,4 +1,4 @@
location __PATH__ {
location __PATH__/ {
# Protecting sensibles urls
location ~ 403 {

View file

@ -4,9 +4,9 @@
# COMMON VARIABLES
#=================================================
# dependencies used by the app
if [ "$lsb_release --codename --short" = "buster"]; then
if [ "$lsb_release --codename --short" = "buster" ]; then
pkg_dependencies="php7.3-sqlite3"
else [ "$lsb_release --codename --short" = "stretch"]
else [ "$lsb_release --codename --short" = "stretch" ]
pkg_dependencies="php7.0-sqlite3"
fi

View file

@ -122,7 +122,6 @@ cp -a $final_path/config.dist.php $final_path/config.local.php
key=$(ynh_string_random --length=50)
# 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 ROOT = __DIR__;" --replace_string="const ROOT = '/var/www/garradin';" --target_file="$final_path/config.local.php"
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"
else

View file

@ -22,7 +22,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..." --time --weight=10
ynh_script_progression --message="Removing dependencies..." --weight=10
# Remove metapackage and its dependencies
ynh_remove_app_dependencies

View file

@ -170,7 +170,6 @@ fi
key=$(ynh_string_random --length=50)
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 ROOT = __DIR__;" --replace_string="'/var/www/garradin';" --target_file="$final_path/config.local.php"
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"
else