Compare commits

...

84 Commits

Author SHA1 Message Date
Tobias Knöppler
332fdb3f40 changelog.md: Document v1.56.0 2025-11-19 15:08:23 +01:00
Tobias Knöppler
7be2748648
Merge pull request #2083 from nextcloud/devel
NC 32 and fixes
2025-11-19 10:03:07 +01:00
Tobias Knöppler
53c9f43dbe publish-image.yml: Fix issue with artifact file name containing spaces 2025-11-16 20:04:14 +01:00
Tobias Knöppler
d6e6215fa9 update-nc.sh: Disable app_api during nc update 2025-11-16 18:44:39 +01:00
Tobias Knöppler
6c3d2503ea build-sd-images.yml: Fix issue with artifact file name containing spaces 2025-11-16 17:33:57 +01:00
Tobias Knöppler
5b11ae0caf nc-nextcloud.sh, ncp-provisioning.sh: Implement nextcloud service workers 2025-11-15 03:38:49 +01:00
Tobias Knöppler
9c54a8a177 nextcloud_tests.py: Fix settings check 2025-11-15 03:08:28 +01:00
Tobias Knöppler
a7cfdb08ed system_tests.py: Add missing comma 2025-11-15 00:11:18 +01:00
Tobias Knöppler
2fbf2ab6b5 update-nc.sh: Convert mysql charset if necessary 2025-11-15 00:09:19 +01:00
Tobias Knöppler
c12e51b396 update-nc.sh: Migrate NC apps after installation of new version 2025-11-15 00:09:19 +01:00
Tobias Knöppler
767a42afbb release.yml: Remove Raspberry Pi 5 config because it has been unified in Armbian 2025-11-15 00:09:19 +01:00
Tobias Knöppler
8c3add3a2d release.yml: Run armbian-test-image only on explicit request 2025-11-15 00:09:19 +01:00
Tobias Knöppler
3ae97ea31d Set supported NC version to 32.0.1 and reenable tasks app 2025-11-15 00:09:19 +01:00
Tobias Knöppler
2475ccca10 nextcloud_tests.py: Fix config checks for NC32 2025-11-15 00:09:19 +01:00
Tobias Knöppler
d345af9c2a Disable app_api unless configured 2025-11-15 00:09:19 +01:00
Tobias Knöppler
d0d30c6872 Temporarily skip installation of tasks app 2025-11-15 00:09:19 +01:00
Tobias Knöppler
dce645be79 Add support for NC 32 2025-11-15 00:09:19 +01:00
Tommy He
0ed0ce065b #2069: Apply fix for notify_push reinstall during Nextcloud updates 2025-11-15 00:09:19 +01:00
Tobias
875e1b62bb Update README to reflect community-scripts changes (#2068) 2025-11-15 00:09:19 +01:00
Tobias Knöppler
c63dd9cd4b Fix CI/CD pipeline issues (#2076)
- Update armbian base and use release branch instead of tag
- Fix nextcloud tests for NC 31
- Use venv for integration tests
- Use ubuntu-latest for all workflows (except arm64)
- Push start NC version for dist-upgrade test to 29
- Use ncp v1.53.2/v1.53.3 as base version for dist-upgrade check
- nextcloud_tests.py: Ignore errors in nextcloud.log
- Fix redis issue on arm
- system_tests.py: Add option to use pw-less sudo for commands
- nextcloud_test.py,activation_tests.py: Use new selenium initialization syntax
- build-lxd.yml: Install incus from system packages
- build-lxd.yml: Disable test-dist-upgrade temporarily
# Conflicts:
#	.github/workflows/build-lxd.yml
#	tests/nextcloud_tests.py
2025-11-15 00:09:17 +01:00
Tobias Knöppler
ca9ac7c81e nextcloud-domain.sh: Minor syntax improvment
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-11-14 23:55:11 +01:00
Tobias Knöppler
c57218e6c9 nextcloud-domain.sh: Minor syntax improvment
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-11-14 23:55:11 +01:00
Lukasz Goworko
cc5c73abf4 fix: Added IPv6 support with brackets to trusted domains
Signed-off-by: Lukasz Goworko <lukaszgoworko@users.noreply.github.com>
2025-11-14 23:55:11 +01:00
Tobias Knöppler
5f38f64336 release.yml, build-sd-images.yml: Add armbian testimage build 2025-10-12 18:25:27 +02:00
Tobias Knöppler
a53f800d02 system_tests.py: Add debug output 2025-10-12 17:50:19 +02:00
Tobias Knöppler
e7f9f6e32a system_tests.py: Add option to use pw-less sudo for commands 2025-10-01 13:39:55 +02:00
Tobias Knöppler
a97397102a Fix armbian builds 2025-09-30 21:05:04 +02:00
Tobias Knöppler
e0a2cec153 Log redis output during installation 2025-09-14 09:58:58 +02:00
Tobias Knöppler
680753b564 Abort if redis cannot be started 2025-09-13 21:13:37 +02:00
Tobias Knöppler
904b0ab310 build-lxd.yml: Use ncp v1.53.2 as base version for dist-upgrade test 2025-09-13 21:04:42 +02:00
Tobias Knöppler
63c80d1604 nextcloud_tests.py: Ignore single error in logs 2025-09-13 20:57:03 +02:00
Tobias Knöppler
25887deba6 build-lxd.yml: Use ncp v1.53.3 as base version for dist-upgrade test 2025-09-13 20:48:24 +02:00
Tobias Knöppler
2f639cf1c2 nextcloud_tests.py: Increase wait time during settings check 2025-09-13 20:38:29 +02:00
Tobias Knöppler
5dcd4b1ff6 armbian.sh: Test starting redis if install fails 2025-09-13 20:23:30 +02:00
Tobias Knöppler
2debc54186 build-lxd.yml: Add debug output 2025-09-13 20:14:10 +02:00
Tobias Knöppler
8eaf974bf6 Push NC base version for dist upgrade test to v29 2025-09-13 20:04:25 +02:00
Tobias Knöppler
e86ed80bb7 build-lxd.yml: Fix path to venv 2025-09-13 20:01:41 +02:00
Tobias Knöppler
502a5c8be3 armbian.sh: Add debug output on failure 2025-09-13 19:43:07 +02:00
Tobias Knöppler
6ed2c17b06 Use armbian release branch instead of tag 2025-09-13 19:30:59 +02:00
Tobias Knöppler
93d29d63c8 Use venv for integration tests 2025-09-13 18:49:40 +02:00
Tobias Knöppler
9ab14a99e7 nextcloud_tests.py: Add debug output if settings check does not succeed 2025-09-13 18:36:05 +02:00
Tobias Knöppler
c6f196dc09 Use ubuntu-latest for all workflows 2025-09-13 18:22:23 +02:00
Tobias Knöppler
42f8ee11b0 Fix nextcloud tests 2025-09-13 18:11:39 +02:00
Tobias Knöppler
06f50ed3de Update armbian base to latest version 2025-09-13 18:04:11 +02:00
Tobias Knöppler
2ada653882
Merge pull request #2044 from nextcloud/devel
Support for NC 31 + Fixes
2025-03-24 11:29:49 +00:00
Tobias Knöppler
a7cf5a2672
changelog.md: Document v1.55.4
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-03-24 12:29:10 +01:00
Josh
ce2406d222
fix(CONFIG): temp directory typo in nc-datadir.sh
Fixes #1857
Fixes #1750 

Signed-off-by: Josh <josh.t.richards@gmail.com>
2025-03-24 01:33:31 +01:00
twojstaryzdomu
6f4b43e3ca
nc-limits.sh: Do not trigger ERR trap due to failed tests 2025-03-24 01:32:18 +01:00
Tobias Knöppler
52010f2baf
Merge pull request #2043 from nextcloud/feature/nc-31
Support Nextcloud 31
2025-03-24 00:30:42 +00:00
Tobias Knöppler
5738d58f28
1.55.3.sh: Prevent nonzero exit code if no action necessary
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-03-24 01:06:53 +01:00
Tobias Knöppler
7f4de99aac
updates/1.56.0.sh: Update row format for db tables
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-03-24 01:06:49 +01:00
Tobias Knöppler
2c7a079e3c
Set supported NC version to 31.0.2
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-03-23 22:46:53 +01:00
Tobias Knöppler
94a8dda931
build-lxd.yml: Run incus/lxc commands as root
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-03-22 16:09:22 +01:00
Tobias Knöppler
92b352f06e
Update supported NC version to 31 for nc apps
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-03-22 11:50:48 +01:00
Tobias Knöppler
bee56f5767
.github/workflows: Update artifact actions to v4
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-03-22 11:23:56 +01:00
Tobias Knöppler
1946e04806
library.sh: Fix invalid redirection of error message
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-03-22 11:23:56 +01:00
Tobias Knöppler
bba41f0dfd
Update supported NC version to 31
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-03-22 11:23:56 +01:00
Tobias Knöppler
60e285766a
changelog.md: Document v1.55.3
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-03-22 11:23:56 +01:00
Tobias Knöppler
77763af71d
README.md: Document installation on Proxmox
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-11-08 21:45:26 +01:00
Tobias Knöppler
d1b3ac5570
Merge pull request #2004 from nextcloud/devel
v1.55.3
2024-11-08 20:42:28 +01:00
Tobias Knöppler
776c190319
changelog.md: Document v1.55.3
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-11-08 18:15:37 +01:00
Tobias Knöppler
aa2ec800cc
Merge pull request #2003 from nextcloud/fix/restore-ncp-previews-patch
Fix/restore ncp previews patch
2024-11-08 18:05:31 +01:00
Tobias Knöppler
7be0a10433
Move ncp-previews-auto fix to updates/1.55.3.sh
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-11-08 17:44:23 +01:00
Moritz Breitbach
c10bf36cbb
Fix typo in nc-previews-auto.sh
Signed-off-by: Moritz Breitbach <moritz.breitbach@t-online.de>
2024-11-08 17:42:16 +01:00
Tobias Knöppler
1f7855bfcf
Merge pull request #2002 from nextcloud/fix/ncp-update-nc-as-oneshot
ncp-update-nc as oneshot
2024-11-08 17:39:49 +01:00
Tobias Knöppler
39a05f8ac6
ncp-update-nc: Use oneshot service type with start and stop timeout for systemd-run
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-11-08 17:37:24 +01:00
Tobias Knöppler
10a5b4e96b
nc-init.sh: Add maintenance:repair step to nextcloud initialization
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-11-06 17:08:39 +01:00
Tobias Knöppler
430e56ee7b
update-nc.sh: Improve informational output during update
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-11-06 17:08:39 +01:00
Tobias K
1579f7b2ea
ncp-update-nc: Fix resetting job after failed update attempt
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-11-06 17:08:39 +01:00
Tobias Knöppler
3cb98599de
Add support for Nextcloud 30
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-11-06 17:08:39 +01:00
Tobias Knöppler
94332db835
dnsmasq.sh: Don't fix it if it ain't broken
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-11-06 17:08:39 +01:00
Tobias Knöppler
7ed6552110
staged_rollouts: Release v1.55.0-v1.55.2 to everyone
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-11-06 17:08:07 +01:00
Tobias Knöppler
eb835b9c12
Merge pull request #1985 from nextcloud/devel
V1.55.2
2024-09-24 19:54:42 +02:00
Tobias Knöppler
50e1adf6c0
changelog.md: Document v1.55.2
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-09-24 19:35:11 +02:00
Tobias Knöppler
a6cf48ec7f
Merge pull request #1984 from nextcloud/release/v1.55.2
Release/v1.55.2
2024-09-24 19:25:39 +02:00
Tobias Knöppler
9890d68532
91-ncp.cnf.sh: Increase allowed packet size for mysqldump
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-09-24 17:18:41 +02:00
Tobias Knöppler
aaf7536943
nc-autoupdate-nc: Fix erroneous update/updated notifications
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-09-24 17:08:10 +02:00
Tobias Knöppler
29e6c05937
Push v1.55.0 and v1.55.1 to 50% of instances 2024-09-13 13:06:11 +02:00
Tobias Knöppler
fb645bcaa7
Merge branch 'devel' 2024-09-08 23:41:41 +02:00
Tobias Knöppler
8726cc3a91
Add staged_rollouts/v1.55.1.txt
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-09-08 23:41:24 +02:00
Tobias Knöppler
50a2b0a8c8
Merge branch 'devel' 2024-09-08 23:39:43 +02:00
Tobias Knöppler
28042b8763
changelog.md: Document v1.55.1
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-09-08 23:39:30 +02:00
Tobias Knöppler
63b6aca7bb
Merge pull request #1971 from nextcloud/devel
[hotfix] library.sh: Fix resolution of target nextcloud version if requesting older version than current
2024-09-08 23:37:37 +02:00
Tobias Knöppler
848ddad7d4
library.sh: Fix resolution of target nextcloud version if requesting older version than current
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-09-08 23:15:20 +02:00
43 changed files with 923 additions and 222 deletions

View File

@ -381,7 +381,7 @@ jobs:
docker exec nextcloudpi bash /usr/local/bin/ncp-diag |& awk "{ print \"${LOG_DIAG} \" \$0 }"
- name: "Upload error report"
if: ${{ failure() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ github.run_id }}-docker-${{ env.ARCH }}-update-test-error-report
path: tests/error-report.txt
@ -533,7 +533,7 @@ jobs:
- name: "Upload error report"
if: ${{ failure() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ github.run_id }}-docker-${{ env.ARCH }}-install-test-error-report
path: tests/error-report.txt

View File

@ -47,7 +47,7 @@ jobs:
echo "lxd_extra_profile=network" | tee -a "$GITHUB_OUTPUT"
else
LXC_CMD="incus"
RUNNER_LABEL="ubuntu-20.04"
RUNNER_LABEL="ubuntu-latest"
fi
echo "runner_label=$RUNNER_LABEL" | tee -a $GITHUB_OUTPUT
@ -73,7 +73,7 @@ jobs:
- name: Setup incus
if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-20.04-arm64' }}
run: |
curl https://pkgs.zabbly.com/get/incus-stable | sudo sh -x
sudo apt-get install -y incus qemu-system incus-tools
sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
sudo incus admin init --auto
@ -91,7 +91,7 @@ jobs:
sudo "$LXC" image export -q ncp/"${version}" "output/${ARTIFACT_FILE}"
echo "artifact_file=${ARTIFACT_FILE}.tar.gz" >> $GITHUB_OUTPUT
- name: upload LXD image to artifact store
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "${{ env.ARTIFACT_NAME }}"
path: "output/${{ steps.pack-lxd.outputs.artifact_file }}"
@ -341,6 +341,7 @@ jobs:
# }
test-dist-upgrade:
if: false
needs:
- determine-runner
runs-on: ${{ needs.determine-runner.outputs.runner_label }}
@ -348,14 +349,14 @@ jobs:
VERSION: "${{ inputs.git_ref || github.ref }}"
LXC: "${{ needs.determine-runner.outputs.lxc_cmd }}"
LXD_EXTRA_PROFILE: "${{ needs.determine-runner.outputs.lxd_extra_profile }}"
PREVIOUS_IMAGE_URL_ARM64: "https://github.com/nextcloud/nextcloudpi/releases/download/v1.53.0/NextcloudPi_LXD_arm64_v1.53.0.tar.gz"
PREVIOUS_IMAGE_URL_AMD64: "https://github.com/nextcloud/nextcloudpi/releases/download/v1.53.0/NextCloudPi_LXD_x86_v1.53.0.tar.gz"
PREVIOUS_IMAGE_URL_ARM64: "https://github.com/nextcloud/nextcloudpi/releases/download/v1.53.2/NextcloudPi_LXD_arm64_v1.53.2.tar.gz"
PREVIOUS_IMAGE_URL_AMD64: "https://github.com/nextcloud/nextcloudpi/releases/download/v1.53.2/NextCloudPi_LXD_x86_v1.53.2.tar.gz"
USE_INCUS: "${{ needs.determine-runner.outputs.lxc_cmd == 'incus' && 'yes' || 'no' }}"
steps:
- name: Setup incus
if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-20.04-arm64' }}
run: |
curl https://pkgs.zabbly.com/get/incus-stable | sudo sh -x
sudo apt-get install -y incus qemu-system incus-tools
sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
sudo incus admin init --auto
@ -364,31 +365,40 @@ jobs:
with:
ref: "v1.54.3"
- name: Setup Firefox
if: ${{ runner.arch != 'ARM64' }}
continue-on-error: true
id: setup-firefox-browser-action
uses: browser-actions/setup-firefox@latest
- name: Setup Firefox from packages
if: ${{ steps.setup-firefox-browser-action.outcome == 'failure' }}
if: ${{ runner.arch == 'ARM64' || steps.setup-firefox-browser-action.outcome == 'failure' }}
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends firefox
- name: Setup GeckoDriver
env:
GH_TOKEN: ${{ github.token }}
run: |
set -x
arch=linux64
if [[ "$RUNNER_ARCH" == "ARM64" ]]
if [[ "${{ runner.arch }}" == "ARM64" ]]
then
arch="linux-aarch64"
fi
gh release download -R mozilla/geckodriver -p 'geckodriver-*-'"$arch.tar.gz"
tar xf "geckodriver-"*"-$arch.tar.gz"
sudo mv geckodriver /usr/local/bin/
sudo chmod +x /usr/local/bin/geckodriver
echo "GECKODRIVER_PATH=/usr/local/bin/geckodriver" >> "$GITHUB_ENV"
geckodriver -V
- name: Setup Selenium
run: pip install selenium
run: |
sudo apt-get -y install python3-venv
python3 -m venv ./.venv
./.venv/bin/pip install selenium
- name: download LXD image
run: |
image_url="${PREVIOUS_IMAGE_URL_AMD64?}"
if [[ "$RUNNER_ARCH" == "ARM64" ]]
if [[ "${{ runner.arch }}" == "ARM64" ]]
then
image_url="${PREVIOUS_IMAGE_URL_ARM64?}"
fi
@ -412,8 +422,11 @@ jobs:
- name: Activate and Test LXD Image
working-directory: ./tests
run: |
set -x
export GECKODRIVER_PATH="$GECKODRIVER_PATH"
export FF_BINARY_PATH="$(which firefox)"
sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
python activation_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
../.venv/bin/python activation_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
echo "Activation test failed!"
echo "Geckodriver logs:"
tail -n 20 geckodriver.log >&2 || true
@ -422,7 +435,7 @@ jobs:
sudo "$LXC" exec ncp -- "tail -n20 /var/log/ncp.log" || true
exit 1
}
python nextcloud_tests.py --skip-release-check --no-gui "nextcloudpi.local" 443 4443 || {
../.venv/bin/python nextcloud_tests.py --skip-release-check --no-gui "nextcloudpi.local" 443 4443 || {
echo "Nextcloud test failed!"
echo "Geckodriver logs:"
tail -n 20 geckodriver.log >&2 || true
@ -435,8 +448,14 @@ jobs:
sudo "$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
exit 1
}
USE_INCUS="$USE_INCUS" python system_tests.py --non-interactive --skip-update-test || {
USE_INCUS="$USE_INCUS" ../.venv/bin/python system_tests.py --non-interactive --skip-update-test || {
echo "System test failed!"
echo "ncp.log: "
sudo "$LXC" exec ncp -- "tail -n20 /var/log/ncp.log" || true
echo "================"
echo "nextcloud log: "
datadir="$(sudo "$LXC" exec ncp -- ncc config:system:get datadirectory)"
sudo "$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
exit 1
}
@ -457,7 +476,7 @@ jobs:
echo "Running update to ${VERSION}"
current_nc_version="$(sudo "$LXC" exec ncp -- ncc status | grep "version:" | awk '{ print $3 }')"
latest_nc_version="27.1.6"
latest_nc_version="29.0.9"
sudo "$LXC" exec ncp -- apt-get update ||:
sudo "$LXC" exec ncp -- apt-get install --no-install-recommends -y gnupg2
@ -466,13 +485,13 @@ jobs:
sudo "$LXC" exec ncp -- bash -c "DBG=x ncp-update ${UPDATE_ARGS[*]}"
sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
if [[ "$current_nc_version" =~ "$latest_nc_version".* ]]
then
echo "Nextcloud is up to date - skipping NC update test."
else
sudo "$LXC" exec ncp -- bash -c "DBG=x ncp-update-nc ${latest_nc_version?}"
sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
fi
#if [[ "$current_nc_version" =~ "$latest_nc_version".* ]]
#then
# echo "Nextcloud is up to date - skipping NC update test."
#else
# sudo "$LXC" exec ncp -- bash -c "DBG=x ncp-update-nc ${latest_nc_version?}"
# sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
#fi
sudo "$LXC" exec ncp -- rm -f /opt/ncdata/data/nextcloud.log
@ -493,7 +512,9 @@ jobs:
- name: Test LXD Image
working-directory: ./tests
run: |
python nextcloud_tests.py --no-gui --skip-release-check "nextcloudpi.local" 443 4443 || {
export GECKODRIVER_PATH="$GECKODRIVER_PATH"
export FF_BINARY_PATH="$(which firefox)"
../.venv/bin/python nextcloud_tests.py --no-gui --skip-release-check "nextcloudpi.local" 443 4443 || {
echo "Nextcloud test failed!"
echo "Geckodriver logs:"
tail -n 20 geckodriver.log >&2 || true
@ -507,7 +528,7 @@ jobs:
exit 1
}
sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
USE_INCUS="$USE_INCUS" python system_tests.py --non-interactive --skip-update-test || {
USE_INCUS="$USE_INCUS" ../.venv/bin/python system_tests.py --non-interactive --skip-update-test || {
echo "System test failed!"
exit 1
}
@ -572,8 +593,11 @@ jobs:
- name: Test LXD Image
working-directory: ./tests
run: |
set -x
export GECKODRIVER_PATH="$GECKODRIVER_PATH"
export FF_BINARY_PATH="$(which firefox)"
sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
python nextcloud_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
../.venv/bin/python nextcloud_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
echo "Nextcloud test failed!"
echo "Geckodriver logs:"
tail -n 20 geckodriver.log >&2 || true
@ -586,7 +610,7 @@ jobs:
sudo "$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
exit 1
}
USE_INCUS="$USE_INCUS" python system_tests.py --non-interactive || {
USE_INCUS="$USE_INCUS" ../.venv/bin/python system_tests.py --non-interactive || {
echo "System test failed!"
exit 1
}
@ -612,34 +636,43 @@ jobs:
- name: Setup incus
if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-20.04-arm64' }}
run: |
curl https://pkgs.zabbly.com/get/incus-stable | sudo sh -x
sudo apt-get install -y incus qemu-system incus-tools
sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
sudo incus admin init --auto
- name: Setup Firefox
if: ${{ runner.arch != 'ARM64' }}
continue-on-error: true
id: setup-firefox-browser-action
uses: browser-actions/setup-firefox@latest
- name: Setup Firefox from packages
if: ${{ steps.setup-firefox-browser-action.outcome == 'failure' }}
if: ${{ runner.arch == 'ARM64' || steps.setup-firefox-browser-action.outcome == 'failure' }}
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends firefox
- name: Setup GeckoDriver
env:
GH_TOKEN: ${{ github.token }}
run: |
set -x
arch=linux64
if [[ "$RUNNER_ARCH" == "ARM64" ]]
if [[ "${{ runner.arch }}" == "ARM64" ]]
then
arch="linux-aarch64"
fi
gh release download -R mozilla/geckodriver -p 'geckodriver-*-'"$arch.tar.gz"
tar xf "geckodriver-"*"-$arch.tar.gz"
sudo mv geckodriver /usr/local/bin/
sudo chmod +x /usr/local/bin/geckodriver
echo "GECKODRIVER_PATH=/usr/local/bin/geckodriver" >> "$GITHUB_ENV"
geckodriver -V
- name: Setup Selenium
run: pip install selenium
run: |
sudo apt-get install -y python3-venv
python3 -m venv ./.venv
./.venv/bin/pip install selenium
- name: download LXD image from artifact store
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
- name: Remove old lxd images
@ -668,34 +701,37 @@ jobs:
- name: Test LXD Image
working-directory: ./tests
run: |
"$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
python activation_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
set -x
export GECKODRIVER_PATH="$GECKODRIVER_PATH"
export FF_BINARY_PATH="$(which firefox)"
sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
../.venv/bin/python activation_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
echo "Activation test failed!"
echo "Geckodriver logs:"
tail -n 20 geckodriver.log >&2 || true
echo "================"
echo "ncp.log: "
"$LXC" exec ncp -- "tail -n20 /var/log/ncp.log" || true
sudo "$LXC" exec ncp -- "tail -n20 /var/log/ncp.log" || true
echo "================"
echo "nextcloud log: "
datadir="$("$LXC" exec ncp -- ncc config:system:get datadirectory)"
"$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
sudo "$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
exit 1
}
python nextcloud_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
../.venv/bin/python nextcloud_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
echo "Nextcloud test failed!"
echo "Geckodriver logs:"
tail -n 20 geckodriver.log >&2 || true
echo "================"
echo "ncp.log: "
"$LXC" exec ncp -- "tail -n20 /var/log/ncp.log" || true
sudo "$LXC" exec ncp -- "tail -n20 /var/log/ncp.log" || true
echo "================"
echo "nextcloud log: "
datadir="$("$LXC" exec ncp -- ncc config:system:get datadirectory)"
"$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
datadir="$(sudo "$LXC" exec ncp -- ncc config:system:get datadirectory)"
sudo "$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
exit 1
}
USE_INCUS="$USE_INCUS" python system_tests.py --non-interactive || {
USE_INCUS="$USE_INCUS" ../.venv/bin/python system_tests.py --non-interactive || {
echo "System test failed!"
exit 1
}
@ -714,7 +750,7 @@ jobs:
LXD_ARTIFACT_FILE: ${{ needs.build-current.outputs.artifact_file }}
steps:
- name: download LXD image from artifact store
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ env.LXD_ARTIFACT_NAME }}
- name: convert to LXC image
@ -732,7 +768,7 @@ jobs:
echo "artifact_file=${LXC_ARTIFACT_FILE?}" >> $GITHUB_OUTPUT;
echo "artifact_name=${LXD_ARTIFACT_NAME//lxd/lxc}" >> $GITHUB_OUTPUT;
- name: upload LXD image to artifact store
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "${{ steps.lxd-to-lxc.outputs.artifact_name }}"
path: "output/${{ steps.lxd-to-lxc.outputs.artifact_file }}"

View File

@ -15,6 +15,10 @@ on:
required: false
default: true
type: boolean
test_image_url:
required: false
type: string
default: ""
outputs:
artifact_name:
value: "${{ jobs.build.outputs.artifact_name }}"
@ -23,7 +27,7 @@ on:
jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
VERSION: "${{ inputs.git_ref }}"
LOG_GUEST: "\\033[1;34mGUEST::\\033[0m"
@ -63,7 +67,13 @@ jobs:
# which qemu-aarch64-static
# update-binfmts --display qemu-aarch64
# update-binfmts --display qemu-arm
- name: "Skip build"
if: "${{ inputs.test_image_url != '' }}"
run: |
echo "artifact_file=NextcloudPi_TestImage_${VERSION//\//_}.img" >> $GITHUB_OUTPUT
echo "ARTIFACT_FILE=NextcloudPi_TestImage_${VERSION//\//_}.img" >> $GITHUB_ENV
- name: "Build Armbian"
if: "${{ inputs.test_image_url == '' }}"
id: build-armbian
continue-on-error: true
run: |
@ -98,12 +108,13 @@ jobs:
echo "ARTIFACT_FILE=${IMG}" >> $GITHUB_ENV
- name: "Upload Armbian logs"
if: ${{ failure() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ github.run_id }}-${{ inputs.board_id }}-logs
path: armbian/output
- name: upload image to artifact store
uses: actions/upload-artifact@v3
if: "${{ inputs.test_image_url == '' }}"
uses: actions/upload-artifact@v4
with:
name: ${{ github.run_id }}-${{ inputs.board_id }}-image
path: output/${{ env.ARTIFACT_FILE }}
@ -134,16 +145,26 @@ jobs:
uses: actions/checkout@v3
with:
ref: "${{ env.VERSION }}"
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
if: "${{ inputs.test_image_url == '' }}"
with:
name: ${{ env.ARTIFACT_ID }}
path: output
- name: Download Test Image
if: "${{ inputs.test_image_url != '' }}"
run: |
set -ex
mkdir -p output
sudo apt-get install -y pv
wget -nv "${{ inputs.test_image_url }}" -O - | pv -n --bytes --rate --timer -i 3 > "output/${ARTIFACT_FILE?}"
- name: Prepare test
run: |
set -x
mv output/${ARTIFACT_FILE?} ncp.img
mv "output/${ARTIFACT_FILE?}" ncp.img
sudo apt-get install -y systemd-container
sudo pip install selenium
python3 -m venv ./.venv
. ./.venv/bin/activate
./.venv/bin/pip install selenium
sudo rm -rf raspbian_root
. ./build/buildlib.sh
mount_raspbian "ncp.img"
@ -175,7 +196,7 @@ jobs:
sudo systemd-nspawn --boot -D ./raspbian_root/ -M ncp --hostname=nextcloudpi |& awk "{ print \"${LOG_GUEST} \" \$0 }" &
sleep 60
CONTAINER_CMD=(sudo systemd-run --machine=ncp -P --wait)
CONTAINER_CMD=(sudo systemd-run --machine=ncp -P --wait)
success=false
for attempt in {1..30}
@ -234,7 +255,7 @@ jobs:
for attempt in {1..5}
do
echo -e "${LOG_CICD} == Activation Tests (attempt $attempt/5) =="
python tests/activation_tests.py -t 300 --no-gui "$ip" 443 4443 |& awk "{ print \"${LOG_TEST} \" \$0 }"
./.venv/bin/python tests/activation_tests.py -t 300 --no-gui "$ip" 443 4443 |& awk "{ print \"${LOG_TEST} \" \$0 }"
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
echo -e "${LOG_CICD} Activation test failed!"
echo -e "${LOG_DIAG} Geckodriver logs:"
@ -258,7 +279,7 @@ jobs:
for attempt in {1..5}
do
echo -e "${LOG_CICD} == System Tests (attempt $attempt/5) =="
sudo python tests/system_tests.py --non-interactive |& awk "{ print \"${LOG_TEST} \" \$0 }"
USE_SUDO=yes ./.venv/bin/python tests/system_tests.py --non-interactive |& awk "{ print \"${LOG_TEST} \" \$0 }"
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
echo -e "${LOG_CICD} System test failed!"
sleep 12
@ -276,7 +297,7 @@ jobs:
for attempt in {1..5}
do
echo -e "${LOG_CICD} == Nextcloud Tests (attempt $attempt/5) =="
python tests/nextcloud_tests.py --no-gui "$ip" 443 4443 |& awk "{ print \"${LOG_TEST} \" \$0 }"
./.venv/bin/python tests/nextcloud_tests.py --no-gui "$ip" 443 4443 |& awk "{ print \"${LOG_TEST} \" \$0 }"
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
echo -e "${LOG_CICD} Nextcloud test failed!"
echo -e "${LOG_DIAG} /etc/os-release:"
@ -336,7 +357,7 @@ jobs:
}
# test-distupgrade:
# runs-on: ubuntu-20.04
# runs-on: ubuntu-latest
# env:
# VERSION: "${{ inputs.git_ref || github.ref }}"
# LOG_GUEST: "\\033[1;34mGUEST::\\033[0m"

View File

@ -32,7 +32,7 @@ jobs:
with:
ref: "${{ env.VERSION }}"
- name: "Download artifact"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact_id }}
path: artifacts
@ -43,7 +43,7 @@ jobs:
run: |
set -ex
mkdir -p publish
mv artifacts/${{ inputs.artifact_file }} publish/
mv "artifacts/${{ inputs.artifact_file }}" publish/
cd publish
asset="${IMG}"

