Skip to content

Commit 46b4489

Browse files
Merge pull request #1948 from nextcloud/feature/autosupport-minor-nc-versions
Dynamically determine upgrade path and auto-upgrade to latest minor version
2 parents 0c023d9 + 11c0a66 commit 46b4489

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+151
-141
lines changed

.github/ISSUE_TEMPLATE/1_Bug_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ about: Report errors and problems
55
---
66

77
<!--
8-
Thanks for reporting issues back to NextCloudPi!
8+
Thanks for reporting issues back to NextcloudPi!
99
1010
Here you can file bugs and feature requests. **Do NOT ask questions**, this is not a support forum.
1111
1212
If there is an important security issue that has gone unnoticed, please send a private email to nacho _at_ ownyourbits.com
1313
1414
### DO NOT ASK QUESTIONS, USE THE FORUMS
1515
16-
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/
16+
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/
1717
1818
For asking questions, please use the forums. https://help.nextcloud.com/c/support/appliances-docker-snappy-vm
1919

.github/ISSUE_TEMPLATE/3_Support_question.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ about: Do NOT ask here - Use the forum
44

55
---
66

7-
Thanks for reporting issues back to NextCloudPi!
7+
Thanks for reporting issues back to NextcloudPi!
88

99
Here you can file bugs and feature requests. **Do NOT ask questions**, this is not a support forum.
1010

1111
---
1212
DO NOT ASK QUESTIONS, USE THE FORUMS
1313
---
1414

15-
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/
15+
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/
1616

17-
We use GitHub issues only to discuss about NextCloudPi bugs and new features.
17+
We use GitHub issues only to discuss about NextcloudPi bugs and new features.
1818

19-
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.
19+
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.
2020

2121
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
2222
the thread as `ncp`.

.github/ISSUE_TEMPLATE/4_Documentation_issue.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
name: ⛔ Documentation Issue
3-
about: See the NextCloudPi Wiki
3+
about: See the NextcloudPi Wiki
44

55
---
66

7-
The NextCloudPi wiki is open to anyone to edit. If you find something inaccurate,
7+
The NextcloudPi wiki is open to anyone to edit. If you find something inaccurate,
88
missing or that can be improved, please feel free to contribute to it.
99

1010
https://github.com/nextcloud/nextcloudpi/wiki

.github/ISSUE_TEMPLATE/5_Security_issue.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/build-lxd.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -683,16 +683,17 @@ jobs:
683683
- name: convert to LXC image
684684
id: lxd-to-lxc
685685
run: |
686-
mkdir repackage output
687-
cd repackage
688-
sudo tar xpf "../${LXD_ARTIFACT_FILE?}"
689-
sudo rm -rf ./rootfs/dev
690-
LXC_ARTIFACT_FILE="${LXD_ARTIFACT_FILE//LXD/LXC}"
691-
sudo tar cpzf "../output/${LXC_ARTIFACT_FILE?}" -C rootfs/ .
692-
cd ..
693-
sudo chown "$(id -un):" "./output/${LXC_ARTIFACT_FILE}"
694-
echo "artifact_file=${LXC_ARTIFACT_FILE?}" >> $GITHUB_OUTPUT
695-
echo "artifact_name=${LXD_ARTIFACT_NAME//lxd/lxc}" >> $GITHUB_OUTPUT
686+
mkdir repackage output;
687+
cd repackage;
688+
sudo su - -c "cd '$(pwd)'; tar xpf '../${LXD_ARTIFACT_FILE?}';"
689+
sudo rm -rf ./rootfs/dev;
690+
LXC_ARTIFACT_FILE="${LXD_ARTIFACT_FILE//LXD/LXC}";
691+
sudo tar cpzf "../output/${LXC_ARTIFACT_FILE?}" -C rootfs/ .;
692+
cd ..;
693+
sudo chown "$(id -un):" "./output/${LXC_ARTIFACT_FILE}";
694+
ls -l ./output
695+
echo "artifact_file=${LXC_ARTIFACT_FILE?}" >> $GITHUB_OUTPUT;
696+
echo "artifact_name=${LXD_ARTIFACT_NAME//lxd/lxc}" >> $GITHUB_OUTPUT;
696697
- name: upload LXD image to artifact store
697698
uses: actions/upload-artifact@v3
698699
with:

bin/ncp-check-nc-version

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@ set -e
66

77
source /usr/local/etc/library.sh # sets NCLATESTVER
88

9-
CURRENT="$(ncc status | grep "version:" | awk '{ print $3 }')"
10-
LATEST="$(wget -qO- https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/etc/ncp.cfg | jq -r .nextcloud_version)"
9+
CURRENT="$(nc_version)"
10+
NEXT_VERSION="$(determine_nc_upgrade_version "${CURRENT}" "${NCLATESTVER?}")"
11+
[[ -n "$NEXT_VERSION" ]] || exit 0
12+
1113
NOTIFIED=/var/run/.nc-version-notified
1214

