Skip to content

Commit

Permalink
Update nextcloud to version v30.0.0 (#1547)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmfretz authored Oct 1, 2024
1 parent 8d7e822 commit 4511539
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 26 deletions.
4 changes: 2 additions & 2 deletions nextcloud/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
- "${APP_DATA_DIR}/data/redis:/data"

web:
image: nextcloud:29.0.7-apache@sha256:3bcd2afa9d02fccc52251712bee1afc4f5891beaf353af47881b7662cd1308f7
image: nextcloud:30.0.0-apache@sha256:6613a36792a7e392fc532d5b75e3b018ea5fcea034002083e1c7a182d07eae99
# Currently needs to be run as root, if we run as uid 1000 this fails
# https://github.com/nextcloud/docker/blob/05026b029d37fc5cd488d4a4a2a79480e39841ba/21.0/apache/entrypoint.sh#L53-L77
# user: "1000:1000"
Expand All @@ -51,7 +51,7 @@ services:
- redis

cron:
image: nextcloud:29.0.7-apache@sha256:3bcd2afa9d02fccc52251712bee1afc4f5891beaf353af47881b7662cd1308f7
image: nextcloud:30.0.0-apache@sha256:6613a36792a7e392fc532d5b75e3b018ea5fcea034002083e1c7a182d07eae99
# Currently needs to be run as root, if we run as uid 1000 this fails
# https://github.com/nextcloud/docker/blob/05026b029d37fc5cd488d4a4a2a79480e39841ba/21.0/apache/entrypoint.sh#L53-L77
# user: "1000:1000"
Expand Down
53 changes: 32 additions & 21 deletions nextcloud/hooks/pre-start
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,20 @@ CONFIG_PHP_FILE="${APP_DATA_DIR}/data/nextcloud/config/config.php"
APP_COMPOSE_FILE="${APP_DATA_DIR}/docker-compose.yml"
APP_COMPOSE_BACKUP_FILE="${APP_DATA_DIR}/docker-compose.yml.bak"

# TODO: When Nextcloud 30 is released, refactor this script to handle updates from all patch versions released to the umbrel app store.

# Supported list of Nextcloud migrations
# Supported list of Nextcloud major version migrations
VERSIONS=()
VERSIONS+=( "22.1.1.2" )
VERSIONS+=( "22.2.10.2" )
VERSIONS+=( "23.0.11.1" )
VERSIONS+=( "24.0.7.1" )
VERSIONS+=( "25.0.1.1" )
VERSIONS+=( "26.0.9.1" )
VERSIONS+=( "27.0.2.1" )
VERSIONS+=( "28.0.3.2" )
VERSIONS+=( "29.0.7.1" )


VERSIONS+=( "22" )
VERSIONS+=( "23" )
VERSIONS+=( "24" )
VERSIONS+=( "25" )
VERSIONS+=( "26" )
VERSIONS+=( "27" )
VERSIONS+=( "28" )
VERSIONS+=( "29" )
VERSIONS+=( "30" )

# List of Nextcloud major version images to migrate to
IMAGES=()
IMAGES+=( "nextcloud:22.1.1-apache@sha256:99d94124b2024c9f7f38dc12144a92bc0d68d110bcfd374169ebb7e8df0adf8e" )
IMAGES+=( "nextcloud:22.2.10-apache@sha256:71c4fb75d7c035ea2c840ebc1adf0da144b0c69e39ce925f4a2ea84b7c06db18" )
IMAGES+=( "nextcloud:23.0.11-apache@sha256:671ed70c7b204c63cb56d5c0d5dd624abec5eadeacd492191e65e834ddffef26" )
IMAGES+=( "nextcloud:24.0.7-apache@sha256:f95a21b598b7470b788251db5b0bbe9516992fdb865e7a8978980585e36eb715" )
Expand All @@ -34,6 +31,7 @@ IMAGES+=( "nextcloud:26.0.9-apache@sha256:23180fbe8169d428ce0058bfc8d47793628a16
IMAGES+=( "nextcloud:27.0.2-apache@sha256:3c8040278bdc991cbc025278eaffc4978a9c2fd4ac34e95b10f646dcadb7c3fb" )
IMAGES+=( "nextcloud:28.0.3-apache@sha256:ed07f89119dcca2a3711897c48a8ac969542d96d69384445d8fcdc7804ca946f" )
IMAGES+=( "nextcloud:29.0.7-apache@sha256:3bcd2afa9d02fccc52251712bee1afc4f5891beaf353af47881b7662cd1308f7" )
IMAGES+=( "nextcloud:30.0.0-apache@sha256:6613a36792a7e392fc532d5b75e3b018ea5fcea034002083e1c7a182d07eae99" )

find_index() {
local -r value="${1}"
Expand Down Expand Up @@ -88,6 +86,10 @@ get_version() {
cat "${CONFIG_PHP_FILE}" | grep "'version'[[:space:]]=>[[:space:]]" | awk -F"'" '{print $4}'
}

get_major_version() {
echo "${1%%.*}"
}

# If a Nextcloud config file does not yet exist
# Then it's likely a new install
# Therefore there is nothing to do
Expand All @@ -96,19 +98,28 @@ if [[ ! -f "${CONFIG_PHP_FILE}" ]]; then
fi

nextcloud_version=$(get_version)
nextcloud_major_version=$(get_major_version "$nextcloud_version")

echo "Active Nextcloud Version: ${nextcloud_version}"
echo "Active Nextcloud Major Version: ${nextcloud_major_version}"

# check if active version has "-patch" appended to it and exit if it does so we allow the migration to complete
# we add "-patch" to the version below during migration
if [[ "${nextcloud_version}" == *"-patch"* ]]; then
echo "Active Nextcloud version is undergoing migration. Exiting..."
exit
fi

# Check if active version is in migration list
active_version_idx=$(find_index "${nextcloud_version}" "${VERSIONS[@]}")
# Check if active major version is in migration list
active_version_idx=$(find_index "${nextcloud_major_version}" "${VERSIONS[@]}")
if [[ "${active_version_idx}" == "-1" ]]; then
echo "Active version is not supported in the list of migrations"
echo "Active major version is not supported in the list of migrations"
exit
fi

# Check if already up to date
if [[ "${VERSIONS[-1]}" == "${nextcloud_version}" ]]; then
echo "Nextcloud is up-to-date"
if [[ "${VERSIONS[-1]}" == "${nextcloud_major_version}" ]]; then
echo "Nextcloud is already on the latest major version. No migration needed."
exit
fi

Expand All @@ -119,7 +130,7 @@ for i in "${!VERSIONS[@]}"; do
version="${VERSIONS[$i]}"
image="${IMAGES[$i]}"

echo "Migrating to: ${version} (${image})"
echo "Migrating to major version: ${version} (${image})"
echo

cp --archive "${APP_COMPOSE_FILE}" "${APP_COMPOSE_BACKUP_FILE}"
Expand Down
14 changes: 11 additions & 3 deletions nextcloud/umbrel-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ manifestVersion: 1.1
id: nextcloud
category: files
name: Nextcloud
version: "29.0.7"
version: "30.0.0"
tagline: Productivity platform that keeps you in control
description: >-
Nextcloud puts your data at your fingertips, under your control.
Expand All @@ -25,8 +25,16 @@ description: >-
Note: After logging in to Nextcloud please change the password to something secure before sharing the address with anyone.
releaseNotes: >-
This is a small bugfix release.
Nextcloud version 30 introduces a range of new features, improvements, and enhancements across various apps and core functionalities. Key updates include:
- File management improvements
- Sharing and collaboration enhancements
- User management and security upgrades
- Theming and user interface updates
- Calendar and contacts enhancements
- Developer tools and API improvements
- Performance and security enhancements
- Photos app improvements
- Text app enhancements
Full release notes can be found at https://github.com/nextcloud/server/releases
developer: Nextcloud GmbH
Expand Down

0 comments on commit 4511539

Please sign in to comment.