Skip to content

Commit 7be2748

Browse files
Merge pull request #2083 from nextcloud/devel
NC 32 and fixes
2 parents 5f38f64 + 53c9f43 commit 7be2748

File tree

19 files changed

+266
-131
lines changed

19 files changed

+266
-131
lines changed

.github/workflows/build-lxd.yml

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
- name: Setup incus
7474
if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-20.04-arm64' }}
7575
run: |
76-
curl https://pkgs.zabbly.com/get/incus-stable | sudo sh -x
76+
sudo apt-get install -y incus qemu-system incus-tools
7777
sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT
7878
sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
7979
sudo incus admin init --auto
@@ -341,6 +341,7 @@ jobs:
341341
# }
342342

343343
test-dist-upgrade:
344+
if: false
344345
needs:
345346
- determine-runner
346347
runs-on: ${{ needs.determine-runner.outputs.runner_label }}
@@ -355,7 +356,7 @@ jobs:
355356
- name: Setup incus
356357
if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-20.04-arm64' }}
357358
run: |
358-
curl https://pkgs.zabbly.com/get/incus-stable | sudo sh -x
359+
sudo apt-get install -y incus qemu-system incus-tools
359360
sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT
360361
sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
361362
sudo incus admin init --auto
@@ -364,11 +365,12 @@ jobs:
364365
with:
365366
ref: "v1.54.3"
366367
- name: Setup Firefox
368+
if: ${{ runner.arch != 'ARM64' }}
367369
continue-on-error: true
368370
id: setup-firefox-browser-action
369371
uses: browser-actions/setup-firefox@latest
370372
- name: Setup Firefox from packages
371-
if: ${{ steps.setup-firefox-browser-action.outcome == 'failure' }}
373+
if: ${{ runner.arch == 'ARM64' || steps.setup-firefox-browser-action.outcome == 'failure' }}
372374
run: |
373375
sudo apt-get update
374376
sudo apt-get install -y --no-install-recommends firefox
@@ -386,6 +388,7 @@ jobs:
386388
tar xf "geckodriver-"*"-$arch.tar.gz"
387389
sudo mv geckodriver /usr/local/bin/
388390
sudo chmod +x /usr/local/bin/geckodriver
391+
echo "GECKODRIVER_PATH=/usr/local/bin/geckodriver" >> "$GITHUB_ENV"
389392
geckodriver -V
390393
- name: Setup Selenium
391394
run: |
@@ -419,6 +422,9 @@ jobs:
419422
- name: Activate and Test LXD Image
420423
working-directory: ./tests
421424
run: |
425+
set -x
426+
export GECKODRIVER_PATH="$GECKODRIVER_PATH"
427+
export FF_BINARY_PATH="$(which firefox)"
422428
sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
423429
../.venv/bin/python activation_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
424430
echo "Activation test failed!"
@@ -444,6 +450,12 @@ jobs:
444450
}
445451
USE_INCUS="$USE_INCUS" ../.venv/bin/python system_tests.py --non-interactive --skip-update-test || {
446452
echo "System test failed!"
453+
echo "ncp.log: "
454+
sudo "$LXC" exec ncp -- "tail -n20 /var/log/ncp.log" || true
455+
echo "================"
456+
echo "nextcloud log: "
457+
datadir="$(sudo "$LXC" exec ncp -- ncc config:system:get datadirectory)"
458+
sudo "$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
447459
exit 1
448460
}
449461
@@ -473,13 +485,13 @@ jobs:
473485
sudo "$LXC" exec ncp -- bash -c "DBG=x ncp-update ${UPDATE_ARGS[*]}"
474486
sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
475487
476-
if [[ "$current_nc_version" =~ "$latest_nc_version".* ]]
477-
then
478-
echo "Nextcloud is up to date - skipping NC update test."
479-
else
480-
sudo "$LXC" exec ncp -- bash -c "DBG=x ncp-update-nc ${latest_nc_version?}"
481-
sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
482-
fi
488+
#if [[ "$current_nc_version" =~ "$latest_nc_version".* ]]
489+
#then
490+
# echo "Nextcloud is up to date - skipping NC update test."
491+
#else
492+
# sudo "$LXC" exec ncp -- bash -c "DBG=x ncp-update-nc ${latest_nc_version?}"
493+
# sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
494+
#fi
483495
484496
sudo "$LXC" exec ncp -- rm -f /opt/ncdata/data/nextcloud.log
485497