View File

@ -26,6 +26,11 @@ on:
description: 'Release images to GH'
required: false
default: false
test_image_url:
type: string
description: 'URL for test image to test instead of actual armbian builds'
required: false
default: ''
push:
tags:
- "v*"
@ -58,22 +63,23 @@ jobs:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
secrets: inherit
raspberrypi-4:
raspberrypi:
if: ${{ inputs.sd-images || ( github.event_name != 'workflow_dispatch' && !startsWith(github.ref_name, 'docker-') ) }}
uses: ./.github/workflows/build-sd-images.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
board_id: rpi4b
board_name: RaspberryPi4
board_name: RaspberryPi 4+
secrets: inherit
raspberrypi-5:
if: ${{ inputs.sd-images || ( github.event_name != 'workflow_dispatch' && !startsWith(github.ref_name, 'docker-') ) }}
armbian-test-image:
if: ${{ inputs.test_image_url != '' }}
uses: ./.github/workflows/build-sd-images.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
board_id: rpi5b
board_name: RaspberryPi5
board_id: testimage
board_name: TestImage
test_image_url: "${{ inputs.test_image_url }}"
secrets: inherit
# TODO: Fix 32bit armbian images
@ -201,31 +207,19 @@ jobs:
artifact_file: "${{ needs.lxd-arm64.outputs.lxc_artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
raspberrypi-4-release:
raspberrypi-release:
needs:
- raspberrypi-4
- raspberrypi
- github-release
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.raspberrypi-4.outputs.artifact_name }}"
artifact_file: "${{ needs.raspberrypi-4.outputs.artifact_file }}"
artifact_id: "${{ needs.raspberrypi.outputs.artifact_name }}"
artifact_file: "${{ needs.raspberrypi.outputs.artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
secrets: inherit
raspberrypi-5-release:
needs:
- raspberrypi-5
- github-release
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.raspberrypi-5.outputs.artifact_name }}"
artifact_file: "${{ needs.raspberrypi-5.outputs.artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
secrets: inherit
odroidxu4-release:
needs:
- odroidxu4

