diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 003f6e21d..5f545788f 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -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: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9874c7e03..5c496b151 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,23 +32,26 @@ 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 }}" @@ -56,7 +59,7 @@ jobs: 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 }}" @@ -64,7 +67,7 @@ jobs: 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 }}" @@ -72,7 +75,7 @@ jobs: 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 }}" @@ -80,14 +83,14 @@ jobs: 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 }}" @@ -106,7 +109,7 @@ 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 }}" @@ -114,7 +117,7 @@ jobs: 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 }}" @@ -132,7 +135,7 @@ 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 }}" @@ -140,7 +143,7 @@ jobs: 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 }}" @@ -148,7 +151,7 @@ jobs: 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 }}" @@ -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 @@ -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 diff --git a/bin/ncp/BACKUPS/nc-backup-auto.sh b/bin/ncp/BACKUPS/nc-backup-auto.sh index 11837ad82..d9d642487 100644 --- a/bin/ncp/BACKUPS/nc-backup-auto.sh +++ b/bin/ncp/BACKUPS/nc-backup-auto.sh @@ -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 diff --git a/bin/ncp/BACKUPS/nc-rsync-auto.sh b/bin/ncp/BACKUPS/nc-rsync-auto.sh index c9d5ae5fd..f44863b5d 100644 --- a/bin/ncp/BACKUPS/nc-rsync-auto.sh +++ b/bin/ncp/BACKUPS/nc-rsync-auto.sh @@ -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?"; @@ -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 diff --git a/bin/ncp/BACKUPS/nc-snapshot-sync.sh b/bin/ncp/BACKUPS/nc-snapshot-sync.sh index 0c4c905e2..25253bd21 100644 --- a/bin/ncp/BACKUPS/nc-snapshot-sync.sh +++ b/bin/ncp/BACKUPS/nc-snapshot-sync.sh @@ -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 @@ -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 diff --git a/bin/ncp/CONFIG/nc-limits.sh b/bin/ncp/CONFIG/nc-limits.sh index 3ce229b46..fb374d578 100644 --- a/bin/ncp/CONFIG/nc-limits.sh +++ b/bin/ncp/CONFIG/nc-limits.sh @@ -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() diff --git a/changelog.md b/changelog.md index 1f10773ab..bc540eb27 100644 --- a/changelog.md +++ b/changelog.md @@ -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 diff --git a/etc/ncp-config.d/nc-backup-auto.cfg b/etc/ncp-config.d/nc-backup-auto.cfg index 42d0ce262..6bc360b19 100644 --- a/etc/ncp-config.d/nc-backup-auto.cfg +++ b/etc/ncp-config.d/nc-backup-auto.cfg @@ -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", diff --git a/etc/ncp-config.d/nc-limits.cfg b/etc/ncp-config.d/nc-limits.cfg index eb31282bb..705d143b1 100644 --- a/etc/ncp-config.d/nc-limits.cfg +++ b/etc/ncp-config.d/nc-limits.cfg @@ -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": [ diff --git a/etc/ncp-config.d/nc-nextcloud.cfg b/etc/ncp-config.d/nc-nextcloud.cfg index 15d301fe6..720f90c9e 100644 --- a/etc/ncp-config.d/nc-nextcloud.cfg +++ b/etc/ncp-config.d/nc-nextcloud.cfg @@ -9,7 +9,7 @@ { "id": "VER", "name": "Version", - "value": "25.0.5" + "value": "25.0.6" }, { "id": "MAXFILESIZE", diff --git a/etc/ncp-config.d/nc-rsync-auto.cfg b/etc/ncp-config.d/nc-rsync-auto.cfg index 490f7a7bb..331475cd3 100644 --- a/etc/ncp-config.d/nc-rsync-auto.cfg +++ b/etc/ncp-config.d/nc-rsync-auto.cfg @@ -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" } ] } diff --git a/etc/ncp-config.d/nc-snapshot-sync.cfg b/etc/ncp-config.d/nc-snapshot-sync.cfg index 961c12e49..0780c5220 100644 --- a/etc/ncp-config.d/nc-snapshot-sync.cfg +++ b/etc/ncp-config.d/nc-snapshot-sync.cfg @@ -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" } ] } diff --git a/etc/ncp-templates/php/pool.d.www.conf.sh b/etc/ncp-templates/php/pool.d.www.conf.sh index c4f8f3f59..c36173528 100644 --- a/etc/ncp-templates/php/pool.d.www.conf.sh +++ b/etc/ncp-templates/php/pool.d.www.conf.sh @@ -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 diff --git a/etc/ncp.cfg b/etc/ncp.cfg index 93a6b0406..38937b122 100644 --- a/etc/ncp.cfg +++ b/etc/ncp.cfg @@ -1,5 +1,5 @@ { - "nextcloud_version": "25.0.5", + "nextcloud_version": "25.0.6", "php_version": "8.1", "release": "bullseye" }