mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-10 15:12:01 -03:30
Compare commits
137 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
332fdb3f40 | ||
|
|
7be2748648 | ||
|
|
53c9f43dbe | ||
|
|
d6e6215fa9 | ||
|
|
6c3d2503ea | ||
|
|
5b11ae0caf | ||
|
|
9c54a8a177 | ||
|
|
a7cfdb08ed | ||
|
|
2fbf2ab6b5 | ||
|
|
c12e51b396 | ||
|
|
767a42afbb | ||
|
|
8c3add3a2d | ||
|
|
3ae97ea31d | ||
|
|
2475ccca10 | ||
|
|
d345af9c2a | ||
|
|
d0d30c6872 | ||
|
|
dce645be79 | ||
|
|
0ed0ce065b | ||
|
|
875e1b62bb | ||
|
|
c63dd9cd4b | ||
|
|
ca9ac7c81e | ||
|
|
c57218e6c9 | ||
|
|
cc5c73abf4 | ||
|
|
5f38f64336 | ||
|
|
a53f800d02 | ||
|
|
e7f9f6e32a | ||
|
|
a97397102a | ||
|
|
e0a2cec153 | ||
|
|
680753b564 | ||
|
|
904b0ab310 | ||
|
|
63c80d1604 | ||
|
|
25887deba6 | ||
|
|
2f639cf1c2 | ||
|
|
5dcd4b1ff6 | ||
|
|
2debc54186 | ||
|
|
8eaf974bf6 | ||
|
|
e86ed80bb7 | ||
|
|
502a5c8be3 | ||
|
|
6ed2c17b06 | ||
|
|
93d29d63c8 | ||
|
|
9ab14a99e7 | ||
|
|
c6f196dc09 | ||
|
|
42f8ee11b0 | ||
|
|
06f50ed3de | ||
|
|
2ada653882 | ||
|
|
a7cf5a2672 | ||
|
|
ce2406d222 | ||
|
|
6f4b43e3ca | ||
|
|
52010f2baf | ||
|
|
5738d58f28 | ||
|
|
7f4de99aac | ||
|
|
2c7a079e3c | ||
|
|
94a8dda931 | ||
|
|
92b352f06e | ||
|
|
bee56f5767 | ||
|
|
1946e04806 | ||
|
|
bba41f0dfd | ||
|
|
60e285766a | ||
|
|
77763af71d | ||
|
|
d1b3ac5570 | ||
|
|
776c190319 | ||
|
|
aa2ec800cc | ||
|
|
7be0a10433 | ||
|
|
c10bf36cbb | ||
|
|
1f7855bfcf | ||
|
|
39a05f8ac6 | ||
|
|
10a5b4e96b | ||
|
|
430e56ee7b | ||
|
|
1579f7b2ea | ||
|
|
3cb98599de | ||
|
|
94332db835 | ||
|
|
7ed6552110 | ||
|
|
eb835b9c12 | ||
|
|
50e1adf6c0 | ||
|
|
a6cf48ec7f | ||
|
|
9890d68532 | ||
|
|
aaf7536943 | ||
|
|
29e6c05937 | ||
|
|
fb645bcaa7 | ||
|
|
8726cc3a91 | ||
|
|
50a2b0a8c8 | ||
|
|
28042b8763 | ||
|
|
63b6aca7bb | ||
|
|
848ddad7d4 | ||
|
|
47f79b7187 | ||
|
|
d52b8dcdf1 | ||
|
|
0e40867347 | ||
|
|
93f76ec8f8 | ||
|
|
1acf1b4a46 | ||
|
|
90ef9dba53 | ||
|
|
325834f86a | ||
|
|
94dd609fab | ||
|
|
8538bfe631 | ||
|
|
31d5ed984f | ||
|
|
ef849572d7 | ||
|
|
41a0af623f | ||
|
|
3b65ecf812 | ||
|
|
e21a027c68 | ||
|
|
e5113f4601 | ||
|
|
e7a40c7cc9 | ||
|
|
f02a49968c | ||
|
|
7612fd9e6b | ||
|
|
6598d864fa | ||
|
|
92587ac813 | ||
|
|
2838c59012 | ||
|
|
2e38ecc57e | ||
|
|
eddb9d393e | ||
|
|
51a2d0f662 | ||
|
|
4d9102a967 | ||
|
|
335df8bd03 | ||
|
|
e05db18897 | ||
|
|
73da8fd057 | ||
|
|
0e30c79a87 | ||
|
|
1fb070df55 | ||
|
|
eea3d51385 | ||
|
|
de9088f418 | ||
|
|
ee07434b82 | ||
|
|
fc0b75b2be | ||
|
|
8fa19a5621 | ||
|
|
bb98f597e9 | ||
|
|
bf98d0eade | ||
|
|
63379519d4 | ||
|
|
3c4141eefb | ||
|
|
2d5cfc543a | ||
|
|
cc30b34bc4 | ||
|
|
f032fd7147 | ||
|
|
8efe6a703e | ||
|
|
46b4489d98 | ||
|
|
11c0a668c3 | ||
|
|
371391e7e8 | ||
|
|
a2c3979558 | ||
|
|
1a210e9f12 | ||
|
|
5489e307ce | ||
|
|
323a202785 | ||
|
|
0c023d95a5 | ||
|
|
298404437d | ||
|
|
66c1601e5a |
4
.github/ISSUE_TEMPLATE/1_Bug_report.md
vendored
4
.github/ISSUE_TEMPLATE/1_Bug_report.md
vendored
@ -5,7 +5,7 @@ about: Report errors and problems
|
||||
---
|
||||
|
||||
<!--
|
||||
Thanks for reporting issues back to NextCloudPi!
|
||||
Thanks for reporting issues back to NextcloudPi!
|
||||
|
||||
Here you can file bugs and feature requests. **Do NOT ask questions**, this is not a support forum.
|
||||
|
||||
@ -13,7 +13,7 @@ If there is an important security issue that has gone unnoticed, please send a p
|
||||
|
||||
### DO NOT ASK QUESTIONS, USE THE FORUMS
|
||||
|
||||
NCP and its extras are explained in the wiki, also make sure to read the articles in ownyourbits explaining NextCloudPi extras before asking. https://ownyourbits.com/category/nextcloudpi/
|
||||
NCP and its extras are explained in the wiki, also make sure to read the articles in ownyourbits explaining NextcloudPi extras before asking. https://ownyourbits.com/category/nextcloudpi/
|
||||
|
||||
For asking questions, please use the forums. https://help.nextcloud.com/c/support/appliances-docker-snappy-vm
|
||||
|
||||
|
||||
8
.github/ISSUE_TEMPLATE/3_Support_question.md
vendored
8
.github/ISSUE_TEMPLATE/3_Support_question.md
vendored
@ -4,7 +4,7 @@ about: Do NOT ask here - Use the forum
|
||||
|
||||
---
|
||||
|
||||
Thanks for reporting issues back to NextCloudPi!
|
||||
Thanks for reporting issues back to NextcloudPi!
|
||||
|
||||
Here you can file bugs and feature requests. **Do NOT ask questions**, this is not a support forum.
|
||||
|
||||
@ -12,11 +12,11 @@ Here you can file bugs and feature requests. **Do NOT ask questions**, this is n
|
||||
DO NOT ASK QUESTIONS, USE THE FORUMS
|
||||
---
|
||||
|
||||
NCP and its extras are explained in the wiki, also make sure to read the articles in ownyourbits explaining NextCloudPi extras before asking. https://ownyourbits.com/category/nextcloudpi/
|
||||
NCP and its extras are explained in the wiki, also make sure to read the articles in ownyourbits explaining NextcloudPi extras before asking. https://ownyourbits.com/category/nextcloudpi/
|
||||
|
||||
We use GitHub issues only to discuss about NextCloudPi bugs and new features.
|
||||
We use GitHub issues only to discuss about NextcloudPi bugs and new features.
|
||||
|
||||
NCP and its extras are explained in the [wiki](https://github.com/nextcloud/nextcloudpi/wiki), also make sure to read the [articles in ownyourbits](https://ownyourbits.com/category/nextcloudpi/) explaining NextCloudPi extras before asking.
|
||||
NCP and its extras are explained in the [wiki](https://github.com/nextcloud/nextcloudpi/wiki), also make sure to read the [articles in ownyourbits](https://ownyourbits.com/category/nextcloudpi/) explaining NextcloudPi extras before asking.
|
||||
|
||||
For any other question or comment, please use the [forums](https://help.nextcloud.com/c/support/appliances-docker-snappy-vm), and make sure to tag
|
||||
the thread as `ncp`.
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
---
|
||||
name: ⛔ Documentation Issue
|
||||
about: See the NextCloudPi Wiki
|
||||
about: See the NextcloudPi Wiki
|
||||
|
||||
---
|
||||
|
||||
The NextCloudPi wiki is open to anyone to edit. If you find something inaccurate,
|
||||
The NextcloudPi wiki is open to anyone to edit. If you find something inaccurate,
|
||||
missing or that can be improved, please feel free to contribute to it.
|
||||
|
||||
https://github.com/nextcloud/nextcloudpi/wiki
|
||||
|
||||
13
.github/ISSUE_TEMPLATE/5_Security_issue.md
vendored
13
.github/ISSUE_TEMPLATE/5_Security_issue.md
vendored
@ -1,13 +0,0 @@
|
||||
---
|
||||
name: ⛔ Security Issue
|
||||
about: Email nacho [at] ownyourbits.com
|
||||
|
||||
---
|
||||
|
||||
⚠ PLEASE DON'T DISCLOSE SECURITY-RELATED ISSUES PUBLICLY, SEE BELOW.
|
||||
|
||||
If you have found a security issue in NextCloudPi, please send the details to
|
||||
nacho [at] ownyourbits.com and don't disclose it publicly until we can provide a
|
||||
fix for it.
|
||||
|
||||
Thank you!
|
||||
@ -13,7 +13,7 @@ inputs:
|
||||
server_type:
|
||||
description: Server type to use for hetzner servers
|
||||
required: true
|
||||
default: "cx11"
|
||||
default: "cx22"
|
||||
|
||||
outputs:
|
||||
server_address:
|
||||
|
||||
@ -13,7 +13,7 @@ inputs:
|
||||
server_type:
|
||||
description: Server type to use for hetzner servers
|
||||
required: true
|
||||
default: "cx11"
|
||||
default: "cx22"
|
||||
|
||||
outputs:
|
||||
server_address:
|
||||
|
||||
4
.github/workflows/build-docker.yml
vendored
4
.github/workflows/build-docker.yml
vendored
@ -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
|
||||
|
||||
184
.github/workflows/build-lxd.yml
vendored
184
.github/workflows/build-lxd.yml
vendored
@ -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 }}"
|
||||
@ -276,13 +276,15 @@ jobs:
|
||||
# exit 1
|
||||
# }
|
||||
# - name: Update ncp
|
||||
# env:
|
||||
# HEAD_REF: "${{ github.head_ref }}"
|
||||
# run: |
|
||||
# set -ex
|
||||
# BRANCH="${VERSION/refs\/heads\//}"
|
||||
# BRANCH="${BRANCH/refs\/tags\//}"
|
||||
# if [[ "$BRANCH" =~ "refs/pull/"* ]]
|
||||
# then
|
||||
# UPDATE_ARGS=("${{ github.head_ref }}" "$VERSION")
|
||||
# UPDATE_ARGS=("${HEAD_REF}" "$VERSION")
|
||||
# else
|
||||
# UPDATE_ARGS=("$BRANCH")
|
||||
# fi
|
||||
@ -339,6 +341,7 @@ jobs:
|
||||
# }
|
||||
|
||||
test-dist-upgrade:
|
||||
if: false
|
||||
needs:
|
||||
- determine-runner
|
||||
runs-on: ${{ needs.determine-runner.outputs.runner_label }}
|
||||
@ -347,46 +350,55 @@ jobs:
|
||||
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.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"
|
||||
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
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: "${{ env.VERSION }}"
|
||||
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
|
||||
@ -410,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
|
||||
@ -420,7 +435,7 @@ jobs:
|
||||
sudo "$LXC" exec ncp -- "tail -n20 /var/log/ncp.log" || true
|
||||
exit 1
|
||||
}
|
||||
python nextcloud_tests.py --no-gui --skip-release-check "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
|
||||
@ -433,19 +448,27 @@ 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
|
||||
}
|
||||
|
||||
- name: Update ncp
|
||||
env:
|
||||
HEAD_REF: "${{ github.head_ref }}"
|
||||
run: |
|
||||
set -ex
|
||||
BRANCH="${VERSION/refs\/heads\//}"
|
||||
BRANCH="${BRANCH/refs\/tags\//}"
|
||||
if [[ "$BRANCH" =~ "refs/pull/"* ]]
|
||||
then
|
||||
UPDATE_ARGS=("${{ github.head_ref }}" "$VERSION")
|
||||
UPDATE_ARGS=("${HEAD_REF}" "$VERSION")
|
||||
else
|
||||
UPDATE_ARGS=("$BRANCH")
|
||||
fi
|
||||
@ -453,17 +476,22 @@ jobs:
|
||||
echo "Running update to ${VERSION}"
|
||||
|
||||
current_nc_version="$(sudo "$LXC" exec ncp -- ncc status | grep "version:" | awk '{ print $3 }')"
|
||||
latest_nc_version="$(cat etc/ncp.cfg | jq -r '.nextcloud_version')"
|
||||
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
|
||||
sudo "$LXC" exec ncp -- apt-key adv --fetch-keys https://packages.sury.org/php/apt.gpg
|
||||
|
||||
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?}"
|
||||
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
|
||||
|
||||
@ -484,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
|
||||
@ -498,10 +528,14 @@ 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
|
||||
}
|
||||
- name: Checkout current version
|
||||
run: |
|
||||
git fetch origin
|
||||
git checkout "${{ env.VERSION }}"
|
||||
- name: NCP distupgrade
|
||||
id: distupgrade
|
||||
run: |
|
||||
@ -510,10 +544,38 @@ jobs:
|
||||
echo "can't upgrade from Debian $(sudo "$LXC" exec ncp -- cat /etc/os-release | grep VERSION_ID=)"
|
||||
exit 1
|
||||
}
|
||||
current_nc_version="$(sudo "$LXC" exec ncp -- ncc status | grep "version:" | awk '{ print $3 }')"
|
||||
latest_nc_version="$(cat etc/ncp.cfg | jq -r '.nextcloud_version')"
|
||||
|
||||
sudo "$LXC" exec ncp -- bash -c "DEBIAN_FRONTEND=noninteractive ncp-dist-upgrade"
|
||||
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
|
||||
|
||||
for i in {1..10};
|
||||
do
|
||||
echo "running nc update ($i/10)..."
|
||||
sudo "$LXC" exec ncp -- bash -c "DBG=x ncp-update-nc ${latest_nc_version?}"
|
||||
|
||||
sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
|
||||
current_nc_version_new="$(sudo "$LXC" exec ncp -- ncc status | grep "version:" | awk '{ print $3 }')"
|
||||
if [[ "$current_nc_version_new" =~ "$latest_nc_version".* ]]
|
||||
then
|
||||
break
|
||||
fi
|
||||
if [[ "$current_nc_version" == "$current_nc_version_new" ]]
|
||||
then
|
||||
echo "failed to update to $latest_nc_version"
|
||||
exit 1
|
||||
fi
|
||||
current_nc_version="$current_nc_version_new"
|
||||
done
|
||||
fi
|
||||
|
||||
sudo "$LXC" exec ncp -- rm -f /opt/ncdata/data/nextcloud.log
|
||||
|
||||
sudo "$LXC" stop ncp
|
||||
- name: Relaunch container
|
||||
run: |
|
||||
@ -531,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
|
||||
@ -545,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
|
||||
}
|
||||
@ -571,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
|
||||
@ -627,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
|
||||
}
|
||||
@ -673,24 +750,25 @@ 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
|
||||
id: lxd-to-lxc
|
||||
run: |
|
||||
mkdir repackage output
|
||||
cd repackage
|
||||
sudo tar xpf "../${LXD_ARTIFACT_FILE?}"
|
||||
sudo rm -rf ./rootfs/dev
|
||||
LXC_ARTIFACT_FILE="${LXD_ARTIFACT_FILE//LXD/LXC}"
|
||||
sudo tar cpzf "../output/${LXC_ARTIFACT_FILE?}" -C rootfs/ .
|
||||
cd ..
|
||||
sudo chown "$(id -un):" "./output/${LXC_ARTIFACT_FILE}"
|
||||
echo "artifact_file=${LXC_ARTIFACT_FILE?}" >> $GITHUB_OUTPUT
|
||||
echo "artifact_name=${LXD_ARTIFACT_NAME//lxd/lxc}" >> $GITHUB_OUTPUT
|
||||
mkdir repackage output;
|
||||
cd repackage;
|
||||
sudo su - -c "cd '$(pwd)'; tar xpf '../${LXD_ARTIFACT_FILE?}';"
|
||||
sudo rm -rf ./rootfs/dev;
|
||||
LXC_ARTIFACT_FILE="${LXD_ARTIFACT_FILE//LXD/LXC}";
|
||||
sudo tar cpzf "../output/${LXC_ARTIFACT_FILE?}" -C rootfs/ .;
|
||||
cd ..;
|
||||
sudo chown "$(id -un):" "./output/${LXC_ARTIFACT_FILE}";
|
||||
ls -l ./output
|
||||
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 }}"
|
||||
|
||||
129
.github/workflows/build-sd-images.yml
vendored
129
.github/workflows/build-sd-images.yml
vendored
@ -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,30 +67,35 @@ 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.board_id != 'raspberrypi' }}
|
||||
if: "${{ inputs.test_image_url == '' }}"
|
||||
id: build-armbian
|
||||
continue-on-error: true
|
||||
run: |
|
||||
set -ex
|
||||
export IMG="NextcloudPi_${{ inputs.board_name }}_${VERSION//\//_}.img"
|
||||
[[ "${{ github.ref_protected }}" == true ]] || export DBG=x
|
||||
|
||||
|
||||
./build/build-SD-armbian.sh "${{ inputs.board_id }}" "${{ inputs.board_name }}"
|
||||
|
||||
|
||||
artifacts=("armbian/output/images/Armbian"*.img)
|
||||
mkdir -p output
|
||||
mv "${artifacts[0]}" "output/$IMG"
|
||||
echo "artifact_file=${IMG}" >> $GITHUB_OUTPUT
|
||||
echo "ARTIFACT_FILE=${IMG}" >> $GITHUB_ENV
|
||||
- name: "Build Armbian (2nd attempt)"
|
||||
if: ${{ inputs.board_id != 'raspberrypi' && steps.build-armbian.outcome == 'failure' }}
|
||||
if: ${{ steps.build-armbian.outcome == 'failure' }}
|
||||
id: build-armbian-2nd
|
||||
run: |
|
||||
set -ex
|
||||
echo -e "${LOG_CICD} Cleanup armbian build leftovers..."
|
||||
sudo rm -rf armbian/ tmp/ output/
|
||||
|
||||
|
||||
export IMG="NextcloudPi_${{ inputs.board_name }}_${VERSION//\//_}.img"
|
||||
[[ "${{ github.ref_protected }}" == true ]] || export DBG=x
|
||||
|
||||
@ -98,36 +107,14 @@ jobs:
|
||||
echo "artifact_file=${IMG}" >> $GITHUB_OUTPUT
|
||||
echo "ARTIFACT_FILE=${IMG}" >> $GITHUB_ENV
|
||||
- name: "Upload Armbian logs"
|
||||
if: ${{ inputs.board_id != 'raspberrypi' && failure() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ github.run_id }}-${{ inputs.board_id }}-logs
|
||||
path: armbian/output
|
||||
- name: Build RPI SD Image
|
||||
if: ${{ inputs.board_id == 'raspberrypi' }}
|
||||
id: build-rpi
|
||||
run: |
|
||||
set -ex
|
||||
echo -e "${LOG_CICD} Protected? ${{ github.ref_protected }}"
|
||||
export IMG="NextcloudPi_${{ inputs.board_name }}_${VERSION//\//_}.img"
|
||||
[[ "${{ github.ref_protected }}" == true ]] || export DBG=x
|
||||
wget -q https://github.com/multiarch/qemu-user-static/releases/latest/download/qemu-aarch64-static -O ./qemu-aarch64-static
|
||||
./build/build-SD-rpi.sh
|
||||
mkdir -p output
|
||||
mv "tmp/$IMG" ./output/
|
||||
|
||||
for i in {1..10}
|
||||
do
|
||||
sudo losetup | grep "${IMG}" || break;
|
||||
[[ "$i" -lt 10 ]] || { echo -e "${LOG_CICD} Timeout while waiting for image to unmount"; exit 1; }
|
||||
sleep 6
|
||||
echo -e "${LOG_CICD} Retrying ($i out of 10)"
|
||||
done
|
||||
|
||||
echo "artifact_file=${IMG}" >> $GITHUB_OUTPUT
|
||||
echo "ARTIFACT_FILE=${IMG}" >> $GITHUB_ENV
|
||||
- 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 }}
|
||||
@ -135,7 +122,7 @@ jobs:
|
||||
|
||||
test:
|
||||
needs: build
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
env:
|
||||
VERSION: "${{ inputs.git_ref }}"
|
||||
ARTIFACT_ID: ${{ needs.build.outputs.artifact_name }}
|
||||
@ -151,32 +138,33 @@ jobs:
|
||||
steps:
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
# - name: Set up QEMU
|
||||
# run: |
|
||||
# sudo apt-get update
|
||||
# sudo apt-get install -y binfmt-support
|
||||
# docker run --rm --privileged tonistiigi/binfmt:latest --install all
|
||||
# docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes
|
||||
# sudo systemctl disable apparmor
|
||||
# sudo mkdir -p /etc/binfmt
|
||||
# for conf in qemu-{aarch64,arm}-static.conf
|
||||
# do
|
||||
# sed 's/:F$/:OC/' /usr/lib/binfmt.d/$conf | sudo tee /etc/binfmt/$conf
|
||||
# done
|
||||
- name: Disable apparmor
|
||||
run: |
|
||||
sudo systemctl disable apparmor
|
||||
- name: Checkout code
|
||||
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"
|
||||
@ -191,9 +179,9 @@ jobs:
|
||||
echo '[Service]' | sudo tee raspbian_root/etc/systemd/system/redis-server.service.d/ncp.conf
|
||||
echo 'PrivateUsers=false' | sudo tee -a raspbian_root/etc/systemd/system/redis-server.service.d/ncp.conf
|
||||
|
||||
sudo mkdir -p raspbian_root/etc/systemd/system/php8.1-fpm.service.d
|
||||
echo '[Service]' | sudo tee raspbian_root/etc/systemd/system/php8.1-fpm.service.d/ncp.conf
|
||||
echo 'ExecStartPre=mkdir -p /var/run/php' | sudo tee -a raspbian_root/etc/systemd/system/php8.1-fpm.service.d/ncp.conf
|
||||
sudo mkdir -p raspbian_root/etc/systemd/system/php8.3-fpm.service.d
|
||||
echo '[Service]' | sudo tee raspbian_root/etc/systemd/system/php8.3-fpm.service.d/ncp.conf
|
||||
echo 'ExecStartPre=mkdir -p /var/run/php' | sudo tee -a raspbian_root/etc/systemd/system/php8.3-fpm.service.d/ncp.conf
|
||||
- name: Test image
|
||||
id: test
|
||||
run: |
|
||||
@ -214,7 +202,7 @@ jobs:
|
||||
for attempt in {1..30}
|
||||
do
|
||||
echo -e "${LOG_CICD} == Wait until container network is available (attempt $attempt/30) =="
|
||||
ip="$("${CONTAINER_CMD[@]}" bash -c '. /usr/local/etc/library.sh > /dev/null; get_ip')"
|
||||
ip="$("${CONTAINER_CMD[@]}" bash -c '. /usr/local/etc/library.sh > /dev/null; get_ip')"
|
||||
[[ -n "$ip" ]] && curl -k "https://$ip/activate/" > /dev/null || { sleep 6; continue; }
|
||||
success=true
|
||||
break
|
||||
@ -249,12 +237,14 @@ jobs:
|
||||
done
|
||||
|
||||
[[ "$success" == "true" ]] || {
|
||||
echo -e "${LOG_CICD} Timeout reached."
|
||||
"${CONTAINER_CMD[@]}" -q systemctl status mysql |& awk "{ print \"${LOG_DIAG} \" \$0 }"
|
||||
"${CONTAINER_CMD[@]}" -q systemctl status redis |& awk "{ print \"${LOG_DIAG} \" \$0 }"
|
||||
"${CONTAINER_CMD[@]}" -q systemctl status 'php*-fpm' |& awk "{ print \"${LOG_DIAG} \" \$0 }"
|
||||
"${CONTAINER_CMD[@]}" -q systemctl status apache2 |& awk "{ print \"${LOG_DIAG} \" \$0 }"
|
||||
"${CONTAINER_CMD[@]}" -q ncp-diag |& awk "{ print \"${LOG_DIAG} \" \$0 }"
|
||||
echo -e "${LOG_CICD} ERR: Timeout reached."
|
||||
"${CONTAINER_CMD[@]}" -q systemctl status mysql |& awk "{ print \"${LOG_DIAG} \" \$0 }" ||:
|
||||
"${CONTAINER_CMD[@]}" -q systemctl status redis-server |& awk "{ print \"${LOG_DIAG} \" \$0 }" ||:
|
||||
sudo journalctl --file ./raspbian_root/var/log/journal/"$(sudo cat ./raspbian_root/etc/machine-id)"/system.journal --no-pager -eu redis-server ||:
|
||||
"${CONTAINER_CMD[@]}" -q journalctl --no-pager -eu redis-server
|
||||
"${CONTAINER_CMD[@]}" -q systemctl status 'php*-fpm' |& awk "{ print \"${LOG_DIAG} \" \$0 }" ||:
|
||||
"${CONTAINER_CMD[@]}" -q systemctl status apache2 |& awk "{ print \"${LOG_DIAG} \" \$0 }" ||:
|
||||
"${CONTAINER_CMD[@]}" -q ncp-diag |& awk "{ print \"${LOG_DIAG} \" \$0 }" ||:
|
||||
exit 1
|
||||
}
|
||||
|
||||
@ -265,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:"
|
||||
@ -289,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
|
||||
@ -307,18 +297,27 @@ 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:"
|
||||
"${CONTAINER_CMD[@]}" -q ncp /bin/bash -c 'cat /etc/os-release'
|
||||
echo -e "${LOG_DIAG} /usr/local/etc/ncp.cfg:"
|
||||
"${CONTAINER_CMD[@]}" --pipe -q ncp /bin/bash -c 'cat /usr/local/etc/ncp.cfg'
|
||||
cat ./raspbian_root/usr/local/etc/ncp.cfg
|
||||
echo -e "${LOG_DIAG} /home/ncp-app-bridge config ncp"
|
||||
sudo ls -l ./raspbian_root/home/www/ncp-app-bridge.sh
|
||||
"${CONTAINER_CMD[@]}" --pipe --uid=33 ncp /bin/bash -c 'sudo /home/www/ncp-app-bridge.sh config ncp'
|
||||
echo -e "{$LOG_DIAG} Geckodriver logs:"
|
||||
tail -n 20 geckodriver.log >&2 |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
|
||||
echo -e "${LOG_CICD} ================"
|
||||
echo -e "${LOG_DIAG} ncp.log: "
|
||||
"${CONTAINER_CMD[@]}" -q ncp /bin/bash -c "tail -n20 /var/log/ncp.log" |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
|
||||
"${CONTAINER_CMD[@]}" --pipe ncp /bin/bash -c "tail -n20 /var/log/ncp.log" |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
|
||||
echo "================"
|
||||
echo "${LOG_DIAG} Nextcloud log: "
|
||||
"${CONTAINER_CMD[@]}" -q ncp /bin/bash -c 'ls -l /opt/ncdata/data/nextcloud.log' |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
|
||||
"${CONTAINER_CMD[@]}" -q ncp /bin/bash -c 'cat /opt/ncdata/data/nextcloud.log' |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
|
||||
"${CONTAINER_CMD[@]}" --pipe -q ncp /bin/bash -c 'ls -l /opt/ncdata/data/nextcloud.log' |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
|
||||
"${CONTAINER_CMD[@]}" --pipe -q ncp /bin/bash -c 'cat /opt/ncdata/data/nextcloud.log' |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
|
||||
sudo cat ./raspbian_root/opt/ncdata/data/nextcloud.log |& awk "{ print \"${LOG_DIAG} \" \$0 }"
|
||||
sleep 12
|
||||
continue
|
||||
}
|
||||
@ -358,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"
|
||||
|
||||
4
.github/workflows/publish-image.yml
vendored
4
.github/workflows/publish-image.yml
vendored
@ -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}"
|
||||
|
||||
92
.github/workflows/release.yml
vendored
92
.github/workflows/release.yml
vendored
@ -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
|
||||
@ -136,6 +142,22 @@ jobs:
|
||||
board_id: odroidc2
|
||||
board_name: OdroidC2
|
||||
secrets: inherit
|
||||
orangepi5:
|
||||
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: orangepi5
|
||||
board_name: OrangePi5
|
||||
secrets: inherit
|
||||
orangepi5plus:
|
||||
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: orangepi5-plus
|
||||
board_name: OrangePi5Plus
|
||||
secrets: inherit
|
||||
|
||||
lxd-x86-release:
|
||||
needs:
|
||||
@ -185,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
|
||||
@ -294,6 +304,30 @@ jobs:
|
||||
artifact_file: "${{ needs.odroidc2.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
|
||||
orangepi5-release:
|
||||
needs:
|
||||
- orangepi5
|
||||
- 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.orangepi5.outputs.artifact_name }}"
|
||||
artifact_file: "${{ needs.orangepi5.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
|
||||
orangepi5plus-release:
|
||||
needs:
|
||||
- orangepi5plus
|
||||
- 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.orangepi5plus.outputs.artifact_name }}"
|
||||
artifact_file: "${{ needs.orangepi5plus.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
|
||||
|
||||
github-release:
|
||||
if: ${{ github.event_name == 'workflow_dispatch' || !startsWith(github.ref_name, 'docker-') }}
|
||||
@ -324,8 +358,14 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
|
||||
NC_VERSION="$(jq -r '.nextcloud_version' < etc/ncp.cfg)"
|
||||
PHP_VERSION="$(jq -r '.php_version' < etc/ncp.cfg)"
|
||||
DEBIAN_VERSION="$(jq -r '.release' < etc/ncp.cfg)"
|
||||
ARMBIAN_VERSIOn="$(cat build/armbian/armbian_version)"
|
||||
|
||||
subject="$(git tag -n10 --format="%(contents:subject)" "${{ env.VERSION }}")"
|
||||
body="$(git tag -n10 --format="%(contents:body)" "${{ env.VERSION }}")"
|
||||
body="$(git tag -n30 --format="%(contents:body)" "${{ env.VERSION }}")"
|
||||
separator="
|
||||
|
||||
---
|
||||
@ -334,6 +374,12 @@ jobs:
|
||||
|
||||
gh release create --draft -F - "${{ env.VERSION }}" <<EOF
|
||||
${subject:-No message found}
|
||||
|
||||
### Included Software
|
||||
Nextcloud ${NC_VERSION} (can be automatically updated to latest minor version)
|
||||
PHP ${PHP_VERSION}
|
||||
Debian ${DEBIAN_VERSION}
|
||||
Armbian ${ARMBIAN_VERSION}
|
||||
|
||||
${body:+${body}${separator}}
|
||||
|
||||
|
||||
57
.github/workflows/vm-tests.yml
vendored
57
.github/workflows/vm-tests.yml
vendored
@ -52,18 +52,19 @@ 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
|
||||
if-no-files-found: error
|
||||
include-hidden-files: true
|
||||
- id: create-test-instance
|
||||
uses: ./.github/actions/create-test-instance
|
||||
with:
|
||||
version: ${{ env.VERSION }}
|
||||
uid: "${{ env.UID }}"
|
||||
hcloud_token: ${{ secrets.TEST_AUTOMATION_HCLOUD_API_TOKEN }}
|
||||
server_type: "cx11"
|
||||
server_type: "cx22"
|
||||
- name: set instance variables
|
||||
run: |
|
||||
echo "SERVER_ADDRESS=${{ steps.create-test-instance.outputs.server_address }}" >> "$GITHUB_ENV"
|
||||
@ -301,18 +302,19 @@ 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
|
||||
if-no-files-found: error
|
||||
include-hidden-files: true
|
||||
- id: create-test-instance
|
||||
uses: ./.github/actions/create-test-instance-bullseye
|
||||
with:
|
||||
version: "${{ env.PREVIOUS_VERSION }}"
|
||||
uid: "${{ env.UID }}"
|
||||
hcloud_token: ${{ secrets.TEST_AUTOMATION_HCLOUD_API_TOKEN }}
|
||||
server_type: "cx11"
|
||||
server_type: "cx22"
|
||||
- name: Set instance variables
|
||||
run: |
|
||||
echo "SERVER_ADDRESS=${{ steps.create-test-instance.outputs.server_address }}" >> "$GITHUB_ENV"
|
||||
@ -339,7 +341,7 @@ jobs:
|
||||
|
||||
echo "Run integration tests"
|
||||
ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null" "root@${SERVER_ADDRESS}" cat /usr/local/etc/instance.cfg
|
||||
test-ncp-instance -a -f "$SNAPSHOT_ID" -b "${VERSION}" --systemtest-args "--skip-update-test" --nc-test-args "--skip-release-check" "root@${SERVER_ADDRESS}" "localhost" "8443" "9443" || {
|
||||
test-ncp-instance -a -f "$SNAPSHOT_ID" -b "v1.54.3" --systemtest-args "--skip-update-test" --nc-test-args "--skip-release-check" "root@${SERVER_ADDRESS}" "localhost" "8443" "9443" || {
|
||||
|
||||
echo "Integration tests failed"
|
||||
echo "Here are the last lines of ncp-install.log:"
|
||||
@ -385,7 +387,7 @@ jobs:
|
||||
NC_TEST_ARGS=()
|
||||
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" cat /etc/os-release | grep VERSION_ID=12 || NC_TEST_ARGS+=("--skip-release-check")
|
||||
set -x
|
||||
test-ncp-instance -f "$SNAPSHOT_ID" -b "${VERSION}" --nc-test-args "$NC_TEST_ARGS" --systemtest-args "--skip-update-test" "root@${SERVER_ADDRESS}" "localhost" "8443" "9443" || {
|
||||
test-ncp-instance -f "$SNAPSHOT_ID" -b "v1.54.3" --nc-test-args "$NC_TEST_ARGS" --systemtest-args "--skip-update-test" "root@${SERVER_ADDRESS}" "localhost" "8443" "9443" || {
|
||||
|
||||
echo "Integration tests failed"
|
||||
echo "Here are the last lines of ncp-install.log:"
|
||||
@ -418,6 +420,45 @@ jobs:
|
||||
}
|
||||
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" DEBIAN_FRONTEND=noninteractive ncp-dist-upgrade
|
||||
echo "skipped=no" | tee -a $GITHUB_OUTPUT
|
||||
- name: Update Nextcloud
|
||||
working-directory: /__w/nextcloudpi/nextcloudpi/ncp-test-automation/bin
|
||||
run: |
|
||||
set -ex
|
||||
apk add jq
|
||||
|
||||
echo "Setup ssh"
|
||||
eval "$(ssh-agent)"
|
||||
ssh-add /__w/nextcloudpi/nextcloudpi/.ssh/automation_ssh_key
|
||||
|
||||
source ./library.sh
|
||||
|
||||
current_nc_version="$(ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" "ncc status" | grep "version:" | awk '{ print $3 }')"
|
||||
latest_nc_version="$(cat ../../etc/ncp.cfg | jq -r '.nextcloud_version')"
|
||||
|
||||
if [[ "$current_nc_version" =~ "$latest_nc_version".* ]]
|
||||
then
|
||||
echo "Nextcloud is up to date - skipping NC update test."
|
||||
else
|
||||
for i in {1..10};
|
||||
do
|
||||
echo "running nc update ($i/10)..."
|
||||
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" "bash -c 'DBG=x ncp-update-nc ${latest_nc_version?}'"
|
||||
|
||||
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" /usr/local/bin/ncc status
|
||||
|
||||
current_nc_version_new="$(ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" "ncc status" | grep "version:" | awk '{ print $3 }')"
|
||||
if [[ "$current_nc_version_new" =~ "$latest_nc_version".* ]]
|
||||
then
|
||||
break
|
||||
fi
|
||||
if [[ "$current_nc_version" == "$current_nc_version_new" ]]
|
||||
then
|
||||
echo "failed to update to $latest_nc_version"
|
||||
exit 1
|
||||
fi
|
||||
current_nc_version="$current_nc_version_new"
|
||||
done
|
||||
fi
|
||||
|
||||
- name: Run integration tests after dist-upgrade
|
||||
id: final_test
|
||||
@ -473,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 }}
|
||||
@ -580,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 }}
|
||||
|
||||
14
FUNDING.yml
Normal file
14
FUNDING.yml
Normal file
@ -0,0 +1,14 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: thecalcaholic
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||
polar: # Replace with a single Polar username
|
||||
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
50
README.md
50
README.md
@ -27,23 +27,21 @@ 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]
|
||||
[](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]
|
||||
[](https://github.com/nextcloud/nextcloudpi/actions/workflows/release.yml)
|
||||
|
||||
---
|
||||
|
||||
## Features
|
||||
|
||||
* Raspberry Pi OS/Debian 11 _(Bullseye)_
|
||||
* Raspberry Pi OS/Debian 12 _(Bookworm)_
|
||||
* Nextcloud
|
||||
* Apache, with HTTP2 enabled
|
||||
* PHP 8.1
|
||||
@ -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 -->
|
||||
|
||||
|
||||
@ -6,18 +6,23 @@ set -e
|
||||
|
||||
source /usr/local/etc/library.sh # sets NCLATESTVER
|
||||
|
||||
CURRENT="$(ncc status | grep "version:" | awk '{ print $3 }')"
|
||||
LATEST="$(wget -qO- https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/etc/ncp.cfg | jq -r .nextcloud_version)"
|
||||
CURRENT="$(nc_version)"
|
||||
NEXT_VERSION="$(determine_nc_update_version "${CURRENT}" "${NCLATESTVER?}")"
|
||||
if [[ -z "$NEXT_VERSION" ]] || [[ "$NEXT_VERSION" == "${CURRENT}" ]]
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
NOTIFIED=/var/run/.nc-version-notified
|
||||
|
||||
test -e "${NOTIFIED}" && [[ "${LATEST}" == "$( cat "${NOTIFIED}" )" ]] && {
|
||||
echo "Found update from ${CURRENT} to ${LATEST}. Already notified"
|
||||
test -e "${NOTIFIED}" && [[ "${NEXT_VERSION}" == "$( cat "${NOTIFIED}" )" ]] && {
|
||||
echo "Found update from ${CURRENT} to ${NEXT_VERSION}. Already notified"
|
||||
exit 0
|
||||
}
|
||||
|
||||
if is_more_recent_than "${LATEST}" "${CURRENT}"; then
|
||||
if is_more_recent_than "${NEXT_VERSION}" "${CURRENT}"; then
|
||||
notify_admin \
|
||||
"Nextcloud update" \
|
||||
"Update from ${CURRENT} to ${LATEST} is available. Update from https://$(get_ip):4443"
|
||||
echo "${LATEST}" > "${NOTIFIED}"
|
||||
"Update from ${CURRENT} to ${NEXT_VERSION} is available. Update from https://$(get_ip):4443"
|
||||
echo "${NEXT_VERSION}" > "${NOTIFIED}"
|
||||
fi
|
||||
|
||||
@ -6,8 +6,8 @@ VERFILE=/usr/local/etc/ncp-version
|
||||
LATEST=/var/run/.ncp-latest-version
|
||||
|
||||
if ncp-test-updates; then
|
||||
echo -e "\nNextCloudPi \e[1m$( cat $VERFILE)\e[0m is outdated"
|
||||
echo -e "\nNextcloudPi \e[1m$( cat $VERFILE)\e[0m is outdated"
|
||||
echo -e "update to \e[1m$( cat $LATEST )\e[0m through 'ncp-config' or type 'sudo ncp-update'"
|
||||
else
|
||||
echo -e "\nNextCloudPi \e[1m$( cat $VERFILE)\e[0m is up to date"
|
||||
echo -e "\nNextcloudPi \e[1m$( cat $VERFILE)\e[0m is up to date"
|
||||
fi
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# NextCloudPi software configuration
|
||||
# NextcloudPi software configuration
|
||||
#
|
||||
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
@ -23,7 +23,7 @@ source /usr/local/etc/library.sh
|
||||
|
||||
latest_ver="$(cat /var/run/.ncp-latest-version 2>/dev/null)"
|
||||
whiptail --backtitle "$backtitle $ncpversion" \
|
||||
--title "NextCloudPi update available" \
|
||||
--title "NextcloudPi update available" \
|
||||
--clear --yesno "Update to $latest_ver?\n\n$changelog" \
|
||||
15 70
|
||||
|
||||
@ -59,7 +59,7 @@ function generate_list()
|
||||
function config_menu()
|
||||
{
|
||||
local dir="$1"
|
||||
local backtitle="NextCloudPi configuration ver. "
|
||||
local backtitle="NextcloudPi configuration ver. "
|
||||
local ncpversion="$(cat /usr/local/etc/ncp-version )"
|
||||
local cfgdir=/usr/local/etc/ncp-config.d
|
||||
local dialog_ok=0
|
||||
@ -73,7 +73,7 @@ function config_menu()
|
||||
# launch the selection menu
|
||||
[[ "$dir" == "$BINDIR" ]] && local cancel_btn="Finish" || local cancel_btn="Back"
|
||||
ncp_app=$( whiptail --backtitle "$backtitle $ncpversion" \
|
||||
--title "NextCloudPi Configuration Tool (ncp-config)" \
|
||||
--title "NextcloudPi Configuration Tool (ncp-config)" \
|
||||
--cancel-button $cancel_btn --ok-button Select \
|
||||
--menu "Select ncp-app to configure or activate:" 20 105 10 \
|
||||
"${list[@]}" \
|
||||
|
||||
@ -151,7 +151,7 @@ echo "Gateway|$GW"
|
||||
echo "Interface|$IFACE"
|
||||
|
||||
# Certificates
|
||||
CERTS="$( grep "SSLCertificateFile */etc/letsencrypt/live/" /etc/apache2/sites-available/nextcloud.conf \
|
||||
CERTS="$( grep "SSLCertificateFile */etc/letsencrypt/live/" /etc/apache2/sites-available/001-nextcloud.conf \
|
||||
| sed 's|.*SSLCertificateFile */etc/letsencrypt/live/||;s|/fullchain.pem||' )"
|
||||
[[ "$CERTS" == "" ]] && CERTS=none
|
||||
echo "Certificates|$CERTS"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/bash
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
@ -37,7 +37,9 @@ save_maintenance_mode
|
||||
|
||||
# Perform dist-upgrade
|
||||
|
||||
apt-get update && apt-get upgrade -y
|
||||
apt-get update
|
||||
apt-get remove -y libc-dev-bin || true
|
||||
apt-get upgrade -y
|
||||
for aptlist in /etc/apt/sources.list /etc/apt/sources.list.d/{php.list,armbian.list,raspi.list}
|
||||
do
|
||||
[ -f "$aptlist" ] && sed -i -e "s/bullseye/bookworm/g" "$aptlist"
|
||||
@ -49,13 +51,16 @@ do
|
||||
sed -i -e "s/deb/#deb/g" "$aptlist"
|
||||
}
|
||||
done
|
||||
apt-get update && apt-get upgrade -y --without-new-pkgs
|
||||
apt-get update
|
||||
apt-get upgrade -y dpkg
|
||||
apt-get upgrade -y --without-new-pkgs
|
||||
if is_lxc
|
||||
then
|
||||
# Required to avoid breakage of /etc/resolv.conf
|
||||
apt-get install -y --no-install-recommends systemd-resolved && systemctl enable --now systemd-resolved
|
||||
fi
|
||||
apt-get full-upgrade -y
|
||||
sudo apt-get install -y --no-install-recommends libc-dev-bin || true
|
||||
sudo apt-get --purge autoremove -y
|
||||
|
||||
apt-get install -y --no-install-recommends exfatprogs
|
||||
|
||||
@ -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
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# NextCloudPi diagnostics report
|
||||
# NextcloudPi diagnostics report
|
||||
#
|
||||
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# NextCloudPi configuration suggestions
|
||||
# NextcloudPi configuration suggestions
|
||||
#
|
||||
# Copyleft 2018 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# update latest NextCloudPi code from github
|
||||
# update latest NextcloudPi code from github
|
||||
|
||||
[[ -z "$DBG" ]] || set -$DBG
|
||||
|
||||
@ -61,7 +61,7 @@ fi
|
||||
sed '/HEAD ->\|origin/s|\[.*\(tag: v[0-9]\+\.[0-9]\+\.[0-9]\+\).*\]|[\1]|' | \
|
||||
sed 's|* \[tag: |[|' > /usr/local/etc/ncp-changelog
|
||||
|
||||
echo -e "NextCloudPi updated to version $VER"
|
||||
echo -e "NextcloudPi updated to version $VER"
|
||||
exit 0
|
||||
|
||||
} # force to read the whole thing into memory, as its contents might change in update.sh
|
||||
|
||||
@ -19,297 +19,50 @@
|
||||
|
||||
set -eE${DBG}
|
||||
|
||||
VER="$1"
|
||||
BIN="${0##*/}"
|
||||
|
||||
source /usr/local/etc/library.sh
|
||||
|
||||
# pre-checks
|
||||
####################
|
||||
VER="$1"
|
||||
[[ "$VER" == "" ]] && { echo "Usage ${BIN} <version>"; exit 1; }
|
||||
[[ -f /.docker-image ]] && BASEDIR=/data || BASEDIR=/var/www
|
||||
cd "$BASEDIR"
|
||||
DATADIR="$( get_nc_config_value datadirectory )"
|
||||
ncc status &>/dev/null || { [[ "$DBG" == x ]] && ncc status; echo "Nextcloud is currently down"; exit 1; }
|
||||
[[ -d "${BASEDIR}/nextcloud-old" ]] && { echo "Nextcloud backup directory found. Interrupted or already running installation?"; exit 1; }
|
||||
[[ -d "${BASEDIR}/nextcloud" ]] || { echo "Nextcloud directory not found" ; exit 1; }
|
||||
[[ -d "$DATADIR" ]] || { echo "Nextcloud data directory not found" ; exit 1; }
|
||||
|
||||
# check version
|
||||
####################
|
||||
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
|
||||
|
||||
[[ ${EUID} -eq 0 ]] && SUDO="sudo -u www-data"
|
||||
CURRENT="$( $SUDO php /var/www/nextcloud/occ status | grep "version:" | awk '{ print $3 }' )"
|
||||
|
||||
MAJOR_CUR=$( cut -d. -f1 <<<"${CURRENT}" )
|
||||
MAJOR_NEW=$( cut -d. -f1 <<<"${VER}" )
|
||||
if [[ $((MAJOR_NEW - MAJOR_CUR)) -gt 1 ]]; then
|
||||
echo "Upgrade cannot skip major versions. Please upgrade one major version at a time" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$MAJOR_NEW" -ge 24 ]] && [[ "$(lsb_release -r)" =~ .*10 ]]
|
||||
then
|
||||
echo -e "NCP doesn't support Nextcloud versions greater than 23 with Debian 10 (Buster). Please run ncp-dist-upgrade."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
grep -qP "\d+\.\d+\.\d+" <<<"$CURRENT" || { echo "Malformed version $CURRENT"; exit 1; }
|
||||
grep -qP "\d+\.\d+\.\d+" <<<"$VER" || { echo "Malformed version $VER" ; exit 1; }
|
||||
|
||||
echo "Current Nextcloud version $CURRENT"
|
||||
echo "Available Nextcloud version $VER"
|
||||
is_more_recent_than "${VER}" "${CURRENT}" || { echo "Nothing to update"; exit 1; } # we want `exit 1` so the autoupdate doesn't notify success in this case
|
||||
|
||||
|
||||
if ! is_more_recent_than '25.0.0' "${VER}" && is_more_recent_than "8.1.0" "${PHPVER}.0" && is_docker
|
||||
then
|
||||
echo 'You need to upgrade to a later docker image in order to upgrade to Nextcloud 25+'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# make sure that cron.php is not running and there are no pending jobs
|
||||
# https://github.com/nextcloud/server/issues/10949
|
||||
pgrep -cf cron.php &>/dev/null && { pkill -f cron.php; sleep 3; }
|
||||
pgrep -cf cron.php &>/dev/null && { echo "cron.php running. Abort"; exit 1; }
|
||||
mysql nextcloud <<<"UPDATE ${DB_PREFIX}jobs SET reserved_at=0;"
|
||||
|
||||
# cleanup
|
||||
####################
|
||||
cleanup() {
|
||||
local RET=$?
|
||||
set +eE
|
||||
echo "Clean up..."
|
||||
rm -rf "$BASEDIR"/nextcloud.tar.bz2 "$BASEDIR"/nextcloud-old
|
||||
trap "" EXIT
|
||||
exit $RET
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
# get new code
|
||||
####################
|
||||
URL="https://download.nextcloud.com/server/releases/nextcloud-$VER.tar.bz2"
|
||||
echo "Download Nextcloud $VER..."
|
||||
wget -q "$URL" -O nextcloud.tar.bz2 || { echo "Error downloading"; exit 1; }
|
||||
|
||||
# backup
|
||||
####################
|
||||
BKPDIR="$BASEDIR"
|
||||
WITH_DATA=no
|
||||
COMPRESSED=yes
|
||||
LIMIT=0
|
||||
|
||||
echo "Back up current instance..."
|
||||
set +eE
|
||||
ncp-backup "$BKPDIR" "$WITH_DATA" "$COMPRESSED" "$LIMIT" # && false # test point
|
||||
RET=$?
|
||||
sync
|
||||
set -eE
|
||||
|
||||
BKP_="$( ls -1t "$BKPDIR"/nextcloud-bkp_*.tar.gz 2>/dev/null | head -1 )"
|
||||
[[ -f "$BKP_" ]] || { set +eE; echo "Error backing up"; false || cleanup; }
|
||||
[[ $RET -ne 0 ]] && { rm -f "$BKP_"; set +eE; echo "Error backing up"; false || cleanup; }
|
||||
BKP="$( dirname "$BKP_" )/$( basename "$BKP_" .tar.gz )-${CURRENT}.tar.gz"
|
||||
echo "Storing backup at '$BKP'..."
|
||||
mv "$BKP_" "$BKP"
|
||||
|
||||
# simple restore if anything fails from here
|
||||
####################
|
||||
rollback_simple() {
|
||||
set +eE
|
||||
trap "" INT TERM HUP ERR
|
||||
echo -e "Abort\nSimple roll back..."
|
||||
rm -rf "$BASEDIR"/nextcloud
|
||||
mv "$BASEDIR"/nextcloud-old "$BASEDIR"/nextcloud
|
||||
false || cleanup # so cleanup exits with 1
|
||||
}
|
||||
trap rollback_simple INT TERM HUP ERR
|
||||
|
||||
# replace code
|
||||
####################
|
||||
echo "Install Nextcloud $VER..."
|
||||
mv -T nextcloud nextcloud-old
|
||||
tar -xf nextcloud.tar.bz2 # && false # test point
|
||||
rm -rf /var/www/nextcloud.tar.bz2
|
||||
|
||||
# copy old config
|
||||
####################
|
||||
cp nextcloud-old/config/config.php nextcloud/config/
|
||||
|
||||
# copy old themes
|
||||
####################
|
||||
cp -raT nextcloud-old/themes/ nextcloud/themes/
|
||||
|
||||
# copy old NCP 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/
|
||||
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 (or was installed already)."
|
||||
return 1
|
||||
else
|
||||
echo "Nextcloud update was not found or failed (unexpected status: '$(systemctl is-active ncp-update-nc ||:)')"
|
||||
fi
|
||||
done
|
||||
|
||||
#false # test point
|
||||
|
||||
# copy data if it was at the default location
|
||||
####################
|
||||
if [[ "$DATADIR" == "/var/www/nextcloud/data" ]] || [[ "$DATADIR" == "/data/nextcloud/data" ]]; then
|
||||
echo "Restore data..."
|
||||
mv -T nextcloud-old/data nextcloud/data
|
||||
fi
|
||||
|
||||
# nc-restore if anything fails from here
|
||||
####################
|
||||
rollback() {
|
||||
set +eE
|
||||
trap "" INT TERM HUP ERR EXIT
|
||||
echo -e "Abort\nClean up..."
|
||||
rm -rf /var/www/nextcloud.tar.bz2 "$BASEDIR"/nextcloud-old
|
||||
echo "Rolling back to backup $BKP..."
|
||||
local TMPDATA
|
||||
mkdir -p "$BASEDIR/recovery/"
|
||||
TMPDATA="$( mktemp -d "$BASEDIR/recovery/ncp-data.XXXXXX" )" || { echo "Failed to create temp dir" >&2; exit 1; }
|
||||
[[ "$DATADIR" == "$BASEDIR/nextcloud/data" ]] && mv -T "$DATADIR" "$TMPDATA"
|
||||
ncp-restore "$BKP" || { echo "Rollback failed! Data left at $TMPDATA"; exit 1; }
|
||||
[[ "$DATADIR" == "$BASEDIR/nextcloud/data" ]] && { rm -rf "$DATADIR"; mv -T "$TMPDATA" "$DATADIR"; }
|
||||
rm "$BKP"
|
||||
echo "Rollback successful. Nothing was updated"
|
||||
exit 1
|
||||
}
|
||||
trap rollback INT TERM HUP ERR
|
||||
|
||||
# fix permissions
|
||||
####################
|
||||
echo "Fix permissions..."
|
||||
chown -R www-data:www-data nextcloud
|
||||
find nextcloud/ -type d -exec chmod 750 {} \;
|
||||
find nextcloud/ -type f -exec chmod 640 {} \;
|
||||
|
||||
# upgrade
|
||||
####################
|
||||
echo "Upgrade..."
|
||||
ncc='sudo -u www-data php nextcloud/occ'
|
||||
$ncc upgrade # && false # test point
|
||||
$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
|
||||
|
||||
# use the correct version for custom apps
|
||||
NCVER="$(ncc status | grep "version:" | awk '{ print $3 }')"
|
||||
if is_more_recent_than "21.0.0" "${NCVER}"; then
|
||||
NCPREV=/var/www/ncp-previewgenerator/ncp-previewgenerator-nc20
|
||||
else
|
||||
# Install notify_push if not installed
|
||||
if ! is_app_enabled notify_push; then
|
||||
ncc app:install notify_push
|
||||
ncc app:enable notify_push
|
||||
install_template nextcloud.conf.sh /etc/apache2/sites-available/nextcloud.conf
|
||||
a2enmod proxy proxy_http proxy_wstunnel
|
||||
apachectl -k graceful
|
||||
## make sure the notify_push daemon is runnnig
|
||||
|
||||
install_template systemd/notify_push.service.sh /etc/systemd/system/notify_push.service
|
||||
start_notify_push
|
||||
nc_domain="$(ncc config:system:get overwrite.cli.url)"
|
||||
set-nc-domain "${nc_domain}" || {
|
||||
echo "notify_push setup failed. You are probably behind a proxy"
|
||||
echo "Run 'ncc config:system:set trusted_proxies 15 --value=<proxy_IP>' and then 'ncc notify_push:setup https://<domain>/push to enable"
|
||||
echo "Check https://help.nextcloud.com/tags/ncp for support"
|
||||
}
|
||||
|
||||
fi
|
||||
NCPREV=/var/www/ncp-previewgenerator/ncp-previewgenerator-nc21
|
||||
fi
|
||||
rm -rf /var/www/nextcloud/apps/previewgenerator
|
||||
ln -snf "${NCPREV}" /var/www/nextcloud/apps/previewgenerator
|
||||
|
||||
if ! is_docker && ! is_more_recent_than "24.0.0" "${NCVER}" && is_more_recent_than "8.1.0" "${PHPVER}.0"
|
||||
if [[ "$(systemctl is-active ncp-update-nc ||:)" =~ ^(active|activating|deactivating)$ ]]
|
||||
then
|
||||
(
|
||||
echo "Upgrading PHP..."
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
PHPVER_OLD="$PHPVER"
|
||||
PHPVER_NEW="8.1"
|
||||
PHP_PACKAGES_OLD=(php-{common,igbinary,redis,json} "php${PHPVER_OLD}" \
|
||||
"php${PHPVER_OLD}"-{curl,gd,fpm,cli,opcache,mbstring,xml,zip,fileinfo,ldap,intl,bz2,json,common,readline,mysql,bcmath,gmp})
|
||||
PHP_PACKAGES_NEW=("php${PHPVER_NEW}" \
|
||||
"php${PHPVER_NEW}"-{curl,gd,fpm,cli,opcache,mbstring,xml,zip,fileinfo,ldap,intl,bz2,mysql,bcmath,gmp,redis,common})
|
||||
|
||||
php_restore() {
|
||||
trap "" INT TERM HUP ERR
|
||||
echo "Something went wrong while upgrading PHP. Rolling back to version ${PHPVER_OLD}..."
|
||||
set +e
|
||||
service "php${PHPVER_NEW}-fpm" stop
|
||||
a2disconf php${PHPVER_NEW}-fpm
|
||||
rm /etc/apt/sources.list.d/php.list
|
||||
apt-get update
|
||||
apt-get remove --purge -y "${PHP_PACKAGES_NEW[@]}"
|
||||
apt-get install -y --no-install-recommends -t "$RELEASE" "${PHP_PACKAGES_OLD[@]}"
|
||||
set_ncpcfg "php_version" "${PHPVER_OLD}"
|
||||
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER_NEW}/mods-available/opcache.ini"
|
||||
run_app nc-limits
|
||||
a2enconf "php${PHPVER_OLD}-fpm"
|
||||
service "php${PHPVER_OLD}-fpm" start
|
||||
service apache2 restart
|
||||
echo "PHP upgrade has been successfully reverted"
|
||||
set -e
|
||||
}
|
||||
|
||||
trap php_restore INT TERM HUP ERR
|
||||
|
||||
# Setup apt repository for php 8
|
||||
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
|
||||
echo "deb https://packages.sury.org/php/ ${RELEASE%-security} main" > /etc/apt/sources.list.d/php.list
|
||||
apt-get update
|
||||
|
||||
clear_opcache
|
||||
|
||||
echo "Stopping apache and php-fpm..."
|
||||
service "php${PHPVER_OLD}-fpm" stop
|
||||
service apache2 stop
|
||||
|
||||
echo "Remove old PHP (${PHPVER_OLD})..."
|
||||
a2disconf "php${PHPVER_OLD}-fpm"
|
||||
|
||||
apt-get remove --purge -y "${PHP_PACKAGES_OLD[@]}"
|
||||
|
||||
echo "Install PHP ${PHPVER_NEW}..."
|
||||
install_with_shadow_workaround --no-install-recommends systemd
|
||||
apt-get install -y --no-install-recommends -t "$RELEASE" "${PHP_PACKAGES_NEW[@]}"
|
||||
|
||||
set_ncpcfg "php_version" "${PHPVER_NEW}"
|
||||
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER_NEW}/mods-available/opcache.ini"
|
||||
( set -e; export PHPVER="${PHPVER_NEW}"; run_app nc-limits )
|
||||
|
||||
a2enconf "php${PHPVER_NEW}-fpm"
|
||||
|
||||
echo "Starting apache and php-fpm..."
|
||||
service "php${PHPVER_NEW}-fpm" start
|
||||
service apache2 start
|
||||
ncc status
|
||||
)
|
||||
|
||||
# Reload library.sh to reset PHPVER
|
||||
source /usr/local/etc/library.sh
|
||||
|
||||
echo "Existing ncp-update-nc process detected. Connecting..."
|
||||
connect_to_nc_update
|
||||
exit $?
|
||||
fi
|
||||
|
||||
# refresh completions
|
||||
ncc _completion -g --shell-type bash -p ncc | sed 's|/var/www/nextcloud/occ|ncc|g' > /usr/share/bash-completion/completions/ncp
|
||||
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
|
||||
|
||||
is_docker && {
|
||||
killall notify_push
|
||||
sleep 1
|
||||
start_notify_push
|
||||
}
|
||||
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
|
||||
|
||||
echo "Update completed successfully."
|
||||
# done
|
||||
####################
|
||||
mkdir -p "$DATADIR"/ncp-update-backups
|
||||
mv "$BKP" "$DATADIR"/ncp-update-backups
|
||||
chown -R www-data:www-data "$DATADIR"/ncp-update-backups
|
||||
BKP="$DATADIR"/ncp-update-backups/"$( basename "$BKP" )"
|
||||
echo "Backup stored at $BKP"
|
||||
|
||||
bash -c "sleep 5; source /usr/local/etc/library.sh; clear_opcache;" &>/dev/null &
|
||||
connect_to_nc_update
|
||||
|
||||
261
bin/ncp-update-nc.d/update-nc.sh
Executable file
261
bin/ncp-update-nc.d/update-nc.sh
Executable file
@ -0,0 +1,261 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eE${DBG}
|
||||
|
||||
VER="$1"
|
||||
source /usr/local/etc/library.sh
|
||||
export RELEASE
|
||||
export PHPVER
|
||||
|
||||
# pre-checks
|
||||
####################
|
||||
BASEDIR=/var/www
|
||||
cd "$BASEDIR"
|
||||
DATADIR="$( get_nc_config_value datadirectory )"
|
||||
ncc status &>/dev/null || { [[ "$DBG" == x ]] && ncc status; echo "Nextcloud is currently down"; exit 1; }
|
||||
[[ -d "${BASEDIR}/nextcloud-old" ]] && { echo "Nextcloud backup directory found. Interrupted or already running installation?"; exit 1; }
|
||||
[[ -d "${BASEDIR}/nextcloud" ]] || { echo "Nextcloud directory not found" ; exit 1; }
|
||||
[[ -d "$DATADIR" ]] || { echo "Nextcloud data directory not found" ; exit 1; }
|
||||
|
||||
# check version
|
||||
####################
|
||||
|
||||
[[ ${EUID} -eq 0 ]] && SUDO="sudo -u www-data"
|
||||
CURRENT="$(nc_version)"
|
||||
if [[ "$VER" == "0" ]] || [[ "$VER" == "" ]]
|
||||
then
|
||||
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 1
|
||||
}
|
||||
[[ -n "$TARGET_VERSION" ]] || {
|
||||
echo "Could not find a valid upgrade path from '${CURRENT}' to '${TARGET_VERSION}'. Nothing to update."
|
||||
exit 1
|
||||
}
|
||||
|
||||
MAJOR_NEW="${TARGET_VERSION%%.*}"
|
||||
DEBIAN_VERSION="$(. /etc/os-release; echo "$VERSION_ID")"
|
||||
|
||||
if [[ "$MAJOR_NEW" -ge 24 ]] && [[ $DEBIAN_VERSION -le 10 ]]
|
||||
then
|
||||
echo -e "NCP doesn't support Nextcloud versions greater than 23 with Debian 10 (Buster). Please run ncp-dist-upgrade."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$MAJOR_NEW" -ge 29 ]] && [[ $DEBIAN_VERSION -le 11 ]]
|
||||
then
|
||||
echo -e "NCP doesn't support Nextcloud versions greater than 28 with Debian 11 (Bullseye). Please run ncp-dist-upgrade."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
grep -qP "\d+\.\d+\.\d+" <<<"$CURRENT" || { echo "Malformed version $CURRENT"; exit 1; }
|
||||
grep -qP "\d+\.\d+\.\d+" <<<"$TARGET_VERSION" || { echo "Malformed version $TARGET_VERSION" ; exit 1; }
|
||||
|
||||
echo "Current Nextcloud version $CURRENT"
|
||||
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 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
|
||||
# https://github.com/nextcloud/server/issues/10949
|
||||
pgrep -cf cron.php &>/dev/null && { pkill -f cron.php; sleep 3; }
|
||||
pgrep -cf cron.php &>/dev/null && { echo "cron.php running. Abort"; exit 1; }
|
||||
mysql nextcloud <<<"UPDATE ${DB_PREFIX}jobs SET reserved_at=0;"
|
||||
|
||||
# cleanup
|
||||
####################
|
||||
cleanup() {
|
||||
local RET=$?
|
||||
set +eE
|
||||
echo "Clean up..."
|
||||
rm -rf "$BASEDIR"/nextcloud.tar.bz2 "$BASEDIR"/nextcloud-old
|
||||
trap "" EXIT
|
||||
exit $RET
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
# get new code
|
||||
####################
|
||||
URL="https://download.nextcloud.com/server/releases/nextcloud-$TARGET_VERSION.tar.bz2"
|
||||
echo "Download Nextcloud $TARGET_VERSION..."
|
||||
wget -q "$URL" -O nextcloud.tar.bz2 || { echo "Error downloading"; exit 1; }
|
||||
|
||||
# backup
|
||||
####################
|
||||
BKPDIR="$BASEDIR"
|
||||
WITH_DATA=no
|
||||
COMPRESSED=yes
|
||||
LIMIT=0
|
||||
|
||||
echo "Back up current instance..."
|
||||
set +eE
|
||||
ncp-backup "$BKPDIR" "$WITH_DATA" "$COMPRESSED" "$LIMIT" # && false # test point
|
||||
RET=$?
|
||||
sync
|
||||
set -eE
|
||||
|
||||
BKP_="$( ls -1t "$BKPDIR"/nextcloud-bkp_*.tar.gz 2>/dev/null | head -1 )"
|
||||
[[ -f "$BKP_" ]] || { set +eE; echo "Error backing up"; false || cleanup; }
|
||||
[[ $RET -ne 0 ]] && { rm -f "$BKP_"; set +eE; echo "Error backing up"; false || cleanup; }
|
||||
BKP="$( dirname "$BKP_" )/$( basename "$BKP_" .tar.gz )-${CURRENT}.tar.gz"
|
||||
echo "Storing backup at '$BKP'..."
|
||||
mv "$BKP_" "$BKP"
|
||||
|
||||
# simple restore if anything fails from here
|
||||
####################
|
||||
rollback_simple() {
|
||||
set +eE
|
||||
trap "" INT TERM HUP ERR
|
||||
echo -e "Abort\nSimple roll back..."
|
||||
rm -rf "$BASEDIR"/nextcloud
|
||||
mv "$BASEDIR"/nextcloud-old "$BASEDIR"/nextcloud
|
||||
false || cleanup # so cleanup exits with 1
|
||||
}
|
||||
trap rollback_simple INT TERM HUP ERR
|
||||
|
||||
# replace code
|
||||
####################
|
||||
echo "Install Nextcloud $TARGET_VERSION..."
|
||||
mv -T nextcloud nextcloud-old
|
||||
tar -xf nextcloud.tar.bz2 # && false # test point
|
||||
rm -rf /var/www/nextcloud.tar.bz2
|
||||
|
||||
# copy old config
|
||||
####################
|
||||
cp nextcloud-old/config/config.php nextcloud/config/
|
||||
|
||||
# copy old themes
|
||||
####################
|
||||
cp -raT nextcloud-old/themes/ nextcloud/themes/
|
||||
|
||||
# copy old NC 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
|
||||
|
||||
#false # test point
|
||||
|
||||
# copy data if it was at the default location
|
||||
####################
|
||||
if [[ "$DATADIR" == "/var/www/nextcloud/data" ]] || [[ "$DATADIR" == "/data/nextcloud/data" ]]; then
|
||||
echo "Restore data..."
|
||||
mv -T nextcloud-old/data nextcloud/data
|
||||
fi
|
||||
|
||||
# nc-restore if anything fails from here
|
||||
####################
|
||||
rollback() {
|
||||
set +eE
|
||||
trap "" INT TERM HUP ERR EXIT
|
||||
echo -e "Abort\nClean up..."
|
||||
rm -rf /var/www/nextcloud.tar.bz2 "$BASEDIR"/nextcloud-old
|
||||
echo "Rolling back to backup $BKP..."
|
||||
local TMPDATA
|
||||
mkdir -p "$BASEDIR/recovery/"
|
||||
TMPDATA="$( mktemp -d "$BASEDIR/recovery/ncp-data.XXXXXX" )" || { echo "Failed to create temp dir" >&2; exit 1; }
|
||||
[[ "$DATADIR" == "$BASEDIR/nextcloud/data" ]] && mv -T "$DATADIR" "$TMPDATA"
|
||||
ncp-restore "$BKP" || { echo "Rollback failed! Data left at $TMPDATA"; exit 1; }
|
||||
[[ "$DATADIR" == "$BASEDIR/nextcloud/data" ]] && { rm -rf "$DATADIR"; mv -T "$TMPDATA" "$DATADIR"; }
|
||||
rm "$BKP"
|
||||
echo "Rollback successful. Nothing was updated"
|
||||
exit 1
|
||||
}
|
||||
trap rollback INT TERM HUP ERR
|
||||
|
||||
# fix permissions
|
||||
####################
|
||||
echo "Fix permissions..."
|
||||
chown -R www-data:www-data nextcloud
|
||||
find nextcloud/ -type d -exec chmod 750 {} \;
|
||||
find nextcloud/ -type f -exec chmod 640 {} \;
|
||||
|
||||
# upgrade
|
||||
####################
|
||||
echo "Upgrade..."
|
||||
ncc='sudo -u www-data php nextcloud/occ'
|
||||
$ncc upgrade # && false # test point
|
||||
$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)"
|
||||
if is_more_recent_than "21.0.0" "${NCVER}"; then
|
||||
NCPREV=/var/www/ncp-previewgenerator/ncp-previewgenerator-nc20
|
||||
else
|
||||
# Install notify_push if not installed
|
||||
if ! is_app_enabled notify_push; then
|
||||
ncc app:install notify_push
|
||||
ncc app:enable notify_push
|
||||
install_template nextcloud.conf.sh /etc/apache2/sites-available/nextcloud.conf
|
||||
a2enmod proxy proxy_http proxy_wstunnel
|
||||
apachectl -k graceful
|
||||
## make sure the notify_push daemon is runnnig
|
||||
|
||||
install_template systemd/notify_push.service.sh /etc/systemd/system/notify_push.service
|
||||
start_notify_push
|
||||
nc_domain="$(ncc config:system:get overwrite.cli.url)"
|
||||
set-nc-domain "${nc_domain}" || {
|
||||
echo "notify_push setup failed. You are probably behind a proxy"
|
||||
echo "Run 'ncc config:system:set trusted_proxies 15 --value=<proxy_IP>' and then 'ncc notify_push:setup https://<domain>/push to enable"
|
||||
echo "Check https://help.nextcloud.com/tags/ncp for support"
|
||||
}
|
||||
|
||||
fi
|
||||
NCPREV=/var/www/ncp-previewgenerator/ncp-previewgenerator-nc21
|
||||
fi
|
||||
rm -rf /var/www/nextcloud/apps/previewgenerator
|
||||
ln -snf "${NCPREV}" /var/www/nextcloud/apps/previewgenerator
|
||||
|
||||
if ! is_more_recent_than "24.0.0" "${NCVER}" && is_more_recent_than "8.1.0" "${PHPVER}.0"
|
||||
then
|
||||
/usr/local/bin/ncp-update-nc.d/upgrade-php-bullseye-8.1.sh
|
||||
|
||||
# Reload library.sh to reset PHPVER
|
||||
source /usr/local/etc/library.sh
|
||||
elif ! is_more_recent_than "29.0.0" "${NCVER}" && is_more_recent_than "8.3.0" "${PHPVER}.0" && [[ "$DEBIAN_VERSION" -ge 12 ]]
|
||||
then
|
||||
/usr/local/bin/ncp-update-nc.d/upgrade-php-bookworm-8.3.sh
|
||||
|
||||
# Reload library.sh to reset PHPVER
|
||||
source /usr/local/etc/library.sh
|
||||
fi
|
||||
|
||||
# refresh completions
|
||||
ncc _completion -g --shell-type bash -p ncc | sed 's|/var/www/nextcloud/occ|ncc|g' > /usr/share/bash-completion/completions/ncp
|
||||
|
||||
echo "Update completed successfully."
|
||||
# done
|
||||
####################
|
||||
mkdir -p "$DATADIR"/ncp-update-backups
|
||||
mv "$BKP" "$DATADIR"/ncp-update-backups
|
||||
chown -R www-data:www-data "$DATADIR"/ncp-update-backups
|
||||
BKP="$DATADIR"/ncp-update-backups/"$( basename "$BKP" )"
|
||||
echo "Backup stored at $BKP"
|
||||
|
||||
bash -c "sleep 5; source /usr/local/etc/library.sh; clear_opcache;" &>/dev/null &
|
||||
68
bin/ncp-update-nc.d/upgrade-php-bookworm-8.3.sh
Executable file
68
bin/ncp-update-nc.d/upgrade-php-bookworm-8.3.sh
Executable file
@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source /usr/local/etc/library.sh
|
||||
|
||||
echo "Upgrading PHP..."
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
PHPVER_OLD="$PHPVER"
|
||||
PHPVER_NEW="8.3"
|
||||
PHP_PACKAGES_OLD=("php${PHPVER_OLD}" \
|
||||
"php${PHPVER_OLD}"-{curl,gd,fpm,cli,opcache,mbstring,xml,zip,fileinfo,ldap,intl,bz2,mysql,bcmath,gmp,redis,common})
|
||||
PHP_PACKAGES_NEW=("php${PHPVER_NEW}" \
|
||||
"php${PHPVER_NEW}"-{curl,gd,fpm,cli,opcache,mbstring,xml,zip,fileinfo,ldap,intl,bz2,mysql,bcmath,gmp,redis,common})
|
||||
|
||||
php_restore() {
|
||||
trap "" INT TERM HUP ERR
|
||||
echo "Something went wrong while upgrading PHP. Rolling back to version ${PHPVER_OLD}..."
|
||||
set +e
|
||||
service "php${PHPVER_NEW}-fpm" stop
|
||||
a2disconf php${PHPVER_NEW}-fpm
|
||||
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
|
||||
echo "deb https://packages.sury.org/php/ ${RELEASE%-security} main" > /etc/apt/sources.list.d/php.list
|
||||
apt-get update
|
||||
apt-get remove --purge -y "${PHP_PACKAGES_NEW[@]}"
|
||||
apt-get install -y --no-install-recommends -t "$RELEASE" "${PHP_PACKAGES_OLD[@]}"
|
||||
set_ncpcfg "php_version" "${PHPVER_OLD}"
|
||||
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER_NEW}/mods-available/opcache.ini"
|
||||
run_app nc-limits
|
||||
a2enconf "php${PHPVER_OLD}-fpm"
|
||||
service "php${PHPVER_OLD}-fpm" start
|
||||
service apache2 restart
|
||||
echo "PHP upgrade has been successfully reverted"
|
||||
set -e
|
||||
}
|
||||
|
||||
trap php_restore INT TERM HUP ERR
|
||||
|
||||
apt-get update
|
||||
|
||||
clear_opcache
|
||||
|
||||
echo "Stopping apache and php-fpm..."
|
||||
service "php${PHPVER_OLD}-fpm" stop
|
||||
service apache2 stop
|
||||
|
||||
echo "Remove old PHP (${PHPVER_OLD})..."
|
||||
a2disconf "php${PHPVER_OLD}-fpm"
|
||||
|
||||
apt-get remove --purge -y "${PHP_PACKAGES_OLD[@]}"
|
||||
|
||||
echo "Install PHP ${PHPVER_NEW}..."
|
||||
install_with_shadow_workaround --no-install-recommends systemd
|
||||
apt-get install -y --no-install-recommends -t "$RELEASE" "${PHP_PACKAGES_NEW[@]}"
|
||||
|
||||
set_ncpcfg "php_version" "${PHPVER_NEW}"
|
||||
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER_NEW}/mods-available/opcache.ini"
|
||||
( set -e; export PHPVER="${PHPVER_NEW}"; run_app nc-limits )
|
||||
|
||||
a2enconf "php${PHPVER_NEW}-fpm"
|
||||
|
||||
[[ -f "/etc/systemd/system/php${PHPVER_OLD}-fpm.service.d/ncp.conf" ]] && {
|
||||
mkdir -p "/etc/systemd/system/php${PHPVER_NEW}-fpm.service.d"
|
||||
cp "/etc/systemd/system/php${PHPVER_OLD}-fpm.service.d/ncp.conf" "/etc/systemd/system/php${PHPVER_NEW}-fpm.service.d/ncp.conf"
|
||||
}
|
||||
|
||||
echo "Starting apache and php-fpm..."
|
||||
service "php${PHPVER_NEW}-fpm" start
|
||||
service apache2 start
|
||||
ncc status
|
||||
65
bin/ncp-update-nc.d/upgrade-php-bullseye-8.1.sh
Executable file
65
bin/ncp-update-nc.d/upgrade-php-bullseye-8.1.sh
Executable file
@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source /usr/local/etc/library.sh
|
||||
|
||||
echo "Upgrading PHP..."
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
PHPVER_OLD="$PHPVER"
|
||||
PHPVER_NEW="8.1"
|
||||
PHP_PACKAGES_OLD=(php-{common,igbinary,redis,json} "php${PHPVER_OLD}" \
|
||||
"php${PHPVER_OLD}"-{curl,gd,fpm,cli,opcache,mbstring,xml,zip,fileinfo,ldap,intl,bz2,json,common,readline,mysql,bcmath,gmp})
|
||||
PHP_PACKAGES_NEW=("php${PHPVER_NEW}" \
|
||||
"php${PHPVER_NEW}"-{curl,gd,fpm,cli,opcache,mbstring,xml,zip,fileinfo,ldap,intl,bz2,mysql,bcmath,gmp,redis,common})
|
||||
|
||||
php_restore() {
|
||||
trap "" INT TERM HUP ERR
|
||||
echo "Something went wrong while upgrading PHP. Rolling back to version ${PHPVER_OLD}..."
|
||||
set +e
|
||||
service "php${PHPVER_NEW}-fpm" stop
|
||||
a2disconf php${PHPVER_NEW}-fpm
|
||||
rm /etc/apt/sources.list.d/php.list
|
||||
apt-get update
|
||||
apt-get remove --purge -y "${PHP_PACKAGES_NEW[@]}"
|
||||
apt-get install -y --no-install-recommends -t "$RELEASE" "${PHP_PACKAGES_OLD[@]}"
|
||||
set_ncpcfg "php_version" "${PHPVER_OLD}"
|
||||
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER_NEW}/mods-available/opcache.ini"
|
||||
run_app nc-limits
|
||||
a2enconf "php${PHPVER_OLD}-fpm"
|
||||
service "php${PHPVER_OLD}-fpm" start
|
||||
service apache2 restart
|
||||
echo "PHP upgrade has been successfully reverted"
|
||||
set -e
|
||||
}
|
||||
|
||||
trap php_restore INT TERM HUP ERR
|
||||
|
||||
# Setup apt repository for php 8
|
||||
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
|
||||
echo "deb https://packages.sury.org/php/ ${RELEASE%-security} main" > /etc/apt/sources.list.d/php.list
|
||||
apt-get update
|
||||
|
||||
clear_opcache
|
||||
|
||||
echo "Stopping apache and php-fpm..."
|
||||
service "php${PHPVER_OLD}-fpm" stop
|
||||
service apache2 stop
|
||||
|
||||
echo "Remove old PHP (${PHPVER_OLD})..."
|
||||
a2disconf "php${PHPVER_OLD}-fpm"
|
||||
|
||||
apt-get remove --purge -y "${PHP_PACKAGES_OLD[@]}"
|
||||
|
||||
echo "Install PHP ${PHPVER_NEW}..."
|
||||
install_with_shadow_workaround --no-install-recommends systemd
|
||||
apt-get install -y --no-install-recommends -t "$RELEASE" "${PHP_PACKAGES_NEW[@]}"
|
||||
|
||||
set_ncpcfg "php_version" "${PHPVER_NEW}"
|
||||
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER_NEW}/mods-available/opcache.ini"
|
||||
( set -e; export PHPVER="${PHPVER_NEW}"; run_app nc-limits )
|
||||
|
||||
a2enconf "php${PHPVER_NEW}-fpm"
|
||||
|
||||
echo "Starting apache and php-fpm..."
|
||||
service "php${PHPVER_NEW}-fpm" start
|
||||
service apache2 start
|
||||
ncc status
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Export NextCloudPi configuration
|
||||
# Export NextcloudPi configuration
|
||||
#
|
||||
#
|
||||
# Copyleft 2017 by Courtney Hicks
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Import NextCloudPi configuration
|
||||
# Import NextcloudPi configuration
|
||||
#
|
||||
#
|
||||
# Copyleft 2017 by Courtney Hicks
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# NextCloudPi scheduled datadir BTRFS snapshots
|
||||
# NextcloudPi scheduled datadir BTRFS snapshots
|
||||
#
|
||||
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Data dir configuration script for NextCloudPi
|
||||
# Data dir configuration script for NextcloudPi
|
||||
#
|
||||
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Data dir configuration script for NextCloudPi
|
||||
# Data dir configuration script for NextcloudPi
|
||||
#
|
||||
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
@ -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
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# HTTPS rewrite configuration script for NextCloudPi
|
||||
# HTTPS rewrite configuration script for NextcloudPi
|
||||
#
|
||||
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
@ -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
|
||||
@ -127,11 +146,11 @@ EOF
|
||||
}
|
||||
|
||||
mysql nextcloud <<EOF
|
||||
replace into ${DB_PREFIX}appconfig values ( 'theming', 'name' , "NextCloudPi" , 2, null);
|
||||
replace into ${DB_PREFIX}appconfig values ( 'theming', 'slogan' , "keep your data close" , 2, null);
|
||||
replace into ${DB_PREFIX}appconfig values ( 'theming', 'url' , "https://nextcloudpi.com" , 2, null);
|
||||
replace into ${DB_PREFIX}appconfig values ( 'theming', 'logoMime' , "image/svg+xml" , 2, null);
|
||||
replace into ${DB_PREFIX}appconfig values ( 'theming', 'backgroundMime', "image/png" , 2, null);
|
||||
replace into ${DB_PREFIX}appconfig values ( 'theming', 'name' , "NextCloudPi" , 2, 0);
|
||||
replace into ${DB_PREFIX}appconfig values ( 'theming', 'slogan' , "keep your data close" , 2, 0);
|
||||
replace into ${DB_PREFIX}appconfig values ( 'theming', 'url' , "https://nextcloudpi.com" , 2, 0);
|
||||
replace into ${DB_PREFIX}appconfig values ( 'theming', 'logoMime' , "image/svg+xml" , 2, 0);
|
||||
replace into ${DB_PREFIX}appconfig values ( 'theming', 'backgroundMime', "image/png" , 2, 0);
|
||||
EOF
|
||||
|
||||
# NCP app
|
||||
@ -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 && {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# System limits configuration for NextCloudPi
|
||||
# System limits configuration for NextcloudPi
|
||||
#
|
||||
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
@ -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
|
||||
|
||||
@ -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'
|
||||
|
||||
@ -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
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Manually add trusted domains in NextCloudPi
|
||||
# Manually add trusted domains in NextcloudPi
|
||||
#
|
||||
# Copyleft 2019 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
@ -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
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# DuckDNS installation on Raspbian for NextCloudPi
|
||||
# DuckDNS installation on Raspbian for NextcloudPi
|
||||
#
|
||||
#
|
||||
# Copyleft 2017 by Courtney Hicks
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Let's encrypt certbot installation on NextCloudPi
|
||||
# Let's encrypt certbot installation on NextcloudPi
|
||||
#
|
||||
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Use uPnP to forward router ports for NextCloudPi
|
||||
# Use uPnP to forward router ports for NextcloudPi
|
||||
#
|
||||
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Manually add trusted proxies in NextCloudPi
|
||||
# Manually add trusted proxies in NextcloudPi
|
||||
#
|
||||
# Copyleft 2019 by Pascal Haefliger <45995338+paschaef_a_t_users_d_o_t_noreply_d_o_tgithub_d_o_t_com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# no-ip.org installation on NextCloudPi
|
||||
# no-ip.org installation on NextcloudPi
|
||||
#
|
||||
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# spDYN setup for NextCloudPi
|
||||
# spDYN setup for NextcloudPi
|
||||
#
|
||||
#
|
||||
# Copyleft 2017/2018 by Timm Goldenstein and Timo Stiefel
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Fail2ban for NextCloudPi
|
||||
# Fail2ban for NextcloudPi
|
||||
#
|
||||
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Launch security audit reports for NextCloudPi
|
||||
# Launch security audit reports for NextcloudPi
|
||||
#
|
||||
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Data at rest encryption for NextCloudPi
|
||||
# Data at rest encryption for NextcloudPi
|
||||
#
|
||||
# Copyleft 2021 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
@ -20,14 +20,14 @@ install()
|
||||
|
||||
configure()
|
||||
{
|
||||
(
|
||||
|
||||
set -e -o pipefail
|
||||
local datadir parentdir encdir tmpdir
|
||||
datadir="$(get_ncpcfg datadir)"
|
||||
[[ "${datadir?}" == "null" ]] && datadir=/var/www/nextcloud/data
|
||||
parentdir="$(dirname "${datadir}")"
|
||||
encdir="${parentdir?}/ncdata_enc"
|
||||
tmpdir="$(mktemp -u -p "${parentdir}" -t nc-data-crypt.XXXXXX))"
|
||||
tmpdir="$(mktemp -u -p "${parentdir}" -t nc-data-crypt.XXXXXX)"
|
||||
|
||||
[[ "${ACTIVE?}" != "yes" ]] && {
|
||||
if ! is_active; then
|
||||
@ -55,9 +55,11 @@ configure()
|
||||
return
|
||||
fi
|
||||
|
||||
export PASSWORD
|
||||
# Just mount already encrypted data
|
||||
if [[ -f "${encdir?}"/gocryptfs.conf ]]; then
|
||||
echo "${PASSWORD?}" | gocryptfs -allow_other -q "${encdir}" "${datadir}" 2>&1 | sed /^Switch/d
|
||||
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
|
||||
a2ensite ncp 001-nextcloud
|
||||
@ -70,12 +72,33 @@ configure()
|
||||
mkdir -p "${encdir?}"
|
||||
echo "${PASSWORD?}" | gocryptfs -init -q "${encdir}"
|
||||
save_maintenance_mode
|
||||
cleanup() {
|
||||
umount "${datadir}" ||:
|
||||
[[ -f "${tmpdir}" ]] && {
|
||||
rm -rf "${datadir?}" ||:
|
||||
mv "${tmpdir}" "${datadir}"
|
||||
|
||||
chown -R www-data:www-data "${datadir}"
|
||||
}
|
||||
}
|
||||
|
||||
trap cleanup 1
|
||||
trap restore_maintenance_mode EXIT
|
||||
|
||||
mv "${datadir?}" "${tmpdir?}"
|
||||
|
||||
mkdir "${datadir}"
|
||||
echo "${PASSWORD}" | gocryptfs -allow_other -q "${encdir}" "${datadir}" 2>&1 | sed /^Switch/d
|
||||
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
|
||||
while [[ "$(systemctl is-active ncp-encrypt)" != "active" ]] || ! mount | grep -1 "${datadir}"
|
||||
do
|
||||
echo "Wating for encryption process to start... (${maxtries})"
|
||||
sleep 3
|
||||
maxtries=$((maxtries - 1))
|
||||
[[ $maxtries -gt 0 ]] || return 1
|
||||
done
|
||||
|
||||
echo "Encrypting data..."
|
||||
mv "${tmpdir}"/* "${tmpdir}"/.[!.]* "${datadir}"
|
||||
@ -85,7 +108,7 @@ configure()
|
||||
set_ncpcfg datadir "${datadir}"
|
||||
|
||||
echo "Data is now encrypted"
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
# License
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Automount configuration for NextCloudPi
|
||||
# Automount configuration for NextcloudPi
|
||||
#
|
||||
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Data dir configuration script for NextCloudPi
|
||||
# Data dir configuration script for NextcloudPi
|
||||
#
|
||||
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Data dir configuration script for NextCloudPi
|
||||
# Data dir configuration script for NextcloudPi
|
||||
#
|
||||
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# NextCloudPi ZRAM settings
|
||||
# NextcloudPi ZRAM settings
|
||||
#
|
||||
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
@ -51,7 +51,7 @@ configure()
|
||||
}
|
||||
|
||||
DATADIR="$(get_nc_config_value datadirectory || true)"
|
||||
if [[ $( stat -fc%d / ) != $( stat -fc%d "$DATADIR" ) ]] || [[ -z "$DATADIR" ]] && [[ "$ALLOW_DATA_DIR_REMOVAL" != "yes" ]]
|
||||
if [[ $( stat -fc%d / ) != $( stat -fc%d "$DATADIR" ) ]] || [[ -z "$DATADIR" ]] && [[ "$ALLOW_DATADIR_REMOVAL" != "yes" ]]
|
||||
then
|
||||
echo "ERROR: Data directory is on USB drive (or can't be determined) and removal of data directory was not explicitly allowed." \
|
||||
"Please move the data directory to SD before formatting the USB drive." \
|
||||
|
||||
@ -23,11 +23,11 @@ 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
|
||||
|
||||
VER="\$( /usr/local/bin/ncc status | grep "version:" | awk '{ print \$3 }' )"
|
||||
VER="\$(nc_version)"
|
||||
|
||||
notify_admin "NextCloudPi" "Nextcloud was updated to \$VER"
|
||||
fi
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Automatically apply NextCloudPi updates
|
||||
# Automatically apply NextcloudPi updates
|
||||
#
|
||||
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
@ -12,12 +12,6 @@ LATEST="$NCLATESTVER"
|
||||
|
||||
configure()
|
||||
{
|
||||
[[ "$VERSION" == "0" ]] && VERSION="$LATEST"
|
||||
if ! is_docker && ! is_more_recent_than "24.0.0" "${VERSION}" && is_more_recent_than "8.1.0" "${PHPVER}.0" && [[ " ${BASH_SOURCE[*]} " =~ .*" /home/www/ncp-launcher.sh ".* ]]
|
||||
then
|
||||
echo "We need to upgrade PHP. This process cannot be performed from the web UI. Please use 'ncp-config' from the terminal (via SSH or direct access) to update Nextcloud instead. Future updates can again be run from the web UI"
|
||||
exit 1
|
||||
fi
|
||||
bash /usr/local/bin/ncp-update-nc "$VERSION"
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Data dir configuration script for NextCloudPi
|
||||
# Data dir configuration script for NextcloudPi
|
||||
#
|
||||
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Unattended upgrades installation on NextCloudPi
|
||||
# Unattended upgrades installation on NextcloudPi
|
||||
#
|
||||
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
@ -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
|
||||
|
||||
@ -19,6 +19,8 @@ LINUXFAMILY=$2
|
||||
BOARD=$3
|
||||
BUILD_DESKTOP=$4
|
||||
|
||||
echo "include home dir? ${INCLUDE_HOME_DIR:-no}"
|
||||
|
||||
cd /tmp/overlay
|
||||
NCPCFG=etc/ncp.cfg
|
||||
source etc/library.sh # sets RELEASE
|
||||
@ -31,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
|
||||
|
||||
1
build/armbian/armbian_version
Normal file
1
build/armbian/armbian_version
Normal file
@ -0,0 +1 @@
|
||||
v25.08
|
||||
@ -31,7 +31,7 @@ prepare_dirs # tmp cache output
|
||||
|
||||
# get latest armbian
|
||||
[[ -d armbian ]] || {
|
||||
git clone --depth 1 --branch v24.02 https://github.com/armbian/build armbian
|
||||
git clone --depth 1 --branch "$(cat "$(dirname "${0}")/armbian/armbian_version")" https://github.com/armbian/build armbian
|
||||
}
|
||||
#( cd armbian && git pull --ff-only --tags && git checkout v23.02 )
|
||||
#sed -i -e '/export rootfs_size=/s/du -sm/du --apparent-size -sm/' armbian/lib/functions/image/partitioning.sh
|
||||
|
||||
82
changelog.md
82
changelog.md
@ -1,5 +1,87 @@
|
||||
# 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
|
||||
|
||||
- Support for Nextcloud 29
|
||||
- Support for PHP 8.3
|
||||
- Run `maintenance:repair --include-expensive` after NC update if necessary
|
||||
- Add logrotate for redis, apache and mysql logs
|
||||
- Add support for the OrangePi 5 and OrangePi 5 Plus boards
|
||||
|
||||
### Fixes
|
||||
|
||||
- Fix bug in nc-format-USB.sh (thanks @m-breitbach)
|
||||
- Nextcloud updater fixes
|
||||
- Fix constant retries of the auto update if on a version that's later than the last officially supported one [#1965](https://github.com/nextcloud/nextcloudpi/issues/1965)
|
||||
- Fix incorrect detection of os constraints for NC updates beyond v28 [#1960](https://github.com/nextcloud/nextcloudpi/issues/1960)
|
||||
- Fix user requested version being ignored if a later version was available
|
||||
- Improve stability of nc-encrypt by daemonizing the encryption process [#1874](https://github.com/nextcloud/nextcloudpi/issues/1874)
|
||||
|
||||
### Development related
|
||||
|
||||
- Perform nc update tests for both lxd as well as vms during CI/CD
|
||||
|
||||
## [v1.54.3](https://github.com/nextcloud/nextcloudpi/tree/v1.54.3) (2024-08-11) Improved Nextcloud (auto) updates
|
||||
|
||||
### Fixes
|
||||
|
||||
- Prevent dependency conflict during distribution upgrade to debian 12
|
||||
|
||||
### Changes
|
||||
|
||||
- Nextcloud updates now automatically determine the next valid version to upgrade to. Auto updates always update to the latest minor version.
|
||||
|
||||
## [v1.54.2](https://github.com/nextcloud/nextcloudpi/tree/v1.54.2) (2024-05-08) Fixes for ncp-dist-upgrade (bookworm)
|
||||
|
||||
### Fixes
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# NextCloudPi function library
|
||||
# NextcloudPi function library
|
||||
#
|
||||
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
# GPL licensed (see end of file) * Use at your own risk!
|
||||
@ -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
|
||||
@ -516,7 +516,54 @@ function check_distro()
|
||||
|
||||
function nc_version()
|
||||
{
|
||||
ncc status | grep "version:" | awk '{ print $3 }'
|
||||
ncc status | grep "versionstring:" | awk '{ print $3 }'
|
||||
}
|
||||
|
||||
function determine_nc_update_version() {
|
||||
local current supported current_maj supported_maj versions next_version
|
||||
current="${1?}"
|
||||
supported="${2?}"
|
||||
requested="${3:-latest}"
|
||||
|
||||
#CURRENT="$(ncc status | grep "versionstring:" | awk '{ print $3 }')"
|
||||
current_maj="${current%%.*}"
|
||||
requested_maj="${requested%%.*}"
|
||||
supported_maj="${supported%%.*}"
|
||||
|
||||
# If valid version is requested -> direct update, don't consider anything else
|
||||
if [[ "$requested" =~ ^[0-9]*.[0-9]*.[0-9]*$ ]]
|
||||
then
|
||||
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)"
|
||||
next_version="$(grep "v${current_maj}." <<<"${versions}" | tail -n 1 | tr -d 'v')"
|
||||
next_version_maj="${next_version%%.*}"
|
||||
next_version_min="${next_version#*.}"
|
||||
next_version_min="${next_version_min%%.*}"
|
||||
|
||||
if [[ "${next_version}" == "${current}" ]]
|
||||
then
|
||||
|
||||
if [[ "${supported_maj}" -le "${current_maj}" ]]
|
||||
then
|
||||
echo "$current"
|
||||
# No update available
|
||||
return 0
|
||||
fi
|
||||
|
||||
next_version="$(grep "$v$((current_maj + 1))." <<< "${versions}" | tail -n 1 | tr -d 'v')"
|
||||
fi
|
||||
|
||||
[[ -z "${next_version}" ]] || echo -n "${next_version}"
|
||||
}
|
||||
|
||||
function get_ip()
|
||||
|
||||
76
etc/library.test
Normal file
76
etc/library.test
Normal 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)"
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"translations": {
|
||||
"DIR": "Directorio",
|
||||
"Export NextCloudPi configuration": "Exportar la configuración de NextCloudPi",
|
||||
"Export NextCloudPi configuration": "Exportar la configuración de NextcloudPi",
|
||||
"nc-export-ncp": "nc-export-ncp"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"translations": {
|
||||
"DIR": "Diretório",
|
||||
"Export NextCloudPi configuration": "Exportar configurações do NextCloudPi",
|
||||
"Export NextCloudPi configuration": "Exportar configurações do NextcloudPi",
|
||||
"nc-export-ncp": "nc-exportar-ncp"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"translations": {
|
||||
"DIR": "位置",
|
||||
"Export NextCloudPi configuration": "匯出NextCloudPi設定",
|
||||
"Export NextCloudPi configuration": "匯出NextcloudPi設定",
|
||||
"nc-export-ncp": "匯出NCP設定"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"translations": {
|
||||
"For NextCloudPi to be able to setup your ports, UPnP must be activated\nin your router. Activate it now on your router admin webpage.\n\n** UPnP is considered a security risk **\n\nDon't forget to disable it afterwards": "Para que NextCloudPi sea capaz de configurar tus puertos, UPnP debe estar activado\nen tu router. Actívalo ahora en la página de administración de tu router\n\n** UPnP se considera un riesgo de seguridad\n\nNo olvides deshabilitarlo más tarde",
|
||||
"For NextCloudPi to be able to setup your ports, UPnP must be activated\nin your router. Activate it now on your router admin webpage.\n\n** UPnP is considered a security risk **\n\nDon't forget to disable it afterwards": "Para que NextcloudPi sea capaz de configurar tus puertos, UPnP debe estar activado\nen tu router. Actívalo ahora en la página de administración de tu router\n\n** UPnP se considera un riesgo de seguridad\n\nNo olvides deshabilitarlo más tarde",
|
||||
"HTTPPORT": "Puerto HTTP",
|
||||
"HTTPSPORT": "Puerto HTTPS",
|
||||
"Instructions for UPnP Port Forwarding": "Instrucciones para UPnP Port Forwarding",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"translations": {
|
||||
"For NextCloudPi to be able to setup your ports, UPnP must be activated\nin your router. Activate it now on your router admin webpage.\n\n** UPnP is considered a security risk **\n\nDon't forget to disable it afterwards": "Para o NextCloudPi conseguir configurar as portas, UPnp deve estar ativo\nno seu Roteador.A ativação é feita na pagina de Web administração do seu roteador\n\n**UPnP é considerado um risco de segurança**\n\nNão esqueça de desativá-lo depois.",
|
||||
"For NextCloudPi to be able to setup your ports, UPnP must be activated\nin your router. Activate it now on your router admin webpage.\n\n** UPnP is considered a security risk **\n\nDon't forget to disable it afterwards": "Para o NextcloudPi conseguir configurar as portas, UPnp deve estar ativo\nno seu Roteador.A ativação é feita na pagina de Web administração do seu roteador\n\n**UPnP é considerado um risco de segurança**\n\nNão esqueça de desativá-lo depois.",
|
||||
"HTTPPORT": "Porta http",
|
||||
"HTTPSPORT": "Porta https",
|
||||
"nc-forward-ports": "nc-portas-encaminhadas (UPnP)",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"translations": {
|
||||
"For NextCloudPi to be able to setup your ports, UPnP must be activated\nin your router. Activate it now on your router admin webpage.\n\n** UPnP is considered a security risk **\n\nDon't forget to disable it afterwards": "如果要讓NextCloudPi自動設置您的Port,請在您的路由器開啟UPnP\n因鑒於安全性等問題,請在設定成功後關閉UPnP",
|
||||
"For NextCloudPi to be able to setup your ports, UPnP must be activated\nin your router. Activate it now on your router admin webpage.\n\n** UPnP is considered a security risk **\n\nDon't forget to disable it afterwards": "如果要讓NextcloudPi自動設置您的Port,請在您的路由器開啟UPnP\n因鑒於安全性等問題,請在設定成功後關閉UPnP",
|
||||
"HTTPPORT": "http Port",
|
||||
"HTTPSPORT": "https Port",
|
||||
"nc-forward-ports": "端口轉發(UPnP)",
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"translations": {
|
||||
"FILE": "Fichero",
|
||||
"Import NextCloudPi configuration from file": "Importa la configuración de NextCloudPi desde un fichero",
|
||||
"Import NextCloudPi configuration from file": "Importa la configuración de NextcloudPi desde un fichero",
|
||||
"nc-import-ncp": "nc-import-ncp"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"translations": {
|
||||
"FILE": "Arquivo",
|
||||
"Import NextCloudPi configuration from file": "Importar a configuração do NextCloudPi de um arquivo",
|
||||
"Import NextCloudPi configuration from file": "Importar a configuração do NextcloudPi de um arquivo",
|
||||
"nc-import-ncp": "nc-importa-ncp"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"translations": {
|
||||
"FILE": "檔案位置",
|
||||
"Import NextCloudPi configuration from file": "匯入NextCloudPi設定",
|
||||
"Import NextCloudPi configuration from file": "匯入NextcloudPi設定",
|
||||
"nc-import-ncp": "匯入NCP設定"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"translations": {
|
||||
"Print NextCloudPi system info": "Imprime informações do sistema NextCloudPi",
|
||||
"Print NextCloudPi system info": "Imprime informações do sistema NextcloudPi",
|
||||
"nc-info": "nc-info"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"translations": {
|
||||
"Print NextCloudPi system info": "顯示NextCloudPi系統信息",
|
||||
"Print NextCloudPi system info": "顯示NextcloudPi系統信息",
|
||||
"nc-info": "NCP系統訊息"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"translations": {
|
||||
"Configure system limits for NextCloudPi": "Configura los límites de sistema para NextCloudPi",
|
||||
"Configure system limits for NextCloudPi": "Configura los límites de sistema para NextcloudPi",
|
||||
"MAXFILESIZE":"Tamaño máximo de archivo en subida",
|
||||
"MEMORYLIMIT": "Límite de memoria",
|
||||
"PHPTHREADS": "Hilos PHP",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"translations": {
|
||||
"Configure system limits for NextCloudPi": "Configura os limites de sistema para NextCloudPi",
|
||||
"Configure system limits for NextCloudPi": "Configura os limites de sistema para NextcloudPi",
|
||||
"MAXFILESIZE":"Tamanho máximo de arquivo para upload",
|
||||
"MEMORYLIMIT": "Limite de memória",
|
||||
"PHPTHREADS": "THREADS PHP",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"translations": {
|
||||
"Configure system limits for NextCloudPi": "設定NextCloudPi的系統限制",
|
||||
"Configure system limits for NextCloudPi": "設定NextcloudPi的系統限制",
|
||||
"MAXFILESIZE": "最大文件大小(<=2G)",
|
||||
"MEMORYLIMIT": "內存限制",
|
||||
"PHPTHREADS": "PHP線程",
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
"MEMORYLIMIT":"Limíte de Memória",
|
||||
"MAXTRANSFERTIME":"Tempo máximo de transferência",
|
||||
"NextCloud installation":"Instalação NextCloud",
|
||||
"This new installation will cleanup current\nNextCloud instance, including files and database.\n\nYou can later use nc-init to configure to NextCloudPi defaults\n\n** perform backup before proceding **\n\nYou can use nc-backup ":"Esta nova instalação irá apagar a instância atual\ndo NextCloud, incluindo os arquivos e o Banco de Dados.\nVocê depois pode usar o nc-init para configurar os padrões do NextCloudPi\n\n**Realize Backup antes de Continuar**\n\nVocê pode usar o nc-backup",
|
||||
"This new installation will cleanup current\nNextCloud instance, including files and database.\n\nYou can later use nc-init to configure to NextCloudPi defaults\n\n** perform backup before proceding **\n\nYou can use nc-backup ":"Esta nova instalação irá apagar a instância atual\ndo NextCloud, incluindo os arquivos e o Banco de Dados.\nVocê depois pode usar o nc-init para configurar os padrões do NextcloudPi\n\n**Realize Backup antes de Continuar**\n\nVocê pode usar o nc-backup",
|
||||
"nc-nextcloud":"nc-nextcloud",
|
||||
"Install any NextCloud version":"Instalar qualquer versão NextCloud"
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
"MEMORYLIMIT":"記憶體限制",
|
||||
"MAXTRANSFERTIME":"最大傳輸時間",
|
||||
"NextCloud installation":"重新下載安裝NextCloud",
|
||||
"This new installation will cleanup current\nNextCloud instance, including files and database.\n\nYou can later use nc-init to configure to NextCloudPi defaults\n\n** perform backup before proceding **\n\nYou can use nc-backup ":"這個動作安裝將清理目前NextCloud的所有內容,所有的文件及數據庫都將會被刪除\n安裝完後您可以使用初始化NextCloud來快速設定回系統默認值以及資料庫\n或者您可以在開始動作前先進行備份(NC備份)",
|
||||
"This new installation will cleanup current\nNextCloud instance, including files and database.\n\nYou can later use nc-init to configure to NextCloudPi defaults\n\n** perform backup before proceding **\n\nYou can use nc-backup ":"這個動作安裝將清理目前Nextcloud的所有內容,所有的文件及數據庫都將會被刪除\n安裝完後您可以使用初始化NextCloud來快速設定回系統默認值以及資料庫\n或者您可以在開始動作前先進行備份(NC備份)",
|
||||
"nc-nextcloud":"重新安裝NC",
|
||||
"Install any NextCloud version":"下載安裝NextCloud"
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"translations":{
|
||||
"ACTIVE":"Ativo",
|
||||
"USER":"Usuário",
|
||||
"Notify in NC when a NextCloudPi update is available":"Notifica no NC quando uma atualização NextCloudPi está disponível",
|
||||
"Notify in NC when a NextCloudPi update is available":"Notifica no NC quando uma atualização NextcloudPi está disponível",
|
||||
"nc-notify-updates":"nc-notificar-atualizações"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"translations": {
|
||||
"CONFIRM": "Confirmar",
|
||||
"Change password for the NextCloudPi Panel": "Cambiar la contraseña para el Panel de NextCloudPi",
|
||||
"Change password for the NextcloudPi Panel": "Cambiar la contraseña para el Panel de NextcloudPi",
|
||||
"PASSWORD": "Contraseña",
|
||||
"nc-passwd": "nc-passwd"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"translations":{
|
||||
"Change password for the NextCloudPi Panel":"Mudar a senha para o painel NextCloudPi",
|
||||
"Change password for the NextcloudPi Panel":"Mudar a senha para o painel NextcloudPi",
|
||||
"nc-passwd":"nc-senha",
|
||||
"PASSWORD":"Senha",
|
||||
"CONFIRM":"Confirmar"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"translations":{
|
||||
"Change password for the NextCloudPi Panel":"修改NextCloudPi網頁介面的密碼",
|
||||
"Change password for the NextcloudPi Panel":"修改NextcloudPi網頁介面的密碼",
|
||||
"nc-passwd":"修改NCP密碼",
|
||||
"PASSWORD":"密碼",
|
||||
"CONFIRM":"再次輸入密碼"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"translations":{
|
||||
"Update NextCloudPi":"atualização NextCloudPi",
|
||||
"Update NextCloudPi":"atualização NextcloudPi",
|
||||
"nc-update":"nc-atualização"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"translations":{
|
||||
"Update NextCloudPi":"更新NextCloudPi",
|
||||
"Update NextCloudPi":"更新NextcloudPi",
|
||||
"nc-update":"更新NCP"
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
{
|
||||
"id": "VER",
|
||||
"name": "Version",
|
||||
"value": "28.0.5"
|
||||
"value": "32.0.1"
|
||||
},
|
||||
{
|
||||
"id": "MAXFILESIZE",
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"id": "nc-passwd",
|
||||
"name": "Nc-passwd",
|
||||
"title": "nc-passwd",
|
||||
"description": "Change password for the NextCloudPi Panel",
|
||||
"description": "Change password for the NextcloudPi Panel",
|
||||
"info": "Please note some special characters are not allowed here, avoid using ) } ; # in password",
|
||||
"infotitle": "",
|
||||
"params": [
|
||||
|
||||
@ -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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"nextcloud_version": "28.0.5",
|
||||
"php_version": "8.1",
|
||||
"nextcloud_version": "32.0.1",
|
||||
"php_version": "8.3",
|
||||
"release": "bookworm"
|
||||
}
|
||||
|
||||
@ -1,16 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#min=$((101-${1:-50}))
|
||||
total_count="${1?}"
|
||||
target_file="${2?}"
|
||||
all=({100..1})
|
||||
cohortes=()
|
||||
for i in "${all[@]:0:${1?}}"
|
||||
|
||||
touch "${target_file?}"
|
||||
|
||||
while IFS="" read -r line || [ -n "$line" ]
|
||||
do
|
||||
[[ -n "$line" ]] || continue
|
||||
cohortes+=("$line")
|
||||
done < "${target_file}"
|
||||
|
||||
cohortes_count=${#cohortes[@]}
|
||||
count=$(( total_count - cohortes_count ))
|
||||
|
||||
for i in "${all[@]:0:${count}}"
|
||||
do
|
||||
cohorte_id=$((RANDOM % i))
|
||||
while [[ " ${cohortes[*]} " =~ .*" ${cohorte_id} ".* ]]
|
||||
do
|
||||
cohorte_id=$((cohorte_id+1))
|
||||
if [[ $cohorte_id -eq 101 ]]
|
||||
then
|
||||
cohorte_id=1
|
||||
fi
|
||||
done
|
||||
cohortes+=($cohorte_id)
|
||||
done
|
||||
|
||||
echo "${cohortes[*]}" | tr ' ' $'\n'
|
||||
(IFS=$'\n'; echo -n "${cohortes[*]}" | sort -h | head -c -1 >| "$target_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
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<category>tools</category>
|
||||
<bugs>https://github.com/nextcloud/nextcloudpi/issues</bugs>
|
||||
<dependencies>
|
||||
<nextcloud min-version="22" max-version="28"/>
|
||||
<nextcloud min-version="22" max-version="32"/>
|
||||
</dependencies>
|
||||
<navigations>
|
||||
<navigation>
|
||||
|
||||
@ -38,6 +38,7 @@ class SettingsService {
|
||||
}
|
||||
if ($config == null) {
|
||||
$this->logger->error("Failed to retrieve ncp config (exit code: $ret)");
|
||||
$this->logger->error("ERR: $stderr");
|
||||
return $defaults;
|
||||
}
|
||||
return $config;
|
||||
@ -132,11 +133,12 @@ class SettingsService {
|
||||
2 => ["pipe", "w"]
|
||||
];
|
||||
|
||||
$proc = proc_open($cmd, $descriptorSpec, $pipes, "/home/www-data", null);
|
||||
$proc = proc_open($cmd, $descriptorSpec, $pipes, "/home/www", null);
|
||||
$stdout = stream_get_contents($pipes[1]);
|
||||
fclose($pipes[1]);
|
||||
$stderr = stream_get_contents($pipes[2]);
|
||||
fclose($pipes[2]);
|
||||
|
||||
return [proc_close($proc), $stdout, $stderr];
|
||||
}
|
||||
}
|
||||
|
||||
@ -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="28" />
|
||||
<nextcloud min-version="20" max-version="32" />
|
||||
</dependencies>
|
||||
|
||||
<commands>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
NextCloudPi Web Backups Panel
|
||||
NextcloudPi Web Backups Panel
|
||||
|
||||
Copyleft 2019 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
///
|
||||
// NextCloudPi Web Panel CSRF protection library
|
||||
// NextcloudPi Web Panel CSRF protection library
|
||||
//
|
||||
// Inspired by http://blog.ircmaxell.com/2013/02/preventing-csrf-attacks.html
|
||||
//
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
///
|
||||
// NextCloudPi Web Panel backend
|
||||
// NextcloudPi Web Panel backend
|
||||
//
|
||||
// Copyleft 2019 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
// GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
///
|
||||
// NextCloudPi Web Panel backend
|
||||
// NextcloudPi Web Panel backend
|
||||
//
|
||||
// Copyleft 2019 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
|
||||
// GPL licensed (see end of file) * Use at your own risk!
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user