Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change x to X, add --recursive, add a default acl for new elements #722

Open
wants to merge 78 commits into
base: testing
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
06a9c07
Update manifest.toml
ericgaspar Apr 23, 2024
e5d224a
Auto-update READMEs
yunohost-bot Apr 23, 2024
89f4373
Merge branch 'testing' into 29.0.0
ericgaspar Apr 25, 2024
ded5039
Merge branch 'testing' into 29.0.0
ericgaspar Apr 26, 2024
3503f0e
add pre upgrade warning for NC 29
OniriCorpe Apr 26, 2024
6d0c2ce
update to PHP8.3
ericgaspar May 22, 2024
2b1d579
Auto-update READMEs
yunohost-bot May 22, 2024
7c9f968
Merge pull request #684 from YunoHost-Apps/29.0.0
ericgaspar May 23, 2024
cc263ec
Update manifest.toml
ericgaspar May 23, 2024
0d05a77
Auto-update READMEs
yunohost-bot May 23, 2024
1b66d7f
Fix space splitting in phpflags on install (#690)
lyynd Jun 1, 2024
c3ec387
Merge branch 'master' into testing
ericgaspar Jun 1, 2024
f6a8dc8
Auto-update READMEs
yunohost-bot Jun 1, 2024
652d6de
Update upgrade
ericgaspar Jun 2, 2024
253357a
Update manifest.toml
ericgaspar Jun 6, 2024
cc45b8e
Auto-update READMEs
yunohost-bot Jun 6, 2024
38c2ecc
Fix phpflags (#691)
tituspijean Jun 8, 2024
1ab6c01
Fix upgrade: php version is 8.3 starting from 29.x ? (#692)
alexAubin Jun 20, 2024
ef6d230
Update manifest.toml
ericgaspar Jun 20, 2024
6aa7821
Auto-update READMEs
yunohost-bot Jun 20, 2024
6870be0
Update tests.toml
ericgaspar Jun 20, 2024
336bc29
Merge branch 'testing' of https://github.com/YunoHost-Apps/nextcloud_…
ericgaspar Jun 20, 2024
25b828b
Merge branch 'master' into testing
ericgaspar Jun 20, 2024
89899fd
[autopatch] Do not delete logs on app removal (#697)
yunohost-bot Jun 23, 2024
2f0cfe5
[autopatch] Do not delete logs on app removal (#698)
yunohost-bot Jun 23, 2024
d848e73
29.0.3
ericgaspar Jun 25, 2024
e584e31
Auto-update READMEs
yunohost-bot Jun 25, 2024
26bfa59
Update remove
ericgaspar Jun 25, 2024
0a4b38f
Merge branch 'testing' of https://github.com/YunoHost-Apps/nextcloud_…
ericgaspar Jun 25, 2024
88fbb73
Indent
alexAubin Jun 27, 2024
f7c21e4
Fix again upgrade ending with Nextcloud being in PHP 8.2 ?
alexAubin Jun 27, 2024
b96736a
Auto-update READMEs
yunohost-bot Jun 27, 2024
42ae252
Update nginx.conf
ericgaspar Jul 1, 2024
9fcb43a
Update manifest.toml
ericgaspar Jul 18, 2024
49e88d8
Auto-update READMEs
yunohost-bot Jul 18, 2024
70e9e72
Rework DESCRIPTION.md (#707)
alexAubin Jul 18, 2024
c0a58b2
bump all old versions
kay0u Jul 25, 2024
9d44878
oupsie
kay0u Jul 25, 2024
9bb5bee
Auto-update READMEs
yunohost-bot Jul 25, 2024
1cb2448
system_addressbook_exposed is a boolean
kay0u Jul 29, 2024
0c4ab48
Auto-update READMEs
yunohost-bot Jul 29, 2024
a3173b7
Merge pull request #703 from YunoHost-Apps/NGINX-upstream-setting
kay0u Jul 29, 2024
7f40b5a
migrate system_addressbook_exposed to boolean, fix upgrade test
kay0u Jul 29, 2024
4fa1f99
another fix for system_addressbook_exposed, update the dav conf accor…
kay0u Jul 29, 2024
ae91654
zblerg, do not modify system_addressbook_exposed config value in the …
kay0u Jul 29, 2024
4b9224f
add redis-server as deps
kay0u Jul 30, 2024
bc59bba
Merge pull request #710 from YunoHost-Apps/trying-to-fix-the-upgrade-…
kay0u Jul 30, 2024
12024a6
Merge branch 'master' into testing
ericgaspar Jul 30, 2024
e215d9c
find files before chown them
kay0u Jul 30, 2024
5dc5e8b
chown the root folder too
kay0u Jul 30, 2024
8d682cb
fix find condition
kay0u Jul 31, 2024
706d507
find ... chmod is not faster, at least avoid to chown -R the data_dir…
kay0u Jul 31, 2024
d240d55
add a button in the config panel to run chown/chmod on data_dir
kay0u Jul 31, 2024
30b2d81
we can avoid this chmod too i guess?
kay0u Jul 31, 2024
55b5c79
only nextcloud is allowed to read the config file
kay0u Jul 31, 2024
07f90a8
zblerg, the config file doesn't exist before install
kay0u Aug 1, 2024
5556fb6
wait until nginx has actually remove the nextcloud conf during upgrad…
kay0u Aug 1, 2024
d7f9b2c
create a function for that
kay0u Aug 1, 2024
49ec72b
fix change-url dav detection
kay0u Aug 1, 2024
73a3498
only if domain has changed...
kay0u Aug 1, 2024
fa5da4f
Update scripts/_common.sh
kay0u Aug 1, 2024
79c87b1
Merge pull request #712 from YunoHost-Apps/fix-dav-detection
kay0u Aug 1, 2024
4372e3d
Merge pull request #711 from YunoHost-Apps/speedup-chown
kay0u Aug 1, 2024
8a7f99d
moar sleep
kay0u Aug 1, 2024
5e498de
oups
kay0u Aug 1, 2024
e83c680
minor typos
ericgaspar Aug 3, 2024
a86e321
Update backup
ericgaspar Aug 3, 2024
31fd6a5
minor typos
ericgaspar Aug 3, 2024
bf5ef59
Merge branch 'master' into testing
ericgaspar Aug 8, 2024
1c8a1ba
Fix removing ACL permissions on uninstall
x3rAx Aug 13, 2024
aae9736
Fix: Add missing `file` argument to `setfacl`
x3rAx Aug 13, 2024
abfb04d
Fix: Use absolute path for removing ACL permissions
x3rAx Aug 13, 2024
79ef249
Update manifest.toml
ericgaspar Aug 20, 2024
2794d04
Auto-update READMEs
yunohost-bot Aug 20, 2024
d7d2403
Add notify push option (#417)
kay0u Aug 27, 2024
9da7de2
Merge pull request #717 from x3rAx/patch-1
kay0u Aug 27, 2024
8b3220e
change x to X, add --recursive, add a default acl for new elements
kay0u Aug 27, 2024
11a8872
Merge branch 'testing' into fix-acl
ericgaspar Nov 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion config_panel.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ name.fr = "Configuration de Nextcloud"
help.en = "Mechanism allowing more instantaneous notifications and reduce server load."
help.fr = "Mécanisme qui permet d'avoir des notifications plus rapides et de réduire la charge du serveur."


[main.php_fpm_config]
name.en = "PHP-FPM configuration"
name.fr = "Configuration de PHP-FPM"
Expand Down
2 changes: 1 addition & 1 deletion hooks/post_user_create
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
user="$1"
app="$(basename $0 | cut -d- -f 2-)" # Extract the app name from the script name, which is supposed to be something like "50-app_id"

setfacl --modify g:$app:rwx /home/$user
setfacl --recursive --modify g:$app:rwX,d:g:$app:rwX /home/$user
6 changes: 6 additions & 0 deletions manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ ram.runtime = "512M"
help.en = "<a href=https://github.com/nextcloud/notify_push#about target=_blank>Notify Push</a> is a mechanism allowing more instantaneous notifications and reduce server load. (However, it is still a bit new)"
help.fr = "<a href=https://github.com/nextcloud/notify_push#about target=_blank>Notify Push</a> est un mécanisme qui permet d'avoir des notifications plus rapides et de réduire la charge du serveur. (Cependant, cette fonctionnalité reste relativement nouvelle)"

[install.enable_notify_push]
ask.en = "Configure the High Performance Backend?"
ask.fr = "Configurer le Backend Hautes Performances ?"
type = "boolean"
default = false

[resources]

[resources.sources]
Expand Down
9 changes: 8 additions & 1 deletion scripts/backup
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ ynh_backup --src_path="$install_dir"
ynh_backup --src_path="$data_dir" --is_big

#=================================================
# SYSTEM CONFIGURATION
# BACKUP THE NGINX CONFIGURATION
#=================================================

ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.d"

#=================================================
# BACKUP THE PHP-FPM CONFIGURATION
#=================================================

ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
Expand Down
1 change: 1 addition & 0 deletions scripts/change_url
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ then
ynh_add_systemd_config --service="${app}-notify-push"

count=0

# cron can sometimes fail when the database is not fully initialized, hence it's retried several times, see https://github.com/YunoHost-Apps/nextcloud_ynh/pull/720
while ! ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php && [[ $count -lt 30 ]]
do
Expand Down
4 changes: 4 additions & 0 deletions scripts/config
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ set__enable_notify_push() {
fi
exec_occ config:app:set notify_push base_endpoint --value https://$domain${path_url%/}/push

mkdir -p /var/run/$app/
chown $app: /var/run/$app/

case $YNH_ARCH in
amd64) arch="x86_64";;
arm64) arch="aarch64";;
Expand All @@ -139,6 +142,7 @@ set__enable_notify_push() {
ynh_add_systemd_config --service="${app}-notify-push"

count=0

# cron can sometimes fail when the database is not fully initialized, hence it's retried several times, see https://github.com/YunoHost-Apps/nextcloud_ynh/pull/720
while ! ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php && [[ $count -lt 30 ]]
do
Expand Down
6 changes: 5 additions & 1 deletion scripts/install
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ then
create_external_storage "/home/\$user" "Home"
# Iterate over users to extend their home folder permissions
for u in $(ynh_user_list); do
setfacl --modify g:$app:rwx "/home/$u" || true
setfacl --recursive --modify g:$app:rwX,d:g:$app:rwX "/home/$u" || true
done
fi

Expand Down Expand Up @@ -212,6 +212,9 @@ then
exec_occ app:install notify_push
exec_occ config:app:set notify_push base_endpoint --value https://$domain${path_url%/}/push

mkdir -p /var/run/$app/
chown $app: /var/run/$app/

case $YNH_ARCH in
amd64) arch="x86_64";;
arm64) arch="aarch64";;
Expand Down Expand Up @@ -297,6 +300,7 @@ ynh_add_fail2ban_config --logpath="/var/log/$app/nextcloud.log" --failregex="^.*
if [ $enable_notify_push -eq 1 ]
then
count=0

# cron can sometimes fail when the database is not fully initialized, hence it's retried several times, see https://github.com/YunoHost-Apps/nextcloud_ynh/pull/720
while ! ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php && [[ $count -lt 30 ]]
do
Expand Down
3 changes: 2 additions & 1 deletion scripts/remove
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ ynh_remove_systemd_config --service="${app}-notify-push"
systemctl disable --now --quiet ${app}-notify-push-watcher.path
ynh_secure_remove --file="/etc/systemd/system/${app}-notify-push-watcher.path"
ynh_remove_systemd_config --service="${app}-notify-push-watcher"
ynh_secure_remove --file="/var/run/$app"

# Remove a cron file
# TODO: Ensure that cron job is not running (How !?)
Expand All @@ -35,7 +36,7 @@ ynh_secure_remove --file="/etc/cron.d/$app"
for path in /home/*; do
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for path in /home/*; do
for u in $(ynh_user_list); do

I'm not sure why we don't use ynh_user_list here. (we need to replace the $path variable in the following code)

# Clean ACL in every directories in /home, except those which start with 'yunohost.'
[[ ! $path == /home/yunohost.* ]] \
&& setfacl --remove g:$app -- "$path" 2>&1
&& setfacl --recursive --remove g:$app,d:g:$app -- "$path" 2>&1
done

#=================================================
Expand Down
6 changes: 4 additions & 2 deletions scripts/restore
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ chmod 750 $install_dir
# Iterate over users to extend their home folder permissions - for the external
# storage plugin usage - and create relevant Nextcloud directories
for u in $(ynh_user_list); do
mkdir -p "$data_dir/$u"
setfacl --modify g:$app:rwx "/home/$u" || true
setfacl --recursive --modify g:$app:rwX,d:g:$app:rwX "/home/$u" || true
done

#=================================================
Expand Down Expand Up @@ -130,6 +129,9 @@ ynh_systemd_action --action=restart --service_name=fail2ban

if [ $enable_notify_push -eq 1 ]
then
mkdir -p /var/run/$app/
chown $app: /var/run/$app/

ynh_restore_file --origin_path="/etc/systemd/system/${app}-notify-push.service"
ynh_restore_file --origin_path="/etc/systemd/system/${app}-notify-push-watcher.service"
ynh_restore_file --origin_path="/etc/systemd/system/${app}-notify-push-watcher.path"
Expand Down
5 changes: 4 additions & 1 deletion scripts/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ then
|| create_external_storage "/home/\$user" "Home"
# Iterate over users to extend their home folder permissions
for u in $(ynh_user_list); do
setfacl --modify g:$app:rwx "/home/$u" || true
setfacl --recursive --modify g:$app:rwX,d:g:$app:rwX "/home/$u" || true
done
fi

Expand Down Expand Up @@ -397,6 +397,9 @@ then
fi
exec_occ config:app:set notify_push base_endpoint --value https://$domain${path_url%/}/push

mkdir -p /var/run/$app/
chown $app: /var/run/$app/

case $YNH_ARCH in
amd64) arch="x86_64";;
arm64) arch="aarch64";;
Expand Down
7 changes: 7 additions & 0 deletions tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,10 @@ test_format = 1.0
args.enable_notify_push = "1"
test_upgrade_from.e9f82ab7.name = "Upgrade from 28.0.6"
test_upgrade_from.e9f82ab7.args.system_addressbook_exposed = "yes"

[notify_push_test]

args.enable_notify_push = "1"
test_upgrade_from.e9f82ab7.name = "Upgrade from 28.0.6"
test_upgrade_from.e9f82ab7.args.system_addressbook_exposed = "yes"