Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
225f1bb
move function to common.sh (#764)
ericgaspar Dec 19, 2024
773ada7
add default_phone_region
ericgaspar Dec 19, 2024
3fb2bb6
Update nginx.conf
ericgaspar Dec 19, 2024
25341f9
Update install
ericgaspar Dec 19, 2024
85c3187
Fix upgrade exploding when $app is nextcloud__2, __3 etc because the …
rodinux Dec 20, 2024
5e4f393
Bump package revision
yunohost-bot Dec 20, 2024
a8378a5
Auto-update READMEs
yunohost-bot Dec 20, 2024
be58bb1
Patch (#768)
ericgaspar Dec 21, 2024
ff3899f
Merge branch 'master' into testing
ericgaspar Dec 24, 2024
e938aeb
Fix fail2ban failregex
looowizz Dec 26, 2024
1a1d9d1
30.0.5
ericgaspar Jan 17, 2025
863381c
Auto-update READMEs
yunohost-bot Jan 17, 2025
ced3d91
Update restore
ericgaspar Jan 19, 2025
dc0fb3d
Update upgrade (#777)
ericgaspar Jan 19, 2025
c6489b6
Update upgrade
ericgaspar Jan 19, 2025
57b41db
Update manifest.toml
ericgaspar Jan 19, 2025
8947bb8
Update manifest.toml
ericgaspar Jan 21, 2025
4c23d65
Update post_user_delete (#778)
ericgaspar Jan 26, 2025
6f01759
Merge branch 'master' into testing
ericgaspar Jan 30, 2025
7f1b13d
Update upgrade (#779)
ericgaspar Jan 30, 2025
8fa00f9
[fix] Remove eval JS patch cause yunohost tiles doesn't exists anymore
zamentur Feb 5, 2025
b9d53ed
Update manifest.toml
ericgaspar Feb 9, 2025
11eb850
Auto-update READMEs
yunohost-bot Feb 9, 2025
577da1f
cleaning
ericgaspar Feb 9, 2025
529c368
cleaning
ericgaspar Feb 9, 2025
a4c2c06
Update remove
ericgaspar Feb 9, 2025
83bb5a6
[enh] Allow login by mail (#783)
zamentur Feb 11, 2025
0d856a8
30.0.6
ericgaspar Feb 13, 2025
5e7de8c
Auto-update READMEs
yunohost-bot Feb 13, 2025
c9e4442
Merge branch 'master' into testing
ericgaspar Feb 13, 2025
a902183
Update manifest.toml
ericgaspar Feb 15, 2025
ffaebda
Merge branch 'testing' into master
kay0u Feb 15, 2025
ff44cfd
Merge pull request #770 from looowizz/master
kay0u Feb 15, 2025
631ac0c
Update manifest.toml
ericgaspar Feb 16, 2025
5d71127
Auto-update READMEs
yunohost-bot Feb 16, 2025
11e30da
[enh] Create custom fail2ban conf, with datepattern and more regex to…
kay0u Feb 18, 2025
04e8948
Merge branch 'master' into testing
ericgaspar Feb 22, 2025
9049d47
Update systemd.service
ericgaspar Feb 22, 2025
913ea56
Update DESCRIPTION_fr.md
ericgaspar Feb 22, 2025
7d70d56
Auto-update READMEs
yunohost-bot Feb 22, 2025
00e64f6
Update manifest.toml (#788)
ericgaspar Feb 27, 2025
6d3e6a1
Update manifest.toml
ericgaspar Feb 27, 2025
8c11acf
Auto-update READMEs
yunohost-bot Feb 27, 2025
1b748ea
Update config: syntax for enable_forward_email was using the old 2.0 …
alexAubin Feb 27, 2025
18d65f2
Merge branch 'master' into testing
ericgaspar Feb 27, 2025
79c3223
Update config
rodinux Feb 27, 2025
b8d178a
Update config
rodinux Feb 27, 2025
ee5d1d1
Update config
rodinux Feb 27, 2025
61840c4
Removing argument --file to calls of ynh_store_file_checksum helper (…
e-jim Mar 13, 2025
a0a4e22
30.0.7
ericgaspar Mar 13, 2025
b327d69
Auto-update READMEs
yunohost-bot Mar 13, 2025
1556216
Update remove
ericgaspar Mar 13, 2025
b2075a8
30.0.8
ericgaspar Mar 19, 2025
f64623a
Auto-update READMEs
yunohost-bot Mar 19, 2025
e20543f
Merge branch 'master' into testing
ericgaspar Mar 21, 2025
39028e5
31.0.2 (#787)
ericgaspar Mar 22, 2025
73c5a62
31.0.3 (#795)
ericgaspar Apr 11, 2025
5097e26
Merge branch 'master' into testing
ericgaspar Apr 15, 2025
2350f9a
Update manifest.toml
ericgaspar Apr 17, 2025
a3d27de
Update manifest.toml
ericgaspar Apr 17, 2025
1c9f476
Merge branch 'master' into testing
ericgaspar Apr 17, 2025
a2aa016
Merge branch 'master' into testing
ericgaspar Apr 18, 2025
46f6c07
add versions_ and trashbin_retention_obligation (#805)
Gredin67 May 5, 2025
231034b
Auto-update READMEs
yunohost-bot May 5, 2025
925c47a
Update manifest.toml
ericgaspar May 15, 2025
3f48ba2
Auto-update READMEs
yunohost-bot May 15, 2025
7d73c27
Update manifest.toml
ericgaspar May 15, 2025
6f77fc4
Merge branch 'testing' of https://github.com/YunoHost-Apps/nextcloud_…
ericgaspar May 15, 2025
d770a97
Improve documentation for user_home question (#808)
tituspijean May 28, 2025
eabfd3b
Merge branch 'master' into testing
ericgaspar May 28, 2025
0b7fa65
Merge pull request #810 from YunoHost-Apps/master
alexAubin Jun 5, 2025
7bf1685
Update manifest.toml
ericgaspar Jun 12, 2025
45967cb
Auto-update READMEs
yunohost-bot Jun 12, 2025
3f5ea5a
Update manifest.toml
ericgaspar Jun 12, 2025
7158637
Merge branch 'testing' of https://github.com/YunoHost-Apps/nextcloud_…
ericgaspar Jun 12, 2025
7615afe
change x to X, add --recursive, add a default acl for new elements (#…
kay0u Jun 17, 2025
6d02113
Merge branch 'master' into testing
zamentur Jun 17, 2025
e9cf2ec
Fix inconsistent php version during upgrade with occ (#815)
alexAubin Jun 17, 2025
31bd516
Manage oldstable version (#816)
zamentur Jun 17, 2025
8b03102
[fix] Logout url missing
zamentur Jun 17, 2025
8974b24
[fix] Upgrade with oldstable
zamentur Jun 17, 2025
9e79535
[enh] Use php8.3-fpm for olstable - 30 version
zamentur Jun 17, 2025
8904b9a
[fix] Remove oldstable features
zamentur Jun 18, 2025
0a48ead
[fix] Remove oldstable from tests
zamentur Jun 18, 2025
af07b8e
[enh] version 30 oldstable
zamentur Jun 18, 2025
201e3d9
[fix] Dead code
zamentur Jun 18, 2025
5f59168
[fix] Dead code
zamentur Jun 18, 2025
cf336bb
Update manifest.toml
rodinux Jul 22, 2025
6015b87
keep ladap mail attribute if used
rodinux Jul 23, 2025
c26c2c8
Auto-update READMEs
yunohost-bot Jul 23, 2025
5427094
Update manifest.toml
ericgaspar Aug 2, 2025
033a225
Auto-update READMEs
yunohost-bot Aug 2, 2025
869c817
Update manifest.toml
ericgaspar Aug 14, 2025
4f8b171
Auto-update READMEs
yunohost-bot Aug 14, 2025
492c445
Update manifest.toml
ericgaspar Sep 11, 2025
8465193
Auto-update READMEs
yunohost-bot Sep 11, 2025
485b38f
Update manifest.toml
ericgaspar Sep 25, 2025
98825fc
Auto-update READMEs
yunohost-bot Sep 25, 2025
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
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ Online storage, file sharing platform and various other applications

[![🌐 Official app website](https://img.shields.io/badge/Official_app_website-darkgreen?style=for-the-badge)](https://nextcloud.com)
[![App Demo](https://img.shields.io/badge/App_Demo-blue?style=for-the-badge)](https://demo.nextcloud.com/)
[![Version: 31.0.6~ynh1](https://img.shields.io/badge/Version-31.0.6~ynh1-rgba(0,150,0,1)?style=for-the-badge)](https://ci-apps.yunohost.org/ci/apps/nextcloud/)
[![Version: 30.0.16~ynh1](https://img.shields.io/badge/Version-30.0.16~ynh1-rgb(18,138,11)?style=for-the-badge)](https://ci-apps.yunohost.org/ci/apps/nextcloud/)

<div align="center">
<a href="https://apps.yunohost.org/app/nextcloud"><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://github.com/YunoHost-Apps/nextcloud_ynh/issues"><img height="100px" src="https://github.com/YunoHost/yunohost-artwork/raw/refs/heads/main/badges/neopossum-badges/badge_report_an_issue.svg"/></a>
</div>


## Screenshots
![Screenshot of Nextcloud](./doc/screenshots/screenshot.png)

## 📦 Developer info

[![Automatic tests level](https://apps.yunohost.org/badge/cilevel/nextcloud)](https://ci-apps.yunohost.org/ci/apps/nextcloud/)
Expand Down
2 changes: 1 addition & 1 deletion conf/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"ldap_cache_ttl": "600",
"ldap_configuration_active": "1",
"ldap_display_name": "displayname",
"ldap_email_attr": "mail",
"ldap_email_attr": "__LDAP_EMAIL_ATTR__",
"ldap_expert_username_attr": "uid",
"ldap_group_display_name": "cn",
"ldap_group_filter": "(&(objectclass=top)(memberUid=*))",
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
13 changes: 4 additions & 9 deletions manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name = "Nextcloud"
description.en = "Online storage, file sharing platform and various other applications"
description.fr = "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications"

version = "31.0.6~ynh1"
version = "30.0.16~ynh1"

maintainers = ["kay0u"]

Expand Down Expand Up @@ -55,19 +55,14 @@ ram.runtime = "512M"
help.fr = "Si activé, le dossier `/home/$user` de chaque compte lui sera ajouté dans Nextcloud."
type = "boolean"
default = false

[resources]

[resources.sources]

[resources.sources.main]
url = 'https://download.nextcloud.com/server/releases/nextcloud-31.0.6.tar.bz2'
sha256 = 'a6abce1be84ae65090625895ee5796c6e631fd10cb17645ec4d73f7d9b372628'

[resources.sources.30]
url = 'https://download.nextcloud.com/server/releases/nextcloud-30.0.12.tar.bz2'
sha256 = '9e19b25f42273d4361218426b4762a766bee408cfa6aa8219f8c27f72095a7a8'
prefetch = false
url = 'https://download.nextcloud.com/server/releases/nextcloud-30.0.16.tar.bz2'
sha256 = '6236d4ae76bc444abb53494b3780315a17aac54af1b42e3efe0cc6bd19dff330'

[resources.sources.29]
url = 'https://download.nextcloud.com/server/releases/nextcloud-29.0.16.tar.bz2'
Expand Down
2 changes: 1 addition & 1 deletion scripts/backup
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ynh_backup "$install_dir"
ynh_backup "$data_dir"

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

ynh_backup "/etc/php/$php_version/fpm/pool.d/$app.conf"
Expand Down
5 changes: 4 additions & 1 deletion scripts/config
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,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 @@ -111,6 +114,7 @@ set__enable_notify_push() {
ynh_config_add_systemd --service="${app}-notify-push"

count=0

while ! ynh_exec_as_app php${php_version} --define apc.enable_cli=1 $install_dir/cron.php && [[ $count -lt 30 ]]
do
sleep 1
Expand All @@ -136,7 +140,6 @@ set__enable_forward_email() {
fi
ynh_app_setting_set --app=$app --key=enable_forward_email --value="$enable_forward_email"
}

#=================================================
# SPECIFIC RUNNERS FOR TOML SHORT KEYS
#=================================================
Expand Down
10 changes: 9 additions & 1 deletion scripts/install
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ ynh_app_setting_set --key=enable_notify_push --value=0
system_addressbook_exposed="0"
ynh_app_setting_set --key=system_addressbook_exposed --value=0

enable_forward_email="0"
ynh_app_setting_set --key=enable_forward_email --value=0
ldap_email_attr="mail"

#=================================================
# CREATE A MYSQL DATABASE
#=================================================
Expand All @@ -34,6 +38,7 @@ ynh_mysql_db_shell <<< "ALTER DATABASE $db_name CHARACTER SET utf8mb4 COLLATE ut
#=================================================
ynh_script_progression "Setting up source files..."

# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"

#=================================================
Expand Down Expand Up @@ -153,7 +158,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 @@ -210,6 +215,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
2 changes: 1 addition & 1 deletion scripts/remove
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ynh_safe_rm "/etc/cron.d/$app"
for path in /home/*; do
# 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
3 changes: 1 addition & 2 deletions scripts/restore
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,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
133 changes: 77 additions & 56 deletions scripts/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ if [ -z ${enable_notify_push:-} ]; then
enable_notify_push=0
fi

if [ -z ${enable_forward_email:-} ]; then
ynh_app_setting_set --key=enable_forward_email --value=0
enable_forward_email=0
fi

# Remove the option backup_core_only if it's in the settings.yml file
ynh_app_setting_delete --key=backup_core_only

Expand All @@ -41,6 +46,7 @@ then
ynh_die "Upgrading from Nextcloud < 22.2 is not supported anymore. You should first upgrade to 22.2 using: yunohost app upgrade nextcloud -u https://github.com/YunoHost-Apps/nextcloud_ynh/tree/41f5f902e7c7cd3c30a6793020562ba98b9bf3e9"
fi


#=================================================
# MAKE SEQUENTIAL UPGRADES FROM EACH MAJOR
# VERSION TO THE NEXT ONE
Expand All @@ -57,7 +63,7 @@ filter_boring_occ_warnings() {
# Define a function to execute commands with `occ`
exec_occ() {
# Backward compatibility to upgrade from older versions
if [ $current_major_version = "$last_major_version" ]
if [ $current_major_version -ge 30 ]
then
NEXTCLOUD_PHP_VERSION="8.3"
elif [ $current_major_version -ge 26 ]
Expand Down Expand Up @@ -125,7 +131,7 @@ function list_installed_apps_not_compatible_with_future_version()
current_version=$(grep OC_VersionString "$install_dir/version.php" | cut -d\' -f2)
current_major_version=${current_version%%.*}

last_version=$(ynh_read_manifest "resources.sources.main.url" | grep -Eo '[0-9][0-9]\.[0-9]\.[0-9]+')
last_version=$(ynh_read_manifest "resources.sources.main.url" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')
last_major_version=${last_version%%.*}

if [[ "$last_major_version" != "$current_major_version" ]]
Expand All @@ -137,6 +143,15 @@ then
fi
fi

# Keep the atrribute choose for ldapEmailAttribute
ldapEmail=$(exec_occ ldap:show-config "" | grep ldapEmailAttribute)
if [ "$(echo $ldapEmail | grep -Po "maildrop")" = "maildrop" ]
then
ldap_email_attr="maildrop"
else
ldap_email_attr="mail"
fi

#=================================================
# UPGRADE NEXTCLOUD
#=================================================
Expand Down Expand Up @@ -166,62 +181,65 @@ if exec_occ app:list | awk '/Enabled/{f=1;next} /Disabled/{f=0} f' | grep -q -w
mail_app_must_be_reactived=1
fi

# While the current version is not the last version, do an upgrade
while [ "$last_version" != "$current_version" ]
do

next_major_version="$(( $current_major_version + 1 ))"
if [[ "$next_major_version" -ge "$last_major_version" ]]; then
ynh_print_info "Upgrading to Nextcloud $last_version"
source_id="main"
else
ynh_print_info "Upgrading to Nextcloud $next_major_version"
source_id="$next_major_version"
fi
# Avoid to downgrade Nextcloud, if channel has changed from stable to oldstable.
if [[ "$current_major_version" -le "$last_major_version" ]]; then

# Create a temporary directory
tmpdir="${install_dir}__tmp_upgrade"

ynh_setup_source --dest_dir="$tmpdir" --source_id="$source_id"

# Backup the config file in the temp dir
cp -a "$install_dir/config/config.php" "$tmpdir/config/config.php"

# Enable maintenance mode
exec_occ maintenance:mode --on

# Backup 3rd party applications from the current Nextcloud
# But do not overwrite if there is any upgrade
# (apps directory already exists in Nextcloud archive)
(
cd $install_dir/apps
for nc_app_dir in */
# While the current version is not the last version, do an upgrade
while [ "$last_version" != "$current_version" ]
do
if [ ! -d "$tmpdir/apps/$nc_app_dir" ]
then
cp -a "$nc_app_dir" "$tmpdir/apps/$nc_app_dir"
fi
done
)

# Replace the old Nextcloud by the new one
ynh_safe_rm "$install_dir"
mv "$tmpdir" "$install_dir"

# Set write access for the following commands
chown -R $app:www-data "$install_dir"
# Upgrade Nextcloud (SUCCESS = 0, UP_TO_DATE = 3)
exec_occ maintenance:mode --off
exec_occ upgrade || [ $? -eq 3 ] || ynh_die "Unable to upgrade $app"

# Get the new current version number
current_version=$(grep OC_VersionString "$install_dir/version.php" | cut -d\' -f2)
current_major_version=${current_version%%.*}

# Print the current version number of Nextcloud
exec_occ -V
done

next_major_version="$(( $current_major_version + 1 ))"
source_id="$next_major_version"
if [[ "$next_major_version" -ge "$last_major_version" ]]; then
ynh_print_info "Upgrading to Nextcloud $last_version"
source_id="main"
else
ynh_print_info "Upgrading to Nextcloud $next_major_version"
fi

# Create a temporary directory
tmpdir="${install_dir}__tmp_upgrade"

ynh_setup_source --dest_dir="$tmpdir" --source_id="$source_id"

# Backup the config file in the temp dir
cp -a "$install_dir/config/config.php" "$tmpdir/config/config.php"

# Enable maintenance mode
exec_occ maintenance:mode --on

# Backup 3rd party applications from the current Nextcloud
# But do not overwrite if there is any upgrade
# (apps directory already exists in Nextcloud archive)
(
cd $install_dir/apps
for nc_app_dir in */
do
if [ ! -d "$tmpdir/apps/$nc_app_dir" ]
then
cp -a "$nc_app_dir" "$tmpdir/apps/$nc_app_dir"
fi
done
)

# Replace the old Nextcloud by the new one
ynh_safe_rm "$install_dir"
mv "$tmpdir" "$install_dir"

# Get the new current version number
current_version=$(grep OC_VersionString "$install_dir/version.php" | cut -d\' -f2)
current_major_version=${current_version%%.*}

# Set write access for the following commands
chown -R $app:www-data "$install_dir"
# Upgrade Nextcloud (SUCCESS = 0, UP_TO_DATE = 3)
exec_occ maintenance:mode --off
exec_occ upgrade || [ $? -eq 3 ] || ynh_die "Unable to upgrade $app"

# Print the current version number of Nextcloud
exec_occ -V
done
fi
exec_occ db:add-missing-indices -n
exec_occ db:add-missing-columns -n
exec_occ db:add-missing-primary-keys -n
Expand Down Expand Up @@ -281,7 +299,7 @@ exec_occ maintenance:repair --include-expensive
# Add dynamic logout URL to the config
url_base64="$(echo -n "https://$domain$path" | base64)"
old_logout_url="https://$(cat /etc/yunohost/current_host)/yunohost/sso/?action=logout"
current_logout_url="$(exec_occ config:system:get logout_url 2> /dev/null)"
current_logout_url="$(exec_occ config:system:get logout_url 2> /dev/null || echo '')"
if [[ "$current_logout_url" == "${old_logout_url}" ]] || [[ "$current_logout_url" == "" ]]
then
echo "
Expand Down Expand Up @@ -396,6 +414,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
9 changes: 4 additions & 5 deletions tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ test_format = 1.0
caldav.logged_on_sso = true
caldav.expect_content = "This is the WebDAV interface."

#[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"
[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"