Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
theCalcaholic committed Apr 26, 2023
2 parents 5a732c8 + 7ae218d commit 987dbca
Show file tree
Hide file tree
Showing 14 changed files with 91 additions and 30 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ on:
default: 'x86'
push:
branches:
- master
- devel
- docker-stable
- docker-devel
pull_request:
branches:
- master
- devel
- release/*
- docker-stable
- docker-devel
- release/docker/*

jobs:
build:
Expand Down
33 changes: 18 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,62 +32,65 @@ on:
required: false
default: false
push:
tags: ["v*"]
tags:
- "v*"
- "docker-v*"
branches:
- master
- docker-stable

permissions:
contents: write

jobs:
lxd-x86:
if: ${{ inputs.lxd || github.event_name != 'workflow_dispatch' }}
if: ${{ inputs.lxd || ( github.event_name != 'workflow_dispatch' && !startsWith(github.ref_name, 'docker-') ) }}
uses: ./.github/workflows/build-lxd.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
arch: 'x86'
secrets: inherit
lxd-arm64:
if: ${{ inputs.lxd || github.event_name != 'workflow_dispatch' }}
if: ${{ inputs.lxd || ( github.event_name != 'workflow_dispatch' && !startsWith(github.ref_name, 'docker-') ) }}
uses: ./.github/workflows/build-lxd.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
arch: 'arm64'
secrets: inherit

docker-x86:
if: ${{ inputs.docker || github.event_name != 'workflow_dispatch' }}
if: ${{ inputs.docker || ( github.event_name != 'workflow_dispatch' && startsWith(github.ref_name, 'docker-') ) }}
uses: ./.github/workflows/build-docker.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
arch: "x86"
secrets: inherit

docker-armhf:
if: ${{ inputs.docker || github.event_name != 'workflow_dispatch' }}
if: ${{ inputs.docker || ( github.event_name != 'workflow_dispatch' && startsWith(github.ref_name, 'docker-') ) }}
uses: ./.github/workflows/build-docker.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
arch: "armhf"
secrets: inherit

docker-arm64:
if: ${{ inputs.docker || github.event_name != 'workflow_dispatch' }}
if: ${{ inputs.docker || ( github.event_name != 'workflow_dispatch' && startsWith(github.ref_name, 'docker-') ) }}
uses: ./.github/workflows/build-docker.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
arch: "arm64"
secrets: inherit

test-curl-installer:
if: ${{ inputs.installer || github.event_name != 'workflow_dispatch' }}
if: ${{ inputs.installer || ( github.event_name != 'workflow_dispatch' && !startsWith(github.ref_name, 'docker-') ) }}
uses: ./.github/workflows/vm-tests.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
secrets: inherit

raspberrypi:
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
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 }}"
Expand All @@ -106,15 +109,15 @@ jobs:
board_name: OdroidHC2
secrets: inherit
rockpro64:
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
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: rockpro64
board_name: RockPro64
secrets: inherit
rock64:
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
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 }}"
Expand All @@ -132,23 +135,23 @@ jobs:
board_name: BananaPi
secrets: inherit
odroidhc4:
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
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: odroidhc4
board_name: OdroidHC4
secrets: inherit
odroidc4:
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
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: odroidc4
board_name: OdroidC4
secrets: inherit
odroidc2:
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
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 }}"
Expand Down Expand Up @@ -307,8 +310,7 @@ jobs:
- docker-x86
- docker-armhf
- docker-arm64
- test-curl-installer
if: ${{ (inputs.release || github.event_name != 'workflow_dispatch') && github.ref_type == 'tag' && (github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
if: ${{ (inputs.release || github.event_name != 'workflow_dispatch') && github.ref_type == 'tag' && (github.ref_protected || startsWith(github.ref, 'refs/tags/docker-v')) }}
runs-on: ubuntu-latest
steps:
- name: Login to DockerHub
Expand Down Expand Up @@ -352,6 +354,7 @@ jobs:
docker manifest push ownyourbits/nextcloudpi:latest
github-release:
if: ${{ github.event_name == 'workflow_dispatch' || !startsWith(github.ref_name, 'docker-') }}
needs:
- test-curl-installer
runs-on: ubuntu-latest
Expand Down
12 changes: 11 additions & 1 deletion bin/ncp/BACKUPS/nc-backup-auto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,17 @@ fi
EOF
chmod +x /usr/local/bin/ncp-backup-auto

echo "0 3 */${BACKUPDAYS} * * root /usr/local/bin/ncp-backup-auto >> /var/log/ncp.log 2>&1" > /etc/cron.d/ncp-backup-auto
[[ "$BACKUPHOUR" =~ ^([0-1]?[0-9]|2[0-4])$ ]] || {
echo "ERROR: 'BACKUPHOUR' must be a number between 0 and 24, was: '$BACKUPHOUR'"
return 1
}