View File

@ -52,7 +52,7 @@ jobs:
ssh-keygen -t ed25519 -f ".ssh/automation_ssh_key"
. /ncp-test-automation/bin/entrypoint.sh
- name: upload ssh private key to artifact store
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "${{ env.SSH_ARTIFACT_NAME }}"
path: /__w/nextcloudpi/nextcloudpi/.ssh
@ -302,7 +302,7 @@ jobs:
ssh-keygen -t ed25519 -f "/__w/nextcloudpi/nextcloudpi/.ssh/automation_ssh_key"
. /ncp-test-automation/bin/entrypoint.sh
- name: upload ssh private key to artifact store
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "${{ env.SSH_ARTIFACT_NAME }}"
path: /__w/nextcloudpi/nextcloudpi/.ssh
@ -514,7 +514,7 @@ jobs:
UID: ${{ github.run_id }}-install
steps:
- name: download ssh private key from artifact store
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
if: ${{ contains('success|failure', env.TEST_RESULT) }}
with:
name: ${{ env.SSH_ARTIFACT_NAME }}
@ -621,7 +621,7 @@ jobs:
SSH_ARTIFACT_NAME: "${{ needs.dist-upgrade-test.outputs.ssh_artifact_name }}"
steps:
- name: download ssh private key from artifact store
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
if: ${{ contains('success|failure', env.TEST_RESULT) }}
with:
name: ${{ env.SSH_ARTIFACT_NAME }}

