Merge pull request #1867 from nextcloud/devel

v1.53.1
This commit is contained in:
Tobias Knöppler 2024-02-01 01:05:29 +01:00 committed by GitHub
commit e18e65af79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
24 changed files with 212 additions and 159 deletions

View File

@ -40,8 +40,8 @@ jobs:
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
- name: Checkout code
uses: actions/checkout@v3
@ -119,8 +119,8 @@ jobs:
echo "Previous version is '$version'"
echo "PREVIOUS_VERSION=$version" >> "$GITHUB_ENV"
echo "previous_version=${version}" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
- name: Enable qemu SUID
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes --credential yes
@ -399,8 +399,8 @@ jobs:
LOG_TEST: "\\033[1;33mTEST::\\033[0m"
LOG_DIAG: "\\033[1;31mDIAG::\\033[0m"
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
- name: Login to docker
run: |

View File

@ -31,7 +31,7 @@ jobs:
determine-runner:
env:
LXD_ARCH: "${{ inputs.arch || 'x86' }}"
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
outputs:
runner_label: ${{ steps.script.outputs.runner_label }}
steps:
@ -40,17 +40,16 @@ jobs:
run: |
if [[ "${LXD_ARCH}" == "arm64" ]]
then
RUNNER_LABEL=ubuntu-20.04-arm64
RUNNER_LABEL="ubuntu-20.04-arm64"
else
RUNNER_LABEL=ubuntu-20.04
RUNNER_LABEL="ubuntu-20.04"
fi
echo "runner_label=$RUNNER_LABEL" | tee -a $GITHUB_OUTPUT
build-current:
needs:
- determine-runner
runs-on:
- ${{ needs.determine-runner.outputs.runner_label }}
runs-on: ${{ needs.determine-runner.outputs.runner_label }}
outputs:
artifact_name: "${{ env.ARTIFACT_NAME }}"
artifact_file: "${{ steps.pack-lxd.outputs.artifact_file }}"
@ -66,8 +65,13 @@ jobs:
- name: Cleanup lxd
run: test -z "$(lxc profile device show default | grep eth0)" || lxc profile device remove default eth0
- uses: whywaita/setup-lxd@v1
continue-on-error: true
with:
lxd_version: latest/stable
- name: Fix LXD
run: |
sudo iptables -I DOCKER-USER -i lxdbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
- name: Build LXD image
run: |
./build/build-LXD.sh
@ -75,7 +79,7 @@ jobs:
id: pack-lxd
run: |
. ./build/buildlib.sh
ARTIFACT_FILE="NextCloudPi_LXD_${LXD_ARCH:-x86}_${VERSION//\//_}"
ARTIFACT_FILE="NextcloudPi_LXD_${LXD_ARCH:-x86}_${VERSION//\//_}"
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
@ -86,7 +90,7 @@ jobs:
if-no-files-found: error
build-previous:
runs-on: ubuntu-20.04
runs-on: [ ubuntu-20.04 ]
if: ${{ inputs.arch == 'x86' || inputs.arch == '' }}
outputs:
artifact_name: "${{ env.ARTIFACT_NAME }}"
@ -95,7 +99,6 @@ jobs:
env:
VERSION: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
ARTIFACT_NAME: "${{ github.run_id }}-lxd-${{ inputs.arch || 'x86' }}-image-previous"
LXD_EXTRA_PROFILE: network
LXD_ARCH: "${{ inputs.arch || 'x86' }}"
steps:
- name: Checkout code
@ -131,29 +134,13 @@ jobs:
echo "VERSION=$version" >> "$GITHUB_ENV"
echo "previous_version=${version}" >> $GITHUB_OUTPUT
- uses: whywaita/setup-lxd@v1
continue-on-error: true
with:
lxd_version: latest/stable
- name: Fix LXD
run: |
lxc profile create network
cat <<EOF | lxc profile edit network
devices:
eth0:
name: eth0
parent: lxdbr0
nictype: bridged
type: nic
EOF
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Enable qemu SUID
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes --credential yes
- name: Download qemu binaries
run: |
wget -nv https://github.com/multiarch/qemu-user-static/releases/latest/download/qemu-aarch64-static -O qemu-aarch64-static
wget -nv https://github.com/multiarch/qemu-user-static/releases/latest/download/qemu-arm-static -O qemu-arm-static
chmod +x qemu-{arm,aarch64}-static
sudo iptables -I DOCKER-USER -i lxdbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
- name: Build LXD image
run: |
@ -162,7 +149,7 @@ jobs:
id: pack-lxd
run: |
. ./build/buildlib.sh
ARTIFACT_FILE="NextCloudPi_LXD_${LXD_ARCH:-x86}_${VERSION//\//_}"
ARTIFACT_FILE="NextcloudPi_LXD_${LXD_ARCH:-x86}_${VERSION//\//_}"
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
@ -175,7 +162,7 @@ jobs:
test-update:
needs:
- build-previous
runs-on: ubuntu-20.04
runs-on: [ubuntu-20.04]
outputs:
artifact_name: "${{ env.ARTIFACT_NAME }}"
artifact_file: "${{ steps.pack-lxd.outputs.artifact_file }}"
@ -184,25 +171,25 @@ jobs:
ARTIFACT_NAME: "${{ needs.build-previous.outputs.artifact_name }}"
steps:
- uses: whywaita/setup-lxd@v1
continue-on-error: true
with:
lxd_version: latest/stable
- name: Fix LXD
run: |
lxc profile create network
cat <<EOF | lxc profile edit network
devices:
eth0:
name: eth0
parent: lxdbr0
nictype: bridged
type: nic
EOF
sudo iptables -I DOCKER-USER -i lxdbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
- name: Checkout code
uses: actions/checkout@v3
with:
ref: "${{ env.VERSION }}"
- name: Setup Firefox
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' }}
run: |
sudo apt-get install -y --no-install-recommends firefox
- name: Setup GeckoDriver
uses: ChlodAlejandro/setup-geckodriver@latest
with:
@ -224,6 +211,32 @@ jobs:
ip="$(lxc list -c n4 -f csv | grep '^ncp' | cut -d ',' -f2)"
ip="${ip/% *}"
echo "${ip} nextcloudpi.local" | sudo tee /etc/hosts
- name: Activate and 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 || {
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"
exit 1
}
python system_tests.py --non-interactive || {
echo "System test failed!"
exit 1
}
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"
exit 1
}
- name: Update ncp
run: |
@ -253,12 +266,10 @@ jobs:
fi
lxc stop ncp
lxc publish -q ncp -f --alias "ncp/updated"
- name: Relaunch container
run: |
set -x
lxc delete -q -f ncp || true
systemd-run --user --scope -p "Delegate=yes" lxc launch -q "ncp/updated" ncp
systemd-run --user --scope -p "Delegate=yes" lxc start ncp
lxc exec ncp -- bash -c 'while [ "$(systemctl is-system-running 2>/dev/null)" != "running" ] && [ "$(systemctl is-system-running 2>/dev/null)" != "degraded" ]; do :; done'
sleep 30
ip="$(lxc list -c n4 -f csv | grep '^ncp' | cut -d ',' -f2)"
@ -268,15 +279,6 @@ jobs:
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 || {
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"
exit 1
}
python system_tests.py --non-interactive || {
echo "System test failed!"
exit 1
@ -309,19 +311,14 @@ jobs:
- name: Cleanup lxd
run: test -z "$(lxc profile device show default | grep eth0)" || lxc profile device remove default eth0
- uses: whywaita/setup-lxd@v1
continue-on-error: true
with:
lxd_version: latest/stable
- name: Fix LXD
continue-on-error: true
run: |
lxc profile create network
cat <<EOF | lxc profile edit network
devices:
eth0:
name: eth0
network: lxdbr0
type: nic
EOF
sudo iptables -I DOCKER-USER -i lxdbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
- name: Setup Firefox
uses: browser-actions/setup-firefox@latest
continue-on-error: true
@ -387,7 +384,7 @@ jobs:
convert-to-lxc-image:
needs:
- build-current
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
outputs:
artifact_name: "${{ steps.lxd-to-lxc.outputs.artifact_name }}"
artifact_file: "${{ steps.lxd-to-lxc.outputs.artifact_file }}"

View File

@ -39,10 +39,15 @@ jobs:
artifact_name: ${{ github.run_id }}-${{ inputs.board_id }}-image
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Setup qemu-user-static
run: |
sudo apt-get update
uses: docker/setup-qemu-action@v3
# - name: Set up QEMU
# run: |
# sudo apt-get update
# sudo apt-get install -y binfmt-support
# curl -L -o /tmp/qemu.sh 'https://raw.githubusercontent.com/qemu/qemu/master/scripts/qemu-binfmt-conf.sh'
# bash /tmp/qemu.sh --debian
# sudo systemctl disable apparmor
# docker run --rm --privileged tonistiigi/binfmt:latest --install all
# docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes
# sudo mkdir -p /etc/binfmt
# for conf in qemu-{aarch64,arm}-static.conf
@ -64,7 +69,7 @@ jobs:
continue-on-error: true
run: |
set -ex
export IMG="NextCloudPi_${{ inputs.board_name }}_${VERSION//\//_}.img"
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 }}"
@ -82,7 +87,7 @@ jobs:
echo -e "${LOG_CICD} Cleanup armbian build leftovers..."
sudo rm -rf armbian/ tmp/ output/
export IMG="NextCloudPi_${{ inputs.board_name }}_${VERSION//\//_}.img"
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 }}"
@ -104,7 +109,7 @@ jobs:
run: |
set -ex
echo -e "${LOG_CICD} Protected? ${{ github.ref_protected }}"
export IMG="NextCloudPi_${{ inputs.board_name }}_${VERSION//\//_}.img"
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
@ -145,21 +150,19 @@ jobs:
shell: bash
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Apt update
run: |
sudo apt-get update
# sudo apt-get -y --no-install-recommends install qemu-user-static
# - name: Apply workaround for sudo bug (https://github.com/multiarch/qemu-user-static/issues/17)
uses: docker/setup-qemu-action@v3
# - name: Set up QEMU
# run: |
# sudo apt-get update
# sudo apt-get -y --no-install-recommends install binfmt-support qemu-user-static
# 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 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
# 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: Checkout code
uses: actions/checkout@v3
with:

View File

@ -188,6 +188,36 @@ jobs:
with:
name: ${{ github.run_id }}-update-ssh-privkey
path: .ssh
- name: Activate and Test postinstall VM
run: |
set -e
echo "Setup ssh"
chmod 0600 ./.ssh/automation_ssh_key
eval "$(ssh-agent)"
ssh-add ./.ssh/automation_ssh_key
cd bin
source ./library.sh
trap 'terminate-ssh-port-forwarding "${SERVER_ADDRESS}"' EXIT 1 2
setup-ssh-port-forwarding "$SERVER_ADDRESS"
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" "root@${SERVER_ADDRESS}" "localhost" "8443" "9443" || {
echo "Integration tests failed"
echo "Here are the last lines of ncp-install.log:"
echo "==========================================="
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" tail /var/log/ncp-install.log;
echo "==========================================="
echo "and ncp.log:"
echo "==========================================="
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" tail /var/log/ncp.log;
echo "==========================================="
exit 1
}
- name: perform update
run: |
set -e
@ -218,7 +248,7 @@ jobs:
echo "Run integration tests"
setup-ssh-port-forwarding "$SERVER_ADDRESS"
test-ncp-instance -a -f "$SNAPSHOT_ID" -b "${VERSION}" --systemtest-args "--skip-update-test" "root@${SERVER_ADDRESS}" "localhost" "8443" "9443" || {
test-ncp-instance -f "$SNAPSHOT_ID" -b "${VERSION}" --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:"

View File

@ -67,7 +67,7 @@ BKP="$( ls -1t /var/www/nextcloud-bkp_*.tar.gz 2>/dev/null | head -1 )"
## Check for encrypted data and ask for password
if needs_decrypt; then
echo "Detected encrypted instance"
a2dissite ncp nextcloud
a2dissite ncp 001-nextcloud
a2ensite ncp-activation
apache2ctl -k graceful
fi

View File

@ -194,11 +194,11 @@ EOF
## SET APACHE VHOST
echo "Setting up Apache..."
install_template nextcloud.conf.sh /etc/apache2/sites-available/nextcloud.conf --allow-fallback || {
install_template nextcloud.conf.sh /etc/apache2/sites-available/001-nextcloud.conf --allow-fallback || {
echo "ERROR: Parsing template failed. Nextcloud will not work."
exit 1
}
a2ensite nextcloud
a2ensite 001-nextcloud
cat > /etc/apache2/sites-available/000-default.conf <<'EOF'
<VirtualHost _default_:80>

View File

@ -27,7 +27,7 @@ configure()
sudo -u www-data php /var/www/nextcloud/cron.php
a2dissite ncp-activation
a2ensite ncp nextcloud
a2ensite ncp 001-nextcloud
apachectl -k graceful
# Trusted Domain (local/public IP), also configures notify_push

View File

@ -9,7 +9,7 @@
ncdir=/var/www/nextcloud
nc_vhostcfg=/etc/apache2/sites-available/nextcloud.conf
nc_vhostcfg=/etc/apache2/sites-available/001-nextcloud.conf
ncp_vhostcfg=/etc/apache2/sites-available/ncp.conf
letsencrypt=/usr/bin/letsencrypt

View File

@ -60,7 +60,7 @@ configure()
echo "${PASSWORD?}" | gocryptfs -allow_other -q "${encdir}" "${datadir}" 2>&1 | sed /^Switch/d
# switch to the regular virtual hosts after we decrypt, so we can access NC and ncp-web
a2ensite ncp nextcloud
a2ensite ncp 001-nextcloud
a2dissite ncp-activation
apache2ctl -k graceful

View File

@ -196,8 +196,8 @@ configure() {
if [[ "$ACTIVE" != yes ]]
then
install_template nextcloud.conf.sh /etc/apache2/sites-available/nextcloud.conf || {
install_template nextcloud.conf.sh /etc/apache2/sites-available/nextcloud.conf --allow-fallback
install_template nextcloud.conf.sh /etc/apache2/sites-available/001-nextcloud.conf || {
install_template nextcloud.conf.sh /etc/apache2/sites-available/001-nextcloud.conf --allow-fallback
echo -e "ERROR while generating nextcloud.conf! Exiting..."
return 1
}
@ -248,8 +248,8 @@ configure() {
echo "done."
install_template nextcloud.conf.sh /etc/apache2/sites-available/nextcloud.conf || {
install_template nextcloud.conf.sh /etc/apache2/sites-available/nextcloud.conf --allow-fallback
install_template nextcloud.conf.sh /etc/apache2/sites-available/001-nextcloud.conf || {
install_template nextcloud.conf.sh /etc/apache2/sites-available/001-nextcloud.conf --allow-fallback
echo -e "ERROR while generating nextcloud.conf! Exiting..."
return 1
}

View File

@ -14,7 +14,7 @@ source build/buildlib.sh
echo -e "\e[1m\n[ Build NCP LXC ]\e[0m"
#CLEAN=0 # Pass this envvar to skip cleaning download cache
IMG="NextCloudPi_LXC_$( date "+%m-%d-%y" ).img"
IMG="NextcloudPi_LXC_$( date "+%m-%d-%y" ).img"
IMG=tmp/"$IMG"
TAR=output/"$( basename "$IMG" .img ).tar.bz2"

View File

@ -14,7 +14,7 @@ source build/buildlib.sh
echo -e "\e[1m\n[ Build NCP LXD ]\e[0m"
#CLEAN=0 # Pass this envvar to skip cleaning download cache
IMG="NextCloudPi_LXD_$( date "+%m-%d-%y" ).img"
IMG="NextcloudPi_LXD_$( date "+%m-%d-%y" ).img"
IMG=tmp/"$IMG"
TAR=output/"$( basename "$IMG" .img ).tar.bz2"

View File

@ -18,7 +18,7 @@ NCPCFG=etc/ncp.cfg
echo -e "\e[1m\n[ Build NCP ${BNAME} ]\e[0m"
IMG="${IMG:-NextCloudPi_${BNAME}_$( date "+%m-%d-%y" ).img}"
IMG="${IMG:-NextcloudPi_${BNAME}_$( date "+%m-%d-%y" ).img}"
IMG=tmp/"$IMG"
TAR=output/"$( basename "$IMG" .img ).tar.bz2"
@ -32,7 +32,7 @@ prepare_dirs # tmp cache output
# get latest armbian
[[ -d armbian ]] || {
git clone --depth 100 https://github.com/armbian/build armbian
(cd armbian; git checkout 8f262c6ccf81040ac26f90e612102b4e726c9878)
( cd armbian && git checkout c47c9372bf6970d6ca8c32bc5f7ec2a1416ab5bd; )
}
#( 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
@ -58,6 +58,7 @@ KERNEL_CONFIGURE=prebuilt
BUILD_DESKTOP=no
BUILD_MINIMAL=yes
USE_CCACHE=yes
INCLUDE_HOME_DIR=yes
EOF
[[ "$CLEAN" == "0" ]] && {
cat >> "$CONF" <<EOF
@ -76,6 +77,7 @@ mkdir -p armbian/userpatches
#sed -e '/docker.*run/s/-it//' armbian/config/templates/config-docker.conf > armbian/userpatches/config-docker.conf
#docker pull "ghcr.io/armbian/build:$(cut -d"." -f1-2 < armbian/VERSION)-$(dpkg --print-architecture)" \
# || docker pull "ghcr.io/armbian/build:latest-$(dpkg --print-architecture)"
export INCLUDE_HOME_DIR=yes
armbian/compile.sh ncp
rm "$CONF"

View File

@ -14,7 +14,7 @@ source build/buildlib.sh
echo -e "\e[1m\n[ Build NCP Berryboot ]\e[0m"
SRC="$1"
IMG="NextCloudPi_RPi_Berryboot_$( date "+%m-%d-%y" ).img"
IMG="NextcloudPi_RPi_Berryboot_$( date "+%m-%d-%y" ).img"
TAR=output/"$( basename "$IMG" .img ).tar.bz2"
test -f "$TAR" && { echo "$TAR already exists. Skipping... "; exit 0; }

View File

@ -16,7 +16,7 @@ echo -e "\e[1m\n[ Build NCP Raspberry Pi ]\e[0m"
URL="https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2022-09-26/2022-09-22-raspios-bullseye-arm64-lite.img.xz"
SIZE=4G # Raspbian image size
#CLEAN=0 # Pass this envvar to skip cleaning download cache
IMG="${IMG:-NextCloudPi_RPi_$( date "+%m-%d-%y" ).img}"
IMG="${IMG:-NextcloudPi_RPi_$( date "+%m-%d-%y" ).img}"
TAR=output/"$( basename "$IMG" .img ).tar.bz2"
##############################################################################

View File

@ -16,7 +16,7 @@ echo -e "\e[1m\n[ Build NCP VM ]\e[0m"
IP=${1:-192.168.0.145} # For QEMU automated testing (optional)
SIZE=3G # Raspbian image size
#CLEAN=0 # Pass this envvar to skip cleaning download cache
IMG="${IMG:-NextCloudPi_VM_$( date "+%m-%d-%y" ).img}"
IMG="${IMG:-NextcloudPi_VM_$( date "+%m-%d-%y" ).img}"
IMG=tmp/"$IMG"
VM="/var/lib/libvirt/images/ncp-vm.img"

View File

@ -1,5 +1,15 @@
# NextcloudPi Changelog
## [v1.53.1](https://github.com/nextcloud/nextcloudpi/tree/v1.53.1) (2024-02-01) Support Nextcloud 27.1.6
### Changes
- Add support for Nextcloud 27.1.6
### Development related
- minor fixes to the build process
## [v1.53.0](https://github.com/nextcloud/nextcloudpi/tree/v1.53.0) (2023-11-15) Staged Rollouts and NC 27.1.3
### Changes

View File

@ -9,7 +9,7 @@
{
"id": "VER",
"name": "Version",
"value": "27.1.3"
"value": "27.1.6"
},
{
"id": "MAXFILESIZE",

View File

@ -0,0 +1,50 @@
#! /bin/bash
set -e
export WEBADMIN=ncp
cat <<EOF
Listen 4443
<VirtualHost _default_:4443>
DocumentRoot /var/www/ncp-web
SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains"
</IfModule>
# 2 days to avoid very big backups requests to timeout
TimeOut 172800
<IfModule mod_authnz_external.c>
DefineExternalAuth pwauth pipe /usr/sbin/pwauth
</IfModule>
</VirtualHost>
<Directory /var/www/ncp-web/>
AuthType Basic
AuthName "ncp-web login"
AuthBasicProvider external
AuthExternal pwauth
<RequireAll>
<RequireAny>
Require host localhost
Require local
Require ip 192.168
Require ip 172
Require ip 10
Require ip fe80::/10
Require ip fd00::/8
</RequireAny>
Require user $WEBADMIN
</RequireAll>
</Directory>
EOF

View File

@ -1,5 +1,5 @@
{
"nextcloud_version": "27.1.3",
"nextcloud_version": "27.1.6",
"php_version": "8.1",
"release": "bullseye"
}

View File

@ -66,7 +66,7 @@ if ( $_POST['action'] == "launch" && $_POST['config'] )
// sanitize
$val = trim(escapeshellarg($new_params[$id]),"'");
preg_match( '/[\'" &]/' , $val , $matches )
preg_match( '/[\&#;\'`|*?~<>^"()[{}$& ]/' , $val , $matches )
and exit( '{ "output": "Invalid characters in input" , "token": "' . getCSRFToken() . '" }' );
// save

56
ncp.sh
View File

@ -70,63 +70,11 @@ EOF
</Directory>
EOF
cat > /etc/apache2/sites-available/ncp.conf <<EOF
Listen 4443
<VirtualHost _default_:4443>
DocumentRoot /var/www/ncp-web
SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains"
</IfModule>
# 2 days to avoid very big backups requests to timeout
TimeOut 172800
<IfModule mod_authnz_external.c>
DefineExternalAuth pwauth pipe /usr/sbin/pwauth
</IfModule>
</VirtualHost>
<Directory /var/www/ncp-web/>
AuthType Basic
AuthName "ncp-web login"
AuthBasicProvider external
AuthExternal pwauth
SetEnvIf Request_URI "^" noauth
SetEnvIf Request_URI "^index\.php$" !noauth
SetEnvIf Request_URI "^/$" !noauth
SetEnvIf Request_URI "^/wizard/index.php$" !noauth
SetEnvIf Request_URI "^/wizard/$" !noauth
<RequireAll>
<RequireAny>
Require host localhost
Require local
Require ip 192.168
Require ip 172
Require ip 10
Require ip fe80::/10
Require ip fd00::/8
</RequireAny>
<RequireAny>
Require env noauth
Require user $WEBADMIN
</RequireAny>
</RequireAll>
</Directory>
EOF
install_template apache2/ncp.conf.sh /etc/apache2/sites-available/ncp.conf --defaults
$APTINSTALL libapache2-mod-authnz-external pwauth
a2enmod authnz_external authn_core auth_basic
a2dissite nextcloud
a2dissite 001-nextcloud
a2ensite ncp-activation
## NCP USER FOR AUTHENTICATION

13
updates/1.53.1.sh Normal file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -e
source /usr/local/etc/library.sh
install_template apache2/ncp.conf.sh /etc/apache2/sites-available/ncp.conf --defaults
a2dissite nextcloud
mv /etc/apache2/sites-available/nextcloud.conf /etc/apache2/sites-available/001-nextcloud.conf
a2ensite 001-nextcloud
install_template systemd/notify_push.service.sh /etc/systemd/system/notify_push.service
systemctl daemon-reload
systemctl restart notify_push
bash -c "sleep 2 && systemctl reload apache2"