13-
test -e "${NOTIFIED}" && [[ "${LATEST}" == "$( cat "${NOTIFIED}" )" ]] && {
14-
echo "Found update from ${CURRENT} to ${LATEST}. Already notified"
15+
test -e "${NOTIFIED}" && [[ "${NEXT_VERSION}" == "$( cat "${NOTIFIED}" )" ]] && {
16+
echo "Found update from ${CURRENT} to ${NEXT_VERSION}. Already notified"
1517
exit 0
1618
}
1719

18-
if is_more_recent_than "${LATEST}" "${CURRENT}"; then
20+
if is_more_recent_than "${NEXT_VERSION}" "${CURRENT}"; then
1921
notify_admin \
2022
"Nextcloud update" \
21-
"Update from ${CURRENT} to ${LATEST} is available. Update from https://$(get_ip):4443"
22-
echo "${LATEST}" > "${NOTIFIED}"
23+
"Update from ${CURRENT} to ${NEXT_VERSION} is available. Update from https://$(get_ip):4443"
24+
echo "${NEXT_VERSION}" > "${NOTIFIED}"
2325
fi

bin/ncp-check-updates

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ VERFILE=/usr/local/etc/ncp-version
66
LATEST=/var/run/.ncp-latest-version
77

88
if ncp-test-updates; then
9-
echo -e "\nNextCloudPi \e[1m$( cat $VERFILE)\e[0m is outdated"
9+
echo -e "\nNextcloudPi \e[1m$( cat $VERFILE)\e[0m is outdated"
1010
echo -e "update to \e[1m$( cat $LATEST )\e[0m through 'ncp-config' or type 'sudo ncp-update'"
1111
else
12-
echo -e "\nNextCloudPi \e[1m$( cat $VERFILE)\e[0m is up to date"
12+
echo -e "\nNextcloudPi \e[1m$( cat $VERFILE)\e[0m is up to date"
1313
fi

bin/ncp-config

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# NextCloudPi software configuration
3+
# NextcloudPi software configuration
44
#
55
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
66
# GPL licensed (see end of file) * Use at your own risk!
@@ -23,7 +23,7 @@ source /usr/local/etc/library.sh
2323

2424
latest_ver="$(cat /var/run/.ncp-latest-version 2>/dev/null)"
2525
whiptail --backtitle "$backtitle $ncpversion" \
26-
--title "NextCloudPi update available" \
26+
--title "NextcloudPi update available" \
2727
--clear --yesno "Update to $latest_ver?\n\n$changelog" \
2828
15 70
2929

@@ -59,7 +59,7 @@ function generate_list()
5959
function config_menu()
6060
{
6161
local dir="$1"
62-
local backtitle="NextCloudPi configuration ver. "
62+
local backtitle="NextcloudPi configuration ver. "
6363
local ncpversion="$(cat /usr/local/etc/ncp-version )"
6464
local cfgdir=/usr/local/etc/ncp-config.d
6565
local dialog_ok=0
@@ -73,7 +73,7 @@ function config_menu()
7373
# launch the selection menu
7474
[[ "$dir" == "$BINDIR" ]] && local cancel_btn="Finish" || local cancel_btn="Back"
7575
ncp_app=$( whiptail --backtitle "$backtitle $ncpversion" \
76-
--title "NextCloudPi Configuration Tool (ncp-config)" \
76+
--title "NextcloudPi Configuration Tool (ncp-config)" \
7777
--cancel-button $cancel_btn --ok-button Select \
7878
--menu "Select ncp-app to configure or activate:" 20 105 10 \
7979
"${list[@]}" \

bin/ncp-dist-upgrade.d/debian-11.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/bash
22

33
set -eu -o pipefail
44

@@ -37,7 +37,9 @@ save_maintenance_mode
3737

3838
# Perform dist-upgrade
3939

40-
apt-get update && apt-get upgrade -y
40+
apt-get update
41+
apt-get remove -y libc-dev-bin || true
42+
apt-get upgrade -y
4143
for aptlist in /etc/apt/sources.list /etc/apt/sources.list.d/{php.list,armbian.list,raspi.list}
4244
do
4345
[ -f "$aptlist" ] && sed -i -e "s/bullseye/bookworm/g" "$aptlist"
@@ -58,6 +60,7 @@ then
5860
apt-get install -y --no-install-recommends systemd-resolved && systemctl enable --now systemd-resolved
5961
fi
6062
apt-get full-upgrade -y
63+
sudo apt-get install -y --no-install-recommends libc-dev-bin || true
6164
sudo apt-get --purge autoremove -y
6265

6366
apt-get install -y --no-install-recommends exfatprogs

bin/ncp-report

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# NextCloudPi diagnostics report
3+
# NextcloudPi diagnostics report
44
#
55
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
66
# GPL licensed (see end of file) * Use at your own risk!

0 commit comments

Comments
 (0)