@@ -500,6 +512,8 @@ jobs:
500512
- name: Test LXD Image
501513
working-directory: ./tests
502514
run: |
515+
export GECKODRIVER_PATH="$GECKODRIVER_PATH"
516+
export FF_BINARY_PATH="$(which firefox)"
503517
../.venv/bin/python nextcloud_tests.py --no-gui --skip-release-check "nextcloudpi.local" 443 4443 || {
504518
echo "Nextcloud test failed!"
505519
echo "Geckodriver logs:"
@@ -579,6 +593,9 @@ jobs:
579593
- name: Test LXD Image
580594
working-directory: ./tests
581595
run: |
596+
set -x
597+
export GECKODRIVER_PATH="$GECKODRIVER_PATH"
598+
export FF_BINARY_PATH="$(which firefox)"
582599
sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
583600
../.venv/bin/python nextcloud_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
584601
echo "Nextcloud test failed!"
@@ -619,16 +636,17 @@ jobs:
619636
- name: Setup incus
620637
if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-20.04-arm64' }}
621638
run: |
622-
curl https://pkgs.zabbly.com/get/incus-stable | sudo sh -x
639+
sudo apt-get install -y incus qemu-system incus-tools
623640
sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT
624641
sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
625642
sudo incus admin init --auto
626643
- name: Setup Firefox
644+
if: ${{ runner.arch != 'ARM64' }}
627645
continue-on-error: true
628646
id: setup-firefox-browser-action
629647
uses: browser-actions/setup-firefox@latest
630648
- name: Setup Firefox from packages
631-
if: ${{ steps.setup-firefox-browser-action.outcome == 'failure' }}
649+
if: ${{ runner.arch == 'ARM64' || steps.setup-firefox-browser-action.outcome == 'failure' }}
632650
run: |
633651
sudo apt-get update
634652
sudo apt-get install -y --no-install-recommends firefox
@@ -646,6 +664,7 @@ jobs:
646664
tar xf "geckodriver-"*"-$arch.tar.gz"
647665
sudo mv geckodriver /usr/local/bin/
648666
sudo chmod +x /usr/local/bin/geckodriver
667+
echo "GECKODRIVER_PATH=/usr/local/bin/geckodriver" >> "$GITHUB_ENV"
649668
geckodriver -V
650669
- name: Setup Selenium
651670
run: |
@@ -682,6 +701,9 @@ jobs:
682701
- name: Test LXD Image
683702
working-directory: ./tests
684703
run: |
704+
set -x
705+
export GECKODRIVER_PATH="$GECKODRIVER_PATH"
706+
export FF_BINARY_PATH="$(which firefox)"
685707
sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
686708
../.venv/bin/python activation_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
687709
echo "Activation test failed!"

.github/workflows/build-sd-images.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,12 @@ jobs:
155155
run: |
156156
set -ex
157157
mkdir -p output
158-
wget -nv "${{ inputs.test_image_url }}" | pv -i 3 > "output/${ARTIFACT_FILE?}"
158+
sudo apt-get install -y pv
159+
wget -nv "${{ inputs.test_image_url }}" -O - | pv -n --bytes --rate --timer -i 3 > "output/${ARTIFACT_FILE?}"
159160
- name: Prepare test
160161
run: |
161162
set -x
162-
mv output/${ARTIFACT_FILE?} ncp.img
163+
mv "output/${ARTIFACT_FILE?}" ncp.img
163164
sudo apt-get install -y systemd-container
164165
python3 -m venv ./.venv
165166
. ./.venv/bin/activate

.github/workflows/publish-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
run: |
4444
set -ex
4545
mkdir -p publish
46-
mv artifacts/${{ inputs.artifact_file }} publish/
46+
mv "artifacts/${{ inputs.artifact_file }}" publish/
4747
cd publish
4848
4949
asset="${IMG}"

.github/workflows/release.yml

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -63,26 +63,17 @@ jobs:
6363
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
6464
secrets: inherit
6565

66-
raspberrypi-4:
66+
raspberrypi:
6767
if: ${{ inputs.sd-images || ( github.event_name != 'workflow_dispatch' && !startsWith(github.ref_name, 'docker-') ) }}
6868
uses: ./.github/workflows/build-sd-images.yml
6969
with:
7070
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
7171
board_id: rpi4b
72-
board_name: RaspberryPi4
73-
secrets: inherit
74-
75-
raspberrypi-5:
76-
if: ${{ false && inputs.sd-images || ( github.event_name != 'workflow_dispatch' && !startsWith(github.ref_name, 'docker-') ) }}
77-
uses: ./.github/workflows/build-sd-images.yml
78-
with:
79-
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
80-
board_id: rpi5b
81-
board_name: RaspberryPi5
72+
board_name: RaspberryPi 4+
8273
secrets: inherit
8374

8475
armbian-test-image:
85-
if: ${{ inputs.test_image_url != '' || ( github.event_name != 'workflow_dispatch' && !startsWith(github.ref_name, 'docker-') ) }}
76+
if: ${{ inputs.test_image_url != '' }}
8677
uses: ./.github/workflows/build-sd-images.yml
8778
with:
8879
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
@@ -216,31 +207,19 @@ jobs:
216207
artifact_file: "${{ needs.lxd-arm64.outputs.lxc_artifact_file }}"
217208
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
218209

219-
raspberrypi-4-release:
210+
raspberrypi-release:
220211
needs:
221-
- raspberrypi-4
212+
- raspberrypi
222213
- github-release
223214
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
224215
uses: ./.github/workflows/publish-image.yml
225216
with:
226217
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
227-
artifact_id: "${{ needs.raspberrypi-4.outputs.artifact_name }}"
228-
artifact_file: "${{ needs.raspberrypi-4.outputs.artifact_file }}"
218+
artifact_id: "${{ needs.raspberrypi.outputs.artifact_name }}"
219+
artifact_file: "${{ needs.raspberrypi.outputs.artifact_file }}"
229220
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
230221
secrets: inherit
231222

232-
raspberrypi-5-release:
233-
needs:
234-
- raspberrypi-5
235-
- github-release
236-
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
237-
uses: ./.github/workflows/publish-image.yml
238-
with:
239-
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
240-
artifact_id: "${{ needs.raspberrypi-5.outputs.artifact_name }}"
241-
artifact_file: "${{ needs.raspberrypi-5.outputs.artifact_file }}"
242-
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
243-
secrets: inherit
244223
odroidxu4-release:
245224
needs:
246225
- odroidxu4

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -138,21 +138,22 @@ and press "Download".
138138
Optionally, you can copy the corresponding md5 sum from the releases page and paste it in the "Checksum" field to have
139139
Proxmox check that the downloaded image was not corrupted
140140

141-
### 2. Installer by tteck
141+
### 2. Installer by community-scripts (formerly tteck)
142142

143-
Use the [install script][ncp-proxmox-install-script-v5] from [tteck][tteck-profile] to install the LXC container on your Proxmox instance
143+
Use the [install script][ncp-proxmox-install-script-v5] from [community-scripts][community-scripts-profile] to install the LXC container on your Proxmox instance
144144

145-
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:
145+
[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:
146146

147-
Installation: `bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/nextcloudpi.sh)"`
147+
148+
Installation: `bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/nextcloudpi.sh)"`
148149

149150
Default Settings: `2GB RAM - 8GB Storage - 2vCPU`
150151

151-
_(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)_
152+
_(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)_
152153

153-
Thenk you [tteck][tteck-profile] :heart: for making the helper script & letting us use this for Proxmox installations :pray:
154+
Thank you to the [community-scripts][community-scripts-profile] organisation :heart: for making the helper script & letting us use this for Proxmox installations :pray:
154155

155-
You can find his GitHub repository with his helper scripts [here][gh-helper-scripts-repo].
156+
You can find the GitHub repository with the helper scripts here: [here][gh-helper-scripts-repo].
156157

157158
## How to build
158159

@@ -293,15 +294,15 @@ You can find us on the [Forum][nc-forum], [Telegram][chat-telegram] or [Matrix][
293294

294295
[nc-badge]: https://img.shields.io/badge/Nextcloud-0082C9?style=for-the-badge&logo=Nextcloud&logoColor=white
295296

296-
<!-- TTECK -->
297+
<!-- COMMUNITY-SCRIPTS -->
297298

298-
[tteck-profile]: https://github.com/tteck
299+
[community-scripts-profile]: https://github.com/community-scripts/
299300

300-
[gh-helper-scripts-repo]: https://github.com/tteck/Proxmox
301+
[gh-helper-scripts-repo]: https://github.com/community-scripts/ProxmoxVE
301302

302-
[website-helper-scripts]: https://tteck.github.io/Proxmox/
303+
[website-helper-scripts]: https://community-scripts.github.io/ProxmoxVE/
303304

304-
[ncp-proxmox-install-script-v5]: https://github.com/tteck/Proxmox/blob/main/install/nextcloudpi-v5-install.sh
305+
[ncp-proxmox-install-script-v5]: https://github.com/community-scripts/ProxmoxVE/blob/main/install/nextcloudpi-install.sh
305306

306307
<!-- IMAGES -->
307308

bin/ncp-provisioning.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,13 @@ EOF
8282
cat /usr/local/etc/instance.cfg
8383
}
8484

85+
systemctl is-enabled -q [email protected] || {
86+
max="$(nproc || echo '2')"
87+
max="$((max-1))"
88+
for i in $(seq 1 "$max")
89+
do
90+
systemctl enable --now "nextcloud-ai-worker@${i}.service"
91+
done
92+
}
8593

8694
exit 0

bin/ncp-update-nc.d/update-nc.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,12 @@ cp nextcloud-old/config/config.php nextcloud/config/
142142
####################
143143
cp -raT nextcloud-old/themes/ nextcloud/themes/
144144

145-
# copy old NCP apps
145+
# copy old NC apps
146146
####################
147-
for app in nextcloudpi previewgenerator; do
148-
if [[ -d nextcloud-old/apps/"${app}" ]]; then
149-
cp -r -L nextcloud-old/apps/"${app}" /var/www/nextcloud/apps/
147+
for app in nextcloud-old/apps/*; do
148+
if ! [[ -d /var/www/nextcloud/apps/"$(basename "$app")" ]]
149+
then
150+
cp -r -L "${app}" /var/www/nextcloud/apps/
150151
fi
151152
done
152153

@@ -195,7 +196,12 @@ $ncc | grep -q db:add-missing-indices && $ncc db:add-missing-indices -n
195196
$ncc | grep -q db:add-missing-columns && $ncc db:add-missing-columns -n
196197
$ncc | grep -q db:add-missing-primary-keys && $ncc db:add-missing-primary-keys -n
197198
$ncc | grep -q db:convert-filecache-bigint && $ncc db:convert-filecache-bigint -n
199+
$ncc | grep -q db:convert-mysql-charset && $ncc db:convert-mysql-charset -n
198200
$ncc maintenance:repair --help | grep -q -e '--include-expensive' && $ncc maintenance:repair --include-expensive
201+
if $ncc app_api:daemon:list | grep 'No registered daemon configs.' > /dev/null 2>&1
202+
then
203+
$ncc app:disable app_api
204+
fi
199205

200206
# use the correct version for custom apps
201207
NCVER="$(nc_version)"

bin/ncp/CONFIG/nc-init.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ EOF
171171
# we handle this ourselves
172172
ncc app:disable updatenotification
173173

174+
# Not supported in Nextcloudpi without manual setup
175+
ncc app:disable app_api
176+
174177
# ncp-previewgenerator
175178
local ncver
176179
ncver="$(ncc status 2>/dev/null | grep "version:" | awk '{ print $3 }')"

bin/ncp/CONFIG/nc-nextcloud.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,25 @@ EOF
8383
update-rc.d redis-server enable
8484
clear_opcache
8585

86+
# NC service workers
87+
cat > /etc/systemd/system/[email protected] <<'EOF'
88+
[Unit]
89+
Description=Nextcloud AI worker %i
90+
After=network.target
91+
92+
[Service]
93+
ExecStart=php occ background-job:worker -t 60 'OC\\TaskProcessing\\SynchronousBackgroundJob'
94+
Restart=always
95+
StartLimitInterval=60
96+
StartLimitBurst=10
97+
WorkingDirectory=/var/www/nextcloud
98+
User=www-data
99+
100+
[Install]
101+
WantedBy=multi-user.target
102+
EOF
103+
104+
86105
# service to randomize passwords on first boot
87106
mkdir -p /usr/lib/systemd/system
88107
cat > /usr/lib/systemd/system/nc-provisioning.service <<'EOF'

bin/nextcloud-domain.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ done
1111
# wicd service finishes before completing DHCP
1212
while :; do
1313
local_ip="$(get_ip)"
14-
pub_ip="$(curl -m4 icanhazip.com 2>/dev/null)"
1514

16-
[[ "$pub_ip" != "" ]] && ncc config:system:set trusted_domains 11 --value="$pub_ip"
15+
pub_ipv4="$(curl -4 -m4 icanhazip.com 2>/dev/null)"
16+
pub_ipv6="$(curl -6 -m4 icanhazip.com 2>/dev/null)"
17+
[[ -z "$pub_ipv4" ]] || ncc config:system:set trusted_domains 11 --value="$pub_ipv4"
18+
[[ -z "$pub_ipv6" ]] || ncc config:system:set trusted_domains 12 --value="[$pub_ipv6]"
19+
1720
[[ "$local_ip" != "" ]] && break
1821

1922
sleep 3

0 commit comments

Comments
 (0)