Empêcher l’exposition des sources PHP

This commit is contained in:
Alexandre NOEL 2026-09-04 11:54:28 +02:00
commit 93647ef9e3
3 changed files with 11 additions and 1 deletions

View file

@ -1,9 +1,17 @@
location = __PATH__/index.php {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME __INSTALL_DIR__/public/index.php;
fastcgi_param HTTP_PROXY "";
fastcgi_pass unix:/var/run/php/php__PHP_VERSION__-fpm-__APP__.sock;
}
location __PATH__/ { location __PATH__/ {
alias __INSTALL_DIR__/public/; alias __INSTALL_DIR__/public/;
index index.php; index index.php;
client_max_body_size 260M; client_max_body_size 260M;
try_files $uri $uri/ @__APP__; try_files $uri $uri/ @__APP__;
location ~ /\. { deny all; } location ~ /\. { deny all; }
location ~ \.php$ { return 404; }
} }
location @__APP__ { location @__APP__ {

View file

@ -5,7 +5,7 @@ id = "globinours"
name = "Globinours" name = "Globinours"
description.en = "Lightweight animal shelter management" description.en = "Lightweight animal shelter management"
description.fr = "Gestion légère et complète pour refuges animaliers" description.fr = "Gestion légère et complète pour refuges animaliers"
version = "1.0.0-rc.3~ynh8" version = "1.0.0-rc.3~ynh9"
maintainers = ["OverSu"] maintainers = ["OverSu"]
[upstream] [upstream]

View file

@ -26,6 +26,8 @@ prepare_persistent_paths() {
chown -R "$app:$app" "$data_dir" chown -R "$app:$app" "$data_dir"
chmod -R u=rwX,g=rX,o= "$install_dir" chmod -R u=rwX,g=rX,o= "$install_dir"
chmod -R u=rwX,g=,o= "$data_dir" chmod -R u=rwX,g=,o= "$data_dir"
chown "$app:www-data" "$data_dir"
chmod 0710 "$data_dir"
chown -R "$app:www-data" "$data_dir/media" chown -R "$app:www-data" "$data_dir/media"
chmod -R u=rwX,g=rX,o= "$data_dir/media" chmod -R u=rwX,g=rX,o= "$data_dir/media"
} }