Skip to content

Commit

Permalink
Merge pull request #1951 from nextcloud/devel
Browse files Browse the repository at this point in the history
  • Loading branch information
theCalcaholic authored Aug 11, 2024
2 parents 5489e30 + 2d5cfc5 commit 3c4141e
Show file tree
Hide file tree
Showing 81 changed files with 206 additions and 142 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/1_Bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ 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.
If there is an important security issue that has gone unnoticed, please send a private email to nacho _at_ ownyourbits.com
### 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
Expand Down
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/3_Support_question.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ 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.

---
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`.
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/4_Documentation_issue.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 0 additions & 13 deletions .github/ISSUE_TEMPLATE/5_Security_issue.md

This file was deleted.

21 changes: 11 additions & 10 deletions .github/workflows/build-lxd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -683,16 +683,17 @@ jobs:
- 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
with:
Expand Down
14 changes: 14 additions & 0 deletions FUNDING.yml
Original file line number Diff line number Diff line change
@@ -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']
16 changes: 9 additions & 7 deletions bin/ncp-check-nc-version
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ 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_upgrade_version "${CURRENT}" "${NCLATESTVER?}")"
[[ -n "$NEXT_VERSION" ]] || exit 0

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
4 changes: 2 additions & 2 deletions bin/ncp-check-updates
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions bin/ncp-config
Original file line number Diff line number Diff line change
@@ -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!
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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[@]}" \
Expand Down
7 changes: 5 additions & 2 deletions bin/ncp-dist-upgrade.d/debian-11.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash

set -eu -o pipefail

Expand Down Expand Up @@ -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"
Expand All @@ -58,6 +60,7 @@ then
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
Expand Down
2 changes: 1 addition & 1 deletion bin/ncp-report
Original file line number Diff line number Diff line change
@@ -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!
Expand Down
2 changes: 1 addition & 1 deletion bin/ncp-suggestions
Original file line number Diff line number Diff line change
@@ -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!
Expand Down
4 changes: 2 additions & 2 deletions bin/ncp-update
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# update latest NextCloudPi code from github
# update latest NextcloudPi code from github

[[ -z "$DBG" ]] || set -$DBG

Expand Down Expand Up @@ -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
34 changes: 13 additions & 21 deletions bin/ncp-update-nc
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ ncc status &>/dev/null || { [[ "$DBG" == x ]] && ncc status; echo "Next
####################

[[ ${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
CURRENT="$(nc_version)"
TARGET_VERSION="$(determine_nc_upgrade_version "${CURRENT?}" "${VER?}")"
[[ -n "$TARGET_VERSION" ]] || {
echo "Could not find a valid upgrade path from '${CURRENT}' to '${TARGET_VERSION}'. Nothing to update."
exit 1
fi
}

MAJOR_NEW="${TARGET_VERSION%%.*}"

if [[ "$MAJOR_NEW" -ge 24 ]] && [[ "$(lsb_release -r)" =~ .*10 ]]
then
Expand All @@ -55,18 +55,10 @@ then
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; }
grep -qP "\d+\.\d+\.\d+" <<<"$TARGET_VERSION" || { echo "Malformed version $TARGET_VERSION" ; 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
echo "Available Nextcloud version $TARGET_VERSION"

# make sure that cron.php is not running and there are no pending jobs
# https://github.com/nextcloud/server/issues/10949
Expand All @@ -88,8 +80,8 @@ trap cleanup EXIT

# get new code
####################
URL="https://download.nextcloud.com/server/releases/nextcloud-$VER.tar.bz2"
echo "Download Nextcloud $VER..."
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
Expand Down Expand Up @@ -127,7 +119,7 @@ trap rollback_simple INT TERM HUP ERR

# replace code
####################
echo "Install Nextcloud $VER..."
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
Expand Down Expand Up @@ -195,7 +187,7 @@ $ncc | grep -q db:add-missing-primary-keys && $ncc db:add-missing-primary-keys -
$ncc | grep -q db:convert-filecache-bigint && $ncc db:convert-filecache-bigint -n

# use the correct version for custom apps
NCVER="$(ncc status | grep "version:" | awk '{ print $3 }')"
NCVER="$(nc_version)"
if is_more_recent_than "21.0.0" "${NCVER}"; then
NCPREV=/var/www/ncp-previewgenerator/ncp-previewgenerator-nc20
else
Expand Down
2 changes: 1 addition & 1 deletion bin/ncp/BACKUPS/nc-export-ncp.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Export NextCloudPi configuration
# Export NextcloudPi configuration
#
#
# Copyleft 2017 by Courtney Hicks
Expand Down
2 changes: 1 addition & 1 deletion bin/ncp/BACKUPS/nc-import-ncp.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Import NextCloudPi configuration
# Import NextcloudPi configuration
#
#
# Copyleft 2017 by Courtney Hicks
Expand Down
2 changes: 1 addition & 1 deletion bin/ncp/BACKUPS/nc-snapshot-auto.sh
Original file line number Diff line number Diff line change
@@ -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!
Expand Down
2 changes: 1 addition & 1 deletion bin/ncp/CONFIG/nc-database.sh
Original file line number Diff line number Diff line change
@@ -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!
Expand Down
2 changes: 1 addition & 1 deletion bin/ncp/CONFIG/nc-datadir.sh
Original file line number Diff line number Diff line change
@@ -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!
Expand Down
2 changes: 1 addition & 1 deletion bin/ncp/CONFIG/nc-httpsonly.sh
Original file line number Diff line number Diff line change
@@ -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!
Expand Down
2 changes: 1 addition & 1 deletion bin/ncp/CONFIG/nc-limits.sh
Original file line number Diff line number Diff line change
@@ -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!
Expand Down
2 changes: 1 addition & 1 deletion bin/ncp/CONFIG/nc-trusted-domains.sh
Original file line number Diff line number Diff line change
@@ -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!
Expand Down
2 changes: 1 addition & 1 deletion bin/ncp/NETWORKING/duckDNS.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# DuckDNS installation on Raspbian for NextCloudPi
# DuckDNS installation on Raspbian for NextcloudPi
#
#
# Copyleft 2017 by Courtney Hicks
Expand Down
2 changes: 1 addition & 1 deletion bin/ncp/NETWORKING/letsencrypt.sh
Original file line number Diff line number Diff line change
@@ -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!
Expand Down
Loading

0 comments on commit 3c4141e

Please sign in to comment.