[[ "$BACKUPDAYS" =~ ^[0-9]+$ ]] || {
echo "ERROR: 'BACKUPDAYS' must be a number, was: '$BACKUPDAYS'"
return 1
}

echo "0 ${BACKUPHOUR} */${BACKUPDAYS} * * root /usr/local/bin/ncp-backup-auto >> /var/log/ncp.log 2>&1" > /etc/cron.d/ncp-backup-auto
chmod 644 /etc/cron.d/ncp-backup-auto
service cron restart

Expand Down
12 changes: 11 additions & 1 deletion bin/ncp/BACKUPS/nc-rsync-auto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ configure()
return 0
}

[[ "$SYNCHOUR" =~ ^([0-1]?[0-9]|2[0-4])$ ]] || {
echo "ERROR: 'BACKUPHOUR' must be a number between 0 and 24, was: '$SYNCHOUR'"
return 1
}

[[ "$SYNCDAYS" =~ ^[0-9]+$ ]] || {
echo "ERROR: 'BACKUPDAYS' must be a number, was: '$SYNCDAYS'"
return 1
}

local DATADIR
DATADIR=$( get_nc_config_value datadirectory ) || {
echo -e "Error reading data directory. Is NextCloud running and configured?";
Expand All @@ -36,7 +46,7 @@ configure()
${SSH[@]} echo || { echo "SSH non-interactive not properly configured"; return 1; }
}

echo "0 5 */${SYNCDAYS} * * root /usr/bin/rsync -ax -e \"ssh -p $PORTNUMBER\" --delete \"$DATADIR\" \"$DESTINATION\"" > /etc/cron.d/ncp-rsync-auto
echo "0 ${SYNCHOUR} */${SYNCDAYS} * * root /usr/bin/rsync -ax -e \"ssh -p $PORTNUMBER\" --delete \"$DATADIR\" \"$DESTINATION\"" > /etc/cron.d/ncp-rsync-auto
chmod 644 /etc/cron.d/ncp-rsync-auto
service cron restart

Expand Down
13 changes: 12 additions & 1 deletion bin/ncp/BACKUPS/nc-snapshot-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ configure()
}

# checks

[[ "$SYNCHOUR" =~ ^([0-1]?[0-9]|2[0-4])$ ]] || {
echo "ERROR: 'BACKUPHOUR' must be a number between 0 and 24, was: '$SYNCHOUR'"
return 1
}

[[ "$SYNCDAYS" =~ ^[0-9]+$ ]] || {
echo "ERROR: 'BACKUPDAYS' must be a number, was: '$SYNCDAYS'"
return 1
}

[[ -d "$SNAPDIR" ]] || { echo "$SNAPDIR does not exist"; return 1; }
if ! [[ -f /root/.ssh/id_rsa ]]; then ssh-keygen -N "" -f /root/.ssh/id_rsa; fi

Expand All @@ -62,7 +73,7 @@ configure()

[[ "$COMPRESSION" == "yes" ]] && ZIP="-z"