View File

@ -27,17 +27,15 @@ Please reach out in the [Matrix][chat-matrix-wiki] or [Telegram][chat-telegram-w
---
### Test Status
`master`
[![VM Tests][vm-tests-badge]][vm-tests]
[![Docker Tests][docker-tests-badge]][docker-tests]
[![Release](https://github.com/nextcloud/nextcloudpi/actions/workflows/release.yml/badge.svg)](https://github.com/nextcloud/nextcloudpi/actions/workflows/release.yml)
`devel`
[![VM Tests][gh-vm-tests-badge-devel]][vm-tests]
[![Docker Tests][gh-docker-tests-badge-devel]][docker-tests]
[![Release](https://github.com/nextcloud/nextcloudpi/actions/workflows/release.yml/badge.svg?branch=devel)](https://github.com/nextcloud/nextcloudpi/actions/workflows/release.yml)
---
@ -127,19 +125,35 @@ lxc start ncp
## Run in Proxmox
Use the [install script][ncp-proxmox-install-script-v5] from [tteck][tteck-profile] to install the LXC container on your Proxmox instance
There are two ways to run NCP on Proxmox:
He has multiple helper scripts available for Proxmox on his [website][website-helper-scripts], do go have a look if you're using Proxmox. :+1:
### 1. Using the official release image
Installation: `bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/nextcloudpi-v5.sh)"`
In your Proxmox web interface, head to any storage pool that has CT Templates enabled, go to CT Templates,
click "Download from URL" and enter the link to the latest LXC image from the [Nextcloudpi releases page](https://github.com/nextcloud/nextcloudpi/releases)
and press "Download".
<img height="300" alt="Download from URL dialog" src="https://nextcloudpi.com/images/ncp-proxmox-download-screenshot.png">
Optionally, you can copy the corresponding md5 sum from the releases page and paste it in the "Checksum" field to have
Proxmox check that the downloaded image was not corrupted
### 2. Installer by community-scripts (formerly tteck)
Use the [install script][ncp-proxmox-install-script-v5] from [community-scripts][community-scripts-profile] to install the LXC container on your Proxmox instance
[community-scripts][community-scripts-profile] has multiple helper scripts available for Proxmox on their [website][website-helper-scripts], go have a look if you're using Proxmox. :+1:
Installation: `bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/nextcloudpi.sh)"`
Default Settings: `2GB RAM - 8GB Storage - 2vCPU`
_(Check his [website][website-helper-scripts] if this has changed and we haven't had the time to update it here yet, it's located under: Media - Photo > NextcloudPi LXC)_
_(Check their [website][website-helper-scripts] if this has changed and we haven't had the time to update it here yet, it's located under: Operating-Systems > NextcloudPi LXC)_
Thenk you [tteck][tteck-profile] :heart: for making the helper script & letting us use this for Proxmox installations :pray:
Thank you to the [community-scripts][community-scripts-profile] organisation :heart: for making the helper script & letting us use this for Proxmox installations :pray:
You can find his GitHub repository with his helper scripts [here][gh-helper-scripts-repo].
You can find the GitHub repository with the helper scripts here: [here][gh-helper-scripts-repo].
## How to build
@ -280,15 +294,15 @@ You can find us on the [Forum][nc-forum], [Telegram][chat-telegram] or [Matrix][
[nc-badge]: https://img.shields.io/badge/Nextcloud-0082C9?style=for-the-badge&logo=Nextcloud&logoColor=white
<!-- TTECK -->
<!-- COMMUNITY-SCRIPTS -->
[tteck-profile]: https://github.com/tteck
[community-scripts-profile]: https://github.com/community-scripts/
[gh-helper-scripts-repo]: https://github.com/tteck/Proxmox
[gh-helper-scripts-repo]: https://github.com/community-scripts/ProxmoxVE
[website-helper-scripts]: https://tteck.github.io/Proxmox/
[website-helper-scripts]: https://community-scripts.github.io/ProxmoxVE/
[ncp-proxmox-install-script-v5]: https://github.com/tteck/Proxmox/blob/main/install/nextcloudpi-v5-install.sh
[ncp-proxmox-install-script-v5]: https://github.com/community-scripts/ProxmoxVE/blob/main/install/nextcloudpi-install.sh
<!-- IMAGES -->

View File

@ -8,7 +8,10 @@ source /usr/local/etc/library.sh # sets NCLATESTVER
CURRENT="$(nc_version)"
NEXT_VERSION="$(determine_nc_update_version "${CURRENT}" "${NCLATESTVER?}")"
[[ -n "$NEXT_VERSION" ]] || exit 0
if [[ -z "$NEXT_VERSION" ]] || [[ "$NEXT_VERSION" == "${CURRENT}" ]]
then
exit 0
fi
NOTIFIED=/var/run/.nc-version-notified

View File

@ -82,5 +82,13 @@ EOF
cat /usr/local/etc/instance.cfg
}
systemctl is-enabled -q nextcloud-ai-worker@1.service || {
max="$(nproc || echo '2')"
max="$((max-1))"
for i in $(seq 1 "$max")
do
systemctl enable --now "nextcloud-ai-worker@${i}.service"
done
}
exit 0

View File

@ -26,19 +26,19 @@ VER="$1"
connect_to_nc_update() {
tail -n 100 -f "/var/log/ncp-update-nc.log" &
tail_pid=$!
trap "kill '$tail_pid'" EXIT
while [[ "$(systemctl is-active ncp-update-nc ||:)" =~ ^(active|activating|deactivating)$ ]]
do
sleep 3
done
kill "$tail_pid"
if [[ "$(systemctl is-active ncp-update-nc ||:)" == "inactive" ]]
then
echo "Nextcloud update finished successfully."
return 0
elif [[ "$(systemctl is-active ncp-update-nc ||:)" == "failed" ]]
then
echo "Nextcloud update failed."
echo "Nextcloud update failed (or was installed already)."
return 1
else
echo "Nextcloud update was not found or failed (unexpected status: '$(systemctl is-active ncp-update-nc ||:)')"
@ -52,15 +52,17 @@ then
exit $?
fi
systemctl reset-failed ncp-encrypt ||:
systemd-run -u 'ncp-update-nc' bash -c "DBG='${DBG:-}' /usr/local/bin/ncp-update-nc.d/update-nc.sh '${VER}' |& tee /var/log/ncp-update-nc.log"
sleep 5
systemctl reset-failed ncp-update-nc 2>/dev/null ||:
systemd-run -u 'ncp-update-nc' --service-type=oneshot --no-block -p TimeoutStartSec="24h" -p TimeoutStopSec="1h" \
bash -c "set -o pipefail; DBG='${DBG:-}' /usr/local/bin/ncp-update-nc.d/update-nc.sh '${VER}' |& tee /var/log/ncp-update-nc.log"
sleep 1
if ! [[ "$(systemctl is-active ncp-update-nc ||:)" =~ ^(active|inactive|activating|deactivating)$ ]]
then
echo "Failed to start ncp-update-nc"
[[ -f /var/log/ncp-update-nc.log ]] && cat /var/log/ncp-update-nc.log
systemctl status --no-pager ncp-update-nc ||:
exit 1
fi
connect_to_nc_update

View File

@ -24,14 +24,14 @@ ncc status &>/dev/null || { [[ "$DBG" == x ]] && ncc status; echo "Next
CURRENT="$(nc_version)"
if [[ "$VER" == "0" ]] || [[ "$VER" == "" ]]
then
REQUESTED_VERSION="${NCLATESTVER?}"
REQUESTED_VERSION="latest"
else
REQUESTED_VERSION="$VER"
fi
TARGET_VERSION="$(determine_nc_update_version "${CURRENT?}" "${NCLATESTVER}" "${REQUESTED_VERSION}")"
[[ "$TARGET_VERSION" == "$CURRENT" ]] && {
echo "Nextcloud version ${CURRENT} is already installed. Nothing to do."
exit 0
exit 1
}
[[ -n "$TARGET_VERSION" ]] || {
echo "Could not find a valid upgrade path from '${CURRENT}' to '${TARGET_VERSION}'. Nothing to update."
@ -57,10 +57,17 @@ grep -qP "\d+\.\d+\.\d+" <<<"$CURRENT" || { echo "Malformed version $CURRENT"; e
grep -qP "\d+\.\d+\.\d+" <<<"$TARGET_VERSION" || { echo "Malformed version $TARGET_VERSION" ; exit 1; }
echo "Current Nextcloud version $CURRENT"
echo "Available Nextcloud version $TARGET_VERSION"
if [[ "$TARGET_VERSION" != "$REQUESTED_VERSION" ]]
echo "Requested Nextcloud version $REQUESTED_VERSION"
echo "Selected Nextcloud version $TARGET_VERSION"
if [[ "$REQUESTED_VERSION" == "latest" ]]
then
echo "INFO: You have requested an update to '${REQUESTED_VERSION}', but a direct update to '${REQUESTED_VERSION}' cannot be performed, so the latest available version that can be updated to has been selected automatically."
echo "INFO: You have requested an update to the latest available version that can be performed directly, which is '${TARGET_VERSION}'. Updates can only performed to the next major version (or the latest minor version of the current major version). If you run ncp-update-nc again after this update completes, a new version might be available."
sleep 3
elif [[ "$TARGET_VERSION" != "$REQUESTED_VERSION" ]]
then
echo "INFO: You have requested an update to '${REQUESTED_VERSION}', but a direct update to '${REQUESTED_VERSION}' cannot be performed, so the latest available version that can be updated to (${TARGET_VERSION}) has been selected automatically."
sleep 3
fi
# make sure that cron.php is not running and there are no pending jobs
@ -135,11 +142,12 @@ cp nextcloud-old/config/config.php nextcloud/config/
####################
cp -raT nextcloud-old/themes/ nextcloud/themes/
# copy old NCP apps
# copy old NC apps
####################
for app in nextcloudpi previewgenerator; do
if [[ -d nextcloud-old/apps/"${app}" ]]; then
cp -r -L nextcloud-old/apps/"${app}" /var/www/nextcloud/apps/
for app in nextcloud-old/apps/*; do
if ! [[ -d /var/www/nextcloud/apps/"$(basename "$app")" ]]
then
cp -r -L "${app}" /var/www/nextcloud/apps/
fi
done
@ -188,7 +196,12 @@ $ncc | grep -q db:add-missing-indices && $ncc db:add-missing-indices -n
$ncc | grep -q db:add-missing-columns && $ncc db:add-missing-columns -n
$ncc | grep -q db:add-missing-primary-keys && $ncc db:add-missing-primary-keys -n
$ncc | grep -q db:convert-filecache-bigint && $ncc db:convert-filecache-bigint -n
$ncc | grep -q db:convert-mysql-charset && $ncc db:convert-mysql-charset -n
$ncc maintenance:repair --help | grep -q -e '--include-expensive' && $ncc maintenance:repair --include-expensive
if $ncc app_api:daemon:list | grep 'No registered daemon configs.' > /dev/null 2>&1
then
$ncc app:disable app_api
fi
# use the correct version for custom apps
NCVER="$(nc_version)"

View File

@ -103,7 +103,7 @@ configure()
cd /var/www/nextcloud
[[ "$BUILD_MODE" == 1 ]] || save_maintenance_mode
echo "moving data directory from ${SRCDIR} to ${BASEDIR}..."
echo "moving data directory from ${SRCDIR} to ${DATADIR}..."
# use subvolumes, if BTRFS
[[ "$(stat -fc%T "${BASEDIR}")" == "btrfs" ]] && ! is_docker && {
@ -135,7 +135,7 @@ configure()
create_tmp_upload_dir
ncc config:system:set tempdirectory --value "$DATADIR/tmp" \
|| sed -i "s|'tempdirectory' =>.*|'tempdirectory' => '${DATADIR}/tmp',|" "${NCDIR?}"/config/config.php
sed -i "s|^;\?upload_tmp_dir =.*$|uploadtmp_dir = ${DATADIR}/tmp|" /etc/php/"${PHPVER?}"/cli/php.ini
sed -i "s|^;\?upload_tmp_dir =.*$|upload_tmp_dir = ${DATADIR}/tmp|" /etc/php/"${PHPVER?}"/cli/php.ini
sed -i "s|^;\?upload_tmp_dir =.*$|upload_tmp_dir = ${DATADIR}/tmp|" /etc/php/"${PHPVER}"/fpm/php.ini
sed -i "s|^;\?sys_temp_dir =.*$|sys_temp_dir = ${DATADIR}/tmp|" /etc/php/"${PHPVER}"/fpm/php.ini

View File

@ -53,10 +53,29 @@ EOF
## INITIALIZE NEXTCLOUD
# make sure redis is running first
REDISPASS="$( grep "^requirepass" /etc/redis/redis.conf | cut -f2 -d' ' )"
if ! pgrep -c redis-server &>/dev/null; then
mkdir -p /var/run/redis
mkdir -p /var/log/
chown redis /var/run/redis
sudo -u redis redis-server /etc/redis/redis.conf &
sudo -u redis redis-server /etc/redis/redis.conf > /var/log/redis.log 2>&1 &
redis_pid=$!
for i in {1..5}
do
if redis-cli -s //var/run/redis/redis.sock -a "$REDISPASS" ping | grep PONG
then
break
else
if [[ $i -ge 5 ]]
then
echo "FAILED TO START REDIS"
cat /var/log/redis.log /var/log/redis/redis-server.log
return 1
fi
fi
sleep 3
done
fi
while :; do
@ -152,6 +171,9 @@ EOF
# we handle this ourselves
ncc app:disable updatenotification
# Not supported in Nextcloudpi without manual setup
ncc app:disable app_api
# ncp-previewgenerator
local ncver
ncver="$(ncc status 2>/dev/null | grep "version:" | awk '{ print $3 }')"
@ -189,6 +211,7 @@ EOF
# TODO temporary workaround for https://github.com/nextcloud/server/pull/13358
ncc -n db:convert-filecache-bigint
ncc db:add-missing-indices
ncc maintenance:repair --include-expensive
# Default trusted domain (only from ncp-config)
test -f /usr/local/bin/nextcloud-domain.sh && {

View File

@ -82,14 +82,14 @@ configure()
[[ "$CONF_VALUE" == "$(cat "$CONF")" ]] || service mariadb restart
# RESTART PHP
[[ "$require_fpm_restart" == "true" ]] && {
[[ "$require_fpm_restart" != "true" ]] || {
bash -c "sleep 3; source /usr/local/etc/library.sh; clear_opcache; service php${PHPVER}-fpm restart" &>/dev/null &
}
# redis max memory
local CONF=/etc/redis/redis.conf
local CURRENT_REDIS_MEM="$( grep "^maxmemory" "$CONF" | awk '{ print $2 }' )"
[[ "$REDISMEM" != "$CURRENT_REDIS_MEM" ]] && {
[[ "$REDISMEM" == "$CURRENT_REDIS_MEM" ]] || {
sed -i "s|^maxmemory .*|maxmemory $REDISMEM|" "$CONF"
chown redis:redis "$CONF"
service redis-server restart

View File

@ -60,6 +60,10 @@ install()
sed -i 's|# rename-command CONFIG ""|rename-command CONFIG ""|' $REDIS_CONF
sed -i "s|^port.*|port 0|" $REDIS_CONF
echo "maxmemory $REDIS_MEM" >> $REDIS_CONF
if [[ "$ARMBIAN_BUILD" == "yes" ]]
then
echo "ignore-warnings ARM64-COW-BUG" >> $REDIS_CONF
fi
echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf
if is_lxc; then
@ -79,6 +83,25 @@ EOF
update-rc.d redis-server enable
clear_opcache
# NC service workers
cat > /etc/systemd/system/nextcloud-ai-worker@.service <<'EOF'
[Unit]
Description=Nextcloud AI worker %i
After=network.target
[Service]
ExecStart=php occ background-job:worker -t 60 'OC\\TaskProcessing\\SynchronousBackgroundJob'
Restart=always
StartLimitInterval=60
StartLimitBurst=10
WorkingDirectory=/var/www/nextcloud
User=www-data
[Install]
WantedBy=multi-user.target
EOF
# service to randomize passwords on first boot
mkdir -p /usr/lib/systemd/system
cat > /usr/lib/systemd/system/nc-provisioning.service <<'EOF'

View File

@ -23,8 +23,8 @@ configure()
grep -qP "^\d+$" <<<"$RUNTIME" || { echo "Invalid RUNTIME value $RUNTIME"; return 1; }
RUNTIME=$((RUNTIME*60))
echo "0 2 * * * root /usr/local/bin/nc-previews" > /etc/cron.d/ncp-previews-auto
chmod 644 /etc/cron.d/ncp-previews-auto
echo "0 2 * * * root /usr/local/bin/nc-previews" > /etc/cron.d/nc-previews-auto
chmod 644 /etc/cron.d/nc-previews-auto
cat > /usr/local/bin/nc-previews <<EOF
#!/bin/bash

View File

@ -14,30 +14,39 @@ install()
set -x
apt-get update
apt-get install --no-install-recommends -y dnsmasq
sleep 10
rc=0
service dnsmasq status > /dev/null 2>&1 || rc=$?
[[ $rc -eq 3 ]] && ! [[ "$INIT_SYSTEM" =~ ^("chroot"|"unknown")$ ]] && command -v systemd-resolve > /dev/null || {
if [[ $rc -eq 3 ]] && ! [[ "$INIT_SYSTEM" =~ ^("chroot"|"unknown")$ ]]
then
echo "Applying workaround for dnsmasq bug (compare issue #1446)"
mkdir -p /etc/systemd/resolved.conf.d
if systemctl status systemd-resolved
then
cat <<EOF > /etc/systemd/resolved.conf.d/nostublistener.conf
cat <<EOF > /etc/systemd/resolved.conf.d/nostublistener.conf
[Resolve]
DNSStubListener=no
EOF
[[ "$INIT_SYSTEM" != "systemd" ]] || systemctl restart systemd-resolved
else
elif systemctl status resolvconf
then
systemctl stop resolvconf
systemctl start dnsmasq
systemctl status dnsmasq
else
echo "dnsmasq failed to start and no workaround could be found. This means, the installer failed."
false
fi
# service systemd-resolved stop || true
systemctl start dnsmasq
systemctl status dnsmasq
}
fi
service dnsmasq stop
[[ "$INIT_SYSTEM" != "systemd" ]] || systemctl start systemd-resolved || systemctl start resolvconf
if [[ "$INIT_SYSTEM" == "systemd" ]] && systemctl list-unit-files resolvconf.service
then
systemctl start resolvconf
fi
update-rc.d dnsmasq disable || rm /etc/systemd/system/multi-user.target.wants/dnsmasq.service
return 0

View File

@ -58,7 +58,7 @@ configure()
export PASSWORD
# Just mount already encrypted data
if [[ -f "${encdir?}"/gocryptfs.conf ]]; then
systemctl reset-failed ncp-encrypt ||:
systemctl reset-failed ncp-encrypt 2>/dev/null ||:
systemd-run -u ncp-encrypt -E PASSWORD bash -c "gocryptfs -fg -allow_other -q '${encdir}' '${datadir}' <<<\"\${PASSWORD}\" 2>&1 | sed /^Switch/d |& tee /var/log/ncp-encrypt.log"
# switch to the regular virtual hosts after we decrypt, so we can access NC and ncp-web
@ -88,7 +88,7 @@ configure()
mv "${datadir?}" "${tmpdir?}"
mkdir "${datadir}"
systemctl reset-failed ncp-encrypt ||:
systemctl reset-failed ncp-encrypt 2>/dev/null ||:
systemd-run -u ncp-encrypt -E PASSWORD bash -c "gocryptfs -fg -allow_other -q '${encdir}' '${datadir}' <<<\"\${PASSWORD}\" 2>&1 | sed /^Switch/d |& tee /var/log/ncp-encrypt.log"
maxtries=5

View File

@ -23,7 +23,7 @@ configure()
source /usr/local/etc/library.sh
echo -e "[ncp-update-nc]" >> /var/log/ncp.log
/usr/local/bin/ncp-update-nc "$NCLATESTVER" 2>&1 | tee -a /var/log/ncp.log
/usr/local/bin/ncp-update-nc "latest" 2>&1 | tee -a /var/log/ncp.log
if [[ \${PIPESTATUS[0]} -eq 0 ]]; then

View File

@ -11,9 +11,12 @@ done
# wicd service finishes before completing DHCP
while :; do
local_ip="$(get_ip)"
pub_ip="$(curl -m4 icanhazip.com 2>/dev/null)"
[[ "$pub_ip" != "" ]] && ncc config:system:set trusted_domains 11 --value="$pub_ip"
pub_ipv4="$(curl -4 -m4 icanhazip.com 2>/dev/null)"
pub_ipv6="$(curl -6 -m4 icanhazip.com 2>/dev/null)"
[[ -z "$pub_ipv4" ]] || ncc config:system:set trusted_domains 11 --value="$pub_ipv4"
[[ -z "$pub_ipv6" ]] || ncc config:system:set trusted_domains 12 --value="[$pub_ipv6]"
[[ "$local_ip" != "" ]] && break
sleep 3

View File

@ -33,7 +33,11 @@ echo -e "\nInstalling NextCloudPi"
hostname -F /etc/hostname # fix 'sudo resolve host' errors
CODE_DIR="$(pwd)" DBG=x bash install.sh
ARMBIAN_BUILD=yes CODE_DIR="$(pwd)" DBG=x bash install.sh || {
echo "SOMETHING WENT WRONG, EXITING..."
exit 1
}
sed -i 's/^ignore-warnings ARM64-COW-BUG//' /etc/redis/redis.conf
echo -e "\nPostinstall..."
run_app_unsafe post-inst.sh

View File

@ -1 +1 @@
v24.08
v25.08

View File

@ -1,5 +1,54 @@
# NextcloudPi Changelog
## [v1.56.0](https://github.com/nextcloud/nextcloudpi/tree/v1.56.0) (2025-11-19) Nextcloud 32 and fixes
### Changes
- Support for Nextcloud 32
- Add service workers for Nextcloud's AI functionality
### Fixes
- Fix broken IPv6 addresses added to trusted IPs ([#2060](https://github.com/nextcloud/nextcloudpi/issues/2060), thanks @lukaszgoworko)
- Fix unnecessary reinstallation of notify_push app during updates ([#2069](https://github.com/nextcloud/nextcloudpi/issues/2069), thanks @lovenemesis)
## [v1.55.4](https://github.com/nextcloud/nextcloudpi/tree/v1.55.3) (2025-03-24) Nextcloud 31 and fixes
### Changes
- Support for Nextcloud 31
### Fixes
- Fix wrongly configured temporary directory for uploads (fixes [#1750](https://github.com/nextcloud/nextcloudpi/issues/1750), [#1857](https://github.com/nextcloud/nextcloudpi/issues/1857)), thanks [@joshtrichards](https://github.com/joshtrichards)
- Fix regression breaking php upgrades (see [#2026](https://github.com/nextcloud/nextcloudpi/pull/2026)), thanks [@twojstaryzdomu](https://github.com/twojstaryzdomu)
## [v1.55.3](https://github.com/nextcloud/nextcloudpi/tree/v1.55.3) (2024-11-08) Nextcloud 30 and fixes
### Changes
- Support for Nextcloud 30 ([#1957](https://github.com/nextcloud/nextcloudpi/issues/1957))
### Fixes
- Fix resetting failed state of previous ncp-update-nc job ([#1992](https://github.com/nextcloud/nextcloudpi/issues/1992))
- Fix installer on systems using resolvconf as DNS manager ([#1926](](https://github.com/nextcloud/nextcloudpi/issues/1926))
- Fix typo that prevents ncp-previews from being disabled (Thanks @m-breitbach)
## [v1.55.2](https://github.com/nextcloud/nextcloudpi/tree/v1.55.2) (2024-09-24) Hotfix release
### Fixes
- Increase the maximum package size for mysqldump to 256M (fixes [#1979](https://github.com/nextcloud/nextcloudpi/issues/1979))
- Fix repeated erroneous update success messages for auto updates (fixes [#1979](https://github.com/nextcloud/nextcloudpi/issues/1979), [#1981](https://github.com/nextcloud/nextcloudpi/issues/1981))
## [v1.55.1](https://github.com/nextcloud/nextcloudpi/tree/v1.55.1) (2024-09-08) Hotfix release
### Fixes
- Prevent attempted downgrade in ncp-update-nc
## [v1.55.0](https://github.com/nextcloud/nextcloudpi/tree/v1.55.0) (2024-09-07) Support for PHP 8.3 and Nextcloud 29
### Changes

View File

@ -22,7 +22,7 @@ export DB_PREFIX="$(php -r 'include("/var/www/nextcloud/config/config.php"); ech
export SYSTEMD_PAGER=
[[ -f "$NCPCFG" ]] || export NCPCFG=/usr/local/etc/ncp.cfg
[[ -f "$NCPCFG" ]] || { echo "$NCPCFG not found" >2; exit 1; }
[[ -f "$NCPCFG" ]] || { echo "$NCPCFG not found" >&2; exit 1; }
if [[ "$(ps -p 1 --no-headers -o "%c")" == "systemd" ]] && ! [[ -d "/run/systemd/system" ]]
then
@ -531,10 +531,17 @@ function determine_nc_update_version() {
supported_maj="${supported%%.*}"
# If valid version is requested -> direct update, don't consider anything else
if [[ "$requested" =~ ^[0-9.]*$ ]] && [[ "$requested_maj" -le "$((current_maj + 1))" ]]
if [[ "$requested" =~ ^[0-9]*.[0-9]*.[0-9]*$ ]]
then
echo "$requested"
return 0
if ! is_more_recent_than "${requested}" "${current}"
then
echo "$current"
return 0
elif [[ "$requested_maj" -le "$((current_maj + 1))" ]]
then
echo "$requested"
return 0
fi
fi
versions="$(curl -q -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/nextcloud/server/releases?per_page=100 | jq -r '.[].tag_name' | grep -v -e 'rc.$' -e 'beta.$' | sort -V)"

76
etc/library.test Normal file
View File

@ -0,0 +1,76 @@
#!/bin/bash
set -ex
fail() {
echo "$@"
exit 1
}
#shellcheck source=./library.sh
. "$(dirname "$0")/library.sh" ||:
case=1
current=27.0.1
supported=27.0.8
requested=""
expected=27.1.11
actual="$(determine_nc_update_version "$current" "$supported" "$requested")"
[[ "$expected" == "$actual" ]] || fail "C$case: unexpected nc target version: $actual (expected: $expected)"
case=2
# TODO: Set to 26.0.1
current=26.0.13
supported=27.0.8
requested=""
expected=27.1.11
actual="$(determine_nc_update_version "$current" "$supported" "$requested")"
[[ "$expected" == "$actual" ]] || fail "C$case: unexpected nc target version: $actual (expected: $expected)"
case=3
current=26.0.1
supported=27.0.8
requested="27.1.3"
expected=27.1.3
actual="$(determine_nc_update_version "$current" "$supported" "$requested")"
[[ "$expected" == "$actual" ]] || fail "C$case: unexpected nc target version: $actual (expected: $expected)"
case=4
current=29.0.5
supported=27.0.8
requested=""
expected=29.0.6
actual="$(determine_nc_update_version "$current" "$supported" "$requested")"
[[ "$expected" == "$actual" ]] || fail "C$case: unexpected nc target version: $actual (expected: $expected)"
case=5
current=29.0.5
supported=27.0.8
requested="27.0.8"
expected="29.0.5"
actual="$(determine_nc_update_version "$current" "$supported" "$requested")"
[[ "$expected" == "$actual" ]] || fail "C$case: unexpected nc target version: $actual (expected: $expected)"

View File

@ -9,7 +9,7 @@
{
"id": "VER",
"name": "Version",
"value": "29.0.4"
"value": "32.0.1"
},
{
"id": "MAXFILESIZE",

View File

@ -19,6 +19,9 @@ innodb_file_per_table=1
innodb_file_format=barracuda
max_allowed_packet=256M
[mysqldump]
max_allowed_packet = 256M
[server]
# innodb settings
skip-name-resolve

View File

@ -1,5 +1,5 @@
{
"nextcloud_version": "29.0.4",
"nextcloud_version": "32.0.1",
"php_version": "8.3",
"release": "bookworm"
}

View File

@ -74,11 +74,6 @@ cp etc/ncp.cfg /usr/local/etc/
cp -r etc/ncp-templates /usr/local/etc/
install_app lamp.sh
if [[ -d "/run/systemd/system" ]] && is_lxc
then
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y systemd-resolved
systemctl enable systemd-resolved
fi
install_app bin/ncp/CONFIG/nc-nextcloud.sh
run_app_unsafe bin/ncp/CONFIG/nc-nextcloud.sh
rm /usr/local/etc/ncp-config.d/nc-nextcloud.cfg # armbian overlay is ro

View File

@ -12,7 +12,7 @@
<category>tools</category>
<bugs>https://github.com/nextcloud/nextcloudpi/issues</bugs>
<dependencies>
<nextcloud min-version="22" max-version="29"/>
<nextcloud min-version="22" max-version="32"/>
</dependencies>
<navigations>
<navigation>

View File

@ -25,7 +25,7 @@ The first time you install this app, before using a cron job, you properly want
</types>
<dependencies>
<php min-version="7.2"/>
<nextcloud min-version="20" max-version="29" />
<nextcloud min-version="20" max-version="32" />
</dependencies>
<commands>

View File

@ -15,6 +15,7 @@ configure()
# stop services
pkill -x redis-server
[[ -f /var/log/redis.log ]] && rm /var/log/redis.log
[[ -f /run/mysqld/mysqld.pid ]] && mysqladmin -u root shutdown
[[ -f /run/crond.pid ]] && kill "$(cat /run/crond.pid)"
pkill -f php-fpm

View File

@ -1,10 +1,100 @@
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
92
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99

100
staged_rollouts/v1.55.1.txt Normal file
View File

@ -0,0 +1,100 @@
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99

100
staged_rollouts/v1.55.2.txt Normal file
View File

@ -0,0 +1,100 @@
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99

View File

@ -23,6 +23,7 @@ import signal
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.firefox.service import Service
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.firefox.options import Options
@ -90,12 +91,15 @@ def signal_handler(sig, frame):
sys.exit(0)
def test_activation(IP, nc_port, admin_port, options, wait_timeout=120):
def test_activation(IP, nc_port, admin_port, options, webdriver_exec_path=None, wait_timeout=120):
""" Activation process checks"""
driver_kwargs={}
if webdriver_exec_path is not None:
driver_kwargs['service'] = Service(webdriver_exec_path)
# activation page
test = Test()
driver = webdriver.Firefox(options=options)
driver = webdriver.Firefox(options=options, **driver_kwargs)
driver.implicitly_wait(5)
test.new("activation opens")
driver.get(f"https://{IP}:{nc_port}")
@ -137,7 +141,9 @@ def test_activation(IP, nc_port, admin_port, options, wait_timeout=120):
# ncp-web
test.new("ncp-web")
driver = webdriver.Firefox(options=options)
if webdriver_exec_path is not None:
driver_kwargs['service'] = Service(webdriver_exec_path)
driver = webdriver.Firefox(options=options, **driver_kwargs)
driver.implicitly_wait(30)
try:
driver.get(f"https://ncp:{urllib.parse.quote_plus(ncp_pass)}@{IP}:{admin_port}")
@ -164,6 +170,13 @@ if __name__ == "__main__":
arg_timeout = 120
options = webdriver.FirefoxOptions()
webdriver_exec_path = None
if 'GECKODRIVER_PATH' in os.environ:
print(f"Setting geckodriver from env ({os.environ['GECKODRIVER_PATH']})")
webdriver_exec_path = os.environ['GECKODRIVER_PATH']
if 'FF_BINARY_PATH' in os.environ:
print(f"Setting firefox binary from env ({os.environ['FF_BINARY_PATH']}")
options.binary_location = os.environ['FF_BINARY_PATH']
for opt, arg in opts:
if opt in ('-h', '--help'):
usage()
@ -184,7 +197,7 @@ if __name__ == "__main__":
print("Activation tests " + tc.yellow + IP + tc.normal)
print("---------------------------")
test_activation(IP, nc_port, admin_port, options, arg_timeout)
test_activation(IP, nc_port, admin_port, options, webdriver_exec_path, arg_timeout)
# License
#

View File

@ -23,6 +23,7 @@ from pathlib import Path
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.firefox.service import Service
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.support.ui import WebDriverWait
@ -179,62 +180,12 @@ def test_nextcloud(IP: str, nc_port: str, driver: WebDriver, skip_release_check:
test.report("password", "Wrong password" not in driver.page_source, msg="Failed to login with provided password")
test.new("settings config")
wait = WebDriverWait(driver, 60 * wait_multiplier)
wait = WebDriverWait(driver, 60 * wait_multiplier * 5)
try:
wait.until(VisibilityOfElementLocatedByAnyLocator([(By.CSS_SELECTOR, "#security-warning-state-ok"),
(By.CSS_SELECTOR, "#security-warning-state-warning"),
(By.CSS_SELECTOR, "#security-warning-state-error"),
(By.CSS_SELECTOR, "#security-warning-state-failure")]))
element_ok = driver.find_element(By.ID, "security-warning-state-ok")
element_warn = driver.find_element(By.ID, "security-warning-state-warning")
if element_warn.is_displayed():
warnings = driver.find_elements(By.CSS_SELECTOR, "#postsetupchecks > .warnings > li")
for warning in warnings:
if re.match(r'.*Server has no maintenance window start time configured.*', warning.text):
continue
elif re.match(r'.*Could not check for JavaScript support.*', warning.text):
continue
# TODO: Solve redis error logs at the source
elif re.match(r'.*\d+ errors? in the logs since.*', warning.text):
continue
else:
raise ConfigTestFailure(f"WARN: {warning.text}")
if driver.find_element(By.CSS_SELECTOR, "#postsetupchecks > .errors").is_displayed():
try:
first_error = driver.find_element(By.CSS_SELECTOR, "#postsetupchecks > .errors > li")
except NoSuchElementException:
first_error = None
raise ConfigTestFailure(f"ERROR: {first_error.text if first_error is not None else 'unexpected error'}")
infos = driver.find_elements(By.CSS_SELECTOR, "#postsetupchecks > .info > li")
for info in infos:
if re.match(r'.*Your installation has no default phone region set.*', info.text) \
or re.match(r'The PHP module "imagick" is not enabled', info.text):
continue
else:
print(f'INFO: {info.text}')
php_modules = info.find_elements(By.CSS_SELECTOR, "li")
if len(php_modules) != 1:
raise ConfigTestFailure(f"Could not find the list of php modules within the info message "
f"'{infos[0].text}'")
if php_modules[0].text != "imagick":
raise ConfigTestFailure("The list of php_modules does not equal [imagick]")
elif not element_ok.is_displayed():
errors = driver.find_elements(By.CSS_SELECTOR, "#postsetupchecks > .errors > li")
for error in errors:
print(f'ERROR: {error.text}')
raise ConfigTestFailure("Neither the warnings nor the ok status is displayed "
"(so there are probably errors or the page is broken)")
test.check(True)
except Exception as e:
test.check(e)
wait.until(VisibilityOfElementLocatedByAnyLocator([(By.CSS_SELECTOR, "#security-warning.settings-section")]))
settings_config_check(wait, test)
except TimeoutException:
settings_config_check_pre32(wait, test)
close_first_run_wizard(driver, wait_multiplier)
@ -315,6 +266,98 @@ def test_nextcloud(IP: str, nc_port: str, driver: WebDriver, skip_release_check:
except Exception as e:
test.check(e)
def settings_config_check_warnings(warnings):
for warning in warnings:
if re.match(r'.*Server has no maintenance window start time configured.*', warning.text) \
or re.match(r'.*Server has no maintenance window start time configured.*', warning.text):
continue
elif re.match(r'.*Could not check for JavaScript support.*', warning.text):
continue
# TODO: Solve redis error logs at the source
elif re.match(r'.*\d+ errors? in the logs since.*', warning.text):
continue
else:
raise ConfigTestFailure(f"WARN: {warning.text}")
def settings_config_check_infos(infos):
for info in infos:
if re.match(r'.*Your installation has no default phone region set.*', info.text) \
or re.match(r'The PHP module "imagick" is not enabled', info.text) \
or re.match(r'The PHP module "imagick" in this instance has no SVG support.*', info.text) \
or re.match(r'\d+ warnings? in the logs since.*', info.text):
continue
else:
print(f'INFO: {info.text}')
php_modules = info.find_elements(By.CSS_SELECTOR, "li")
if len(php_modules) != 1:
raise ConfigTestFailure(f"Could not find the list of php modules within the info message "
f"'{infos[0].text}'")
if php_modules[0].text != "imagick":
raise ConfigTestFailure("The list of php_modules does not equal [imagick]")
def settings_config_check_errors(errors):
if len(errors) == 0:
return
for error in errors:
print(f'ERROR: {error.text}')
raise ConfigTestFailure("Neither the warnings nor the ok status is displayed "
"(so there are probably errors or the page is broken)")
def settings_config_check(wait, test):
try:
wait.until_not(VisibilityOfElementLocatedByAnyLocator([(By.CSS_SELECTOR, "#security-warning .loading-icon")]))
warnings = driver.find_elements(By.CSS_SELECTOR, "#security-warning li.settings-setup-checks-item--warning .settings-setup-checks-item__description")
settings_config_check_warnings(warnings)
infos = driver.find_elements(By.CSS_SELECTOR, "#security-warning li.settings-setup-checks-item--info .settings-setup-checks-item__description")
settings_config_check_infos(infos)
errors = driver.find_elements(By.CSS_SELECTOR, "#security-warning li.settings-setup-checks-item--error .settings-setup-checks-item__description")
settings_config_check_errors(errors)
test.check(True)
except Exception as e:
print(driver.find_element(By.CSS_SELECTOR, "#security-warning").get_attribute("innerHTML"))
test.check(e)
def settings_config_check_pre32(wait, test):
try:
wait.until(VisibilityOfElementLocatedByAnyLocator([(By.CSS_SELECTOR, "#security-warning-state-ok"),
(By.CSS_SELECTOR, "#security-warning-state-warning"),
(By.CSS_SELECTOR, "#security-warning-state-error"),
(By.CSS_SELECTOR, "#security-warning-state-failure")]))
element_ok = driver.find_element(By.ID, "security-warning-state-ok")
element_warn = driver.find_element(By.ID, "security-warning-state-warning")
if element_warn.is_displayed():
warnings = driver.find_elements(By.CSS_SELECTOR, "#postsetupchecks > .warnings > li")
settings_config_check_warnings(warnings)
if driver.find_element(By.CSS_SELECTOR, "#postsetupchecks > .errors").is_displayed():
try:
first_error = driver.find_element(By.CSS_SELECTOR, "#postsetupchecks > .errors > li")
except NoSuchElementException:
first_error = None
raise ConfigTestFailure(f"ERROR: {first_error.text if first_error is not None else 'unexpected error'}")
infos = driver.find_elements(By.CSS_SELECTOR, "#postsetupchecks > .info > li")
settings_config_check_infos(infos)
elif not element_ok.is_displayed():
errors = driver.find_elements(By.CSS_SELECTOR, "#postsetupchecks > .errors > li")
settings_config_check_errors(errors)
test.check(True)
except Exception as e:
print(driver.find_element(By.CSS_SELECTOR, "#security-warning").get_attribute("innerHTML"))
test.check(e)
if __name__ == "__main__":
signal.signal(signal.SIGINT, signal_handler)
@ -328,6 +371,13 @@ if __name__ == "__main__":
skip_release_check = False
options = webdriver.FirefoxOptions()
webdriver_exec_path = None
if 'GECKODRIVER_PATH' in os.environ:
print(f"Setting geckodriver from env ({os.environ['GECKODRIVER_PATH']})")
webdriver_exec_path = os.environ['GECKODRIVER_PATH']
if 'FF_BINARY_PATH' in os.environ:
print(f"Setting firefox binary from env ({os.environ['FF_BINARY_PATH']}")
options.binary_location = os.environ['FF_BINARY_PATH']
wait_multiplier = 1
for opt, arg in opts:
if opt in ('-h', '--help'):
@ -377,7 +427,10 @@ if __name__ == "__main__":
print("Nextcloud tests " + tc.yellow + IP + tc.normal)
print("---------------------------")
driver = webdriver.Firefox(options=options)
if webdriver_exec_path is None:
driver = webdriver.Firefox(options=options)
else:
driver = webdriver.Firefox(options=options, service=Service(webdriver_exec_path))
failed=False
try:
test_nextcloud(IP, nc_port, driver, skip_release_check, wait_multiplier)

View File

@ -1,2 +1,2 @@
robotframework
selenium
selenium>=3.0.0,<4.0.0

View File

@ -20,9 +20,13 @@ import sys
import getopt
import os
import signal
from subprocess import run, getstatusoutput, PIPE, CompletedProcess
from subprocess import run as sp_run, getstatusoutput, PIPE, CompletedProcess
from typing import Optional
def run(*args, **kwargs):
print("running command: " + " ".join(args[0]))
return sp_run(*args, **kwargs)
processes_must_be_running = [
'apache2',
'cron',
@ -252,6 +256,8 @@ def test_autoupdates():
if __name__ == "__main__":
sudo_prefix = ['sudo'] if os.environ.get('USE_SUDO', 'no') == 'yes' else []
signal.signal(signal.SIGINT, signal_handler)
# parse options
@ -290,23 +296,27 @@ if __name__ == "__main__":
# detect if we are running this in a NCP instance
try:
dockers_running = run(['docker', 'ps', '--format', '{{.Names}}'], stdout=PIPE).stdout.decode('utf-8')
dockers_running = run(sudo_prefix + ['docker', 'ps', '--format', '{{.Names}}'], stdout=PIPE).stdout.decode('utf-8')
except:
dockers_running = ''
lxc_command = ['lxc'] if 'USE_INCUS' not in os.environ or os.environ['USE_INCUS'] != 'yes' else ['incus']
lxc_command = sudo_prefix + ['lxc'] if os.environ.get('USE_INCUS', 'no') != 'yes' else ['incus']
try:
lxc_test = run(lxc_command + ['info'], stdout=PIPE, check=True)
if lxc_test.returncode != 0:
raise Exception(f"failed to execute {lxc_command} info")
except:
try:
lxc_test = run(['sudo'] + lxc_command + ['info'], stdout=PIPE, check='True')
lxc_command = ['sudo'] + lxc_command
except:
if os.environ.get('USE_SUDO', 'no') == 'yes':
lxc_command = None
lxc_running = False
else:
try:
lxc_test = run(['sudo'] + lxc_command + ['info'], stdout=PIPE, check='True')
lxc_command = ['sudo'] + lxc_command
except:
lxc_command = None
lxc_running = False
# detect if we are running this in a LXC instance
if lxc_command is not None:
@ -316,7 +326,7 @@ if __name__ == "__main__":
lxc_running = False
try:
systemd_container_running = run(['machinectl', 'show', 'ncp'], stdout=PIPE, check = True)
systemd_container_running = run(sudo_prefix + ['machinectl', 'show', 'ncp'], stdout=PIPE, check = True)
except:
systemd_container_running = False
@ -326,12 +336,12 @@ if __name__ == "__main__":
print(tc.brown + "* local NCP instance detected" + tc.normal)
if not is_lxc():
binaries_must_be_installed = binaries_must_be_installed + binaries_no_docker
pre_cmd = []
pre_cmd = sudo_prefix
# docker method
elif 'nextcloudpi' in dockers_running:
print( tc.brown + "* local NCP docker instance detected" + tc.normal)
pre_cmd = ['docker', 'exec']
pre_cmd = sudo_prefix + ['docker', 'exec']
if interactive:
pre_cmd.append('-ti')
pre_cmd.append('nextcloudpi')
@ -342,7 +352,7 @@ if __name__ == "__main__":
pre_cmd = lxc_command + ['exec', 'ncp', '--']
elif systemd_container_running:
pre_cmd = ['systemd-run', '--wait', '-P', '--machine=ncp']
pre_cmd = sudo_prefix + ['systemd-run', '--wait', '-P', '--machine=ncp']
# SSH method
else:
@ -350,20 +360,20 @@ if __name__ == "__main__":
print( tc.brown + "* No local NCP instance detected, trying SSH with " +
tc.yellow + ssh_cmd + tc.normal + "...")
binaries_must_be_installed = binaries_must_be_installed + binaries_no_docker
pre_cmd = ['ssh', '-o UserKnownHostsFile=/dev/null' , '-o PasswordAuthentication=no',
pre_cmd = sudo_prefix + ['ssh', '-o UserKnownHostsFile=/dev/null' , '-o PasswordAuthentication=no',
'-o StrictHostKeyChecking=no', '-o ConnectTimeout=10', ssh_cmd[4:]]
if not skip_ping:
at_char = ssh_cmd.index('@')
ip = ssh_cmd[at_char+1:]
ping_cmd = run(['ping', '-c1', '-w10', ip], stdout=PIPE, stderr=PIPE)
ping_cmd = run(sudo_prefix + ['ping', '-c1', '-w10', ip], stdout=PIPE, stderr=PIPE)
if ping_cmd.returncode != 0:
print(tc.red + "No connectivity to " + tc.yellow + ip + tc.normal)
#sys.exit(1)
ssh_test = run(pre_cmd + [':'], stdout=PIPE, stderr=PIPE)
if ssh_test.returncode != 0:
ssh_copy = run(['ssh-copy-id', ssh_cmd[4:]], stderr=PIPE)
ssh_copy = run(sudo_prefix + ['ssh-copy-id', ssh_cmd[4:]], stderr=PIPE)
if ssh_copy.returncode != 0:
print(tc.red + "SSH connection failed" + tc.normal)
sys.exit(1)

9
updates/1.55.2.sh Normal file
View File

@ -0,0 +1,9 @@
#!/bin/bash
set -e
source /usr/local/etc/library.sh
run_app nc-autoupdate-nc
install_template "mysql/91-ncp.cnf.sh" "/etc/mysql/mariadb.conf.d/91-ncp.cnf"
service mariadb reload

3
updates/1.55.3.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
! [ -f /etc/cron.d/ncp-previews-auto ] || mv /etc/cron.d/ncp-previews-auto /etc/cron.d/nc-previews-auto

8
updates/1.55.4.sh Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -eu -o pipefail
echo "Update DB row format ..."
mysql -u root -N nextcloud -e "SELECT CONCAT('ALTER TABLE \`', table_name, '\` row_format=DYNAMIC;') FROM information_schema.tables WHERE table_schema = 'nextcloud' AND engine = 'InnoDB' AND row_format != 'Dynamic';" | mysql -u root nextcloud
echo "Done."

31
updates/1.56.0.sh Normal file
View File

@ -0,0 +1,31 @@
#!/usr/bin/env bash
if ncc app_api:daemon:list | grep 'No registered daemon configs.' > /dev/null 2>&1
then
ncc app:disable app_api
fi
cat > /etc/systemd/system/nextcloud-ai-worker@.service <<'EOF'
[Unit]
Description=Nextcloud AI worker %i
After=network.target
[Service]
ExecStart=php occ background-job:worker -t 60 'OC\\TaskProcessing\\SynchronousBackgroundJob'
Restart=always
StartLimitInterval=60
StartLimitBurst=10
WorkingDirectory=/var/www/nextcloud
User=www-data
[Install]
WantedBy=multi-user.target
EOF
max="$(nproc || echo '2')"
max="$((max-1))"
for i in $(seq 1 "$max")
do
systemctl enable --now "nextcloud-ai-worker@${i}.service"
done
exit 0