From cc5c73abf4acf552c6f4e106874ad9e41f144c35 Mon Sep 17 00:00:00 2001 From: Lukasz Goworko Date: Thu, 16 Oct 2025 10:17:21 +0200 Subject: [PATCH 01/21] fix: Added IPv6 support with brackets to trusted domains Signed-off-by: Lukasz Goworko --- bin/nextcloud-domain.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/nextcloud-domain.sh b/bin/nextcloud-domain.sh index a8d0af1d..ffc9d86f 100644 --- a/bin/nextcloud-domain.sh +++ b/bin/nextcloud-domain.sh @@ -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)" + [[ "$pub_ipv4" != "" ]] && ncc config:system:set trusted_domains 11 --value="$pub_ipv4" + [[ "$pub_ipv6" != "" ]] && ncc config:system:set trusted_domains 12 --value="[$pub_ipv6]" + [[ "$local_ip" != "" ]] && break sleep 3 From c57218e6c92d48c97b8e7b819b664a70475ab816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sat, 18 Oct 2025 15:25:10 +0200 Subject: [PATCH 02/21] nextcloud-domain.sh: Minor syntax improvment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com> --- bin/nextcloud-domain.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/nextcloud-domain.sh b/bin/nextcloud-domain.sh index ffc9d86f..e6672995 100644 --- a/bin/nextcloud-domain.sh +++ b/bin/nextcloud-domain.sh @@ -14,7 +14,7 @@ while :; do pub_ipv4="$(curl -4 -m4 icanhazip.com 2>/dev/null)" pub_ipv6="$(curl -6 -m4 icanhazip.com 2>/dev/null)" - [[ "$pub_ipv4" != "" ]] && ncc config:system:set trusted_domains 11 --value="$pub_ipv4" + [[ -z "$pub_ipv4" ]] || ncc config:system:set trusted_domains 11 --value="$pub_ipv4" [[ "$pub_ipv6" != "" ]] && ncc config:system:set trusted_domains 12 --value="[$pub_ipv6]" [[ "$local_ip" != "" ]] && break From ca9ac7c81e3fee1445c53cda0d61d0201af5221d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sat, 18 Oct 2025 15:25:26 +0200 Subject: [PATCH 03/21] nextcloud-domain.sh: Minor syntax improvment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com> --- bin/nextcloud-domain.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/nextcloud-domain.sh b/bin/nextcloud-domain.sh index e6672995..718b7fac 100644 --- a/bin/nextcloud-domain.sh +++ b/bin/nextcloud-domain.sh @@ -15,7 +15,7 @@ while :; do 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" - [[ "$pub_ipv6" != "" ]] && ncc config:system:set trusted_domains 12 --value="[$pub_ipv6]" + [[ -z "$pub_ipv6" ]] || ncc config:system:set trusted_domains 12 --value="[$pub_ipv6]" [[ "$local_ip" != "" ]] && break From c63dd9cd4b9d551487702851e32d92f14e6d087d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sat, 18 Oct 2025 13:09:27 +0000 Subject: [PATCH 04/21] 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 --- .github/workflows/build-lxd.yml | 46 ++++++++++++++++++++++++--------- tests/activation_tests.py | 21 ++++++++++++--- tests/nextcloud_tests.py | 18 ++++++++++--- tests/requirements.txt | 2 +- 4 files changed, 67 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build-lxd.yml b/.github/workflows/build-lxd.yml index e1be4fc3..971cd288 100644 --- a/.github/workflows/build-lxd.yml +++ b/.github/workflows/build-lxd.yml @@ -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 @@ -341,6 +341,7 @@ jobs: # } test-dist-upgrade: + if: false needs: - determine-runner runs-on: ${{ needs.determine-runner.outputs.runner_label }} @@ -355,7 +356,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 @@ -364,11 +365,12 @@ 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 @@ -386,6 +388,7 @@ jobs: 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: | @@ -419,6 +422,9 @@ 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 }' & ../.venv/bin/python activation_tests.py --no-gui "nextcloudpi.local" 443 4443 || { echo "Activation test failed!" @@ -444,6 +450,12 @@ jobs: } 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 } @@ -473,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 @@ -500,6 +512,8 @@ jobs: - name: Test LXD Image working-directory: ./tests run: | + 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:" @@ -579,6 +593,9 @@ 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 }' & ../.venv/bin/python nextcloud_tests.py --no-gui "nextcloudpi.local" 443 4443 || { echo "Nextcloud test failed!" @@ -619,16 +636,17 @@ 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 @@ -646,6 +664,7 @@ jobs: 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: | @@ -682,6 +701,9 @@ 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 }' & ../.venv/bin/python activation_tests.py --no-gui "nextcloudpi.local" 443 4443 || { echo "Activation test failed!" diff --git a/tests/activation_tests.py b/tests/activation_tests.py index b9a9b7f6..dde06f2d 100755 --- a/tests/activation_tests.py +++ b/tests/activation_tests.py @@ -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 # diff --git a/tests/nextcloud_tests.py b/tests/nextcloud_tests.py index 4007c4df..30ba9bdc 100755 --- a/tests/nextcloud_tests.py +++ b/tests/nextcloud_tests.py @@ -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 @@ -193,7 +194,8 @@ def test_nextcloud(IP: str, nc_port: str, driver: WebDriver, skip_release_check: 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): + 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 @@ -215,7 +217,7 @@ def test_nextcloud(IP: str, nc_port: str, driver: WebDriver, skip_release_check: 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'1 warning in the logs since.*', info.text): + or re.match(r'\d+ warning in the logs since.*', info.text): continue else: print(f'INFO: {info.text}') @@ -332,6 +334,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'): @@ -381,7 +390,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) diff --git a/tests/requirements.txt b/tests/requirements.txt index f83fedc2..6f808926 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,2 +1,2 @@ robotframework -selenium +selenium>=3.0.0,<4.0.0 From 875e1b62bb54aacb1a0d054d33e2783b5ce914ed Mon Sep 17 00:00:00 2001 From: Tobias <96661824+CrazyWolf13@users.noreply.github.com> Date: Sat, 18 Oct 2025 15:12:38 +0200 Subject: [PATCH 05/21] Update README to reflect community-scripts changes (#2068) --- README.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index cf21d776..20567a9e 100644 --- a/README.md +++ b/README.md @@ -138,21 +138,22 @@ and press "Download". 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 tteck +### 2. Installer by community-scripts (formerly tteck) -Use the [install script][ncp-proxmox-install-script-v5] from [tteck][tteck-profile] to install the LXC container on your Proxmox instance +Use the [install script][ncp-proxmox-install-script-v5] from [community-scripts][community-scripts-profile] to install the LXC container on your Proxmox instance -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: +[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 "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/nextcloudpi.sh)"` + +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 @@ -293,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-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 From 0ed0ce065b184305056185ef39f3e760f5a5fdbc Mon Sep 17 00:00:00 2001 From: Tommy He Date: Sat, 20 Sep 2025 16:43:09 +0800 Subject: [PATCH 06/21] #2069: Apply fix for notify_push reinstall during Nextcloud updates --- bin/ncp-update-nc.d/update-nc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/ncp-update-nc.d/update-nc.sh b/bin/ncp-update-nc.d/update-nc.sh index ade4393e..5f057c9d 100755 --- a/bin/ncp-update-nc.d/update-nc.sh +++ b/bin/ncp-update-nc.d/update-nc.sh @@ -144,7 +144,7 @@ cp -raT nextcloud-old/themes/ nextcloud/themes/ # copy old NCP apps #################### -for app in nextcloudpi previewgenerator; do +for app in nextcloudpi previewgenerator notify_push; do if [[ -d nextcloud-old/apps/"${app}" ]]; then cp -r -L nextcloud-old/apps/"${app}" /var/www/nextcloud/apps/ fi From dce645be79a6b7bc0098eec70acb8d6038b2cad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sat, 18 Oct 2025 18:50:04 +0200 Subject: [PATCH 07/21] Add support for NC 32 --- etc/ncp-config.d/nc-nextcloud.cfg | 2 +- etc/ncp.cfg | 2 +- ncp-app/appinfo/info.xml | 2 +- ncp-previewgenerator/ncp-previewgenerator-nc21/appinfo/info.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/ncp-config.d/nc-nextcloud.cfg b/etc/ncp-config.d/nc-nextcloud.cfg index aaa39fb9..40ed1115 100644 --- a/etc/ncp-config.d/nc-nextcloud.cfg +++ b/etc/ncp-config.d/nc-nextcloud.cfg @@ -9,7 +9,7 @@ { "id": "VER", "name": "Version", - "value": "31.0.2" + "value": "32.0.0" }, { "id": "MAXFILESIZE", diff --git a/etc/ncp.cfg b/etc/ncp.cfg index 5c30ba3d..3e681bbc 100644 --- a/etc/ncp.cfg +++ b/etc/ncp.cfg @@ -1,5 +1,5 @@ { - "nextcloud_version": "31.0.2", + "nextcloud_version": "32.0.0", "php_version": "8.3", "release": "bookworm" } diff --git a/ncp-app/appinfo/info.xml b/ncp-app/appinfo/info.xml index a3040d3a..167b8371 100644 --- a/ncp-app/appinfo/info.xml +++ b/ncp-app/appinfo/info.xml @@ -12,7 +12,7 @@ tools https://github.com/nextcloud/nextcloudpi/issues - + diff --git a/ncp-previewgenerator/ncp-previewgenerator-nc21/appinfo/info.xml b/ncp-previewgenerator/ncp-previewgenerator-nc21/appinfo/info.xml index e7a25109..84b3abfb 100644 --- a/ncp-previewgenerator/ncp-previewgenerator-nc21/appinfo/info.xml +++ b/ncp-previewgenerator/ncp-previewgenerator-nc21/appinfo/info.xml @@ -25,7 +25,7 @@ The first time you install this app, before using a cron job, you properly want - + From d0d30c6872f5cce20d255be4feee9f0215739e93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sat, 18 Oct 2025 19:04:35 +0200 Subject: [PATCH 08/21] Temporarily skip installation of tasks app --- bin/ncp/CONFIG/nc-init.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/ncp/CONFIG/nc-init.sh b/bin/ncp/CONFIG/nc-init.sh index 2445b7ed..f467b322 100644 --- a/bin/ncp/CONFIG/nc-init.sh +++ b/bin/ncp/CONFIG/nc-init.sh @@ -165,8 +165,8 @@ EOF ncc app:enable contacts ncc app:install notes ncc app:enable notes - ncc app:install tasks - ncc app:enable tasks + #ncc app:install tasks + #ncc app:enable tasks # we handle this ourselves ncc app:disable updatenotification From d345af9c2a65058e1ca5034e69d56152b7f4dfcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sat, 18 Oct 2025 21:03:22 +0200 Subject: [PATCH 09/21] Disable app_api unless configured --- bin/ncp/CONFIG/nc-init.sh | 3 +++ updates/1.56.0.sh | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100644 updates/1.56.0.sh diff --git a/bin/ncp/CONFIG/nc-init.sh b/bin/ncp/CONFIG/nc-init.sh index f467b322..bfe8ca81 100644 --- a/bin/ncp/CONFIG/nc-init.sh +++ b/bin/ncp/CONFIG/nc-init.sh @@ -171,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 }')" diff --git a/updates/1.56.0.sh b/updates/1.56.0.sh new file mode 100644 index 00000000..6466a2d9 --- /dev/null +++ b/updates/1.56.0.sh @@ -0,0 +1,8 @@ +#!/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 + +exit 0 \ No newline at end of file From 2475ccca10b66d023b86a6850c84d4e130bfa1d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sat, 18 Oct 2025 21:03:39 +0200 Subject: [PATCH 10/21] nextcloud_tests.py: Fix config checks for NC32 --- tests/nextcloud_tests.py | 156 ++++++++++++++++++++++++--------------- 1 file changed, 97 insertions(+), 59 deletions(-) diff --git a/tests/nextcloud_tests.py b/tests/nextcloud_tests.py index 30ba9bdc..7c4b65ce 100755 --- a/tests/nextcloud_tests.py +++ b/tests/nextcloud_tests.py @@ -181,66 +181,12 @@ def test_nextcloud(IP: str, nc_port: str, driver: WebDriver, skip_release_check: test.new("settings config") wait = WebDriverWait(driver, 60 * wait_multiplier * 3) - 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")])) + secwarn = driver.find_element(By.CSS_SELECTOR, "#security-warning.settings-section") + if secwarn is None: + settings_config_check_pre32(wait, test) + else: + settings_config_check(wait, test) - 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) \ - 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}") - - 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) \ - or re.match(r'The PHP module "imagick" in this instance has no SVG support.*', info.text) \ - or re.match(r'\d+ warning 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]") - - 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: - - print(driver.find_element(By.CSS_SELECTOR, "#security-warning").get_attribute("innerHTML")) - test.check(e) close_first_run_wizard(driver, wait_multiplier) @@ -321,6 +267,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) From 3ae97ea31dd03bc3f45434bd11868732556cb6d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sat, 18 Oct 2025 21:27:23 +0200 Subject: [PATCH 11/21] Set supported NC version to 32.0.1 and reenable tasks app --- bin/ncp/CONFIG/nc-init.sh | 4 ++-- etc/ncp-config.d/nc-nextcloud.cfg | 2 +- etc/ncp.cfg | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/ncp/CONFIG/nc-init.sh b/bin/ncp/CONFIG/nc-init.sh index bfe8ca81..3d7503e3 100644 --- a/bin/ncp/CONFIG/nc-init.sh +++ b/bin/ncp/CONFIG/nc-init.sh @@ -165,8 +165,8 @@ EOF ncc app:enable contacts ncc app:install notes ncc app:enable notes - #ncc app:install tasks - #ncc app:enable tasks + ncc app:install tasks + ncc app:enable tasks # we handle this ourselves ncc app:disable updatenotification diff --git a/etc/ncp-config.d/nc-nextcloud.cfg b/etc/ncp-config.d/nc-nextcloud.cfg index 40ed1115..7117926f 100644 --- a/etc/ncp-config.d/nc-nextcloud.cfg +++ b/etc/ncp-config.d/nc-nextcloud.cfg @@ -9,7 +9,7 @@ { "id": "VER", "name": "Version", - "value": "32.0.0" + "value": "32.0.1" }, { "id": "MAXFILESIZE", diff --git a/etc/ncp.cfg b/etc/ncp.cfg index 3e681bbc..53f46154 100644 --- a/etc/ncp.cfg +++ b/etc/ncp.cfg @@ -1,5 +1,5 @@ { - "nextcloud_version": "32.0.0", + "nextcloud_version": "32.0.1", "php_version": "8.3", "release": "bookworm" } From 8c3add3a2d64d26843796c5f54e77b35cf0180d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sat, 8 Nov 2025 11:47:51 +0100 Subject: [PATCH 12/21] release.yml: Run armbian-test-image only on explicit request --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 00b0a7f2..9ddae673 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,7 +82,7 @@ jobs: secrets: inherit armbian-test-image: - if: ${{ inputs.test_image_url != '' || ( github.event_name != 'workflow_dispatch' && !startsWith(github.ref_name, 'docker-') ) }} + if: ${{ inputs.test_image_url != '' }} uses: ./.github/workflows/build-sd-images.yml with: git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}" From 767a42afbbce67eddeebe1e5f1b08c3fb99e702b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sat, 8 Nov 2025 11:59:53 +0100 Subject: [PATCH 13/21] release.yml: Remove Raspberry Pi 5 config because it has been unified in Armbian --- .github/workflows/release.yml | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9ddae673..ecf962e6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,22 +63,13 @@ 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 - secrets: inherit - - raspberrypi-5: - if: ${{ false && 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: rpi5b - board_name: RaspberryPi5 + board_name: RaspberryPi 4+ secrets: inherit armbian-test-image: @@ -216,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 From c12e51b39677d44d2315ab12ec5f2d945179bbe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sat, 8 Nov 2025 14:56:55 +0100 Subject: [PATCH 14/21] update-nc.sh: Migrate NC apps after installation of new version --- bin/ncp-update-nc.d/update-nc.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/ncp-update-nc.d/update-nc.sh b/bin/ncp-update-nc.d/update-nc.sh index 5f057c9d..d035907f 100755 --- a/bin/ncp-update-nc.d/update-nc.sh +++ b/bin/ncp-update-nc.d/update-nc.sh @@ -142,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 notify_push; 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 From 2fbf2ab6b5078fbd09ac63659d4ec08bf9950374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Fri, 14 Nov 2025 23:40:23 +0100 Subject: [PATCH 15/21] update-nc.sh: Convert mysql charset if necessary --- bin/ncp-update-nc.d/update-nc.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/ncp-update-nc.d/update-nc.sh b/bin/ncp-update-nc.d/update-nc.sh index d035907f..d9d17eb4 100755 --- a/bin/ncp-update-nc.d/update-nc.sh +++ b/bin/ncp-update-nc.d/update-nc.sh @@ -196,6 +196,7 @@ $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 # use the correct version for custom apps From a7cfdb08eda193132fcc955f8a3d7e1bf9254079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sat, 15 Nov 2025 00:11:18 +0100 Subject: [PATCH 16/21] system_tests.py: Add missing comma --- tests/system_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system_tests.py b/tests/system_tests.py index b0c13617..2632369e 100755 --- a/tests/system_tests.py +++ b/tests/system_tests.py @@ -51,7 +51,7 @@ binaries_no_docker = [ 'btrfs', 'fail2ban-server', 'udiskie', - 'ufw' + 'ufw', 'samba', ] From 9c54a8a177e634393ac6aa265c23bb5665e648ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sat, 15 Nov 2025 02:41:52 +0100 Subject: [PATCH 17/21] nextcloud_tests.py: Fix settings check --- .github/workflows/build-sd-images.yml | 3 ++- tests/nextcloud_tests.py | 11 +++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-sd-images.yml b/.github/workflows/build-sd-images.yml index 0ee2e73a..af7ca7fb 100644 --- a/.github/workflows/build-sd-images.yml +++ b/.github/workflows/build-sd-images.yml @@ -155,7 +155,8 @@ jobs: run: | set -ex mkdir -p output - wget -nv "${{ inputs.test_image_url }}" | pv -i 3 > "output/${ARTIFACT_FILE?}" + 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 diff --git a/tests/nextcloud_tests.py b/tests/nextcloud_tests.py index 7c4b65ce..f87152f6 100755 --- a/tests/nextcloud_tests.py +++ b/tests/nextcloud_tests.py @@ -180,13 +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 * 3) - secwarn = driver.find_element(By.CSS_SELECTOR, "#security-warning.settings-section") - if secwarn is None: - settings_config_check_pre32(wait, test) - else: + wait = WebDriverWait(driver, 60 * wait_multiplier * 5) + try: + 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) From 5b11ae0caf7131b6e8dd0b3be5f8f7622a17df16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sat, 15 Nov 2025 03:38:49 +0100 Subject: [PATCH 18/21] nc-nextcloud.sh, ncp-provisioning.sh: Implement nextcloud service workers --- bin/ncp-provisioning.sh | 8 ++++++++ bin/ncp/CONFIG/nc-nextcloud.sh | 19 +++++++++++++++++++ updates/1.56.0.sh | 23 +++++++++++++++++++++++ 3 files changed, 50 insertions(+) diff --git a/bin/ncp-provisioning.sh b/bin/ncp-provisioning.sh index b4b7400c..82c7deae 100644 --- a/bin/ncp-provisioning.sh +++ b/bin/ncp-provisioning.sh @@ -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 diff --git a/bin/ncp/CONFIG/nc-nextcloud.sh b/bin/ncp/CONFIG/nc-nextcloud.sh index 70732b5e..5582dfee 100644 --- a/bin/ncp/CONFIG/nc-nextcloud.sh +++ b/bin/ncp/CONFIG/nc-nextcloud.sh @@ -83,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' diff --git a/updates/1.56.0.sh b/updates/1.56.0.sh index 6466a2d9..d5224319 100644 --- a/updates/1.56.0.sh +++ b/updates/1.56.0.sh @@ -5,4 +5,27 @@ 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 \ No newline at end of file From 6c3d2503eae85a6753cf14bcf538fb589fee01fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sun, 16 Nov 2025 17:33:57 +0100 Subject: [PATCH 19/21] build-sd-images.yml: Fix issue with artifact file name containing spaces --- .github/workflows/build-sd-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-sd-images.yml b/.github/workflows/build-sd-images.yml index af7ca7fb..61770a0e 100644 --- a/.github/workflows/build-sd-images.yml +++ b/.github/workflows/build-sd-images.yml @@ -160,7 +160,7 @@ jobs: - 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 python3 -m venv ./.venv . ./.venv/bin/activate From d6e6215fa966fbdadbbdaea113a12c0bafefc4bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sun, 16 Nov 2025 18:44:39 +0100 Subject: [PATCH 20/21] update-nc.sh: Disable app_api during nc update --- bin/ncp-update-nc.d/update-nc.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/ncp-update-nc.d/update-nc.sh b/bin/ncp-update-nc.d/update-nc.sh index d9d17eb4..6986ddb6 100755 --- a/bin/ncp-update-nc.d/update-nc.sh +++ b/bin/ncp-update-nc.d/update-nc.sh @@ -198,6 +198,10 @@ $ncc | grep -q db:add-missing-primary-keys && $ncc db:add-missing-primary-keys - $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)" From 53c9f43dbeb3bb68aab67f17fb5e808cdcdc0eae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sun, 16 Nov 2025 20:04:14 +0100 Subject: [PATCH 21/21] publish-image.yml: Fix issue with artifact file name containing spaces --- .github/workflows/publish-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index 925c66cd..9ef5d703 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -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}"