echo "30 4 */${SYNCDAYS} * * root /usr/local/bin/btrfs-sync -qd $ZIP \"$SNAPDIR\" \"$DESTINATION\"" > /etc/cron.d/ncp-snapsync-auto
echo "30 ${SYNCHOUR} */${SYNCDAYS} * * root /usr/local/bin/btrfs-sync -qd $ZIP \"$SNAPDIR\" \"$DESTINATION\"" > /etc/cron.d/ncp-snapsync-auto
chmod 644 /etc/cron.d/ncp-snapsync-auto
service cron restart

Expand Down
9 changes: 6 additions & 3 deletions bin/ncp/CONFIG/nc-limits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@ tmpl_php_max_filesize() {
}

tmpl_php_threads() {
local TOTAL_MEM="$( get_total_mem )"
local PHPTHREADS="$(find_app_param nc-limits PHPTHREADS)"
[[ $PHPTHREADS -eq 0 ]] && PHPTHREADS=$(nproc)
[[ $PHPTHREADS -lt 6 ]] && PHPTHREADS=6
echo -n "$PHPTHREADS"
# By default restricted by memory / 100MB
[[ $PHPTHREADS -eq 0 ]] && PHPTHREADS=$(( TOTAL_MEM / ( 100 * 1024 * 1024 ) ))
# Minimum 16
[[ $PHPTHREADS -lt 16 ]] && PHPTHREADS=16
echo -n "$PHPTHREADS"
}

configure()
Expand Down
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# NextcloudPi Changelog

## [v1.51.3](https://github.com/nextcloud/nextcloudpi/tree/v1.51.3) (2023-04-26) Add support for Nextcloud 25.0.6

### Changes

- Add support for NC 25.0.6

## [v1.51.2](https://github.com/nextcloud/nextcloudpi/tree/v1.51.2) (2023-04-16) Restore support for LXC images

### Changes
Expand Down
6 changes: 6 additions & 0 deletions etc/ncp-config.d/nc-backup-auto.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
"suggest": "7",
"value": "7"
},
{
"id": "BACKUPHOUR",
"name": "Hour of Day to run the Backup",
"suggest": "3",
"value": "3"
},
{
"id": "BACKUPLIMIT",
"name": "Number of backups to keep",
Expand Down
2 changes: 1 addition & 1 deletion etc/ncp-config.d/nc-limits.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "nc-limits",
"name": "Nc-limits",
"title": "nc-limits",
"description": "Configure system limits for NextCloudPi",
"description": "Configure system limits for NextcloudPi",
"info": "Examples: 200M or 2G. Write 0 for autoconfig",
"infotitle": "",
"params": [
Expand Down
2 changes: 1 addition & 1 deletion etc/ncp-config.d/nc-nextcloud.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
"id": "VER",
"name": "Version",
"value": "25.0.5"
"value": "25.0.6"
},
{
"id": "MAXFILESIZE",
Expand Down
6 changes: 6 additions & 0 deletions etc/ncp-config.d/nc-rsync-auto.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
"name": "Sync periodicity (in days)",
"value": "3",
"suggest": "3"
},
{
"id": "SYNCHOUR",
"name": "Hour of Day when syncing",
"value": "5",
"suggest": "5"
}
]
}
6 changes: 6 additions & 0 deletions etc/ncp-config.d/nc-snapshot-sync.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
"name": "Sync periodicity (in days)",
"value": "1",
"suggest": "1"
},
{
"id": "SYNCHOUR",
"name": "Hour of Day when syncing",
"value": "4",
"suggest": "4"
}
]
}
2 changes: 1 addition & 1 deletion etc/ncp-templates/php/pool.d.www.conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [[ "$1" == "--defaults" ]] || ! [[ -f "${BINDIR}/CONFIG/nc-limits.sh" ]]
then
echo "INFO: Restoring template to default settings" >&2

PHPTHREADS=6
PHPTHREADS=16
else
PHPTHREADS="$(source "${BINDIR}/CONFIG/nc-limits.sh"; tmpl_php_threads)"
fi
Expand Down
2 changes: 1 addition & 1 deletion etc/ncp.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"nextcloud_version": "25.0.5",
"nextcloud_version": "25.0.6",
"php_version": "8.1",
"release": "bullseye"
}

0 comments on commit 987dbca

Please sign in to comment.