fix: réparer durablement les permissions publiques
This commit is contained in:
parent
0b8a44037b
commit
3c94a43eb7
3 changed files with 20 additions and 6 deletions
|
|
@ -12,7 +12,7 @@ Lightweight animal shelter management
|
||||||
|
|
||||||
[](https://globinours.fr)
|
[](https://globinours.fr)
|
||||||
[](https://demo.globinours.fr)
|
[](https://demo.globinours.fr)
|
||||||
[?style=for-the-badge)](https://ci-apps.yunohost.org/ci/apps/globinours/)
|
[?style=for-the-badge)](https://ci-apps.yunohost.org/ci/apps/globinours/)
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<a href="https://apps.yunohost.org/app/globinours"><img height="100px" src="https://github.com/YunoHost/yunohost-artwork/raw/refs/heads/main/badges/neopossum-badges/badge_more_info_on_the_appstore.svg"/></a>
|
<a href="https://apps.yunohost.org/app/globinours"><img height="100px" src="https://github.com/YunoHost/yunohost-artwork/raw/refs/heads/main/badges/neopossum-badges/badge_more_info_on_the_appstore.svg"/></a>
|
||||||
|
|
|
||||||
|
|
@ -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.23~ynh1"
|
version = "1.0.0-rc.24~ynh1"
|
||||||
maintainers = ["OverSu"]
|
maintainers = ["OverSu"]
|
||||||
|
|
||||||
[upstream]
|
[upstream]
|
||||||
|
|
@ -34,8 +34,8 @@ ram.runtime = "100M"
|
||||||
|
|
||||||
[resources]
|
[resources]
|
||||||
[resources.sources.main]
|
[resources.sources.main]
|
||||||
url = "https://nnsprod.com/git/oversu/Globinours/archive/2029849f18278abd9994ef7b82af10451de93c3e.tar.gz"
|
url = "https://nnsprod.com/git/oversu/Globinours/archive/44933575900512a5808ac9d21c2b77b9e1bbd55e.tar.gz"
|
||||||
sha256 = "af99de3939bfeeb3ef277d3b46277b382cb949e067c0dc2abe62b7fd05804ae6"
|
sha256 = "f54e5856f15b58e3107508f21af61e8c355f8bf14d0ceff6e748df37634cb82c"
|
||||||
in_subdir = true
|
in_subdir = true
|
||||||
autoupdate.strategy = "latest_forgejo_commit"
|
autoupdate.strategy = "latest_forgejo_commit"
|
||||||
autoupdate.upstream = "https://nnsprod.com/git/oversu/Globinours"
|
autoupdate.upstream = "https://nnsprod.com/git/oversu/Globinours"
|
||||||
|
|
|
||||||
|
|
@ -76,10 +76,16 @@ repair_and_verify_permissions() {
|
||||||
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"
|
||||||
|
|
||||||
|
# Nginx doit pouvoir traverser tout le code public. Une mise à jour
|
||||||
|
# autonome plus ancienne a pu créer ces dossiers avec un umask strict.
|
||||||
|
find "$install_dir/public" -type d -exec chmod 0755 {} +
|
||||||
|
find "$install_dir/public" -type f -exec chmod 0644 {} +
|
||||||
|
|
||||||
chown "$app:www-data" "$data_dir"
|
chown "$app:www-data" "$data_dir"
|
||||||
chmod 0710 "$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"
|
find "$data_dir/media" -type d -exec chmod 0750 {} +
|
||||||
|
find "$data_dir/media" -type f -exec chmod 0640 {} +
|
||||||
|
|
||||||
if ! ynh_exec_as_app test -r "$data_dir" || ! ynh_exec_as_app test -w "$data_dir"; then
|
if ! ynh_exec_as_app test -r "$data_dir" || ! ynh_exec_as_app test -w "$data_dir"; then
|
||||||
ynh_die --message="The Globinours system user cannot read and write its persistent data directory."
|
ynh_die --message="The Globinours system user cannot read and write its persistent data directory."
|
||||||
|
|
@ -87,6 +93,14 @@ repair_and_verify_permissions() {
|
||||||
if ! runuser -u www-data -- test -x "$data_dir" || ! runuser -u www-data -- test -r "$data_dir/media"; then
|
if ! runuser -u www-data -- test -x "$data_dir" || ! runuser -u www-data -- test -r "$data_dir/media"; then
|
||||||
ynh_die --message="Nginx cannot access the Globinours public media directory."
|
ynh_die --message="Nginx cannot access the Globinours public media directory."
|
||||||
fi
|
fi
|
||||||
|
if ! runuser -u www-data -- test -r "$install_dir/public/index.php"; then
|
||||||
|
ynh_die --message="Nginx cannot access the Globinours public entry point."
|
||||||
|
fi
|
||||||
|
local public_media_sample
|
||||||
|
public_media_sample="$(find "$data_dir/media" -type f -print -quit)"
|
||||||
|
if [[ -n "$public_media_sample" ]] && ! runuser -u www-data -- test -r "$public_media_sample"; then
|
||||||
|
ynh_die --message="Nginx cannot read an existing Globinours public media file."
|
||||||
|
fi
|
||||||
if [[ -f "$data_dir/refuge.sqlite" ]]; then
|
if [[ -f "$data_dir/refuge.sqlite" ]]; then
|
||||||
local integrity_check
|
local integrity_check
|
||||||
integrity_check="$(ynh_exec_as_app sqlite3 "$data_dir/refuge.sqlite" "PRAGMA quick_check;")"
|
integrity_check="$(ynh_exec_as_app sqlite3 "$data_dir/refuge.sqlite" "PRAGMA quick_check;")"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue