Compare commits

...

1869 Commits

Author SHA1 Message Date
Tobias Knöppler
332fdb3f40 changelog.md: Document v1.56.0 2025-11-19 15:08:23 +01:00
Tobias Knöppler
7be2748648
Merge pull request #2083 from nextcloud/devel
NC 32 and fixes
2025-11-19 10:03:07 +01:00
Tobias Knöppler
53c9f43dbe publish-image.yml: Fix issue with artifact file name containing spaces 2025-11-16 20:04:14 +01:00
Tobias Knöppler
d6e6215fa9 update-nc.sh: Disable app_api during nc update 2025-11-16 18:44:39 +01:00
Tobias Knöppler
6c3d2503ea build-sd-images.yml: Fix issue with artifact file name containing spaces 2025-11-16 17:33:57 +01:00
Tobias Knöppler
5b11ae0caf nc-nextcloud.sh, ncp-provisioning.sh: Implement nextcloud service workers 2025-11-15 03:38:49 +01:00
Tobias Knöppler
9c54a8a177 nextcloud_tests.py: Fix settings check 2025-11-15 03:08:28 +01:00
Tobias Knöppler
a7cfdb08ed system_tests.py: Add missing comma 2025-11-15 00:11:18 +01:00
Tobias Knöppler
2fbf2ab6b5 update-nc.sh: Convert mysql charset if necessary 2025-11-15 00:09:19 +01:00
Tobias Knöppler
c12e51b396 update-nc.sh: Migrate NC apps after installation of new version 2025-11-15 00:09:19 +01:00
Tobias Knöppler
767a42afbb release.yml: Remove Raspberry Pi 5 config because it has been unified in Armbian 2025-11-15 00:09:19 +01:00
Tobias Knöppler
8c3add3a2d release.yml: Run armbian-test-image only on explicit request 2025-11-15 00:09:19 +01:00
Tobias Knöppler
3ae97ea31d Set supported NC version to 32.0.1 and reenable tasks app 2025-11-15 00:09:19 +01:00
Tobias Knöppler
2475ccca10 nextcloud_tests.py: Fix config checks for NC32 2025-11-15 00:09:19 +01:00
Tobias Knöppler
d345af9c2a Disable app_api unless configured 2025-11-15 00:09:19 +01:00
Tobias Knöppler
d0d30c6872 Temporarily skip installation of tasks app 2025-11-15 00:09:19 +01:00
Tobias Knöppler
dce645be79 Add support for NC 32 2025-11-15 00:09:19 +01:00
Tommy He
0ed0ce065b #2069: Apply fix for notify_push reinstall during Nextcloud updates 2025-11-15 00:09:19 +01:00
Tobias
875e1b62bb Update README to reflect community-scripts changes (#2068) 2025-11-15 00:09:19 +01:00
Tobias Knöppler
c63dd9cd4b Fix CI/CD pipeline issues (#2076)
- Update armbian base and use release branch instead of tag
- Fix nextcloud tests for NC 31
- Use venv for integration tests
- Use ubuntu-latest for all workflows (except arm64)
- Push start NC version for dist-upgrade test to 29
- Use ncp v1.53.2/v1.53.3 as base version for dist-upgrade check
- nextcloud_tests.py: Ignore errors in nextcloud.log
- Fix redis issue on arm
- system_tests.py: Add option to use pw-less sudo for commands
- nextcloud_test.py,activation_tests.py: Use new selenium initialization syntax
- build-lxd.yml: Install incus from system packages
- build-lxd.yml: Disable test-dist-upgrade temporarily
# Conflicts:
#	.github/workflows/build-lxd.yml
#	tests/nextcloud_tests.py
2025-11-15 00:09:17 +01:00
Tobias Knöppler
ca9ac7c81e nextcloud-domain.sh: Minor syntax improvment
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-11-14 23:55:11 +01:00
Tobias Knöppler
c57218e6c9 nextcloud-domain.sh: Minor syntax improvment
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-11-14 23:55:11 +01:00
Lukasz Goworko
cc5c73abf4 fix: Added IPv6 support with brackets to trusted domains
Signed-off-by: Lukasz Goworko <lukaszgoworko@users.noreply.github.com>
2025-11-14 23:55:11 +01:00
Tobias Knöppler
5f38f64336 release.yml, build-sd-images.yml: Add armbian testimage build 2025-10-12 18:25:27 +02:00
Tobias Knöppler
a53f800d02 system_tests.py: Add debug output 2025-10-12 17:50:19 +02:00
Tobias Knöppler
e7f9f6e32a system_tests.py: Add option to use pw-less sudo for commands 2025-10-01 13:39:55 +02:00
Tobias Knöppler
a97397102a Fix armbian builds 2025-09-30 21:05:04 +02:00
Tobias Knöppler
e0a2cec153 Log redis output during installation 2025-09-14 09:58:58 +02:00
Tobias Knöppler
680753b564 Abort if redis cannot be started 2025-09-13 21:13:37 +02:00
Tobias Knöppler
904b0ab310 build-lxd.yml: Use ncp v1.53.2 as base version for dist-upgrade test 2025-09-13 21:04:42 +02:00
Tobias Knöppler
63c80d1604 nextcloud_tests.py: Ignore single error in logs 2025-09-13 20:57:03 +02:00
Tobias Knöppler
25887deba6 build-lxd.yml: Use ncp v1.53.3 as base version for dist-upgrade test 2025-09-13 20:48:24 +02:00
Tobias Knöppler
2f639cf1c2 nextcloud_tests.py: Increase wait time during settings check 2025-09-13 20:38:29 +02:00
Tobias Knöppler
5dcd4b1ff6 armbian.sh: Test starting redis if install fails 2025-09-13 20:23:30 +02:00
Tobias Knöppler
2debc54186 build-lxd.yml: Add debug output 2025-09-13 20:14:10 +02:00
Tobias Knöppler
8eaf974bf6 Push NC base version for dist upgrade test to v29 2025-09-13 20:04:25 +02:00
Tobias Knöppler
e86ed80bb7 build-lxd.yml: Fix path to venv 2025-09-13 20:01:41 +02:00
Tobias Knöppler
502a5c8be3 armbian.sh: Add debug output on failure 2025-09-13 19:43:07 +02:00
Tobias Knöppler
6ed2c17b06 Use armbian release branch instead of tag 2025-09-13 19:30:59 +02:00
Tobias Knöppler
93d29d63c8 Use venv for integration tests 2025-09-13 18:49:40 +02:00
Tobias Knöppler
9ab14a99e7 nextcloud_tests.py: Add debug output if settings check does not succeed 2025-09-13 18:36:05 +02:00
Tobias Knöppler
c6f196dc09 Use ubuntu-latest for all workflows 2025-09-13 18:22:23 +02:00
Tobias Knöppler
42f8ee11b0 Fix nextcloud tests 2025-09-13 18:11:39 +02:00
Tobias Knöppler
06f50ed3de Update armbian base to latest version 2025-09-13 18:04:11 +02:00
Tobias Knöppler
2ada653882
Merge pull request #2044 from nextcloud/devel
Support for NC 31 + Fixes
2025-03-24 11:29:49 +00:00
Tobias Knöppler
a7cf5a2672
changelog.md: Document v1.55.4
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-03-24 12:29:10 +01:00
Josh
ce2406d222
fix(CONFIG): temp directory typo in nc-datadir.sh
Fixes #1857
Fixes #1750 

Signed-off-by: Josh <josh.t.richards@gmail.com>
2025-03-24 01:33:31 +01:00
twojstaryzdomu
6f4b43e3ca
nc-limits.sh: Do not trigger ERR trap due to failed tests 2025-03-24 01:32:18 +01:00
Tobias Knöppler
52010f2baf
Merge pull request #2043 from nextcloud/feature/nc-31
Support Nextcloud 31
2025-03-24 00:30:42 +00:00
Tobias Knöppler
5738d58f28
1.55.3.sh: Prevent nonzero exit code if no action necessary
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-03-24 01:06:53 +01:00
Tobias Knöppler
7f4de99aac
updates/1.56.0.sh: Update row format for db tables
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-03-24 01:06:49 +01:00
Tobias Knöppler
2c7a079e3c
Set supported NC version to 31.0.2
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-03-23 22:46:53 +01:00
Tobias Knöppler
94a8dda931
build-lxd.yml: Run incus/lxc commands as root
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-03-22 16:09:22 +01:00
Tobias Knöppler
92b352f06e
Update supported NC version to 31 for nc apps
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-03-22 11:50:48 +01:00
Tobias Knöppler
bee56f5767
.github/workflows: Update artifact actions to v4
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-03-22 11:23:56 +01:00
Tobias Knöppler
1946e04806
library.sh: Fix invalid redirection of error message
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-03-22 11:23:56 +01:00
Tobias Knöppler
bba41f0dfd
Update supported NC version to 31
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-03-22 11:23:56 +01:00
Tobias Knöppler
60e285766a
changelog.md: Document v1.55.3
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2025-03-22 11:23:56 +01:00
Tobias Knöppler
77763af71d
README.md: Document installation on Proxmox
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-11-08 21:45:26 +01:00
Tobias Knöppler
d1b3ac5570
Merge pull request #2004 from nextcloud/devel
v1.55.3
2024-11-08 20:42:28 +01:00
Tobias Knöppler
776c190319
changelog.md: Document v1.55.3
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-11-08 18:15:37 +01:00
Tobias Knöppler
aa2ec800cc
Merge pull request #2003 from nextcloud/fix/restore-ncp-previews-patch
Fix/restore ncp previews patch
2024-11-08 18:05:31 +01:00
Tobias Knöppler
7be0a10433
Move ncp-previews-auto fix to updates/1.55.3.sh
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-11-08 17:44:23 +01:00
Moritz Breitbach
c10bf36cbb
Fix typo in nc-previews-auto.sh
Signed-off-by: Moritz Breitbach <moritz.breitbach@t-online.de>
2024-11-08 17:42:16 +01:00
Tobias Knöppler
1f7855bfcf
Merge pull request #2002 from nextcloud/fix/ncp-update-nc-as-oneshot
ncp-update-nc as oneshot
2024-11-08 17:39:49 +01:00
Tobias Knöppler
39a05f8ac6
ncp-update-nc: Use oneshot service type with start and stop timeout for systemd-run
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-11-08 17:37:24 +01:00
Tobias Knöppler
10a5b4e96b
nc-init.sh: Add maintenance:repair step to nextcloud initialization
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-11-06 17:08:39 +01:00
Tobias Knöppler
430e56ee7b
update-nc.sh: Improve informational output during update
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-11-06 17:08:39 +01:00
Tobias K
1579f7b2ea
ncp-update-nc: Fix resetting job after failed update attempt
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-11-06 17:08:39 +01:00
Tobias Knöppler
3cb98599de
Add support for Nextcloud 30
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-11-06 17:08:39 +01:00
Tobias Knöppler
94332db835
dnsmasq.sh: Don't fix it if it ain't broken
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-11-06 17:08:39 +01:00
Tobias Knöppler
7ed6552110
staged_rollouts: Release v1.55.0-v1.55.2 to everyone
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-11-06 17:08:07 +01:00
Tobias Knöppler
eb835b9c12
Merge pull request #1985 from nextcloud/devel
V1.55.2
2024-09-24 19:54:42 +02:00
Tobias Knöppler
50e1adf6c0
changelog.md: Document v1.55.2
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-09-24 19:35:11 +02:00
Tobias Knöppler
a6cf48ec7f
Merge pull request #1984 from nextcloud/release/v1.55.2
Release/v1.55.2
2024-09-24 19:25:39 +02:00
Tobias Knöppler
9890d68532
91-ncp.cnf.sh: Increase allowed packet size for mysqldump
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-09-24 17:18:41 +02:00
Tobias Knöppler
aaf7536943
nc-autoupdate-nc: Fix erroneous update/updated notifications
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-09-24 17:08:10 +02:00
Tobias Knöppler
29e6c05937
Push v1.55.0 and v1.55.1 to 50% of instances 2024-09-13 13:06:11 +02:00
Tobias Knöppler
fb645bcaa7
Merge branch 'devel' 2024-09-08 23:41:41 +02:00
Tobias Knöppler
8726cc3a91
Add staged_rollouts/v1.55.1.txt
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-09-08 23:41:24 +02:00
Tobias Knöppler
50a2b0a8c8
Merge branch 'devel' 2024-09-08 23:39:43 +02:00
Tobias Knöppler
28042b8763
changelog.md: Document v1.55.1
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-09-08 23:39:30 +02:00
Tobias Knöppler
63b6aca7bb
Merge pull request #1971 from nextcloud/devel
[hotfix] library.sh: Fix resolution of target nextcloud version if requesting older version than current
2024-09-08 23:37:37 +02:00
Tobias Knöppler
848ddad7d4
library.sh: Fix resolution of target nextcloud version if requesting older version than current
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-09-08 23:15:20 +02:00
Tobias Knöppler
47f79b7187
Merge pull request #1968 from nextcloud/devel
v1.55.0
2024-09-07 10:43:23 +02:00
Tobias Knöppler
d52b8dcdf1
changelog.md: Adjust date for v1.55.0
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-09-07 10:42:53 +02:00
Tobias Knöppler
0e40867347
nc-encrypt.sh: Fix detection of running encryption
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-09-07 02:51:44 +02:00
Tobias Knöppler
93f76ec8f8
changelog.md: Document v1.55.0
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-09-06 17:50:03 +02:00
Tobias Knöppler
1acf1b4a46
release.yml: Add orangepi5 and orangepi5-plus
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-09-06 15:46:46 +02:00
Tobias Knöppler
90ef9dba53
vm-tests.yml: Fix distupgrade tests
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-09-06 14:07:41 +02:00
Tobias Knöppler
325834f86a
SettingsService.php: Fix syntax errors
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-09-05 19:22:41 +02:00
Tobias Knöppler
94dd609fab
vm-tests.yml: Fix installer tests
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-09-05 14:52:16 +02:00
Tobias Knöppler
8538bfe631
build-sd-images.yml: Fix armbian tests
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-09-05 12:40:58 +02:00
Tobias Knöppler
31d5ed984f
build-sd-images.yml: Adjust php fpm fix to correct php version
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-24 19:38:46 +02:00
Tobias Knöppler
ef849572d7
build-SD-armbian.sh: Fix path to armbian_version
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-23 18:53:00 +02:00
Tobias Knöppler
41a0af623f
Merge pull request #1961 from nextcloud/fix/nc-update-allow-custom-version-request
allow custom version request in ncp-update-nc && php 8.3 support
2024-08-23 18:27:41 +02:00
Tobias Knöppler
3b65ecf812
1.54.0.sh: Prevent apt update from failing due to invalid signing key
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-23 18:00:42 +02:00
Tobias Knöppler
e21a027c68
build-lxd.yml: Use older nextcloud version for upgrade test
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-23 17:36:49 +02:00
Tobias Knöppler
e5113f4601
library.sh: Respect requested NC version in determine_nc_update_version
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-23 13:55:35 +02:00
Tobias Knöppler
e7a40c7cc9
nextcloud_tests.py: Fix first run wizard close button not being detected
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-23 13:53:48 +02:00
Tobias Knöppler
f02a49968c
v1.54.3.txt: Release v1.54.3 for all instances
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-22 23:32:32 +02:00
Tobias Knöppler
7612fd9e6b
ncp.sh, 1.55.0.sh: Install logrotate
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-20 12:35:21 +02:00
Tobias Knöppler
6598d864fa
nc-encrypt.sh: Run gocryptfs as transient systemd service
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-19 12:23:46 +02:00
Tobias Knöppler
92587ac813
README.md: Update referred debian version
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-19 11:47:34 +02:00
Tobias Knöppler
2838c59012
build-lxd.yml: Use compatible repository versions to run tests
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-19 05:00:51 +02:00
Tobias Knöppler
2e38ecc57e
lamp.sh,ncp.cfg: Use PHP 8.3
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-19 05:00:50 +02:00
Tobias Knöppler
eddb9d393e
nextcloudpi/lib/SettingsService.php: Fix running commands in nonexisting working directory
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-19 05:00:50 +02:00
Tobias Knöppler
51a2d0f662
update-nc.sh: Improve output if no new NC version is available
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-19 05:00:50 +02:00
Tobias Knöppler
4d9102a967
update-nc.sh: Run maintenance:repair --include-expensive after update
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-19 05:00:50 +02:00
Tobias Knöppler
335df8bd03
nextcloud_tests.py: Implement workaround for selenium selector issue
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-19 05:00:50 +02:00
Tobias Knöppler
e05db18897
update-nc.sh: Implement upgrade of PHP to 8.3
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-19 05:00:49 +02:00
Tobias Knöppler
73da8fd057
ncp.cfg,nc-nextcloud.cfg,ncp-app/: Add support for NC 29
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-19 05:00:49 +02:00
Tobias Knöppler
0e30c79a87
build-lxd.yml: Pin nc version to update to before dist upgrade
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-19 05:00:49 +02:00
Tobias Knöppler
1fb070df55
ncp-update-nc: fix update termination detection
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-19 05:00:49 +02:00
Tobias Knöppler
eea3d51385
ncp-update-nc: Propagate debug flag
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-19 05:00:49 +02:00
Tobias Knöppler
de9088f418
release.yml: Add info about included software versions to release description
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-19 05:00:49 +02:00
Tobias Knöppler
ee07434b82
ncp-update-nc: Use systemd-run to run update
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-19 05:00:46 +02:00
Moritz Breitbach
fc0b75b2be
Fix typo in nc-format-USB.sh
Signed-off-by: Moritz Breitbach <moritz.breitbach@t-online.de>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-19 04:58:38 +02:00
Tobias Knöppler
8fa19a5621
staged_rollouts/v1.54.3.txt: Expand rollout to 60%
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-19 04:57:46 +02:00
Tobias Knöppler
bb98f597e9
ncp-update-nc: Improve output if no new NC version is available
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-19 04:13:24 +02:00
Tobias Knöppler
bf98d0eade
Merge branch 'devel' 2024-08-12 10:45:15 +02:00
Tobias Knöppler
63379519d4
ncp-update-nc: Add info if updating to another nc release than requested
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-12 10:43:44 +02:00
Tobias Knöppler
3c4141eefb
Merge pull request #1951 from nextcloud/devel 2024-08-11 14:17:31 +02:00
Tobias Knöppler
2d5cfc543a
Add FUNDING.yml
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-11 13:53:47 +02:00
Tobias Knöppler
cc30b34bc4
v1.54.3.txt: Configure staged_rollouts for v1.54.3
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-11 13:40:28 +02:00
Tobias Kn?ppler
f032fd7147
build-SD-armbian.sh: Update Armbian version
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-11 11:50:42 +02:00
Tobias Knöppler
8efe6a703e
changelog.md: Document v1.54.3
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-10 23:27:29 +02:00
Tobias Knöppler
46b4489d98
Merge pull request #1948 from nextcloud/feature/autosupport-minor-nc-versions
Dynamically determine upgrade path and auto-upgrade to latest minor version
2024-08-10 01:47:28 +02:00
Tobias Knöppler
11c0a668c3
debian-11.sh: Remove package libc-dev-bin prior to install to avoid dependency conflict
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-10 01:08:47 +02:00
Tobias Knöppler
371391e7e8
activation_tests.py: Accept old and new spelling for web panel title
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-09 20:08:07 +02:00
Tobias Knöppler
a2c3979558
build-lxd.yml: Execute image generation as root
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-08 14:59:59 +02:00
Tobias Knöppler
1a210e9f12
Replace 'NextCloudPi' with 'NextcloudPi' in localization and code comments
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-08-06 14:34:30 +02:00
Tobias Knöppler
5489e307ce
ncp-diag: Fix error when retrieving certificate info
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-07-28 20:05:19 +02:00
Tobias K
323a202785
ncp-update-nc, nc-autoupdate-nc, ncp-check-nc-version: Dynamically determine upgrade path and auto-upgrade to latest minor version
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-07-28 19:14:51 +02:00
Tobias Knöppler
0c023d95a5
debian-11.sh: Upgrade dpkg before all other packages.
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-05-09 16:28:56 +02:00
Tobias Knöppler
298404437d
build-lxd.yml: Prevent code injection in GH workflow via malicious PR
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-05-09 13:55:01 +02:00
Tobias Knöppler
66c1601e5a
1.54.1.sh: Make sure zstd is installed before running apt-get upgrade 2024-05-09 13:24:59 +02:00
Tobias Knöppler
3897e46c86
changelog.md: Document v1.54.1 and v1.54.2
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-05-08 19:31:01 +02:00
Tobias Knöppler
559aead3d7
staged_rollouts: Push v1.54.x to all users
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-05-08 19:15:23 +02:00
Tobias Knöppler
c6517765e2
Merge pull request #1925 from nextcloud/devel
Devel
2024-05-07 09:58:42 +02:00
Tobias Knöppler
2432a3b374
Merge pull request #1924 from nextcloud/fix/cicd/incus-on-custom-runner
Fix/cicd/incus on custom runner
2024-05-07 09:58:09 +02:00
Tobias Knöppler
9b66766b1b
system_tests.py: Correctly handle case where no valid lxc command can be determined
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-05-07 01:32:44 +02:00
Tobias Knöppler
6a93bb14e3
build-lxd.yml: Change to custom geckodriver install script for arm support
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-05-07 01:32:35 +02:00
Tobias Knöppler
7c7d5a25f9
build-lxd.yml: Add network profile to incus containers on the arm gh runner
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-05-06 20:19:22 +02:00
Tobias Knöppler
3f979eef73
Merge pull request #1923 from nextcloud/devel
Detect db prefix dynamically
2024-05-06 19:51:58 +02:00
Tobias Knöppler
8c1dc9f717
1.54.2.sh: Make sure zstd is installed.
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-05-06 19:20:20 +02:00
Tobias K
d7f7ff4133
build-LXD.sh: Migrate to incus
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-05-06 19:20:15 +02:00
Tobias K
53af5f5810
build-lxd.yml: Migrate to incus
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-04 11:56:30 +02:00
Tobias K
8d4fc3b8f9
library.sh: Detect DB_PREFIX dynamically if possible
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-04 11:50:31 +02:00
Jan Vlug
a6c4b245ff
Fix database prefix (#1889)
* Fix database prefix

Signed-off-by: Jan Vlug <jan.public@famvlug.nl>

---------

Signed-off-by: Jan Vlug <jan.public@famvlug.nl>
Co-authored-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-05-04 11:41:53 +02:00
Tobias K
3778e397ee
debian-11.sh,1.54.1.sh: Remove ncp-recommended.cfg after successful dist-upgrade
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-04 11:37:52 +02:00
Tobias K
c75fa44117
1.54.1.sh: Fix erroneously disabled package sources
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-03 22:06:05 +02:00
Tobias K
f7aa18f541
debian-11.sh: Correctly process raspi.list
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-02 20:36:56 +02:00
Tobias K
b0f86cc26f
debian-11.sh: Prevent dist-upgrade from raspbian for now
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-02 12:37:20 +02:00
Tobias K
e883baac43
Merge branch 'fix/1.54.0-pam-error' 2024-05-02 12:03:02 +02:00
Tobias K
8da59ef850
ncp-dist-upgrade: Write dist-upgrade logs to disk
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-02 12:01:52 +02:00
Tobias Knöppler
916d56f8ba
1.54.0.sh: workaround PAM error with chsh
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-02 11:58:04 +02:00
Tobias K
96b2c19823
ncp.sh,SSH.sh: Move root login configuration to SSH.sh
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-02 02:48:28 +02:00
Tobias K
ab4545399e
build-lxd.yml: Disable update-test temporarily
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-02 01:54:39 +02:00
Tobias K
91ac514893
build-LXD.sh: Make sure to set branch variable if inherited
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-02 01:45:48 +02:00
Tobias K
437f30d867
1.54.0.sh,run_update_history.sh: Disable debug output
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-02 00:56:02 +02:00
Tobias K
42f8b2a0ea
build-lxd.yml: Set BRANCH explicitly when building LXD images
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-02 00:54:13 +02:00
Tobias K
665bfe154a
vm-tests.yml: Disable update-test for now
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 22:21:35 +02:00
Tobias K
b8da470727
run_update_history.sh: Enable debug output
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 21:34:40 +02:00
Tobias Knöppler
c4288d8e04
Merge pull request #1905 from nextcloud/devel
Support debian 12 and Nextcloud 25.0.8
2024-05-01 15:48:44 +02:00
Tobias Knöppler
379207171a
Merge branch 'master' into devel
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:48:21 +02:00
Tobias K
428343ec9e
changelog.md: Update release date for v1.54.0
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:47:03 +02:00
Tobias K
4da8374d7e
build-lxd.yml: Skip update test before running actual update
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:47:02 +02:00
Tobias K
c7ff30c618
nextcloud_tests.py: Fix error state detection for NC 28.0.5
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:47:02 +02:00
Tobias K
f49d710dea
install.sh,1.54.0.sh: Make sure, gnupg is installed
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:47:02 +02:00
Tobias K
218a6584a7
library.sh,1.54.0.sh: Remove invalid trusted_proxies
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:47:02 +02:00
Tobias Knöppler
5d0f9eec91
build-sd-images.yml: Add debug output on failure
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:47:01 +02:00
Tobias Knöppler
858fe9991a
build-sd-images.yml: Add debug output on failure
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:47:01 +02:00
Tobias Knöppler
9959a4e5b1
build-SD-armbian.sh: Build off of armbian/build branch v24.02
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:47:01 +02:00
Tobias Knöppler
96d545212c
updates/1.54.0.sh: Change obsolete theming url for existing installations
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:47:01 +02:00
Tobias Knöppler
d13be9826a
1.54.0.sh: Install new sury repository signing key
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:47:00 +02:00
Tobias Knöppler
1fdd3865cf
changelog.md: Document v1.54.0
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:47:00 +02:00
Tobias Knöppler
242ca671f9
library.sh: Remove invalid trusted_proxy
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:47:00 +02:00
Tobias Knöppler
68e2e2d7ac
Enable v1.54.0 for 10% of users
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:47:00 +02:00
Tobias Knöppler
25c2377e2f
Enable canary group for staging releases
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:46:59 +02:00
Tobias Knöppler
1fd24c5155
Add support for Nextcloud 28.0.5
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:46:59 +02:00
Tobias Knöppler
9fb334cc25
install.sh,ncp.sh,1.54.0.sh: Disable root login via ssh
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:46:59 +02:00
Tobias Knöppler
1ecd13ed54
.vm-tests.yml: Use fixed previous version and create-test-instance-bullseye in update test
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:46:58 +02:00
Tobias Knöppler
81ef2331bf
Remove ownyourbits.com in various places
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:46:58 +02:00
Tobias Knöppler
5c6b37a4f6
ncp.sh,nc-passwd.sh: Add activation hint in tty login screen
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:46:58 +02:00
Tobias Knöppler
f58852ea27
dnsmasq.sh: Fix dns resolv workaround for hosts using resolvconf instead of systemd-resolved
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:46:58 +02:00
Tobias Knöppler
78039d38d1
armbian.sh: Disable autologin, require root password and use passwd -l instead of nologin shell for root login prevention
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:46:57 +02:00
Tobias Knöppler
a0c6b213e6
/etc/ncp-dist-upgrade*: Implement dist-upgrade for bullseye->bookworm and add integration tests for it
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:46:57 +02:00
Tobias Knöppler
474c0007a1
nc-nextcloud.sh,install.sh,lamp.sh: Fix build process for debian 12
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:46:57 +02:00
Tobias Knöppler
eadb23c049
build-LXD.sh,system_tests.py,build-lxd.yml: Add support for incus
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:46:57 +02:00
Tobias Knöppler
07dab0b7ee
changelog.md: Document v1.53.3
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-05-01 15:46:56 +02:00
Tobias Knöppler
7b46013c2c
Merge pull request #1896 from nextcloud/devel
Support Nextcloud 28.0.4
2024-04-20 21:10:13 +02:00
Tobias Knöppler
de0acd4383
changelog.md: Document v1.53.3
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-04-20 18:56:11 +02:00
Tobias Knöppler
67ec9b767e
ncp.cfg, nc-nextcloud.cfg: Add support for Nextcloud 28.0.4
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-04-20 18:35:22 +02:00
Tobias Knöppler
f0fc7e074e
changelog.md: Fix date for v1.53.2
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-03-29 17:23:43 +01:00
Tobias Knöppler
fb9d93e63b
build-SD-armbian.sh: Use main branch of armbian/build
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-03-28 14:53:28 +01:00
Tobias Knöppler
f6dfa1cf41
build-SD-armbian.sh: Use branch v24.02 of armbian/build repo instead of tag
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-03-27 22:42:21 +01:00
Tobias Knöppler
b5b05859eb
Improve decryption handling
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-03-27 19:40:26 +01:00
Tobias Knöppler
11b5a86328
ncp.cfg, nc-nextcloud.cfg: Support NC 28.0.3 2024-03-27 19:07:00 +01:00
Tobias Knöppler
29d6375050
Merge pull request #1877 from nextcloud/devel
Add support for Nextcloud 28
2024-03-27 19:03:11 +01:00
Tobias Knöppler
a307430541
nextcloud_tests.py: Ignore errors in logs for now
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-03-27 15:31:41 +01:00
Tobias Knöppler
474139c298
build-lxd.yml: Improve debug logs
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-03-27 14:52:57 +01:00
Tobias K
7019dd9d1a
build-lxd.yml, build-sd-images.yml: Add debug output if tests fail
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-03-27 13:40:15 +01:00
Tobias K
48f6989b78
build-SD-armbian.sh: Update armbian build code to v24.2.1
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-03-27 13:40:15 +01:00
Tobias Knöppler
6f2b315fdf
build-SD-armbian.sh: Use latest release of armbian instead of arbitrary commit
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-03-27 13:40:14 +01:00
Tobias Knöppler
26076e4212
build-SD-armbian.sh: Use latest commit of armbian/build
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-03-27 13:40:14 +01:00
Tobias Knöppler
7246cf5372
Clear nextcloud logs after update
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-03-27 13:40:14 +01:00
Tobias Knöppler
910b9fcf34
Fix nextcloud_tests for NC 28
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-03-27 13:40:14 +01:00
Tobias Knöppler
242ecdba9b
Remove ncp.tar.gz
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-03-27 13:40:14 +01:00
Tobias Knöppler
deacb661ff
install.sh: Remove nextcloud log after installation
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-03-27 13:40:13 +01:00
Tobias Knöppler
860fcbe548
ncp-app: Add options for default_phone_region and maintenance_window_start
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-03-27 13:40:13 +01:00
Tobias Knöppler
869bd6a8f4
nextcloud_tests.py: Ignore errors that require user configuration
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-03-27 13:40:13 +01:00
Tobias Knöppler
c9ca623f27
ncp-previewgenerator: Add support for NC 28
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-03-27 13:40:13 +01:00
Tobias Knöppler
06af55a5a7
nc-init.sh: Skip installation of news app
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-03-27 13:40:13 +01:00
Tobias Knöppler
579ba2d3a4
Add support for Nextcloud 28
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-03-27 13:40:13 +01:00
Victor-ray, S
6b9667a24f
࿓❯ fix: Removed Docker information from README (#1851)
Signed-off-by: Victor-ray, S <owl@zendai.net.eu.org>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-03-27 13:40:08 +01:00
Tobias Knöppler
e3635e06a8
࿓❯ fix: Removed Docker information from README (#1851) (#1869)
Signed-off-by: Victor-ray, S <owl@zendai.net.eu.org>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Co-authored-by: Victor-ray, S <owl@zendai.net.eu.org>
2024-02-22 13:52:17 +01:00
Tobias Knöppler
e18e65af79
Merge pull request #1867 from nextcloud/devel
v1.53.1
2024-02-01 01:05:29 +01:00
Tobias Knöppler
2d0af3bc4e
updates/1.53.1.sh: Fix possible race condition
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-02-01 00:14:27 +01:00
Tobias Knöppler
5616129c46
changelog.md: Fix date for v1.53.1
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-02-01 00:10:34 +01:00
Tobias Knöppler
a542b5e1b7
build/*: Fix capitalization in NCP images
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-02-01 00:02:32 +01:00
Tobias Knöppler
23a21bb61f
changelog.md: Document release v1.53.1
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-01-31 23:51:04 +01:00
Tobias K
46b3654f1d
1.53.1.sh: Make sure, notify_push service is updated
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2024-01-31 21:41:00 +01:00
Tobias K
bd9d73c749
build-lxd.yml: Fix firefox installation on arm64
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-01-28 16:03:54 +01:00
Tobias K
994dcfd9ba
Support Nextcloud v27.1.6
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-01-28 14:53:31 +01:00
Tobias K
516935ec9c
build-sd-images.yml: Fix qemu-static support for ubuntu-latest runner
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-01-28 14:52:49 +01:00
Tobias K
550724fc18
build-lxd: Fix runner labels
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-01-26 14:31:44 +01:00
Tobias K
c2179e8340
.github/workflow/*: Use latest version of docker/setup-qemu-action
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-01-26 13:11:03 +01:00
Tobias K
b54d332a09
rename nextcloud.conf to 001-nextcloud.conf to force it to be considered before ncp.conf
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-01-26 01:24:36 +01:00
Tobias K
641685f5c7
v1.53.1.sh: Prevent breaking the web interface during apache2 reload
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-01-25 22:55:26 +01:00
Tobias K
79e1bff1c9
build-lxd.yml: Use self-hosted garm runners and ubuntu-22.04
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-01-25 22:50:48 +01:00
Tobias K
4c5a3d5f96
Rename updates/1.53.0sh to updates/1.53.0.sh
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-01-25 22:50:15 +01:00
Tobias K
c5eb4589c8
build-SD-armbian.sh: Set INCLUDE_HOME_DIR=yes during build
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-01-25 18:39:54 +01:00
Tobias K
62623b5749
build-SD-armbian.sh: set INCLUDE_HOME_DIR=yes
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-01-25 00:35:33 +01:00
Tobias K
c2c8bab9ea
Add support for NC 27.1.5
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-01-25 00:32:43 +01:00
Tobias K
308aef9b2b
ncp.sh: Move ncp.conf to ncp-template
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2024-01-25 00:31:37 +01:00
Tobias Knöppler
f64af68384
Merge branch 'devel' 2023-11-15 18:35:43 +01:00
Tobias Knöppler
9396f7932b
build-SD-armbian.sh: Pin armbian/build to commit 8f262c6 until upstream issue is resolved
upstream issue: https://github.com/armbian/build/issues/5918

Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-11-15 18:35:29 +01:00
Tobias Knöppler
f550440a84
Merge pull request #1836 from nextcloud/devel
Changes from v1.53.0
2023-11-15 00:53:22 +01:00
Tobias Knöppler
57820ba98f
Document v1.53.0
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-11-15 00:52:18 +01:00
Tobias Knöppler
ce635edb26
Merge pull request #1845 from nextcloud/release/v1.53.0
Release/v1.53.0
2023-11-09 13:07:55 +01:00
Tobias Knöppler
c7393b0435
system_tests.py: Add debug output
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-11-03 17:11:21 +01:00
Tobias K
cb962d0914
Add support for NC 27.1.3
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-10-31 11:23:52 +01:00
Tobias K
ab66d2fd47
vm-tests.yml: Skip update tests for vms (for now)
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-10-31 11:22:30 +01:00
Tobias Knöppler
fa793b3173
install.sh: Fix ncp-provisioning not being executed on baremetal install
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-10-30 17:10:07 +01:00
Tobias Knöppler
61ba6a63fa
system_tests.py: Add auto update test
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-10-26 14:30:17 +02:00
Tobias Knöppler
eb35f8344e
.github/publish-image.yml: Migrate from hub to gh
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-10-25 10:46:52 +02:00
Tobias Knöppler
ddf7a5faa7
nextcloud_tests.py: Increase wait timeout
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-10-24 12:38:32 +02:00
Tobias Knöppler
4632ddb663
.github/*: Use latest version of selenium
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-10-23 20:49:54 +02:00
Tobias Knöppler
2df558d242
tests: Remove deprecated syntax for headless option
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-10-23 20:28:15 +02:00
Tobias Knöppler
7dca1d6290
ncp-check-version: Temporarily override canary setting
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-10-23 16:48:53 +02:00
Tobias Knöppler
10867d1914
nextcloud_tests.py: Increase timeout for NCP settings toggle test
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-10-21 13:19:21 +02:00
Tobias Knöppler
e78c39cbc8
release.yml: Migrate from hub to gh cli
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-10-20 20:12:08 +02:00
Tobias Knöppler
5b246e1916
Merge pull request #1841 from nextcloud/feature/ncp-app-adminsection
Add admin section to nextcloudpi nc app
2023-10-20 16:53:15 +02:00
Tobias Knöppler
a76c8a9c88
Add integration test for nc admin section
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-10-20 03:15:06 +02:00
Tobias K
3958883e62
Add ncp-community.sh and admin section to ncp-app
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-10-19 20:17:37 +02:00
Tobias Knöppler
50c09041dc
Merge pull request #1839 from nextcloud/feature/armbian-next-support
Feature/armbian next support
2023-10-18 23:23:06 +02:00
Tobias Knöppler
48b361bf4a
build-sd-images.yml: Fix armbian build
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-10-18 22:34:18 +02:00
Tobias Knöppler
f1b1f643bc
Add build-SD-armbian-vagrant.sh
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-10-18 00:04:12 +02:00
Tobias Knöppler
f1f6ca3bc7
Rename TMPDIR environment variables to TEMPDIR to avoid overriding php temp dir.
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-10-18 00:04:01 +02:00
Tobias Knöppler
1d77f6d5c1
build-SD-armbian.sh: Use armbian-next to build NCP images
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-10-11 14:27:20 +02:00
Tobias Knöppler
9ed15a5a30
build-SD-armbian.sh: Patch rootfs size determination in armbian build code
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-10-10 22:01:01 +02:00
Tobias Knöppler
f5a71daa14
build-SD-armbian.sh: Disable armbian's FAST_CREATE_IMAGE
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-10-10 20:03:21 +02:00
Tobias Knöppler
6a5f469f21
build-SD-armbian.sh: Don't checkout git history
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-10-10 17:34:12 +02:00
Tobias Knöppler
7d93579db4
changelog.md: Document v1.52.5
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-10-10 17:01:56 +02:00
Tobias Knöppler
899231a143
Update Nextcloud to 27.1.2
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-10-10 16:57:15 +02:00
Tobias Knöppler
e4a5f744e0
build-sd-images.yml: Fix selenium setup
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-10-03 20:08:13 +02:00
Tobias Knöppler
abdedc0391
Merge pull request #1831 from nextcloud/feature/staged-rollouts
Feature/staged rollouts
2023-09-30 12:54:01 +02:00
Tobias K
3c85d9ea64
build-lxd.yml: Fix selenium setup
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-09-30 12:26:09 +02:00
Tobias Knöppler
6311d72ab8
Add utility_script generate_cohortes.sh
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-09-27 17:59:47 +02:00
Tobias Knöppler
46d33f7698
ncp-check-version: Add check for staged rollouts
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-09-27 17:59:13 +02:00
Tobias Knöppler
27fa01299d
Merge branch 'devel' 2023-07-31 01:38:16 +02:00
Tobias Knöppler
04cef2ebcc
changelog.md: Document v1.52.4
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-07-31 01:38:02 +02:00
Tobias Knöppler
abcccd5d18
ncp-check-version: Don't use command that's unavailable in context
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-07-31 01:36:06 +02:00
Tobias Knöppler
2ed68b5846
Merge branch 'devel' 2023-07-26 22:24:46 +02:00
Tobias Knöppler
432d7ebe19
changelog.md: Document v1.52.3
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-07-26 22:24:33 +02:00
Tobias Knöppler
be68b785dc
Merge pull request #1803 from nextcloud/devel
v1.52.3
2023-07-26 22:17:07 +02:00
Tobias Knöppler
b260103260
Merge pull request #1802 from nextcloud/feature/nc-27
Add support for Nextcloud 27
2023-07-26 21:52:19 +02:00
Tobias Knöppler
4bd2860ed0
Add support for Nextcloud 27
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-07-26 17:18:35 +02:00
Tobias Knöppler
cd7e911baa
ncp-restore: Fix wrong variable name 2023-07-19 14:20:41 +02:00
Tobias Knöppler
8c068cf20c
Merge pull request #1796 from nextcloud/devel
Add support for Nextcloud 26.0.3

### Changes

- Adds support for NC 26.0.3
- Add ZFS support for the data directory (#1767)

### Fixes

- Fix bug in ncp-backup (#1791)
- Fix missing configuration field for nc-backup-auto (#1787)
2023-07-17 22:59:32 +02:00
Tobias Knöppler
4fd410ee04
Add support for NC 26.0.3
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-07-17 22:38:25 +02:00
Tobias Knöppler
6657adbd76
release.yml: Remove docker images from release notes
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-07-17 22:04:04 +02:00
Tobias Knöppler
dfc5f18ef3
build-sd-images.yml: Use ubuntu-20.04 runner
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-07-16 22:38:41 +02:00
Tobias Knöppler
f31529726a
Add support for ZFS for the data directory
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-07-16 22:19:18 +02:00
Tobias Knöppler
e9624fd9f7
ncp-backup: Fix expansion of tar exclude parameters
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-07-16 22:12:46 +02:00
Tobias Knöppler
16e5de770b
updates/1.52.1.sh: Only set BACKUPHOUR if missing from config
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-07-16 22:06:30 +02:00
Tobias K
3742689ea5
tests/nextcloud_tests.py: Fix deprecated syntax 2023-07-16 22:00:43 +02:00
Tobias Knöppler
05ad72685a
ncp-check-version: Check for docker-stable branch if running docker
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-07-16 22:00:42 +02:00
Victor-ray, S
ed337627ba
Merge pull request #1780 from nextcloud/enh/noid/apcu
rename ACPU to APCu
2023-05-27 21:35:00 +02:00
Simon L
e87169bc4c rename ACPU to APCu
Signed-off-by: Simon L <szaimen@e.mail.de>
2023-05-26 18:45:40 +02:00
Tobias Knöppler
f99bb37bd5
Merge pull request #1771 from nextcloud/devel
Add support for Nextcloud 26
2023-05-01 15:16:48 +02:00
Tobias K
78c91681c3
changelog.md: Dockument release v1.52.0
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-05-01 15:16:05 +02:00
Tobias K
6876a96be9
Add support for NC 26
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-05-01 14:44:37 +02:00
Tobias K
483bd15309
ncp-restore: Use second-accurate timestamps for temporary and backup directories
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-05-01 14:44:36 +02:00
Tobias Knöppler
83cc630932
build-docker.sh: Remove docker-* prefix from tags during build (#1769)
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-05-01 14:44:36 +02:00
Tobias K
c770c4190c
run-parts.sh: Fix order of parameters to notify_admin
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-05-01 14:44:36 +02:00
Tobias K
10012e72d4
Merge branch 'devel' 2023-04-27 02:45:16 +02:00
Tobias K
c5698e1d8e
run-parts.sh: Fix order of parameters to notify_admin
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-04-27 02:43:38 +02:00
Tobias K
592e38f01e
Merge branch 'docker-devel' into docker-stable 2023-04-27 02:29:41 +02:00
Tobias K
4c0f59c119
release.yml: Allow tags with docker-* prefix for releases
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-04-27 02:28:31 +02:00
Tobias K
de8c73cb2f
Merge branch 'devel' 2023-04-27 01:08:22 +02:00
Tobias K
dda2f30baf
Merge branch 'docker-devel' into docker-stable 2023-04-27 01:07:46 +02:00
Tobias K
211722035e
release.yml, build-docker.yml: Remove docker-* prefix from version tags
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-04-27 01:07:07 +02:00
Tobias K
987dbca232
Merge branch 'devel' 2023-04-26 23:52:41 +02:00
Tobias K
2244fafc48
Merge branch 'docker-devel' into docker-stable 2023-04-26 23:51:48 +02:00
Tobias K
7ae218d75d
changelog.md: Fix date for v1.51.3
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-04-26 23:51:23 +02:00
Tobias K
a886602a79
Merge branch 'docker-devel' into docker-stable 2023-04-26 12:43:27 +02:00
Tobias K
f867b16014
release.yml: Don't test non-docker images on docker-* branches and tags
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-04-26 12:42:55 +02:00
Tobias K
e551a354c4
Merge branch 'docker-devel' into docker-stable 2023-04-26 11:54:14 +02:00
Tobias Knöppler
1e21b929e6
.github/workflows: Only trigger docker CI for docker-* tags and branches
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-04-24 11:53:17 +02:00
Tobias Knöppler
c75f83b467
Add support for Nextcloud 25.0.6
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-04-24 11:17:05 +02:00
Tobias Knöppler
16aa6c8055
Merge branch 'devel' of github.com:nextcloud/nextcloudpi into devel 2023-04-24 11:16:09 +02:00
Jürgen
6750497924
Improved default for php max children (#1738)
Fixes #1624
2023-04-24 11:15:23 +02:00
Tobias Knöppler
4d6236345b
nc-backup-auto, nc-rsync-auto, nc-snapshot-sync: Add input validation for cron configuration
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-04-24 11:13:18 +02:00
Martin
0f4de56086
Let users configure Hour for backups / btrfs sync (#1762)
Signed-off-by: Martin <mayermart@users.noreply.github.com>
2023-04-24 11:02:19 +02:00
Tobias Knöppler
5a732c89a6
publish-image.yml: Fix condition for publishing images
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-04-16 04:02:48 +02:00
Tobias Knöppler
f983acd341
Merge pull request #1765 from nextcloud/devel
v1.51.2
2023-04-16 02:20:46 +02:00
Tobias Knöppler
be6e109230
publish-image.yml: Retry updating release description with random delays to avoid race conditions
- build-lxd.yml: Remove EXPERIMENTAL-suffix from LXC image artifacts

Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-04-16 01:19:21 +02:00
Tobias Knöppler
663b65e45c
1.51.2.sh: Update mysql config after update
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-04-16 00:04:44 +02:00
Tobias Knöppler
902226d5da
91-ncp.cnf.sh: Increase max_allowed_packet to avoid errors on large sql queries
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-04-15 23:59:48 +02:00
Tobias Knöppler
7e07152dc8
SSH.sh: Don't disable ssh for users during ncp installation
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-04-15 22:14:57 +02:00
Tobias Knöppler
08054a60f6
build-lxd.yaml Always use runner ubuntu-20.04 for covering LXD to LXC image
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-04-15 10:29:03 +02:00
Tobias Knöppler
62859363ae
Merge pull request #1763 from nextcloud/feature/cicd/build-lxc
Build LXC images in CICD pipeline
2023-04-15 02:45:00 +02:00
Tobias Knöppler
f72b11d938
run-parts.sh: Notify docker users about discontinuation of NCP docker
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-04-15 02:28:42 +02:00
Tobias Knöppler
0de39f155e
Add nc-broadcast utility script
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-04-15 02:06:36 +02:00
Tobias Knöppler
ab501b3f51
ncp-metrics.cfg.sh: Exclude snapshots from backup monitoring on LXD/LXC
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-04-15 02:06:25 +02:00
Tobias Knöppler
4dd2dcef6a
update.sh: Support some previously excluded apps on LXD/LXC containers
- fail2ban.sh: Use systemd backend for ssh jail (auth.log might not be available)
- SSH.sh: Make sure openssh-server is installed

newly supported on LXC/LXD are:
- nc-autoupdate-ncp
- nc-update
- nc-datadir
- nc-database
- UFW
- nc-audit
- SSH
- fail2ban
- nc-nextcloud
- nc-init
- samba

Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-04-15 02:06:01 +02:00
Tobias Knöppler
ae5ab8df90
ncp.sh: Don't disable root/webui user for container images
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-04-15 02:02:59 +02:00
Tobias Knöppler
7299cb0258
CICD: Extract LXC images from LXD images
- build-lxd.yml: Merge jobs update-previous and test-update
- build-lxd.yml: Add job for converting LXD images to LXC images
- release.yml: Release LXC images

Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-04-15 02:02:11 +02:00
Tobias Knöppler
d2c480ac1a
release.yaml: Fix detection of docker stable release
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-04-11 01:16:02 +02:00
Martin
13aa4737fb
1.51.1.sh: Fix data directory path (#1759)
Signed-off-by: Martin <mayermart@users.noreply.github.com>
2023-04-11 01:05:55 +02:00
Tobias K
75b90ce93a changelog.md: Add date for v1.51.1 release
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-04-08 14:16:22 +02:00
Tobias Knöppler
b85d8ff022
Merge pull request #1755 from nextcloud/devel
Update to 1.51.1
2023-04-08 14:14:37 +02:00
Tobias K
81d4d68df7 1.51.1.sh: Fix invalid data directory path
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-04-08 14:11:19 +02:00
Tobias Knöppler
6aec414676
Merge pull request #1754 from nextcloud/release/v1.51.1
Release/v1.51.1
2023-04-08 13:55:21 +02:00
Tobias Knöppler
18058ed366
SSH.sh: Improve output when disabling ssh users
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-04-05 21:45:07 +02:00
Tobias Knöppler
fd60a22b17
1.51.1.sh: Fix retrieval of theming app instance ID
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-04-05 20:39:47 +02:00
Tobias Knöppler
39549d2e6e
Fix update script with wrong version
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-04-05 20:34:18 +02:00
Tobias K
b01da03fe4
changelog.md: Correct supported NC version in v1.51.1 2023-04-05 15:35:06 +02:00
Tobias K
3a5fceebd0
changelog.md: Document changes from v1.51.1
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-04-05 15:35:06 +02:00
Tobias Knöppler
eabb975a5a
ncp-update-nc: Restart notify_push after successful nc update on docker
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-04-05 15:33:51 +02:00
Tobias Knöppler
87ded5925a
nc-nextcloud.cfg, ncp.cfg: Push NC to v25.0.5
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-03-29 22:49:57 +02:00
Tobias Knöppler
f10c48d1c0
nc-init.sh: Fix ncp theming
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-03-28 15:39:16 +02:00
Tobias Knöppler
378df3bd5c
build-SD-armbian.sh: Use armbian v23.02 as base
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-03-28 11:12:04 +02:00
Tobias Knöppler
bbc81c958d
Merge pull request #1714 from nextcloud/fix/create_user
࿓❯ SSH.sh: Rewrote SSH activation to allow user creation
2023-03-28 10:55:20 +02:00
Victor-ray, S
9030882d28
࿓❯ SSH.sh: Added user creation functionality
Signed-off-by: Victor-ray, S <12261439+ZendaiOwl@users.noreply.github.com>

࿓❯ SSH.sh: Added a '-' for the '--append'

Signed-off-by: Victor-ray, S <12261439+ZendaiOwl@users.noreply.github.com>

࿓❯ SSH.sh: Removed chage -d 0 "USER" as it forces an immediate password change after login and signs the user out afterwards

Signed-off-by: Victor-ray, S <12261439+ZendaiOwl@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-03-26 16:15:56 +02:00
Victor-ray, S
4824cad24e
࿓❯ SSH.sh: Rewrote SSH activation so it allows for user creation and disallows the webadmin to be used
Signed-off-by: Victor-ray, S <12261439+ZendaiOwl@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-03-26 16:15:51 +02:00
Tobias Knöppler
078210b52c
Add support for arm64 lxd image (#1751)
* build-LXD.sh, build-lxd.yml, release.yml: Add support for lxd images for armhf/arm64
* release.yml: Remove armhf lxd as target platform
* build-LXD.sh: Attempt to start container as root if user service couldn't be started
* build-lxd.yml: Use architecture specific runner for unit tests
* build-lxd.yml: Allow 'setup firefox' to fail (not required on self-hosted runner)
* Allow 'fix lxd' step to fail
* build-lxd.yml: Allow 'setup geckodriver' step to fail (not required on self-hosted runner)
* build-lxd.yml: Delete lxd images on self-hosted runner before running tests

---------

Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-03-26 16:15:04 +02:00
Tobias Knöppler
4b171e6331
Merge pull request #1726 from nextcloud/fix/docker-prevent-start-with-unsupported-nc-version
Fix various issues related to updating Nextcloud
2023-03-26 15:53:09 +02:00
Tobias Knöppler
324c0d39cb
nc-update-nextcloud.sh: Prevent PHP upgrade from the web UI
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-03-26 15:36:29 +02:00
Tobias Knöppler
6a71870278
run-parts.sh: Read NC version from /data instead of /var/www
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-03-26 15:36:29 +02:00
Tobias Knöppler
a13a88bdb7
run-parts.sh: Compare minimum to currently installed nc version on docker startup
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-03-26 15:36:29 +02:00
Tobias Knöppler
50640d9b9e
ncp-update-nc: Fix wrong base dir being used to check for interrupted installation on docker
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2023-03-26 15:36:25 +02:00
Tobias K
bab86f2687
elements.php: Fail gracefully if script configs can't be loaded
Signed-off-by: Tobias K <6317548+thecalcaholic@users.noreply.github.com>
2023-02-02 13:08:46 +01:00
Tobias Knöppler
0827781a5a
Merge branch 'devel' 2023-01-22 22:06:10 +01:00
Tobias Knöppler
799537f54e
Merge remote-tracking branch 'origin/devel' into devel 2023-01-22 22:05:56 +01:00
Tobias Knöppler
a1579843a9
release.yml: Fix check for release tag format in docker-release
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 22:05:40 +01:00
Tobias Knöppler
0cfc542962
Merge pull request #1710 from nextcloud/devel
[Fix] ncp-update-nc: Clear opcache before removing PHP, to avoid breaking t…
2023-01-22 14:47:24 +01:00
Tobias Knöppler
94c8c74b33
ncp-update-nc: Clear opcache before removing PHP, to avoid breaking the PHP upgrade
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 14:46:50 +01:00
Tobias Knöppler
d10da4ac6d
Merge pull request #1709 from nextcloud/devel
[fix] ncp-update-nc: Don't remove systemd during PHP rollback
2023-01-22 14:10:23 +01:00
Tobias Knöppler
27e2ed7b9e
ncp-update-nc: Don't remove systemd during PHP rollback
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 14:09:09 +01:00
Tobias Knöppler
62adb71652
Merge branch 'devel'
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 02:19:10 +01:00
Tobias Knöppler
8ab5ea59a6
changelog.md: Remove empty line
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 02:18:40 +01:00
Tobias Knöppler
5e334b5760
Merge pull request #1708 from nextcloud/devel
Release v1.51.0
2023-01-22 01:56:46 +01:00
Tobias Knöppler
cdf99f6511
Update changelog.md
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:08 +01:00
Tobias Knöppler
33af0ed554
1.51.0.sh: Make sure, Changes to opcache.ini are in effect
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:08 +01:00
Tobias Knöppler
362c8288f5
Remove unnecessary clear_opcache calls, as opcache is now disabled for cli
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:08 +01:00
Tobias Knöppler
88ec3a8720
library.sh: Fix opcache path
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:07 +01:00
Tobias Knöppler
07689a4831
Revert "library.sh: Simplify clear_opcache"
This reverts commit 59c2297c808a44344a22966369f4b26166779d4d.

Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:07 +01:00
Tobias Knöppler
cfc4d57306
opcache.ini.sh: Disable opcache for cli
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:07 +01:00
Tobias Knöppler
e8352bd10e
ncp-restore: Make sure to clear opcache before executing ncc commands
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:07 +01:00
Tobias Knöppler
39c915dc67
library.sh: Simplify clear_opcache
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:07 +01:00
Tobias Knöppler
d5fcc40bab
build-sd-images.yml: Fix aborted tests before retries are reached
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:06 +01:00
Tobias Knöppler
b9acc8a0d7
Dockerfile: Disable branch pinning as it has no effect during build
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:06 +01:00
Tobias Knöppler
f121aac809
library.sh: Simplify clear_opcache
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:06 +01:00
Tobias Knöppler
a5f777ae86
000ncp: Fix copying of new config files to persistent config
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:06 +01:00
Tobias Knöppler
d2ba6498d6
release.yml: Disable broken image builds
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:06 +01:00
Tobias Knöppler
dea9d5df4e
ncp.cfg, nc-nextcloud.cfg: Update NC to 25.0.3
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:06 +01:00
Tobias Knöppler
30fe8c763c
000ncp: Copy new config files to persistent config
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:05 +01:00
Tobias Knöppler
624b560e01
release.yml: Disable 32bit armbian images
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:05 +01:00
Tobias Knöppler
615b6f1c4d
build-docker.yml: Disable update test for armhf
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:05 +01:00
Tobias Knöppler
41a7b6b373
010lamp: clear opcache on container startup
- Dockerfile: Set apache configuration environment variables
- library.sh: Only retry setting up notify_push on failure

Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:05 +01:00
Tobias Knöppler
56e1ff45ee
opcache.ini.sh: Increase interned_strings_buffer as recommended by NC
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:05 +01:00
Tobias Knöppler
262e4b1591
library.sh: Increase retries for setting up notify_push to 5
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:05 +01:00
Tobias Knöppler
6fad75e586
build-sd-images.yml: Disable container shutdown on exit
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:04 +01:00
Tobias Knöppler
8cfc779dd5
build-docker.yml: Increase attempts for container startup check
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:04 +01:00
Tobias Knöppler
bdf7c11841
build-docker.yml: Allow 10 attempts for activation tests
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:04 +01:00
Tobias Knöppler
87e3fc883e
opcache.ini.sh: include potential fix for opcache jit segfaults
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:04 +01:00
Tobias Knöppler
07fd406030
opcache.ini.sh: Ensure opcache temp dir exists
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:04 +01:00
Tobias Knöppler
7a9a2ea301
build-sd-images.yml: Remove '-e' shell option for the test step
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:04 +01:00
Tobias Knöppler
8a824db61c
ncp-update-nc: Ensure recovery directory exists before attempting restore
- ncp-update-nc: Clear opcache *before* running ncc commands
- build-sd-images: Don't abort pipeline when failing to retrieve redis credentials

Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:03 +01:00
Tobias Knöppler
f09ccf26ce
library.sh: Have notify_admin notify *all* admins, not just the first
1.51.0.sh: clear opcache after removing php-json, notify users if php8.2 packages need to be removed

Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:03 +01:00
Tobias Knöppler
92698aa028
build-sd-images.yml: Increase number of retries when waiting for container startup
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:03 +01:00
Tobias Knöppler
ab67e98647
build-sd-images.yml: Improve debug output for container status check
build-docker.yml: Wait for container update to complete

Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:03 +01:00
Victor-ray, S
b10868f313
࿓❯ Fixed a comma (,) that should've been a period (.) and docker to Docker
Signed-off-by: Victor-ray, S <12261439+ZendaiOwl@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:03 +01:00
Victor-ray, S
a873d615f6
࿓❯ Added an example of running the install script with sudo
Signed-off-by: Victor-ray, S <12261439+ZendaiOwl@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:02 +01:00
Victor-ray, S
b21a2cd630
࿓❯ Fixed a typo I had missed
Signed-off-by: Victor-ray, S <12261439+ZendaiOwl@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:02 +01:00
Victor-ray, S
09508fa1e7
࿓❯ Added a badge for the devel branch tests
Signed-off-by: Victor-ray, S <12261439+ZendaiOwl@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:02 +01:00
Victor-ray, S
f80c3a680f
࿓❯ Updated the README a little bit more
Signed-off-by: Victor-ray, S <12261439+ZendaiOwl@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:02 +01:00
Victor-ray, S
2e6c8d5da4
࿓❯ Updated the README
Signed-off-by: Victor-ray, S <12261439+ZendaiOwl@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:02 +01:00
Victor-ray, S
1c5bc66401
࿓❯ Updated the README
Signed-off-by: Victor-ray, S <12261439+ZendaiOwl@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:02 +01:00
Victor-ray, S
4f2d61546c
࿓❯ Update README
Signed-off-by: Victor-ray, S <12261439+ZendaiOwl@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:01 +01:00
Tobias Knöppler
b631366020
build-docker.yml: Improve detecting of successful container startup
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:01 +01:00
Tobias Knöppler
3298b95aa9
ncp-update-nc, 1.51.0.sh: Remove deprecated package php-json
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:01 +01:00
Tobias Knöppler
1934fd2de6
build-sd-images.yml: Fix permissions when accessing container logs
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:01 +01:00
Victor-ray, S
b65bcff218
࿓❯ Removed the extra forward slash in the config directory variable
Signed-off-by: Victor-ray, S <12261439+ZendaiOwl@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:01 +01:00
Tobias Knöppler
9e95cbb8c1
build-{docker,sd-images}.yml: Improve CICD robustness and output
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:00 +01:00
Tobias Knöppler
52f6454e23
build-SD-armbian.sh: Update to latest raspios version
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:00 +01:00
Tobias Knöppler
f763e79f76
build-docker.yml: Include nextcloud update in update test
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:00 +01:00
Tobias K
04cf27148c
Clear php opcache on ncp update
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:00 +01:00
Tobias Knöppler
9afbf0b5b5
Implement clear-php-opcache.sh
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:00 +01:00
Victor-ray, S
c23abe7e05
࿓❯ Added array declarations so mapfile works properly
Signed-off-by: Victor-ray, S <12261439+ZendaiOwl@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:21:00 +01:00
Victor-ray, S
bc0abc6c48
ncp-diag, web-ui: Integrate new port check backend
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:20:59 +01:00
Tobias K
74200976ad
build-docker.yml: Only allow tags as previous version
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:20:59 +01:00
Tobias K
127c9bdfb1
build-{docker,lxd}: Also run on PRs against release branches
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:20:59 +01:00
Tobias K
ba4bb1d951
Add support for Nextcloud 25.0.2
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:20:59 +01:00
Tobias Knöppler
a09ddbe308
020nextcloud: Fix NC logfile path
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:20:59 +01:00
Tobias Knöppler
2c94c420d8
nc-snapshot-auto.sh: Ad quotes to allow datadirectory paths with spaces
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:20:59 +01:00
Tobias Knöppler
9b8af4db99
Merge commits from release v1.50.5
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-22 01:20:24 +01:00
thecalcaholic
d9cb6543cd
Update Readme.md
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:39 +01:00
thecalcaholic
557004cd5b
Update changelog.md
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:38 +01:00
Tobias Knöppler
13129b694e
nc-snapshot-auto.sh: Add missing import of library.sh in /etc/cron.hourly/btrfs-snp (#1689)
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:38 +01:00
thecalcaholic
9fdd7822cd
build-docker.yml, build-sd-images.yml: Increase retries and timeouts during tests
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:38 +01:00
Tobias K
5c82b7e681
build-lxd.yml, build-docker.yml: Use GH API token for downloading gecko driver
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:38 +01:00
Tobias K
35c775be2f
opcache.ini.sh: Fix template populating /data/... during docker build
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:38 +01:00
Tobias K
72d35fbb99
ncp-restore: Add command for merging data directory with backup
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:38 +01:00
Tobias K
71f8a2ef81
ncp-restore: Use new default data directory location when resetting datadir
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:37 +01:00
Tobias K
ef4ec175ff
ncp-restore: Improve clarity of output regarding data conflicts
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:37 +01:00
Tobias K
da2dedc450
Fix erroneously created symlinks in /usr/local/bin/ncp
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:37 +01:00
Tobias K
2655c5d5a1
Update nextcloud to version 24.0.5
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:37 +01:00
Victor-ray, S
298f0f2e93
࿓❯ Changed NextCloud to Nextcloud
Signed-off-by: Victor-ray, S <12261439+ZendaiOwl@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:37 +01:00
Victor-ray, S
2f71dbec2e
࿓❯ Updated the README a little bit
Signed-off-by: Victor-ray, S <12261439+ZendaiOwl@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:37 +01:00
Victor-ray, S
7303d47759
࿓❯ Updated the README a little bit
Signed-off-by: Victor-ray, S <12261439+ZendaiOwl@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:36 +01:00
Victor-ray, S
224b64bcea
࿓❯ Fixed ncp.sh, removed the pi user /sbin/nologin shell as that user no longer exists by default
Signed-off-by: Victor-ray, S <12261439+ZendaiOwl@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:36 +01:00
Tobias K
eee84431a1
Fix release pipeline for lxd and docker
- build-docker.yml: Increase retries for integration tests to 5
- build-lxd.yml: Fix empty output variables

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:36 +01:00
Tobias K
23f698da20
000ncp: Install templates during docker startup
- docker-build.yml: Fix update-test job

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:36 +01:00
Tobias K
731e25e36b
nc-datadir.sh: Prevent btrfs commands from being executed on docker
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:36 +01:00
Tobias K
0c3ac35e39
ncp-restore: Don't assume data directory inside nc directory on docker
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:36 +01:00
Tobias K
f8e416f6d5
docker-build.yml: Fix docker update-test
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:35 +01:00
Tobias K
64fa7d4e10
Fix setting up datadir at new default location during docker build
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:35 +01:00
Tobias K
b69ad71507
Add basic integration test for nc-backup
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:35 +01:00
Tobias K
cde1b44063
Move ncp-backup and ncp-restore to separate files (instead relying on cat during installation)
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:35 +01:00
Tobias K
2072f77720
Installer and pipeline fixes
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:35 +01:00
Tobias K
8149493439
SSH: Add option to enable sudo for ssh user.
- Disable root login

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:35 +01:00
Tobias K
bd835dcd82
Fix installation and pipeline errors
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:34 +01:00
thecalcaholic
73213342d1
library.sh: Make notify_push setup in set-nc-domain more robust
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:34 +01:00
Tobias K
97085dbc3f
nc-restore: Fix potential dataloss when restoring backup (fixes #1417)
- nc-restore: Keep old data directory if present
- nc-restore: Temporarily move and restore user files during nc-restore

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:34 +01:00
Tobias K
5178e5553f
release.yml: Don't tag docker images as :latest on prereleases
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:34 +01:00
MB-Finski
ff8877db65
Change backup directory for docker compatibility
Improve docker compatibility: Change the backup directory for ./nextcloud/data to reside within the host file system (basedir) so as to avoid moving the data folder back and forth between the docker container and the host file system. In situations where the nextcloud data takes up more than the free available space on the host system, this may lead to loosing some or all of the data.

Signed-off-by: MB-Finski <64466176+MB-Finski@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:34 +01:00
MB-Finski
d94ca6b109
Temporarily place backup to BASEDIR
Improves docker compatibility. Placing the backup file in /var/www/ will cause a failure in rolling back the update on containerized setups ("Can only restore from ext/btrfs/zfs filesystems"). The host filesystem is most likely compatible so using $BASEDIR as the backup location *should* solve this issue for most users.

Signed-off-by: MB-Finski <64466176+MB-Finski@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:34 +01:00
coltkondo
ff5fdb65d4
Fixed: Nextcloudpi icon pointing to ownyoursbits.com #1571
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2023-01-08 21:16:33 +01:00
thecalcaholic
a17d6840f6
Update changelog.md 2022-12-17 19:22:52 +01:00
thecalcaholic
a8e4a55193
lamp.sh: Remove obsolete TODO
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-12-17 00:48:43 +01:00
thecalcaholic
679a18fe5b
lamp.sh: Remove unversioned php package
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-12-17 00:48:37 +01:00
thecalcaholic
9975742ff3
SSH.sh: Enable user when configuring SSH
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-10-03 23:23:17 +02:00
thecalcaholic
ddc04e6187
changelog.md: Document v1.50.3
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-10-03 22:50:06 +02:00
Tobias Knöppler
d9be4e17b4
Merge pull request #1604 from nextcloud/fix/pi-user-disabled
SSH.sh: Reenable pi user if selected in SSH
2022-10-03 20:59:34 +02:00
Tobias K
da1295dd82 build-SD-rpi.sh: Don't set pi user as default in SSH 2022-09-30 12:39:06 +02:00
Tobias K
0759aeaaae SSH.sh: Reenable pi user if selected in SSH 2022-09-30 12:32:50 +02:00
thecalcaholic
c5c87300f5
build-docker.yml: Add sleep for qemu update tests
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-29 04:28:02 +02:00
thecalcaholic
997cbc8644
vm-tests.yml: Fix invalid variable usage
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-29 03:39:58 +02:00
thecalcaholic
220a53abd3
Fix HPB service
vm-tests.yml: Fix invalid variable usage

Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-29 03:36:59 +02:00
thecalcaholic
84b78e8362
Merge branch 'devel' 2022-09-29 02:07:30 +02:00
thecalcaholic
06de15d5c7
changelog.md: Document v1.50.2
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-29 02:07:14 +02:00
Tobias Knöppler
47153b3c8d
Merge pull request #1596 from nextcloud/fix/invalid-db-dir 2022-09-29 02:02:21 +02:00
thecalcaholic
4d56423c6b
nc-limits.sh: Limit max memory to 4GB on 32 bit systems
run-parts.sh: Run backup on startup not shutdown

Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-29 02:01:36 +02:00
thecalcaholic
0040f89e81
run-parts.sh: Simplify backup creation
nextcloud-domain.sh: Only start notify_push if the nc_domain has been set

Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-29 00:58:34 +02:00
thecalcaholic
ea13af3d4d
vm-tests.yml: Fix invalid use of environment variables
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 23:49:51 +02:00
thecalcaholic
a6ebbb8601
010lamp: Fail if dbdir could not be configured
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 23:43:39 +02:00
thecalcaholic
9076b3599f
lamp.sh: Only create systemd users if systemd is not already present
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 22:05:54 +02:00
thecalcaholic
f3292624eb
run-parts.sh: Create backup before shutting down services
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 22:02:28 +02:00
thecalcaholic
270fc64d0c
vm-tests.yml: Remove obsolete matrix configuration
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 21:29:19 +02:00
thecalcaholic
ff90eedf92
build-docker.yml: Add status information
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 21:17:23 +02:00
thecalcaholic
c8eb8a49b5
release.yml: Fix dependencies of docker-release job
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 21:12:01 +02:00
thecalcaholic
c75f100b55
build-docker.yml: Add timeouts to update test
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 21:07:03 +02:00
thecalcaholic
c8aad36199
build-docker.yml: Fix docker manifest platform
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 20:57:05 +02:00
thecalcaholic
eea991fc49
build-docker.yml: Add fallback value for arch
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 20:47:50 +02:00
thecalcaholic
a226b53da0
build-docker.yml: Use env variable for arch detection
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 20:45:13 +02:00
thecalcaholic
e310f33663
build-docker.yml: Add default arch
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 20:41:20 +02:00
thecalcaholic
6906c50729
build-docker.yml: Use inputs instead of matrix strategy for speeding up builds
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 20:40:19 +02:00
thecalcaholic
a6aaa4abe8
lamp.sh: Create systemd users manually, prevent changed uids
build-docker.yml: Add update tests

Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 20:34:26 +02:00
thecalcaholic
fc79b722f2
run-parts.sh: Fix wrong permissions on /data/database
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 19:37:40 +02:00
thecalcaholic
3f795f812e
update.sh: Prevent ncp-update on older docker containers
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 19:27:01 +02:00
thecalcaholic
82f938c52b
metrics.sh: Fix incorrect return code in relaod_metrics_config if ncp-metrics-export was disabled
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 16:18:53 +02:00
thecalcaholic
ba7b845c73
run-parts.sh: Add information about critical bug
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 16:17:59 +02:00
thecalcaholic
1499cfbdc2
run-parts.sh: Do the backup on shutdown not on startup
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 16:14:02 +02:00
thecalcaholic
6b8501e3aa
run-parts.sh: Enable debug output during backups
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 16:14:01 +02:00
thecalcaholic
9b5fbba517
run-parts.sh: Fix undefined backup location
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 16:14:01 +02:00
thecalcaholic
1c4fefbb7a
run-parts.sh: Fix syntax
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 16:14:01 +02:00
thecalcaholic
95411b58e1
Dockerfile: Fix db directory after installation
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 16:14:01 +02:00
thecalcaholic
879a44ba9c
Dockerfile: Add missing semicolon
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 16:14:01 +02:00
thecalcaholic
549ba6aad3
Dockerfile: Mark as image build during lamp setup
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 16:14:01 +02:00
thecalcaholic
4049a4b07d
90-ncp.cnf.sh: Fix /data-ro being used as db directory outside of installation
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 16:14:00 +02:00
thecalcaholic
412efad20f
run-parts.sh: Backup docker instance when starting container
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 16:14:00 +02:00
thecalcaholic
1a80ecbfc9
90-ncp.cnf.sh: Don't use /data-ro for database path
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 16:13:57 +02:00
thecalcaholic
99f4285e8e
run-parts.sh: Prevent mariadb to start with /data-ro/* as db dir
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 15:54:06 +02:00
thecalcaholic
77a2d0cdf9
update.sh: Disable nc-update on docker
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 12:21:11 +02:00
thecalcaholic
d1daa9b7fa
Revert d784a6a932977fc2b2a04eceeaa1803c8e159dea
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 12:20:38 +02:00
thecalcaholic
b1de996809
000ncp: Don't make /etc/services-enabled.d persistent
000ncp: Show ncp.log in docker output
010lamp: Only persist apache sites config, not apache config

Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 12:20:08 +02:00
thecalcaholic
d784a6a932
v1.50.1.sh: Fix missing PHP 8 configuration on docker
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 10:55:15 +02:00
thecalcaholic
6a2867e638
Merge branch 'devel' 2022-09-28 01:14:37 +02:00
thecalcaholic
4882d5c31e
changelog.md: Add v1.50.1 release notes
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 01:14:09 +02:00
thecalcaholic
a475184803
library.sh: Warn that clearing opcache can take some time
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-28 00:28:04 +02:00
Tobias Knöppler
21d9894e63
Merge pull request #1587 from nextcloud/devel
v1.50.1 release
2022-09-27 23:17:12 +02:00
Tobias Knöppler
672731adf8
gateway instead of Gateway (as ncp-report looks for this) (#1586)
Signed-off-by: Jürgen <55851807+schoetju@users.noreply.github.com>
Co-authored-by: Jürgen <55851807+schoetju@users.noreply.github.com>
2022-09-27 20:25:21 +02:00
Tobias Knöppler
0a5ba754c5
Update the Nextcloud version number to 24.0.5 in Readme (#1585) 2022-09-27 20:24:02 +02:00
Tobias Knöppler
1dfcf65a1c
Merge pull request #1584 from nextcloud/release/v1.50.1c 2022-09-27 20:22:06 +02:00
thecalcaholic
2032e570b5
build-lxd.yml: Skip NC update test if NC is already up to date
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-27 20:20:48 +02:00
thecalcaholic
b990f91bb6
1.50.1.sh: clear opcache once more, as that process was broken for some users in v1.50.0
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-27 20:20:48 +02:00
thecalcaholic
fb8414fa64
ncp.sh: Force ncp-update-nc to run on docker during installation
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-27 20:20:48 +02:00
thecalcaholic
2589f49377
notify_push: Automatically restart notify_push on error
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-27 20:20:48 +02:00
thecalcaholic
1d7ce6d8cd
ncp-dist-upgrade: Fix attempt to install php version that is not in apt repositories of bullseye
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-27 20:20:48 +02:00
Tobias K
0c3a817421
ncp-update: Prevent running update script inside docker without explicit confirmation
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-27 20:20:48 +02:00
thecalcaholic
780d02a6bd
CI/CD: Fix armbian builds 2022-09-27 20:17:50 +02:00
thecalcaholic
d4ab157046
CI/CD: Fix docker builds 2022-09-27 20:17:31 +02:00
thecalcaholic
e27671249c
1.50.0.sh: Fix update crashing when run from web ui
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-26 14:28:50 +02:00
Tobias K
91ac8610cc
build-docker.yml: Fix syntax for docker logs
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2022-09-24 12:20:17 +02:00
thecalcaholic
4b6d3afb91
ncp-update-nc: Prevent upgrade to PHP 8 on docker
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-23 12:31:21 +02:00
thecalcaholic
dfbcd43ade
build-docker.yml: Improve debug logging
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-23 12:25:24 +02:00
thecalcaholic
9fc24a6b2f
build-docker.yml, build-sd-images.yml: Add workaround for qemu/sudo bug
for reference: https://github.com/multiarch/qemu-user-static/issues/17

Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-23 11:30:05 +02:00
thecalcaholic
7b06986ee4
build-docker.yml: Add workaround for qemu/sudo bug
for reference: https://github.com/multiarch/qemu-user-static/issues/17

Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-23 11:11:53 +02:00
thecalcaholic
b00dff6ae6
1.50.0.sh: stop and start php-fpm service instead of mere restart
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-22 21:52:18 +02:00
thecalcaholic
e72fdf6d20
ncp-update-nc: Support the debug flag
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-22 21:36:54 +02:00
thecalcaholic
998c89e44a
1.50.0.sh: Ensure that system ncp.cfg is being used
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-22 21:17:03 +02:00
thecalcaholic
8c5531340d
Ensure that php opcache is cleared after PHP upgrade
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-22 15:23:45 +02:00
thecalcaholic
04bb842504
Revert "opcache.ini.sh: Add workaround for segfault when using PHP"
This reverts commit 546fd0d46d6295478e346cbda985cfb454e44469.
2022-09-22 15:13:19 +02:00
thecalcaholic
fc9b7d9b50
changelog.md: Fix invalid version number 2022-09-22 15:12:33 +02:00
thecalcaholic
390cdae51d
updates/1.50.0.sh: Reinstall opcache.ini to apply workaround.
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-22 12:33:53 +02:00
thecalcaholic
cdce1c24de
ncp-diag: Fix datadir incorrectly report if running as user www-data
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-22 12:28:16 +02:00
thecalcaholic
546fd0d46d
opcache.ini.sh: Add workaround for segfault when using PHP
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-22 12:27:39 +02:00
thecalcaholic
d98356e335
ncp-report: Don't rely on functions defined in library.sh
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-16 14:26:51 +02:00
thecalcaholic
a0f16c6443
update.sh: Suppress meaningless error messages
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-16 02:07:39 +02:00
thecalcaholic
ada5018e26
build-lxd.yml: Include nextcloud upgrade in update test
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-16 01:54:55 +02:00
thecalcaholic
199dcc014f
ncp-templates/*: Remove side effects from ncp-templates
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-16 01:42:36 +02:00
thecalcaholic
a97c73d420
ncp-templates/pool.d.www.conf.sh: Fix php socket path
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-16 01:35:06 +02:00
thecalcaholic
ea75a97a91
ncp-templates: Fix erroneous outputs messing up config files
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-16 00:37:16 +02:00
thecalcaholic
7225c2c898
nc-limits.sh: Migrate installation of www.conf to ncp template
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-16 00:16:25 +02:00
thecalcaholic
4737b56d71
nc-limits.sh: Suppress errors if configuration files don't exist
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-15 23:59:35 +02:00
thecalcaholic
ab50562359
ncp.cfg, nc-nextcloud.cfg: Add support for Nextcloud 24.0.5
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-15 21:16:56 +02:00
thecalcaholic
39ad3695a1
ncp-update-nc: Abort php upgrade if nc-limits fails
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-15 20:58:44 +02:00
thecalcaholic
a810c5e518
library.sh: Make sure the directory exists before installing template
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-15 20:48:43 +02:00
thecalcaholic
af45635719
update.sh: Refresh NCP configuration after potential NC update
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-15 20:36:31 +02:00
thecalcaholic
c3fbaa61ac
UFW.sh: Fix syntax of logrotate config modification
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-15 17:31:17 +02:00
thecalcaholic
1086361c35
ncp-update-nc: Remove redundant debian version compatibility check
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-15 17:31:17 +02:00
Tobias Knöppler
b675d61e61
Upgrade to PHP 8.1 when installing NC >= 24 (#1554)
* Update nextcloud to 24.0.4
* ncp-update-nc: Upgrade php to version 8.1 when installing NC >= 24
* ncp-update-nc: Use /etc/shadow workaround for installing systemd
* ncp-update-nc: Run nc-limits after php upgrade
* ncp-update-nc: Rollback after failed php upgrade
* ncp-update-nc: Add success message
* ncp-update-nc: Prevent installation of NC >= 24 on debian 10/PHP <= 7.3
* lamp.sh: Install php8.1 from sury.org
* lamp.sh: Use /etc/shadow workaround for installing systemd
* Dockerfile: Install wget, ca-certificates, lsb-release and procps before installing lamp.sh
* Dockerfile: Make sure, ncp-templates are available when installing lamp.sh
* Migrate all scripts to use template for writing opcache.ini and get_nc_config_value for retrieving datadir
* nc-nextcloud.sh Fix crash if nc-datadir has not been installed yet
* opcache.ini.sh: Don't try to get tmpl values from nc-datadir in containers
2022-09-15 17:31:15 +02:00
thecalcaholic
6cd3b16de6
build-lxd.yml: Fix missing quote
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-14 20:53:50 +02:00
thecalcaholic
7c5eff9f38
build-lxd.yml: Fix discovery of previous tag when running on tag
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-14 19:34:00 +02:00
thecalcaholic
23be1495bc
Update changelog.md
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-09-14 16:47:46 +02:00
Tobias Knöppler
43dfd3d44f
Merge pull request #1563 from nextcloud/devel
Minor fixes
2022-09-14 16:40:37 +02:00
thecalcaholic
7b48938c5e
build-docker.yml: Enable on PR to devel if coming from same repository
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-08-29 20:49:12 +02:00
thecalcaholic
55c4ff7595
ncp-update: Suppress output from fetching git tags
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-08-29 20:12:38 +02:00
thecalcaholic
917ee9bbcd
Improve output for all ci/cd tests
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-08-26 16:10:59 +02:00
Tobias Knöppler
a1851628a8
Minor Fixes
Include #1537 and #1481
2022-08-26 13:34:50 +02:00
thecalcaholic
7eb6a3579b
Run docker tests on PRs to master
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-08-26 12:29:21 +02:00
thecalcaholic
c619589a22
nc-init.sh, ncp-update-nc, library.sh: Fix invalid architecture name in notify_push binary path
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
2022-08-26 12:29:21 +02:00
DesktopECHO
c41d38aa2a
Use dpkg for architecture detection (#1481) 2022-08-25 13:13:02 +02:00
thecalcaholic
c072a9c4d7 ncp-update: Only checkout pr after moving to git directory 2022-08-25 12:41:56 +02:00
Tobias K
b88ce441e4 nc-datadir.sh: Add success message 2022-08-21 15:21:05 +02:00
Tobias K
377c932fe9 build-lxd.yml: Fix retrieval of current branch from gh ref 2022-08-21 14:52:03 +02:00
Victor-ray
220c55528f
ncp-diag: Fix port check for dual stack lite 2022-08-21 14:24:46 +02:00
Tobias Knöppler
1669bdeace
ncp-update: Add support for pr refs 2022-08-21 13:26:15 +02:00
Tobias K
8b4f9cb0b3 build-lxd.yml: Add update test 2022-08-21 02:40:27 +02:00
thecalcaholic
9933d072d1 build-docker.yml: Disable for pull requests (secrets not available) 2022-08-20 16:57:01 +02:00
thecalcaholic
36a1439c04 pr-tests.yml, build-docker.yml: Use correct github ref in PRs 2022-08-19 00:10:15 +02:00
thecalcaholic
ae4186a0a4 pr-tests.yml: Use correct github ref 2022-08-19 00:03:26 +02:00
thecalcaholic
a3820f3294 vm-tests.yml: Reenable for push:master 2022-08-18 10:35:29 +02:00
thecalcaholic
feed6801bf vm-tests.yml: Disable for push:master 2022-08-18 10:34:30 +02:00
thecalcaholic
ea47e8fa36 Add pr-tests.yml 2022-08-18 10:32:00 +02:00
thecalcaholic
be198ff61e build-lxd.yml: Add branches filter to pull_request trigger 2022-08-18 10:26:26 +02:00
thecalcaholic
d012722378 build-lxd.yml: Run on pull requests 2022-08-18 10:20:18 +02:00
Tobias Knöppler
851d1b89a8 Improve robustness of nc-format-usb (#1533)
- Prevent users from breaking their system if datadir is on USB
- Support systems that don't use an SD card as root disk
2022-08-18 10:20:18 +02:00
thecalcaholic
f05f2fa55a publish-image.yml: Us gh instead of hub as github API client, to work around https://github.com/github/hub/issues/1817 2022-08-16 23:59:47 +02:00
thecalcaholic
7a9ad8e3ef publish-image.yml: Escape backtics 2022-08-16 21:41:57 +02:00
thecalcaholic
c28a21e0ed publish-image.yml: Fix trailing quote 2022-08-16 21:41:50 +02:00
thecalcaholic
5c13eba8c4 publish-image.yml: Provide GITHUB_TOKEN to the publish artifact step 2022-08-16 21:41:42 +02:00
thecalcaholic
e014bf1b5e publish-image.yml: Escape back tics 2022-08-16 11:31:51 +02:00
thecalcaholic
f314fdb276 release.yml: Remove obsolete checksum code from gh release job 2022-08-16 01:23:45 +02:00
thecalcaholic
4aecae54e5 release.yml: Fix invalid working directory 2022-08-15 22:11:34 +02:00
thecalcaholic
cb70d2f953 release.yml: Fix tag protection not being recognized in workflow 2022-08-15 21:49:09 +02:00
thecalcaholic
712b6f9d37 release.yml: Add debug output 2022-08-15 16:45:32 +02:00
thecalcaholic
d3777aaa88 vm-tests.yml: Avoid matrix breaking deployment 2022-08-15 15:06:52 +02:00
thecalcaholic
1fc6bfe141 vm-tests.yml: Avoid matrix breaking deployment 2022-08-15 14:51:46 +02:00
thecalcaholic
6ff7553983 changelog.md: Add changes for v1.49.0 2022-08-15 05:35:22 +02:00
thecalcaholic
ac064dfaba ncp-diag: Fix port check 2022-08-15 05:33:51 +02:00
thecalcaholic
b148093bb5 release.yml: Fix dry-run condition for asset releases 2022-08-15 00:11:27 +02:00
thecalcaholic
c9412e83a3 build-SD-rpi.sh: Remove debug flags 2022-08-15 00:03:02 +02:00
thecalcaholic
82e47e52e3 buildlib.sh: Reduce verbosity of download_raspbian 2022-08-14 23:06:03 +02:00
thecalcaholic
939a373654 build-sd-images.yml: Don't skip everything on push event 2022-08-14 16:21:32 +02:00
thecalcaholic
b2ed8de68c build-sd-images.yml: Fix syntax 2022-08-14 16:15:29 +02:00
Tobias Knöppler
83113a5b96
Merge pull request #1530 from nextcloud/devel
Update NC to version 24
2022-08-14 16:10:48 +02:00
Tobias K
1c77b169a1 publish-image.yml: Make it clear in the job output if we're doing a dry-run 2022-08-13 11:55:33 +02:00
Tobias K
b11345263e build-sd-images.yml: Retry armbian build once on failure 2022-08-13 11:39:44 +02:00
Tobias K
035c6f8a44 build-sd-images.yml: Fix rpi image path 2022-08-13 11:19:49 +02:00
Tobias K
ae42036af6 build-docker.yml: Reenable for master branch 2022-08-12 14:55:07 +02:00
Tobias K
6244bf4486 release.yml: Use release.yml to run most tests 2022-08-12 14:39:40 +02:00
Tobias Knöppler
64ce2b2643
Implement automated tests for all images (#1529) 2022-08-12 14:34:48 +02:00
thecalcaholic
5bf6505ac5 library.sh: Don't use {release}-security package source if not available in sources.list 2022-08-12 14:26:32 +02:00
thecalcaholic
611fd7a357 vm-tests.yml: Enable curl installer tests on all branches 2022-08-12 14:26:32 +02:00
thecalcaholic
0e67ccc8bb ncp.cfg: Update NC to 24.0.3
ncp-app,nextcloudpincp-previews: Mark as compatible with NC 24
2022-08-12 14:26:32 +02:00
Jürgen
5b183f56bf
Update CONTRIBUTING.md (#1524)
updated the link to "Ways to contribute"

removed the link to https://help.nextcloud.com/t/testing-nextcloudpi/126380 for now (as this one is still in draft-status + needs to be rewritten)


Signed-off-by: Jürgen <55851807+schoetju@users.noreply.github.com>
2022-08-03 20:37:57 +02:00
thecalcaholic
d8975973a5 organize_gh_project.yml: Only add has-update tag if commenter is not assigned the issue 2022-07-28 20:07:33 +02:00
thecalcaholic
1f1ce9ed95 organize_gh_project.yml: Implement workflow for gh project automation 2022-07-28 17:25:26 +02:00
thecalcaholic
c3f4e766be 1.47.0.sh: Fix ncp-update if prometheus-node-exporter was not installed before 2022-07-28 09:37:47 +02:00
Tobias K
fcd2f47270 nc-datadir.sh, nc-encrypt.sh: Avoid set -u in scripts 2022-07-25 22:08:45 +02:00
Tobias K
7058939176 release.yml: Fix missing checksums in release 2022-07-25 18:52:08 +02:00
Tobias K
20eb4a6b06 metrics.sh: Fix set -u in calling script causing failure 2022-07-25 18:48:36 +02:00
Tobias K
ba209a7a5d release.yml: Fix working directory for release step 2022-07-24 17:43:05 +02:00
Tobias K
e6d182119e release.yml: Fix wrong variable name 2022-07-24 16:12:57 +02:00
Tobias Knöppler
9eed4cce64
README.md: Add direct link to releases
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
2022-07-24 15:21:49 +02:00
Tobias K
745938fb45 release.yml: Fix tag message formatting in release creation 2022-07-24 14:29:05 +02:00
Tobias K
1146767299 release.yml: Fix release step not seeing assets variable 2022-07-24 14:07:45 +02:00
Tobias K
a73ef5d78f release.yml: Provide GITHUB_TOKEN env variable 2022-07-24 11:00:07 +02:00
Tobias Knöppler
526211b296
build-images.yml: Fix rpi image build (#1510)
* release.yml: Don't publish anything unless triggered by tag

* build-sd-images.yml: Wait until rpi image is unmounted before packing
2022-07-24 00:00:43 +02:00
thecalcaholic
52508e9c37 build-sd-images.yml: Make sure, IMG variable doesn't change during builds 2022-07-21 21:05:50 +02:00
thecalcaholic
c77b0c4560 release.yml: Checkout repository before creating GH release 2022-07-20 10:16:37 +02:00
thecalcaholic
baae501f3c changelog.md: Fix wrong version number 2022-07-20 00:45:14 +02:00
thecalcaholic
a7ad0e6a1f release.yml: Enable docker release 2022-07-20 00:44:25 +02:00
thecalcaholic
60692fe9bc Fix notify_push sometimes using wrong URL 2022-07-20 00:43:53 +02:00
Tobias Knöppler
7af7582fff
Create releases from GH workflow (#1507)
- Implement lxd-build GH workflow
- Implement GH workflow for building armbian and raspberry pi images
- Implement release GH workflow
2022-07-20 00:25:19 +02:00
thecalcaholic
9a142d13d7 ncp-update-nc: Ensure notify_push is using localhost as NC URL 2022-07-20 00:23:25 +02:00
thecalcaholic
0648ea36d3 nc-nextcloud.cfg: Install NC 23.0.6 by default 2022-07-20 00:22:43 +02:00
Tobias K
9a2e631e2b dnsmasq.sh: Fix RPI build 2022-07-17 20:25:35 +02:00
Tobias K
82beb6eeaf dnsmasq.sh: Revert dnsmasq workaround 2022-07-17 19:38:26 +02:00
Tobias K
99cc9e610c dnsmasq.sh: Don't use update-rc.d for systemd-resolved 2022-07-17 19:18:10 +02:00
Tobias K
23fa33b638 dnsmasq.sh: Simplify dnsmasq workaround 2022-07-17 17:29:43 +02:00
Tobias K
0ce9d1175b dnsmasq.sh: Simplify dnsmasq workaround 2022-07-17 17:18:42 +02:00
Tobias K
2934a7a374 dnsmasq.sh: Fix dnsmasq workaround 2022-07-17 17:13:12 +02:00
Tobias K
a2b63156b6 dnsmasq.sh: Fix bug in dnsmasq workaround 2022-07-17 16:58:23 +02:00
Tobias K
13bd759911 Fix RPI build 2022-07-17 00:37:56 +00:00
thecalcaholic
e4d66e5c22 build-docker.yml: Increase timeout for cross arch integration tests 2022-07-13 00:24:44 +02:00
thecalcaholic
85a4c7e0e2 build-docker.yml: Fix docker release missing latest tags
test: Fix usage of deprecated selenium API functions
2022-07-12 22:57:55 +02:00
thecalcaholic
7207a22e3e Update changelog 2022-07-12 21:53:22 +02:00
Tobias K
c57a622304 Push NC to version 23.0.6
Signed-off-by: Tobias K <6317548+thecalcaholic@users.noreply.github.com>
2022-07-08 17:57:19 +02:00
thecalcaholic
82b04be261 build-docker.yml: Push architecture specific images 2022-06-23 15:14:33 +02:00
thecalcaholic
8475768836 build-docker.yml: Checkout code before building manifest 2022-06-22 19:11:37 +02:00
Tobias K
c273744e8a
changelog.md: Fix change message
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2022-05-05 19:03:34 +02:00
Tobias K
246b6404fb
build-docker.yml: Fix release condition
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2022-05-05 19:03:04 +02:00
Tobias K
244a10413a
changelog.md: Fix change message
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2022-05-05 18:12:13 +02:00
Tobias Knöppler
ab63f947f7
docker-build.yml: Implement workaround for ssl mutex bug on qemu/arm64 docker container 2022-05-05 18:10:53 +02:00
Tobias K
6692663907
build-docker.yml: Fix push rule to match all branches
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2022-05-05 01:35:52 +02:00
Tobias K
5e8193456e
Dockerfile, build-docker.yml: Add workaround for failing arm64 container when run via qemu
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2022-05-05 01:30:02 +02:00
Tobias Knöppler
42df5736d6
Add CI/CD workflow for docker integration tests 2022-05-04 22:28:45 +02:00
Tobias K
e69d3c4acb
README.md: Add docker CI/CD tests badge
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2022-05-04 22:26:33 +02:00
Tobias K
98be0220c2
build-docker.yml: Add integration tests for docker images and only push
on success

- build/docker/, build/build-docker.sh: Migrate to multistage docker images
- tests/: Fix tests for GH workflow scenarios
2022-05-04 21:44:56 +02:00
Tobias K
bc13877dc8
ncp-dist-upgrade: Detect availability of bullseye-security package source more robustly
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2022-04-28 21:41:03 +02:00
Matthias Weis
0f05c0197e
add github workflow for automated container builds
* build for tags only
* add docker manifest to support multi arch push to docker hub
2022-04-20 17:10:06 +02:00
Tobias K
b013c046eb
Merge branch 'devel' 2022-04-19 01:32:18 +02:00
Tobias K
afbf651412
dnsmasq, metrics: Fix docker build issues
dnsmasq.sh: Skip systemd-resolved workaround on docker
metrics.sh: Fix service installation on docker

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2022-04-19 01:31:24 +02:00
Tobias K
fef94a2a9d
Add GH workflow for running integration tests against VMs (curl installer + update)
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2022-04-19 00:05:27 +02:00
Tobias K
d9313da25c
Add GH workflow for running integration tests against VMs (curl installer + update) 2022-04-18 21:51:46 +02:00
Tobias K
f3fb20dede
ncp-templates/*: Use is_docker function for docker detection
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2022-04-18 20:10:11 +02:00
Tobias K
07e32739d0
metrics.sh: Fix docker detection issue
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2022-04-18 18:25:29 +02:00
Tobias K
9663ef7f38
system_tests.py: Remove deprecated wicd_curses check
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2022-04-13 11:23:36 +02:00
Tobias K
9563367363
library.sh: Prevent systemd pager from blocking script execution
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2022-04-13 11:01:40 +02:00
Tobias K
a799eec113
Merge branch 'master' into devel 2022-04-12 12:41:27 +02:00
Tobias Knöppler
6b47bfc3cf
Merge pull request #1457 from nextcloud/fix/dist-upgrade-raspbian
ncp-dist-upgrade: Fix invalid target for apt-get on Raspbian
2022-04-11 17:30:26 +02:00
Tobias Knöppler
1f57b10e97
ncp-dist-upgrade: Fix invalid target for apt-get on Raspbian 2022-04-09 15:25:32 +02:00
Tobias Knöppler
2fbb82df85
Merge pull request #1444 from feature/custom-prometheus-exporter
Add custom metrics exporter
2022-04-08 15:09:26 +02:00
Tobias K
d42a0c8cd5
metrics.sh: Reinstall metrics when upgrading
- Upgrade ncp-metrics-exporter to v1.1.0
- Install prometheus-node-exporter-collectors when dist-upgrading from buster

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2022-04-08 15:07:34 +02:00
Tobias K
fa0fbffb04
metrics.sh: Add docker support
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2022-04-08 14:52:36 +02:00
Tobias K
0e694329d2
metrics.sh: Install and manage ncp-metrics-exporter
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2022-04-08 09:36:02 +02:00
Tobias K
9409c115e9
notify_push: Add dependency for redis service
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2022-04-08 09:36:01 +02:00
Tobias K
d9cee78384
ncp-update, update.sh: Inherit DBG flag from install script
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2022-04-08 09:36:01 +02:00
Tobias K
99a3c45592 dnsmasq.sh: Workaround dnsmasq startup failure bug
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2022-03-30 17:19:50 -06:00
nachoparker
cd98b50da7 docker: adjust PHP version in apache config
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2022-03-07 11:36:27 -07:00
nachoparker
21b7fe70f0 SSH: cannot check for default password because of Debian bug #1003151
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2022-03-04 17:13:34 -07:00
nachoparker
f473f737fd nc-hdd-monitor: fix Bullseye service name
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2022-03-04 15:56:39 -07:00
nachoparker
c9610e4d5c ncp-dist-upgrade: fix VM grub-pc issue
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2022-03-03 09:45:14 -07:00
Zendai
062c803d20 ncp-dist-upgrade: add DHCP fix for raspios
Added a sed -i statement that changes the necessary line in /etc/systemd/system/dhcpcd.service.d/wait.conf so DHCP works after a reboot.

Signed-off-by: ZendaiOwl victorray91@pm.me

fix
2022-03-03 09:44:52 -07:00
nachoparker
06ba8a0411 nc-scan: check for maintenance mode enabled
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2022-03-02 14:53:28 -07:00
nachoparker
6245770b1d nc-trusted-domains: dont return 1 if last domain is empty
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2022-03-02 14:53:28 -07:00
nachoparker
a834ba0013 samba: fix usernames with spaces
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2022-03-02 14:53:28 -07:00
Silas Meyer
f8af35b35f nc-datadir: include dotfiles 2022-03-02 14:53:28 -07:00
nachoparker
878f08fa36 upgrade to NC23.0.2
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2022-03-02 14:53:28 -07:00
nachoparker
9bf5ff032c update to Debian 11 Bullseye
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2022-03-02 14:53:24 -07:00
SoongJr
dd8fc3dd7d
fix update from pre-1.46 to post-1.46 not working in docker (#1406)
Signed-off-by: SoongJr <SoongJr@googlemail.com>
2022-01-10 14:25:15 -07:00
nachoparker
bcd850cc3f letsencrypt: fix invalid arithmetic operator error
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-12-13 13:01:39 -07:00
Tobias Knöppler
26a7778d06 notify_push: fix service not restarting on binary update (#1398)
* notify_push: fix service not restarting on binary update

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* notify_push: fix cronjob path and add executable flag

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* notify_push: Don't restart notify_push.service when setting up the update watcher

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2021-12-09 15:44:44 -07:00
nachoparker
5a404c00a9 ncp-previewgenerator: fix app enable in NC22
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-11-29 11:46:08 -07:00
nachoparker
0a4f8c10af ncp-web: fix spurious characters in power menu
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-11-19 11:40:24 -07:00
nachoparker
4717eb334f tweak ncc command
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-11-18 10:07:04 -07:00
nachoparker
0c589ff36f ncp-app: bump to NC22
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-11-17 13:33:14 -07:00
nachoparker
2aa95c657b ncp-previewgenerator: update to NC22
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-11-17 13:33:14 -07:00
nachoparker
340a381926 upgrade to NC22.2.2
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-11-17 13:33:11 -07:00
nachoparker
6aba9b92a6 nc-restore: improve restoring data from SD to docker
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-11-05 13:38:00 -06:00
nachoparker
c56a4db369 ncp-web: hide power menu on docker
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-11-05 13:12:56 -06:00
nachoparker
13f69cda0d ncp-web: tweak invalid character set
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-11-04 13:35:54 -06:00
nachoparker
3118a92cef install: skip dphys-swapfile if BTRFS
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-11-04 13:34:02 -06:00
Malakai
d4bca07240
nc-restore: Adding ZFS to filesystem whitelist / updating error message
Signed-off-by: Kai Boschma <30702097+Malakai13@users.noreply.github.com>
2021-11-04 13:18:46 -06:00
nachoparker
19ede8a659 nc-datadir: support for nc-encrypted folders
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-11-02 17:11:47 -06:00
nachoparker
99a701b18e build: provide 1GiB for the VM
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-11-02 17:11:47 -06:00
nachoparker
ee01a706b1 ncp-web: tweak password suggestions
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-11-02 17:11:47 -06:00
Thomas Heller
a8285767d7
Clarify documentation of nc-previews-auto command (#1370) 2021-10-29 16:44:01 -06:00
nachoparker
7b73d1db5f add nc-encrypt
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-27 15:46:13 -06:00
nachoparker
532a6a8bb6 letsencrypt: sync ncp and nc cert paths
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-27 15:18:57 -06:00
nachoparker
41368fedfc ncp-vm: add automatic testing and change default root password
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-27 15:18:57 -06:00
nachoparker
ccf957fcde small trusted domains refactor
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-27 15:18:55 -06:00
nachoparker
b1e73237da nextcloud-domain: fix variable collision
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-25 10:45:02 -06:00
nachoparker
9ff21bb3fb nc-backup-auto: ncc path
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-23 09:36:36 -06:00
nachoparker
e11ce5960b ncp-web: fix log download bug
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-22 09:35:06 -06:00
nachoparker
3f57513325 ncp-web: add Russion translations
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-21 13:26:24 -06:00
nachoparker
36c1f465fc letsencrypt: disable also ncp web certs if OFF
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-21 12:47:38 -06:00
frazhome
dcfd1cff4a ncp-backup: added help message (#1231)
Co-authored-by: Franz Pfoertsch <franz.pfoertsch@gmail.com>
2021-10-18 12:11:35 -06:00
nachoparker
ec94e6fb80 nc-static-IP: use ifdown/ifup
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-18 12:00:33 -06:00
nachoparker
f9c9e37a88 fail2ban: fix UFW jail
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-18 12:00:03 -06:00
nachoparker
326de1d085 fix dual IPv6 stack port checking
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-18 11:24:01 -06:00
nachoparker
d12b30c7eb build: check for existing NC database
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-18 08:34:47 -06:00
nachoparker
78a88ebb47 ncp-web: remove dir indicator on nc-backup
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-18 08:34:43 -06:00
nachoparker
06ffb1eecd nc-static-IP: make sure dhclient is no longer running
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-18 08:09:10 -06:00
nachoparker
74ed53f2de letsencrypt: hardcode cert name to avoid -0001 paths
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-18 08:01:49 -06:00
nachoparker
0a866caca4 save and restore maintenance mode status in ncp-apps
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-18 08:01:48 -06:00
nachoparker
80575ae849 ncp-update-nc: check skip major versions
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-18 08:01:25 -06:00
nachoparker
cf4cfd81a8 also save hostname in trusted domains
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-15 09:01:20 -06:00
nachoparker
c75db63260 letsencrypt: take into account the possibility of the ncp-nextcloud folder being used
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-14 13:48:40 -06:00
nachoparker
b41fad0b94 ncp-web: add NCP logs section
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-14 13:47:55 -06:00
nachoparker
85cb1f01cc nc-import-ncp: run activated apps upon import
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-14 11:08:07 -06:00
nachoparker
35a3a54845 letsencrypt: favor most recent cert if there are many
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-14 11:08:05 -06:00
nachoparker
9bddfad805 fix HPB with dynamic IP
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-14 10:24:16 -06:00
nachoparker
4e790e4e9e letsencrypt: fix template generation
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-14 10:24:16 -06:00
nachoparker
d2983a16ea build: fix OdroidC2 build
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-11 15:56:04 -06:00
Oliver V
b64859e237 add architecture and kernel info to ncp-info (#1360) 2021-10-11 15:56:03 -06:00
nachoparker
f3fda8f948 build: refactor
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-11 15:55:47 -06:00
nachoparker
76fbf5038e build: fix rpi build
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-11 15:55:47 -06:00
nachoparker
891dc86c05 update README
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-11 15:55:47 -06:00
nachoparker
cc3f3366f1 letsencrypt: keep original cert name
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-11 15:55:33 -06:00
nachoparker
9c9ae91a3f
Update README.md 2021-10-11 14:49:01 -06:00
Tobias Knöppler
de104a5da8 Make templating safer and more verbose (#1343)
* letsencrypt: fix active status check

Signed-off-by: nachoparker <nacho@ownyourbits.com>

* letsencrypt: take into account duplicate domains ending in -0001

Signed-off-by: nachoparker <nacho@ownyourbits.com>

* letsencrypt: fix renewal with httpsonly enabled

Signed-off-by: nachoparker <nacho@ownyourbits.com>

* fix inverted template logic for docker

Signed-off-by: nachoparker <nacho@ownyourbits.com>

* library.sh: Move templating to separate function

- Backup old file before templating (and restore on failure)
- Use stderr in the template for debug/info output

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* library.sh: Fix syntax error

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* library.sh: Only fallback to default config if explicitly allowed

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* letsencrypt.sh: Set cert-name

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* nextcloud.conf.sh: Use certificate named ncp-nextcloud if available

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* letsencrypt.sh: Support multiple, comma separated domains in field "OTHER_DOMAIN"

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* nextcloud.conf.sh: Fix path resolution for certificates

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* letsencrypt.sh: Improve warning about max trusted domains reached

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* letsencrypt.sh: Fix max trusted domains check

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* letsencrypt.sh: Fix splitting of domain string by comma

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* letsencrypt.sh: Fix splitting of domain string to array

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* adjustments for docker/lxc

Signed-off-by: nachoparker <nacho@ownyourbits.com>

Co-authored-by: nachoparker <nacho@ownyourbits.com>
2021-10-07 13:29:00 -06:00
nachoparker
8a6c1c08a2 ncp-check-nc-version: dont notify the same version more than once
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-07 13:28:50 -06:00
nachoparker
9e276600e6 build: add LXD/docker automatic testing
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-06 12:08:28 -06:00
nachoparker
fde2f73cfc build: rpi build fixes
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-06 09:55:42 -06:00
nachoparker
ea1e00c251 nc-update-nc: BTRFS support
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-05 13:50:37 -06:00
Christoph Rössig
7c361c5cb4
update: improve check for apt (#1356)
fix check for running apt during update
(https://github.com/nextcloud/nextcloudpi/issues/1354)

Update script is exiting if any process contains 'apt' in the name. pgrep interpretes <pattern> as regular expression. Whole process name to be checked with option -x.
2021-10-05 13:26:26 -06:00
nachoparker
31f20bcb25 build: close mysql inside the configure step
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-05 12:44:47 -06:00
nachoparker
a0728d7487 nc-notify-updates: notify of new supported NC versions
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-04 15:13:02 -06:00
nachoparker
20370640c7 ncp-web: disable activation page once activated
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-04 14:06:39 -06:00
nachoparker
714c3e5fa7 ncp-config: fix first time error with no known latest version
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-04 12:29:55 -06:00
nachoparker
05f0d352cf ncp-web: fix upload from local file path
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-30 22:49:54 -06:00
nachoparker
26edf1f7b0 build: add LXC/LXD support
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-30 22:48:19 -06:00
nachoparker
f1c90f543d nc-httpsonly: always use overwriteprotocol https in all cases
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-30 12:29:37 -06:00
nachoparker
c037c11dfc add bash completion to ncc
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-29 20:07:56 -06:00
nachoparker
2be666b1f5 nc-https: proto logic was inverted fix
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-27 18:32:02 -06:00
nachoparker
b067844550 add get_ip function
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-27 18:27:44 -06:00
nachoparker
6ad96eddd3 nc-https:only fix infinite redirects behind proxy
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-25 12:58:03 -06:00
nachoparker
eef7b096bf ncp-web: make letsencrypt detection more robust
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-23 10:30:13 -06:00
nachoparker
814569be56 fix junk in overwrite.cli.url because of Redis not being yet ready
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-22 09:38:28 -06:00
nachoparker
4039da90a9 letsencrypt: take into account duplicate domains ending in -0001
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-22 09:18:45 -06:00
nachoparker
2b51476630 fix inverted template logic for docker
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-22 00:48:57 -06:00
nachoparker
a4851dcd31 letsencrypt: fix renewal with httpsonly enabled
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-22 00:48:57 -06:00
nachoparker
1046a2413b letsencrypt: fix active status check
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-22 00:48:56 -06:00
nachoparker
98976c91b3 dont update config if Redis is not yet ready
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-22 00:48:06 -06:00
nachoparker
534b9b505d ncp-update-nc: pre-check that NC is currently working fine
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-20 09:59:35 -06:00
nachoparker
cb184d2bde ncp-update-nc: dont keep notifying when there is nothing to upgrade
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-20 09:59:35 -06:00
nachoparker
311cd2b769 improve btrfs/ext checks
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-20 09:59:35 -06:00
nachoparker
f3e3b01ab5 letsencrypt: improve active status check
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-20 09:59:35 -06:00
nachoparker
110311fef6 nextcloud-domain: make sure redis is running before it starts
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-20 09:59:32 -06:00
nachoparker
6290c1f472 nc-static-IP: take into account httpsonly
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-13 14:07:06 -06:00
nachoparker
c10d4bd8fb upgrade to NC21.0.4
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-12 16:55:46 -06:00
nachoparker
3bf746bad0 raspi: allow oldstable origins
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-08-25 14:59:04 -06:00
nachoparker
e23b252f92 nc-init: drop News for 32-bit :(
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-08-17 09:57:12 -06:00
nachoparker
bb720be490 build: make sure we clean /.ncp-image in old builds
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-08-17 07:49:19 -06:00
nachoparker
9642cf91d4 unattended-upgrades: update raspbian origins
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-08-17 07:47:17 -06:00
nachoparker
956eea4624 nc-restore: try to detect old datadir in dataless restoration
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-08-16 20:41:14 -06:00
Tobias K
4f29d94a02
nextcloud.conf.sh: Prevent apache config test output to end up in generated template
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2021-08-16 21:26:08 +02:00
nachoparker
6e2dca5d52 upgrade to NC20.0.12
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-08-09 17:37:34 -06:00
nachoparker
b8c14093ad letsencrypt: ability to disable it and roll back to self-signed certificates
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-08-09 17:25:55 -06:00
nachoparker
5a05b8990f nextcloud: remove beta option
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-08-09 17:16:38 -06:00
rababerladuseladim
6aefb5de1c remove unused USER variable from ncp apps nc-notify-updates and nc-update-nc-apps-auto (#1307)
* remove unused USER variable

Signed-off-by: Henning Schiebenhoefer <henning.schiebenhoefer@posteo.de>

* remove unused USER variable

Signed-off-by: Henning Schiebenhoefer <henning.schiebenhoefer@posteo.de>
2021-08-09 17:16:38 -06:00
schoetju
1d696f0678 nc-backup-auto.sh: don't smash ncp.log
append to log instead of clearing it
see https://github.com/nextcloud/nextcloudpi/issues/1232#issuecomment-891524543
2021-08-09 17:16:38 -06:00
Tobias K
fa1c0c7f81 nextcloud_tests.py: Fix detection of non-critical warnings
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2021-08-09 17:16:38 -06:00
Tobias K
f93c183ecc nextcloud_tests.py: Ignore warning about unset default phone region
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2021-08-09 17:16:38 -06:00
Tobias K
b8402459b1 metrics.sh: Fix inverted is_active result
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2021-08-09 17:16:38 -06:00
Tobias K
fb102d233c metrics.sh: Fix USER variable being ignored
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2021-08-09 17:16:38 -06:00
Tobias K
e49203249b nextcloud.conf.sh: Allow any user name for metrics endpoint and fix docker build
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

nextcloud.conf.sh: Fix apps overwriting each other during templating

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

nextcloud.conf.sh: Make --default mode failsafe (don't expect apps to be installed)

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

nextcloud.conf.sh: Allow any user name for metrics endpoint

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

nextcloudpi/Dockerfile: Copy the templates directory to the container

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

lamp/Dockerfile: Copy the templates directory to the container

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

install.sh: Ensure templates are available before executing nc-nextcloud.sh

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2021-08-09 17:16:35 -06:00
Tobias Knöppler
b8a990e264
Add ncp-app for prometheus (system) metrics
* metrics.{sh,cfg}: Implement ncp-app for prometheus (system) metrics

letsencrypts.sh, nc-nextcloud.sh, nextcloud.conf.sh: Introduce templating/generator concept to allow multiple ncp apps to edit the same file without conflicts

library.sh: Add convenience function find_app_param

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* letsencrypt.sh: Remove commented code

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* metrics.cfg: Deactivate by default

- Add title, description and remove TODO entries

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* metrics.sh: Restart apache after enabling proxy_http

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* update.sh: Update ncp-templates directory during updates

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* update.sh: Copy ncp-templates directory, not just its content

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* metrics.sh,update.sh: Disable metrics in docker for now

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* metrics.sh: Disable prometheus-node-exporter via systemctl

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* metrics.sh: Move apache mod configuration to updates

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* metrics.cfg: Remove invalid parameter type

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* metrics.sh: Create /etc/default/prometheus-node-exporter via heredoc

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* nextcloud.conf.sh: Prevent template parsing error if metrics.sh is disabled (i.e. on docker)

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* metrics.cfg: Add info directing users to my preconfigured ncp dashboard

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* Various fixes

- metrics.sh: Fix is_active function always returning 1
- metrics.sh: Fix apache2 reload potentially interrupting web ui
- nc-nextcloud.sh: exit if nextcloud.conf templating fails
- various readability and code style improvements

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* letsencrypt.sh: Use consistent return codes in tmpl_letsencrypt_domain

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* nextcloud.conf.sh: Remove obsolete return code escape

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* nextcloud.conf.sh: Ensure that the snakeoil self-signed cert exists before enabling it

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* updates/1.36.4.sh: Reload apache in the background instead of restarting it blockingly

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2021-08-02 15:12:56 -06:00
nachoparker
4300e30d78 unattended-upgrades: update raspbian origins
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-07-31 20:38:17 -06:00
Tobias K
7660530a4e nextcloud_tests.py: Don't fail if the only warning is the missing imagick php module
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2021-07-28 22:42:19 -06:00
Tobias K
1cb8580cd6 ncp-update: Fix failure to determine latest version in some cases
ncp.sh: Make branch configurable

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2021-07-28 22:42:19 -06:00
nachoparker
b1ffd709da ncp-app: bump to NC21
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-07-26 21:02:57 -06:00
nachoparker
b837403a7c build: fix docker build /etc/hosts
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-07-26 21:02:50 -06:00
nachoparker
665ed28ae6 build: trap and curl installer fixes
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-07-25 14:59:07 -06:00
nachoparker
effdd6cdb3 upgrade to NC20.0.11
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-07-25 07:23:48 -06:00
Tobias K
33067ddfde
activation_tests, nextcloud_tests: Make ports configurable 2021-07-07 15:41:30 +02:00
nachoparker
7b809d114b ncp-web: fix port checking for IPv6 dual stack
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-06-02 13:57:42 -06:00
nachoparker
1a8ac71543 ncp-web: fix port checking
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-05-12 21:49:42 -06:00
nachoparker
bd0c23d9f9 build: bail out upon any error in docker builds
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-05-12 21:49:42 -06:00
nachoparker
67aa5994d6 lamp: allow only TLSv12 and TLSv13
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-05-12 21:49:42 -06:00
Huizerd
7aef967f09 Namecheap dynamic DNS client
Signed-off-by: Huizerd <15855769+Huizerd@users.noreply.github.com>
2021-05-12 21:49:42 -06:00
nachoparker
8d76a6b849 ncp-web: fix display of big files for 32 bit
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-05-12 21:49:42 -06:00
nachoparker
0ee3aa9186 ncp-web: fix backup download for big files in 32-bit
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-05-12 21:49:39 -06:00
nachoparker
be30663c7a upgrade to NC20.0.8
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-02-27 08:09:03 -07:00
nachoparker
ffe332ccfb docker: tag multi-arch images as well
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-02-27 08:07:47 -07:00
Leandro Lucarella
7d15924c8c nc-autoupdate-ncp: Append to log instead of replace
Signed-off-by: Leandro Lucarella <luca@llucax.com>
2021-01-20 06:54:05 -07:00
lixin
b1a9617a1e Improve documentation
update English doc, optimize the directory structure, add simplified Chinese translation

Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-01-20 06:52:15 -07:00
nachoparker
abf668d6b4 update: cleanup
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-01-20 06:48:00 -07:00
nachoparker
117b8ea9d9 nc-automount: udiskie verbose output
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-01-20 06:47:08 -07:00
nachoparker
b978184ce6 docker: fix datadir path contents
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-01-19 17:25:32 -07:00
nachoparker
84ccf94af7 docker: fix datadir path
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-01-18 22:09:16 -07:00
nachoparker
afa39fb6e7 ncp-config: shorten descriptions
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-01-18 22:08:47 -07:00
nachoparker
3a3b6a7042 btrfs-sync: check for existing keys
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-01-17 20:11:09 -07:00
nachoparker
6cb682abe2 update cron interval
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-01-17 20:11:06 -07:00
nachoparker
20bd14fe7b wizard: fix letsencrypt empty email
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-01-17 20:02:26 -07:00
nachoparker
5a16d57cf5 build: add odroid HC4, C2, C4
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-01-17 16:40:36 -07:00
nachoparker
23eecffd1d unattended-upgrades: fix raspbian origin
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-01-01 14:34:55 -07:00
nachoparker
ec428a288f upgrade to NC20.0.4
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-01-01 13:56:35 -07:00
nachoparker
82d00c8a61 ncp-config: fix empty values
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-01-01 13:56:09 -07:00
nachoparker
42fd597e8b nc-update-nc: improve error messages
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-12-12 19:48:22 -07:00
nachoparker
ffd0b449e1 upgrade to NC20.0.3
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-12-10 09:28:48 -07:00
nachoparker
e9e51fae47 build: only use latest docker tag
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-12-10 09:27:51 -07:00
nachoparker
4ec894ad28
Update README.md 2020-12-09 21:52:44 +00:00
nachoparker
8743cd1a85 update README
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-12-03 00:26:14 -07:00
nachoparker
35c0d96d0b nc-update-nc: ncp apps might not exist
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-11-30 20:19:51 -07:00
nachoparker
7afdc0fe8d upgrade to NC20.0.2
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-11-27 14:54:46 -07:00
nachoparker
a335b5e2bf build: use 64bit RaspiOS image
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-11-27 14:54:36 -07:00
nachoparker
92156694f6 pre-initialize docker image
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-11-27 14:54:34 -07:00
nachoparker
ab9184cadd upgrade to NC19.0.4
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-10-19 19:00:37 -06:00
dsmic
945061311b nc-info: fixed api change for portchecker (#1194)
Signed-off-by: detlef <ds2@physik.de>
2020-10-19 18:55:53 -06:00
nachoparker
f00fe2105e upgrade to NC19.0.2
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-09-19 14:11:24 -06:00
Daadii
82baebf070 ncp-web: added a lot of german locales 2020-09-19 14:07:38 -06:00
nachoparker
3706ed0c7a nc-previews: fix killing generate-all
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-09-12 11:12:12 -06:00
nachoparker
9d65011e84 nc-restore: also set tempdirectory
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-09-07 18:34:52 -06:00
nachoparker
21a791db98 nc-limits: minimum 6 PHP threads (for NC talk)
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-08-30 17:57:27 -06:00
Giuseppe C
c143accdfc do not hsts preload by default, only serve hsts header over https
Signed-off-by: Giuseppe C <AvverbioPronome@users.noreply.github.com>
2020-08-30 17:27:35 -06:00
nachoparker
c506b22f9e build: make sure we dont include wizard.cfg
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-08-30 17:22:15 -06:00
Florian Wallner
14b78e372b ncp-web: Fix the style of the language selection dropdown (chrome)
If the selection is active the background color as well as the color was white and therefore the language options were unreadable.
Fix by setting the color to white only if selection is not active.

Signed-off-by: Florian Wallner <florian.wallner@exxcellent.de>
2020-08-30 14:38:48 -06:00
nachoparker
34e84bab94 ncp-web: fix initial screen displaying all sections
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-08-30 14:38:08 -06:00
nachoparker
17aae5640c ncp-update-nc: check for ncc commands before using them
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-08-30 14:12:26 -06:00
Brooks
76ffaec83c nc-static-IP: Restricting gateway to one
Signed-off-by: Brooks <603632+bmbeverst@users.noreply.github.com>
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-08-30 08:35:08 -06:00
nachoparker
3cf269a305 upgrade to NC19.0.2
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-08-29 09:05:40 -06:00
Leandro Lucarella
4c5b207bbd
ncp-backup-auto: fix exit status for cron
Signed-off-by: Leandro Lucarella <luca@llucax.com>

* Update bin/ncp/BACKUPS/nc-backup-auto.sh

Co-authored-by: nachoparker <nacho@ownyourbits.com>
2020-08-02 11:08:30 -06:00
nachoparker
81fcd1483a ncp-autoupdate-apps: dont fail cron if no updates
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-08-02 10:44:10 -06:00
nachoparker
06017a4bcf nc-limits: adjust db size
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-08-02 10:34:08 -06:00
nachoparker
dda010bed4 nc-ramlogs: pin version
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-08-02 09:57:57 -06:00
nachoparker
99cfe9bc87 upgrade to NC18.0.7
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-07-23 16:58:40 -06:00
nachoparker
3c96d2eed3 upgrade to NC18.0.6
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-07-05 20:25:53 -06:00
Leandro Lucarella
337ffeb1c5 ncp-autoupdate: cronjob write to the log only (#1144)
Cronjobs should not have any output, unless the cronjob fails, otherwise
an e-mail notification is sent with the output. This cronjob in
particular is also reporting results via Nextcloud notification, so
having an e-mail with logs saying the same as the notification is not
particularly useful. Instead we just redirect all output to the
/var/log/ncp.log so the user can debug in case of problems and doesn't
receive spurious e-mails when all works fine.

Signed-off-by: Leandro Lucarella <luca@llucax.com>
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-06-13 09:22:44 -06:00
nachoparker
4e7938650f ncp-web: fix port checking
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-06-13 08:56:10 -06:00
nachoparker
aedd8f0f9e upgrade to NC18.0.5
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-06-11 19:23:40 -06:00
nachoparker
ed3619fc3b upgrade to NC18.0.4
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-04-24 17:51:31 -06:00
nachoparker
1c45e0dadf ncp-web: cache backup info
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-04-18 15:54:04 -06:00
nachoparker
ff565d6fbc build: small tweaks
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-04-06 00:49:47 -06:00
nachoparker
ae6c88f8d1 nc-backup-auto: fix notify_admin
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-04-06 00:49:20 -06:00
nachoparker
3a5769bdb4 nc-init: add indices after installing apps
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-03-27 10:46:47 -06:00
nachoparker
35de05a73d build: fix post-inst
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-03-26 09:35:23 -06:00
nachoparker
a3dbec1b69 upgrade to NC18.0.3
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-03-24 11:03:58 -06:00
nachoparker
0a97f77691 lamp: disable old TLS versions
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-03-22 21:27:22 -06:00
nachoparker
84e6b4ea6b ncp-web: check for possibly missing index
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-03-15 22:38:23 -06:00
nachoparker
d108fad254 upgrade to NC18.0.2
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-03-15 22:23:50 -06:00
nachoparker
c09dfd9c84 nc-snapshot-auto: read datadir location during execution
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-03-15 22:23:50 -06:00
nachoparker
f71c8c864f nc-maintenance: add is_active
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-03-15 22:23:50 -06:00
Tobias K
c49c3900be samba: option to apply only to a NC group (#1048)
Signed-off-by: Tobias Knöppler

Co-authored-by: nachoparker <nacho@ownyourbits.com>
2020-03-15 22:23:45 -06:00
paschaef
9304c86a03 Add nc-trusted-proxies (#1094)
Signed-off-by: paschaef <45995338+paschaef@users.noreply.github.com>
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-03-02 18:31:56 -07:00
nachoparker
4a51c1f5e8 upgrade to NC18.0.1
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-02-29 20:03:11 -07:00
nachoparker
f066b03aca redis: make sure we have the right permissions for conf file
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-02-28 00:29:46 -07:00
Haraade
c0cee6bce6
fail2ban: fix regex for NC18 2020-02-12 01:18:15 +00:00
nachoparker
0c538aef3c add notify_admin functionality
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-02-04 20:29:03 -07:00
Oliver V
986046f51f
nc-backup: add more info to description (#1073) 2020-02-05 02:45:31 +00:00
Georgiy Sitnikov
b404765e7a fail2ban: update regex for NC17
Fix for #1065 based on https://gist.github.com/GAS85/957e0b1a4f30120225a7be09b173eb24
2020-01-26 16:17:39 -07:00
Tobias Knöppler
4a99207a74 ncp-config: dont save passwords
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-01-21 20:11:02 -07:00
nachoparker
3af0c46516 build: update armbian branches
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-01-21 20:10:06 -07:00
nachoparker
a98baee67f update: fix case where there is no current version file
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-01-18 20:02:57 -07:00
budulinek
e0ae40b8db Add user only if it does not exist. (#1059)
If user already exists, useradd ends with error and terminates the whole instalation process.
2020-01-19 02:22:57 +00:00
nachoparker
6359ca307d nc-ramlogs: disable armbian-ramlog when inactive
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-01-14 09:40:24 -07:00
Florian Wallner
953c47a0e5 Extend the ssh configuration check by calling the echo command if the first check fails.
Signed-off-by: Florian Wallner <florian.wallner@exxcellent.de>
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-12-31 16:10:34 -07:00
nachoparker
13e4208d87 build: fix VM image name
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-12-30 15:34:24 -07:00
nachoparker
6d0bc6bbd9 Revert "build: dont use empty values by default"
This reverts commit da3c94933893e6b359b01b9609a376a79b083819.
2019-12-20 20:20:23 -07:00
nachoparker
f854afaba1 armbian: fix distro build
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-12-20 20:18:40 -07:00
nachoparker
f75c415214 upgrade to NC17.0.2
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-12-19 10:55:48 -07:00
nachoparker
0bb61d7bf2 update: fix missing theme
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-12-08 17:47:35 -07:00
nachoparker
f9deb25aa0 pre-generate: fix permissions
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-12-08 14:50:30 -07:00
nachoparker
ad5b47058b pre-generate: avoid upstream updating over this
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-12-08 11:57:29 -07:00
nachoparker
62e1da72ab nc-scan-auto: reduce logging verbosity
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-12-08 10:16:47 -07:00
nachoparker
72d2d00f74 upgrade to NC17.0.1
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-12-08 10:01:43 -07:00
nachoparker
9fb8468e97 ncp-app: bump to NC17
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-11-30 08:47:14 -07:00
nachoparker
c42bcc1738 update: fix matching values
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-11-30 08:47:14 -07:00
rababerladuseladim
310877f61c Letsencrypt: support second domain (#1025) 2019-11-30 08:47:14 -07:00
Nikolaos Perrakis
a208a02a53 Fix for reappearing opcache bug. (#1031)
Signed-off-by: Nikolaos Perrakis <nikperrakis@gmail.com>
2019-11-30 08:46:53 -07:00
Matthias Weis
3562d91566 docker: fixing file permission for redis config (#1021)
Signed-off-by: Matthias Weis <matthias1.weis@web.de>
2019-10-31 23:00:41 +00:00
nachoparker
0fc23905c0 add ncp-previews
Signed-off-by: nachoparker <nacho@ownyourbits.com>

add ncp-previews

Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-10-27 21:35:12 -06:00
nachoparker
f23d6c6bf9 install: make sure we have lsb-release
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-10-27 18:37:48 -06:00
nachoparker
cb476b8fbd install: tweak check_distro
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-10-06 14:01:32 -06:00
nachoparker
c63cb274e9 nc-backup: exclude group folders in dataless backup
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-09-29 14:45:24 -06:00
nachoparker
05e78cc5eb upgrade to NC16.0.5
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-09-28 16:46:31 -06:00
nachoparker
46b2187980 fix apt stuck in interactive conf file dialog
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-09-28 16:45:43 -06:00
nachoparker
f885861ada unattended-upgrades: fix armbian disabling UU
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-09-16 20:46:23 -06:00
Nikolaos Perrakis
9ee9947250 Increased modsecurity bodynofileslimit so larger files can be synced (#993)
Signed-off-by: Nikolaos Perrakis <nikperrakis@gmail.com>
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-09-13 13:52:14 -06:00
nachoparker
dbf129fb7f nc-datadir: fix
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-09-13 13:51:39 -06:00
nachoparker
789f0b58d7 nc-datadir: make sure dir exists before check
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-09-12 14:28:18 -06:00
nachoparker
4bd06e6c13 fail2ban: dont need ufw check in docker
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-09-12 09:32:18 -06:00
nachoparker
f4ee2af47d fail2ban: fix missing ufw filter for old images
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-09-10 11:39:00 -06:00
nachoparker
9c8b990a4c update: fix distro check detection
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-09-10 10:31:41 -06:00
nachoparker
c1e1b65616 install: fix possible missing PATH
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-09-09 21:48:10 -06:00
nachoparker
06005e12e9 nc-datadir: avoid using the symlink
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-09-09 21:32:16 -06:00
nachoparker
a875faabe2 bookmarks: install php-gmp
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-09-09 21:31:55 -06:00
OlafBr
f4b4a659b5 custom code before/after auto-backup
Signed-off-by: OlafBr 18134858+OlafBr@users.noreply.github.com
2019-09-06 10:30:04 -06:00
benne
fd2b74bdff Add missing port in nc-rsync-auto.sh (#983)
Co-Authored-By: nachoparker <nacho@ownyourbits.com>
2019-09-05 13:19:32 -06:00
nachoparker
1a367a65f1 upgrade to NC16.0.4
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-09-05 13:19:32 -06:00
David Hilton
954366ef75 make sure ufw.log always exists for fail2ban (#937)
* make sure ufw.log always exists for fail2ban
2019-09-05 13:19:32 -06:00
Oliver V
bf30c4febd add warning to add LABEL when formating
The importance of this seems to be unclear to users, because they clearly don't read docs.
I commit directly to devel, thinking you'd agree ;-) I would have used create new branch if not.
2019-09-05 13:19:32 -06:00
nachoparker
d17fe03fb9 build: fix changed log2ram path
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-08-23 19:53:47 -06:00
nachoparker
3a3b709fd9 nc-previews: tweak config
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-08-18 15:34:25 -06:00
nachoparker
8b8779f650 fix armbian sources
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-08-18 15:33:41 -06:00
nachoparker
80fd18cd99 update README
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-08-03 21:59:10 -06:00
nachoparker
779514b767 build: fix armbian activation
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-08-01 10:33:03 -06:00
nachoparker
bcef6bf36d nc-snapshot: update btrfs-snp
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-07-24 17:55:10 -06:00
Zaoqi
1bf610f3b7 Update README-ZH-TW.md (#941)
* Update README-ZH-TW.md
2019-07-24 23:38:56 +00:00
nachoparker
e30271f96f armbian: fix distro check
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-07-24 17:26:05 -06:00
violoncello.ch
2fb7225d28
fix wrong dash in sudo ncp-report 2019-07-21 23:47:05 +02:00
nachoparker
ef98253dd1 armbian: fix build
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-07-21 07:36:52 -06:00
nachoparker
31f7e52d9b update: fix distro check detection
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-07-20 10:46:34 -06:00
nachoparker
212bd467ab update: restore smbclient after dist upgrade
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-07-20 10:46:34 -06:00
nachoparker
5bc9057377 update: remove dist upgrade notification after upgrade
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-07-20 10:46:33 -06:00
langfingaz
03713d6b0b docker: Remove Expose Ports (#946)
If you start an docker image via docker or docker-compose all ports which are exposed through inside the Dockerfile are always opened! The user cannot disable it.

See "sudo docker ps" after starting nextcloudpi-docker: Ports 80, 443 and 4443 are always exposed on the host.

This even bypasses the UFW setup on the host system as docker directly modifies the ip tables. There exist some issues on the Docker repo discussing this problem. But the easiest "workaround" is not to force-expose any ports.

Launching the Docker image normally or via docker-compose should not be affected. If the user has for example "ports: \n - 80:80 \n - 443:443 \n - 4443:4443" included in his compose file, he won't notice this change.

What do you think of this? Is there any reason for not being able to expose the ports?

Greetings,
Daniel
2019-07-20 10:46:33 -06:00
nachoparker
7663a90275 exclude versions, trash, uploads from backups
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-07-20 10:46:33 -06:00
nachoparker
404907f922 raspi: fix dhcp bug
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-07-20 10:46:27 -06:00
nachoparker
e4bd5feb66 move to buster/PHP7.3
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-07-18 03:55:39 -06:00
nachoparker
68b3f8a9b5 nc-previews: active by default
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-07-08 05:48:50 -06:00
nachoparker
e74290d45e update: add distro migration step
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-07-08 05:18:05 -06:00
qrest
95a658f3fb build: do not enable NCP app (#940)
Signed-off-by: qrest <qrest@protonmail.com>
2019-07-06 23:14:01 +00:00
nachoparker
85ebb39c26 nc-snapshot-sync: update btrfs-sync
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-07-06 15:42:33 -06:00
nachoparker
53d02fe96d nc-hdd-monitor: fix detection
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-07-06 14:48:54 -06:00
nachoparker
e3cab9b118 update: fix for non docker images
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-07-05 21:49:18 -06:00
nachoparker
fa9ddcad8d upgrade to NC16.0.2
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-07-05 21:43:58 -06:00
qrest
aaeef7eaf8 update: copy NCP app to nextcloud directory (#936)
Signed-off-by: qrest <qrest@protonmail.com>
2019-07-05 21:43:58 -06:00
nachoparker
6abf09f571 build: no-ip cleaning workaround no longer needed
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-07-05 21:43:58 -06:00
nachoparker
521c03ff95 build: dont include imagick
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-07-05 21:43:58 -06:00
nachoparker
35526ab9fc build: use a system wide config file. Remove sury sources
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-07-05 21:43:54 -06:00
nachoparker
88da901edd ncp-update: fixes on the new step based upgrade system
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-06-29 16:22:16 -06:00
FaniD
2aa28d22a7 ncp-update: implement step based upgrade 2019-06-29 15:20:28 -06:00
nachoparker
fbdab43b96 ncp-web: adjust ipv6 local restrictions
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-06-29 15:16:06 -06:00
nachoparker
ce4477c8a4 nc-previews: adjust preview sizes
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-06-29 15:14:46 -06:00
theGreatWhiteShark
0701949f01 spDYN: remove unused IPV6 argument in spDYN.sh
Signed-off-by: theGreatWhiteShark <thetruephil@googlemail.com>
2019-06-23 20:41:58 -06:00
nachoparker
c39252919f nc-backup: fix exclusion of ncp backups
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-06-17 17:07:34 -06:00
nachoparker
c7c17f4e8a update links in CONTRIBUTING.md
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-06-17 17:06:33 -06:00
Tanarri
775582e851 nc-automount: Update description (#925) 2019-06-17 22:56:38 +00:00
Fani Dimou
34b548548e Update build-docker.sh (#918)
Tag docker images debian-ncp, lamp and nextcloud so
that they correspond to the respective images being
pushed to DockerHub inside batch.sh. (amd64->x86,
arm64v8->arm64). Also, fix ncp_tag to get value of
arch var correctly.
2019-06-08 23:50:50 +00:00
nachoparker
81ca69a058 fix upgrade
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-06-04 05:36:03 -06:00
nachoparker
5de855ffec ncp-web: avoid quotes in fields
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-06-01 15:43:15 -06:00
nachoparker
86f14ae2a7 upgrade to NC15.0.8
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-06-01 11:21:29 -06:00
nachoparker
5924131f6f fail2ban: fix missing ufw filter
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-06-01 11:17:56 -06:00
nachoparker
c71b37f2b7 ncp-notify-updates: dont spam cron mail
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-05-27 17:56:48 -06:00
nachoparker
bfdc47548e docker: mount timezone
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-05-25 19:41:10 -06:00
nachoparker
76137edb72 ncp-app: bump to NC16
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-05-25 19:36:41 -06:00
nachoparker
da09dc9811 fail2ban: add a ufw jail and filter (dmaroulidis)
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-05-25 19:07:08 -06:00
nachoparker
30c0f57f68 ncp-web: update config reference URL
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-05-25 19:03:40 -06:00
DjackRocha
c8d6222b12 ncp-web: Pt Translate (#907)
* Some Pt Translate

Signed-off-by: juaryR <jrochamindelo@gmail.com>

Some Pt Translate

* Correções e novas traduções. Todos os arquivos traduzidos.

Signed-off-by: bootbL <chrisroos14@gmail.com>

Correções e novas traduções. Todos os arquivos traduzidos.
2019-05-25 18:49:36 -06:00
nachoparker
3b36dd3752 build: refactor docker builds
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-05-12 21:31:38 -06:00
nachoparker
d9384817c2 nc-scan-auto: recursive and home-only options
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-05-11 11:14:19 -06:00
nachoparker
758908128a fix logrotate files 2019-05-11 11:13:52 -06:00
Hofer-Julian
1be5ddda1d Rename configuration variables into self-documenting ones (#889) 2019-05-01 01:41:08 +00:00
nachoparker
f34354c336 ncp-web: add backups panel 2019-04-30 18:02:58 -06:00
nachoparker
01cd4215a5 letsencrypt: force renewal by default 2019-04-29 19:59:02 -06:00
nachoparker
b3c7d1375e letsencrypt: switch to apt version 2019-04-29 19:57:40 -06:00
nachoparker
02efd614fd nc-restore: check btrfs command 2019-04-29 19:57:40 -06:00
PanagiotisS
4a0885c0a6 Replace links from github wiki to docs.nextcloudpi.com (#881) 2019-04-29 19:57:40 -06:00
chiyi4488
515c7b71f9 update Readme zh-tw (#882)
* Update README-ZH-TW.md

Signed-off-by: chiyi4488 <chiyi4869@gmail.com>

* Update README-ZH-TW.md

Signed-off-by: chiyi4488 <chiyi4869@gmail.com>
2019-04-13 14:42:15 +00:00
nachoparker
37546093a6 armbian: fix uu 2019-04-06 07:51:55 -06:00
nachoparker
a712935c6d nc-backup: fix space calculation 2019-04-05 01:09:59 -06:00
nachoparker
5dedeafa39 upgrade to NC15.0.6 2019-04-05 00:47:51 -06:00
nachoparker
a6e33b104c update UPDATE config section 2019-04-05 00:47:25 -06:00
nachoparker
c775a46b3f cleanup update.sh 2019-04-05 00:22:25 -06:00
nachoparker
194d11101b create UPDATE config section 2019-04-04 19:28:33 -06:00
paschaef
b11c13e531 nc-backup: improve needed space calculation (#864) 2019-04-04 19:21:46 -06:00
nachoparker
5af854b0d6 letsencrypt: dont return error if notif fails 2019-04-01 18:06:16 -06:00
nacho
e2da70e179 nc-restore: adjust path 2019-04-01 18:03:51 -06:00
nachoparker
c18273a0f6 nc-backup: fix space calculation 2019-04-01 18:03:51 -06:00
Tanarri
41a4e84a3e nc-restore: Check for free space in $TMPDIR before extracting tar file 2019-04-01 18:03:35 -06:00
Oliver V
29429f0c42 nc-passwd: clarify usage
Found a few reference https://github.com/nextcloud/nextcloudpi/issues/155
to issues with special characters in passwords, also with german umlaut ".
Which ones are sanitized? and need to be added to "info" or should it be in "description"?
I will also add it to Config-Reference, once established which characters to avoid ;-)
2019-04-01 18:03:35 -06:00
Tanarri
dec80d87af Adjust naming of "data dir" to "data directory" to be consistent (#869) 2019-03-31 20:22:22 -06:00
Tanarri
c0bad9c1ac nc-restore: info text corrected 2019-03-31 20:22:16 -06:00
nachoparker
7e40a70523 letsencrypt: make sure deploy dir exists 2019-03-26 11:46:00 -06:00
nachoparker
38799fd537 letsencrypt: rework notification 2019-03-23 10:27:54 -06:00
nachoparker
24602646d9 fix cron path 2019-03-23 10:19:35 -06:00
nachoparker
e99662e3f0 update PGP keys 2019-03-23 08:14:09 -06:00
nachoparker
f0b467ba9b nc-update-nc-apps-auto: only notify if there was update 2019-03-18 19:59:50 -06:00
nachoparker
4b6572a113 nc-update-nc: fix case where imported cfg from non docker to docker 2019-03-18 19:51:29 -06:00
chiyi4488
9bafc9bbb9 Update README.md 2019-03-18 19:47:39 -06:00
chiyi4488
aa8635ff84 Create README-ZH-TW.md 2019-03-18 19:47:39 -06:00
nachoparker
ec66e40b70 freeDNS: fix hash 2019-03-16 17:16:37 -06:00
nachoparker
311ccc76ab nc-update-nc-apps-auto: notify user 2019-03-13 20:11:32 -06:00
Tanarri
b969bc7007 SSH: small typo (#840) 2019-03-14 00:08:27 +00:00
nachoparker
d5aa572c68 update docs URL 2019-03-13 00:26:38 -06:00
nachoparker
06073ed6d6 add nc-previews-auto 2019-03-13 00:25:12 -06:00
nachoparker
d7bbe2516e nc-scan: improvements 2019-03-13 00:24:34 -06:00
nachoparker
e03b095325 nc-previews: improvements 2019-03-13 00:24:06 -06:00
nachoparker
ccb6fc12e5 nc-scan-auto: improvements 2019-03-13 00:23:32 -06:00
Tanarri
6a01f89b02 nc-datadir: Inform the user about the current step (#835) 2019-03-11 17:44:46 -06:00
Tanarri
803287e1e5 datadir: show more info (#834) 2019-03-11 17:44:46 -06:00
nachoparker
89cc0425a7 nc-init: previews settings 2019-03-10 23:39:01 -06:00
nachoparker
0c95243d8f unattended upgrades: update labels 2019-03-10 23:39:01 -06:00
nachoparker
6eecf132ff add RockPro64 2019-03-09 02:36:54 -07:00
nachoparker
f5ba0b10ee wizard: fix headers 2019-03-09 02:31:40 -07:00
nachoparker
1a46667df5 cleanup update.sh 2019-03-08 16:40:22 -07:00
nachoparker
ba64390899 update fix LE live not existing 2019-03-07 07:09:32 -07:00
nachoparker
c5636aa240 docker: fix build 2019-03-05 11:22:12 -07:00
nachoparker
060f0042f6 fix LE cron 2019-03-05 11:22:12 -07:00
nachoparker
41601e94ed cleanup update.sh 2019-03-05 11:22:12 -07:00
nachoparker
a9d4775214 upgrade to NC15.0.5 2019-03-05 11:22:12 -07:00
nachoparker
23bcf21896 ncp-web: fix output buffering off 2019-03-05 11:22:12 -07:00
nachoparker
9c39606aab nc-nextcloud: disable .user.ini 2019-03-05 11:22:12 -07:00
nachoparker
bf1fc1fd87 nc-limits: autocalculate database memory 2019-03-05 11:22:12 -07:00
nachoparker
54565e476d cleanup update.sh 2019-03-05 11:22:12 -07:00
nachoparker
e39c3abd5b lamp: adjust mariadb parameters 2019-03-05 11:22:12 -07:00
Oliver V
160e295c68 nc-datadir: Add SATA to description (#822)
Some users do not see this as obvious ;-)
2019-03-05 01:06:33 +00:00
chiyi4488
602b3f22b2 add nc-maintenance-mode (#809) 2019-02-22 17:03:01 -07:00
nachoparker
5e1ea773fc add nc-restore-snapshot 2019-02-17 18:25:41 -07:00
nachoparker
41a48c97aa nc-backup-auto: notify failures 2019-02-17 00:29:59 -07:00
nachoparker
743cb24610 nc-automount: fix NFS delay 2019-02-15 16:38:50 -07:00
nachoparker
c28868d342 nc-trusted-domains: empty values by default 2019-02-15 11:56:04 -07:00
nachoparker
4e04339a65 nc-nextcloud: update description 2019-02-14 16:46:50 -07:00
nachoparker
af5e35d00c ncp-update-nc: BTRFS basedir not supported 2019-02-13 17:32:09 -07:00
nachoparker
b0703877e6 nc-datadir: lift mountpoint restriction 2019-02-13 17:14:06 -07:00
nachoparker
c9c2153373 nc-zram: remove from docker 2019-02-10 19:16:27 -07:00
nachoparker
3e566f5e78 nc-nextcloud: add a warning 2019-02-10 19:13:45 -07:00
chiyi4488
8be591911d nc-static-IP: update description (#797) 2019-02-09 15:12:46 -07:00
nachoparker
b4bb86d39d upgrade to NC15.0.4 2019-02-07 17:53:08 -07:00
nachoparker
5cf8d4b424 update: make letsencrypt update more resiliant (3) 2019-02-07 17:52:25 -07:00
nachoparker
1a6b7df0d3 nc-trusted-domains: add description 2019-02-07 17:49:33 -07:00
Daniel Röhrig
8f84daf690 nc-rsync: choose ssh port other than 22 (#564) (#793) 2019-02-06 00:20:11 +00:00
nachoparker
4edbae169b nc-update-nc-apps-auto: make it daily 2019-02-04 17:29:39 -07:00
nachoparker
a1842bca41 nc-update-nc-apps-auto: log upgrades 2019-01-30 16:19:36 -07:00
nachoparker
8ca3535a01 added nc-update-nc-apps and nc-update-nc-apps-auto 2019-01-30 09:13:31 -07:00
nachoparker
6331ce5dcd update: make letsencrypt update more resiliant (2) 2019-01-28 12:00:06 -07:00
nachoparker
55121d483d update: make letsencrypt update more resiliant 2019-01-28 08:35:26 -07:00
nachoparker
9a36ceb422 letsencrypt: use the latest github version 2019-01-27 09:18:07 -07:00
nachoparker
338da330f4 ncp-update-nc: fix unnecessary quotes 2019-01-26 12:52:29 -07:00
Nathan Acks
ffc1fa50ea ncp-config: fix local variables 2019-01-25 16:46:04 -07:00
nachoparker
b338ede59f ncp-config: fix missing variable 2019-01-24 14:56:52 -07:00
Nathan Acks
b6f7862b6a update: check for existing cron files (#785) 2019-01-24 19:47:34 +00:00
nachoparker
b7efa7afdb armbian: fix cron permissions bug (2) 2019-01-22 15:22:32 -07:00
schuft69
9a6e6f536a Update Docker links (#779) 2019-01-22 09:39:05 -07:00
nachoparker
af426a5817 armbian: fix cron permissions bug 2019-01-22 09:38:18 -07:00
Nathan Acks
0e062aa223 dnsmasq: detect IP from config file (#782) 2019-01-22 01:07:39 +00:00
Nathan Acks
57728e2847 Proposed fix for issue #773 (#781) 2019-01-22 00:56:36 +00:00
nachoparker
8edfd067e3 update: nc-automount only in non-docker 2019-01-17 17:57:10 -07:00
nachoparker
d0ca44a6fc docker: support for ncp-update-nc 2019-01-16 19:27:03 -07:00
nachoparker
1dd1bb737d add nc-trusted-domains 2019-01-16 18:46:08 -07:00
nachoparker
1f11d40c47 add public IP to trusted domains 2019-01-16 18:42:44 -07:00
nachoparker
bab2d22b3a docker: change location of the nextcloud folder 2019-01-16 18:40:45 -07:00
nachoparker
84ac075831 nc-backup: parallel compression 2019-01-16 17:44:08 -07:00
nachoparker
2419e578b6 nc-backup: compress in place and exclude previews folder 2019-01-15 21:17:46 -07:00
nachoparker
0b8252b385 build: add exfat utils for external storage 2019-01-15 20:43:35 -07:00
nachoparker
193d89b0e4 nc-datadir: fix fail2ban logpath 2019-01-14 21:14:38 -07:00
nachoparker
2ac9b8b97b ncp-web: allow private IPv6 addresses 2019-01-14 21:06:46 -07:00
nachoparker
34cba9f528 nc-automount: add delays to some services in a persistent way 2019-01-14 20:53:45 -07:00
nachoparker
6fb9c9b906 nc-hdd-test: try to detect device type if auto doesnt work 2019-01-14 19:09:04 -07:00
nachoparker
9b1ecbb8d6 nc-info: fix automount reporting 2019-01-14 18:34:08 -07:00
nachoparker
389ed0cfe6 nc-ramlog: adapt to armbian 2019-01-14 18:17:42 -07:00
nachoparker
be9a5465af nc-automount: fix description 2019-01-14 18:06:19 -07:00
nachoparker
7b30d55e03 build: fix post script 2019-01-14 18:05:32 -07:00
nachoparker
3a35b62b3b test: add some checks 2019-01-14 18:05:10 -07:00
nachoparker
e43d31780b test: add check for ncp-version file 2019-01-13 17:26:49 -07:00
nachoparker
c4b4765d8a build: fix raspbian build, fail at any error 2019-01-13 17:26:45 -07:00
nachoparker
61e3ff31b5 ncp-update: fail if version cant be parsed 2019-01-13 15:41:52 -07:00
nachoparker
96a8021372 ncp-app: support NC14 as well 2019-01-12 17:44:59 -07:00
nachoparker
2c943b72e5 upgrade to NC15.0.2 2019-01-12 12:27:19 -07:00
nachoparker
9eaab31e48 add NCP Nextcloud app 2019-01-12 10:57:05 -07:00
nachoparker
6d358f0c5a nc-hdd-test: avoid systemd 2019-01-12 10:55:05 -07:00
nachoparker
d21592c7d0 nc-update-nextcloud: only try to restore on reboot once 2019-01-12 10:55:05 -07:00
nachoparker
da3c949338 build: dont use empty values by default 2019-01-12 10:55:03 -07:00
nachoparker
228c818203 ncp-web: fix section unselected when sidebar reloads 2019-01-10 19:27:47 -07:00
nachoparker
6ba0cb0638 ncp-web: escape HTML in details box 2019-01-10 19:22:21 -07:00
nachoparker
0ff1df9b5c upgrade to NC15 2019-01-10 18:18:59 -07:00
nachoparker
9de1f51a3d build: stop at any error 2019-01-09 21:56:42 -07:00
nachoparker
2e7da45f68 armbian: overlay is ro 2019-01-09 21:56:42 -07:00
nachoparker
06b00e4cc7 wizard: dont change missing parameters 2019-01-09 21:53:56 -07:00
nachoparker
f722c457c4 nc-update-nc: remove backup after restoring 2019-01-08 22:44:21 -07:00
nachoparker
678b7ab485 update: fail with the first error 2019-01-08 22:43:17 -07:00
nachoparker
f1d348e961 Revert "nc-update-nc: check app compatibility before before executing NC update (#682)"
This reverts commit 7ead0f0ad40ca48d803b848932ef95c1a6bf2d3a.
2019-01-08 22:43:15 -07:00
nachoparker
5bf8492bf0 nc-update-nextcloud: fix accidentally deleted line 2019-01-08 22:43:05 -07:00
nachoparker
bb7685326e update: fix run active by default apps 2019-01-08 20:24:43 -07:00
nachoparker
013198cdf7 ncp-config: allow empty values 2019-01-08 19:20:27 -07:00
nachoparker
8e34bd1da5 fail2ban: shorten description 2019-01-08 01:06:48 -07:00
Tobias K
7ead0f0ad4 nc-update-nc: check app compatibility before before executing NC update (#682) 2019-01-08 07:43:30 +00:00
nachoparker
db8ded640a nc-restore: update data fingerprint (TomTurnschuh) 2019-01-08 00:30:21 -07:00
nachoparker
f038eea1da ncp-web: fix scroll follows ncp_app output 2019-01-08 00:26:08 -07:00
nachoparker
3dbc038b1f build: new update process 2019-01-07 23:58:28 -07:00
nachoparker
30b0b6df98 lamp: fix mysql utf8 collation 2019-01-07 01:24:25 -07:00
nachoparker
c8f49b77aa curl: add provisioning 2019-01-06 19:28:47 -07:00
nachoparker
1a056212f1 ncp-web: file type and case insensitive search 2019-01-06 18:43:09 -07:00
nachoparker
bda1fc468d nc-limits: use minimum of 3 PHP threads 2019-01-06 17:04:57 -07:00
nachoparker
2a3df3d2f2 curl: build fix 2019-01-06 17:04:54 -07:00
nachoparker
3c135c22a8 ncp-app tweaks 2019-01-05 23:30:48 -07:00
nachoparker
44b3068873 complete config options 2019-01-05 23:30:46 -07:00
nachoparker
67415a3b63 build: curl installer fixes 2019-01-05 09:53:05 -07:00
nachoparker
50435d678a cleanup update.sh 2019-01-04 18:22:08 -07:00
nachoparker
011d55552b build fix rpi 2019-01-04 18:14:53 -07:00
nachoparker
b1089418be apply search filter upon reload sidebar 2019-01-04 18:14:53 -07:00
nachoparker
388fa77b37 small fixes 2019-01-04 18:14:53 -07:00
nachoparker
c842e00399 sanitize params 2019-01-04 18:14:53 -07:00
nachoparker
7dd4828938 migrate cfg 2019-01-04 18:14:53 -07:00
nachoparker
84cfedffbe div margin top adjustment 2019-01-04 18:14:53 -07:00
nachoparker
9099aa8828 search-box animations 2019-01-04 18:14:53 -07:00
nachoparker
6c95498990 fix selectedID from URL 2019-01-04 18:14:53 -07:00
nachoparker
cbf746e47b search-box select first 2019-01-04 18:14:53 -07:00
nacho
b5e6ab6007 search box fixes 2019-01-04 18:14:53 -07:00
nacho
841322897e docker: bin persistent 2019-01-04 18:14:53 -07:00
nacho
48a70477dd search box 2019-01-04 18:14:53 -07:00
nacho
c0fc0b9b4c fix request ids 2019-01-04 18:14:53 -07:00
nacho
33ab3b36d0 fix retstatus red circle 2019-01-04 18:14:53 -07:00
nacho
74db3796ad fix URL links 2019-01-04 18:14:53 -07:00
nacho
7fe4743220 add icons for passwords and defaults 2019-01-04 18:14:53 -07:00
nacho
7864c3a3fc add path exists 2019-01-04 18:14:53 -07:00
nacho
80cd216eac add directory type 2019-01-04 18:14:53 -07:00
nacho
497edb8d94 add restore defaults btn 2019-01-04 18:14:53 -07:00
nacho
bc0271e359 add password reveal button + version fix 2019-01-04 18:14:53 -07:00
nacho
363f968164 fix selected in URL navigation 2019-01-04 18:14:53 -07:00
nacho
ee53c17599 cfg adjustments 2019-01-04 18:14:53 -07:00
nacho
abef04f7ed adjust installation 2019-01-04 18:14:52 -07:00
nacho
b0726207f3 fix version, provisioning and more 2019-01-04 18:14:52 -07:00
nacho
5d9c1b1427 re-rename DDNS options 2019-01-04 18:14:52 -07:00
Oliver V
a635a1cdbc update name and discription field 2019-01-04 18:14:52 -07:00
nachoparker
d5c1f0058b rework to use JSON based cfg and more 2019-01-04 18:14:52 -07:00
chiyi4488
21fee19452 ncp-web: new chinese translate and update chinese translate. (#721) 2018-12-31 14:40:09 +00:00
nacho
a38be5ec8a curl installer: add provisioning step 2018-12-29 11:32:40 -07:00
TomTurnschuh
4307b14f27 dynDNS: pdate cron execution interval (#754) 2018-12-28 10:02:50 -07:00
Tobias K
2e9440d9ce log2ram: adapt to new name in armbian (#749) 2018-12-28 10:02:50 -07:00
paschaef
e87c972225 docker: fix DATADIR variable in nc-backup (#746) 2018-12-21 01:43:50 +00:00
Oliver V
9766dc2cc3 nc-init: update echo at end when init done. (#738) 2018-12-17 01:35:00 +00:00
nachoparker
d75ecc2c2d fix tempdir config 2018-12-16 18:31:06 -07:00
nachoparker
49f5a35777 update README.md 2018-12-15 11:25:24 -07:00
nachoparker
ca7bc903a3 nc-init: fix missing variable 2018-12-06 17:27:09 -07:00
nachoparker
d6ea50ef16 build: start sharing torrents automatically 2018-12-06 17:26:16 -07:00
nachoparker
d19a7f7e7f nc-datadir: also use tempdirectory setting 2018-12-01 14:57:44 -07:00
nachoparker
845cff1475 build: armbian fixes 2018-12-01 14:57:25 -07:00
nachoparker
d6a7f5c816 cleanup 2018-12-01 14:57:22 -07:00
nachoparker
d7f7f5bcb4 vm: build improvements 2018-11-26 22:17:55 -07:00
nachoparker
88d9fe2ecc nc-restore: check that we are in linux fs 2018-11-26 18:36:31 -07:00
nachoparker
5278bfd37f nc-datadir: shorten short description 2018-11-26 18:35:33 -07:00
nachoparker
5e4be44142 change dialog text width to 120 2018-11-26 18:19:38 -07:00
nachoparker
b0262f9fec referrer policy already in .htaccess in NC14.0.4 2018-11-23 11:01:19 -07:00
nachoparker
bcac4bc531 upgrade to NC14.0.4 2018-11-22 14:47:59 -07:00
nachoparker
5aeb83cb44 nc-static-IP: clarify usage 2018-11-18 11:31:00 -07:00
Oliver V
c70dd17a4d nc-datadir: clarify usage under info (#717)
Following request from user wayneoutthere https://github.com/nextcloud/nextcloudpi/issues/707
@nachoparker let me know if this is the correct way to add to the code: meaning doing pull request against devel?
2018-11-18 11:30:26 -07:00
Oliver V
843bb71fda nc-database: update info field to clarify usage (#716) 2018-11-18 11:30:21 -07:00
nachoparker
f3666d6a34 build: package php7.2-imagick now available 2018-11-11 13:45:55 -07:00
nachoparker
b0b18c2c0e update btrfs-sync 2018-11-11 13:15:23 -07:00
nachoparker
d4206f75a0 nc-hdd-test: remove redundancy 2018-11-11 13:15:07 -07:00
nachoparker
1b251419bc dont fail removing cronfile 2018-11-06 17:59:28 -07:00
nachoparker
ac8aa1c2c2 update: remove libcurl4 2018-11-04 20:41:19 -07:00
nachoparker
089bebb794 nc-info: speedup 2018-11-04 20:38:27 -07:00
nachoparker
3cd1cd55e8 add nc-hdd-monitor 2018-11-04 20:38:27 -07:00
nachoparker
61381831c8 add nc-test-hdd 2018-11-04 20:38:25 -07:00
nachoparker
308a1a2ec6 build: avoid buster 2018-11-04 07:17:56 -07:00
nachoparker
bc5dc6e574 build: fix apt https-transport 2018-11-03 13:11:48 -06:00
nachoparker
5e7f3da605 docker: fix provisioning on a stopped the container 2018-11-03 11:21:27 -06:00
nachoparker
1758331c18 check for path transversal 2018-10-27 08:00:15 -06:00
Nikolaos Perrakis
6446229a7d Removed redundant php7.2 opcache configuration. (#694) 2018-10-27 13:24:14 +00:00
nachoparker
26083e9b75 update: update sources 2018-10-26 20:27:03 -06:00
nachoparker
54e5c21f1c ncp-config: use simple characters 2018-10-24 15:46:03 -06:00
chiyi4488
9d998ae0db ncp-web: update chinese translations 2018-10-24 15:46:03 -06:00
nachoparker
c7643b795b build: php-imagick has been renamed 2018-10-24 15:46:03 -06:00
nachoparker
50043da8e3 build: adjustments for Raspbian 2018-10-24 15:46:03 -06:00
nachoparker
03d435224c nc-nextcloud: package php-imagick has been renamed 2018-10-23 19:57:01 -06:00
nachoparker
0f425ff6d7 build: use sury packages for x86 2018-10-22 19:57:41 -06:00
nachoparker
b3069cb353 add Vagrantfile 2018-10-22 18:09:47 -06:00
nachoparker
20a4147147 ncp-web: update chinese translations 2018-10-21 10:10:33 -06:00
TomTurnschuh
bd9b9f1ff1 DDNS_spDYN: switch to wget and more
* Update DDNS_spDYN.sh

- Switched from curl to wget
- Switched to spDYN for IP check
- Removed unused code

* Shift cron by 10 minutes

Advantages are that it is not executed at the same time as Nextcloud cron, and that changes in IP address, that are presumably done at full hours, are detected quicker.
2018-10-21 09:48:47 -06:00
nachoparker
00e86c7e4d test fixes 2018-10-21 09:48:31 -06:00
Abel Büchner-Mihaljević
b5ba95a9fd ncp-web: fixed hover text for ncp wizard icon (#688) 2018-10-21 15:00:32 +00:00
nachoparker
d2155b04c9 nc-rsync: dont preserve ACL 2018-10-21 08:48:59 -06:00
nachoparker
b1d5d4d487 update: only apply logrotate rules once 2018-10-21 08:41:53 -06:00
Abel Büchner-Mihaljević
6fb1c069ee nc-rsync: sync datadir, not only content (#686) (#687) 2018-10-21 08:41:22 -06:00
nachoparker
ef3787bb1a add system tests 2018-10-18 23:08:33 -06:00
nachoparker
c7455c433c docker: better cleanup call 2018-10-18 23:08:12 -06:00
nachoparker
d6b7267bc2 ncp-update-nc: make sure cron.php is not running and there are no pending jobs 2018-10-14 16:35:41 -06:00
nachoparker
c03652522f docker: make bin persistent too 2018-10-12 17:24:58 -06:00
nachoparker
51918ff03a update: docker container doesnt have ufw 2018-10-12 09:32:00 -06:00
nachoparker
a9b15421aa upgrade to NC14.0.3 2018-10-12 08:53:05 -06:00
nachoparker
b4555bae1c upgrade to NC14.0.2 2018-10-11 17:13:17 -06:00
nachoparker
2ea43f428b build: dont dist-upgrade to avoid kernel bug 2018-10-07 14:11:59 -06:00
nachoparker
48ac238f5b limit logs size with logrotate 2018-10-07 14:10:44 -06:00
TomTurnschuh
694a885597 DDNS_spDYN reinstall DDNS_spDYN for use of IPv6 (#642) 2018-10-07 19:26:17 +00:00
TomTurnschuh
c6da8a9c56 Use DIG instead of NSLOOKUP in DDNS apps (#666) 2018-10-07 15:24:38 +00:00
TomTurnschuh
54e09689ce nc-prettyURL: Catch failure of maintenance:update:htaccess (#654) 2018-10-07 15:22:39 +00:00
nachoparker
5e3d411f4c nc-limits: fix PHP service restart 2018-10-06 09:25:29 -06:00
nachoparker
0bf604593b nc-update-nc: dont fix the news app if there is no news app 2018-10-03 22:25:19 -06:00
nachoparker
aa886f9948 nc-update-nextcloud: option to upgrade to the latest version 2018-10-03 22:25:16 -06:00
nachoparker
af4b646ecf nc-autoupdate-nc: fix repeating notification 2018-10-03 13:18:09 -06:00
nachoparker
961d8145e5 docker: fix spawn a stopped container 2018-10-02 07:38:20 -06:00
nachoparker
632494911a nc-prettyURL: make sure URL is correct 2018-10-02 07:19:00 -06:00
nachoparker
6aa9dfd21f docker: fix upgrade to PHP7.2 2018-10-01 20:20:03 -06:00
nachoparker
a74f1d5f1e build: forgot to include preview generator 2018-10-01 20:18:08 -06:00
nachoparker
a98b5371ab update: there were still references to NextCloudPlus 2018-10-01 20:18:05 -06:00
nachoparker
cdc7bb4798 nc-prettyURL: fix for NC14 2018-10-01 20:16:40 -06:00
nachoparker
2a3555d159 accept nextcloudpi and nextcloudpi.lan domains 2018-09-30 17:12:49 -06:00
nachoparker
4f20b716f8 redis: change eviction policy 2018-09-30 16:52:16 -06:00
nachoparker
6b14527ab4 build: make sure we dont deactivate the wizard accidentally 2018-09-29 09:00:03 -06:00
nachoparker
aa2b3baa91 build: small tweaks for docker and armbian 2018-09-29 08:55:23 -06:00
nachoparker
4bce1bb99f upgrade to PHP7.2 2018-09-29 08:55:23 -06:00
nachoparker
66e4d83917 upgrade to NC14 2018-09-29 08:55:23 -06:00
nachoparker
015588bfea add multiple issue template to Github 2018-09-29 08:53:12 -06:00
nachoparker
6152e7e2ad ncp-web: put configuration in a separate file from available languages 2018-09-24 18:38:30 -06:00
nachoparker
cdbb750e71 docker: disable auto-upgrade until it is adapted to containers 2018-09-24 17:47:06 -06:00
nachoparker
1150ed8bfe nc-format-USB: fix 2018-09-24 17:11:10 -06:00
nachoparker
3de5fe0cfe armbian: fix locales for ncp-config 2018-09-24 17:08:22 -06:00
nachoparker
a7f0fd2d2f build: use a separate file for NCP database config 2018-09-23 14:48:50 -06:00
nachoparker
1bfcebc2d8 nc-update-nextcloud: workaround news integrity bug 2018-09-23 10:43:19 -06:00
TomTurnschuh
5914624e3f DDNS_spdyn.sh : Send new IP only when changed. 2018-09-23 08:55:00 -06:00
nachoparker
4720e20385 docker: local builds can use caching 2018-09-23 08:09:53 -06:00
nachoparker
f80ee23e06 nc-restore: restore to volume in docker container 2018-09-23 07:51:03 -06:00
nachoparker
3a1b974c8a add nc-previews 2018-09-23 07:50:13 -06:00
nacho
445748551f autoupdate: log everything to ncp.log 2018-09-21 23:52:16 -06:00
nacho
cc53f40c73 ncp-report: remove sensitive data 2018-09-21 23:52:16 -06:00
nacho
dabc17fb07 build: fully local builds 2018-09-21 23:48:00 -06:00
nacho
7a8c0e40f5 docker: build fixes 2018-09-20 22:30:40 -06:00
nachoparker
9ee428280a docker: fix letsencrypt not persistent 2018-09-20 20:07:09 -06:00
nachoparker
744342502b docker: allow domains in command line, not only IPs 2018-09-20 18:12:19 -06:00
TomTurnschuh
41f21fad37 Don't overwrite an existing mail_smtpmode, if it is not "PHP"
Overwriting the value `SMTP` is probably not the best idea. `SMTP` settings are done manually as required. They should not be disabled or overwritten.
2018-09-17 22:15:50 -06:00
TomTurnschuh
14203481c4 spDYN: fix misspelled variables 2018-09-17 22:11:46 -06:00
TomTurnschuh
3479014e79 spDYN: support IPv6 2018-09-16 10:20:53 -06:00
TomTurnschuh
241f2e0531 Change email program from PHP to Sendmail
PHP seems to be no longer supported in Nextcloud 14.
This modification might need further testing in different environments.
2018-09-16 09:35:27 -06:00
nacho
5be786659f lamp: add referrer policy for enhanced privacy 2018-09-16 09:21:01 -06:00
Corey Wilson
fcbd661b4f ncp-web: add hover text for ncp admin header icons 2018-09-16 08:48:39 -06:00
nacho
6a755c31a5 nc-prettyURL: fixes 2018-09-16 08:48:03 -06:00
TomTurnschuh
cdaec0588b Create nc_prettyURL 2018-09-16 08:48:03 -06:00
TomTurnschuh
a00cd0b542 nc-format-USB: drive number was off by one (#631)
Resolves #630
Delete `-1` in calculation of drives
2018-09-14 17:10:46 -06:00
TomTurnschuh
e26a834b63 Rename DDNS apps so they show up together 2018-09-12 19:57:03 -06:00
nacho
7703cebe27 cleanup update.sh 2018-09-12 18:54:15 -06:00
nacho
1210517df2 wizard: fix instructions for BTRFS 2018-09-12 18:54:15 -06:00
nacho
76898b95e0 fix NCP url in README 2018-09-12 18:54:15 -06:00
nachoparker
ed96a0c5d8 nc-limits: fix error when specifying units 2018-09-12 18:54:15 -06:00
nachoparker
ee370f1bbb ncp-suggestions: fix Raspbian parsing 2018-09-12 18:54:15 -06:00
nachoparker
6e1a1a91b3 build: add imagick for gallery 2018-09-12 18:54:15 -06:00
nachoparker
e25f5d1862 nc-format-USB: fix wrong detection of USB drives present 2018-09-11 18:05:19 -06:00
nachoparker
378ca60d88 nc-datadir: support specifying the root of the mountpoint 2018-09-11 18:03:38 -06:00
nachoparker
9113ab21ce update to NC 13.0.6 2018-08-31 07:20:04 -06:00
TomTurnschuh
002eb3e259 fail2ban: Change order in configuration entries (#602)
The email-entry is moved below the option to activate email notifications.
2018-08-22 23:29:57 -06:00
nachoparker
cc4170864c update: remove the armbian fix so we can build images again 2018-08-18 17:55:02 -06:00
nachoparker
a898e8918b cleanup update.sh 2018-07-31 13:36:30 -04:00
nachoparker
2301943431 remove accidentally created folder 2018-07-27 16:28:54 -04:00
nachoparker
dad9900740 nc-datadir: backup existing datadir after checks 2018-07-25 07:36:23 -04:00
chiyi4488
7486d66101 Update zh.json 2018-07-25 05:02:32 -04:00
chiyi4488
593e72f0a6 Update and rename zn.json to zh.json 2018-07-25 05:02:26 -04:00
nachoparker
df7a277895 update to NC 13.0.5 2018-07-24 06:39:32 -04:00
Nikolaos Perrakis
965716d82a Fixes #566 Remove redundant opcache configuration (#572) 2018-07-22 20:19:23 -04:00
nachoparker
d3f5f5df35 updated Github template 2018-07-21 10:41:37 -04:00
nachoparker
55a5943edc added CONTRIBUTING.md 2018-07-20 13:12:36 -04:00
nachoparker
bf91e4c167 ncp-config: add spaces to invalid characters 2018-07-20 12:36:35 -04:00
nachoparker
baaf79a301 nc-backup: fix space check error message 2018-07-20 11:33:39 -04:00
nachoparker
b81b3e6753 fix ncc command repeating itself 2018-07-13 17:27:07 +00:00
nachoparker
2619c46e84 build: berryboot tested ok 2018-07-05 10:26:00 +02:00
nachoparker
dc089bfe7c armbian: fix image tag preventing updates 2018-07-05 10:25:34 +02:00
nachoparker
491b4b63db armbian: update rock64 branch 2018-07-03 16:45:39 +02:00
nachoparker
ff43b288eb build: fix disabling apache mods 2018-06-29 17:53:23 +02:00
nachoparker
c2d0e49d31 build: kill cron upon cleanup 2018-06-28 17:20:56 +02:00
nachoparker
16227491a7 build: clean cache by default 2018-06-28 17:20:54 +02:00
nachoparker
fbc0d465e9 added config for OrangePi Zero Plus2 H5 2018-06-27 18:01:54 +02:00
nachoparker
2aa0e8f0d4 SSH: fix root password in Raspbian 2018-06-27 17:58:15 +02:00
nachoparker
8d0faf748f build: prevent services from starting during build 2018-06-27 17:58:12 +02:00
nachoparker
2d70fad41f build: cleanup 2018-06-27 14:08:20 +02:00
nachoparker
89835cc714 build: fix noip cleanup uninstalls udiskie 2018-06-27 14:08:16 +02:00
nachoparker
2c01a876c2 nc-automount: fix udiskie not installed in latest image 2018-06-26 18:36:26 +02:00
nachoparker
40f0cbc9b6 build: generate armhf container locally with qemu-user 2018-06-26 07:45:17 +02:00
Shaunak Deshmukh
f1cc627f2f added database dir to ncp-info (#553) 2018-06-26 07:42:46 +02:00
nachoparker
fe12ff9e24 nc-limits: fix units 2018-06-24 15:10:11 +02:00
nachoparker
bbb25fa49c nc-limits: autolimits enhancements 2018-06-22 11:11:17 +02:00
nachoparker
9983b7cff9 letsencrypt: notify of renewals 2018-06-21 12:33:13 +02:00
nachoparker
a0a31b4b96 ncp-web: fix JS docker detection 2018-06-21 12:33:13 +02:00
nachoparker
de5d9fb86e nc-format-USB: fix when ZRAM active 2018-06-21 07:47:17 +02:00
nachoparker
d82a635eb1 armbian: fix disabling SSH and clean before builds 2018-06-20 16:58:01 +02:00
nachoparker
f3274e7784 build: cleanup cache in batch build 2018-06-20 12:34:28 +02:00
nachoparker
891c2a229e build: autoupload to testing folder 2018-06-20 12:33:22 +02:00
nachoparker
f266ce6bed build: cron is not running anymore 2018-06-20 12:32:49 +02:00
nachoparker
3ee64098b6 docker: adapt wizard 2018-06-19 18:51:55 +02:00
nachoparker
1af50d792c docker: persist cron timers 2018-06-19 17:52:36 +02:00
nachoparker
c727d65c3c docker: fix persist ncp-web password 2018-06-19 17:19:15 +02:00
nachoparker
683cbc89c0 build: use local version of armbian.sh 2018-06-19 17:12:24 +02:00
nachoparker
6b3ba23152 letsencrypt: fix is_active check 2018-06-19 12:40:43 +02:00
nachoparker
c591494b30 build: refresh services only in curl installer 2018-06-19 12:40:40 +02:00
nachoparker
8f873c174d nc-snapshot-sync: install ssh client 2018-06-19 12:01:24 +02:00
nachoparker
54e8cf3515 noip: install gcc and cleanup afterwards 2018-06-19 11:58:14 +02:00
nachoparker
fce84f66c8 docker: update service files as well 2018-06-19 11:58:14 +02:00
nachoparker
91a85ab8f4 docker: build fixes (shutdown mysql, letsencrypt cert dir) 2018-06-19 06:40:51 +02:00
nachoparker
9637502da7 added wizard.cfg to .gitignore 2018-06-19 06:39:22 +02:00
nachoparker
f62e36a2b5 docker: letsencrypt cleanup no longer necessary 2018-06-19 05:41:04 +02:00
nachoparker
d50b16e22b build: post-inst in install step 2018-06-19 05:40:39 +02:00
nachoparker
865ad0836b fix mysqld service named mysql 2018-06-19 05:38:41 +02:00
nachoparker
1a9a53fce3 fix nextcloud-domain running before default GW is ready 2018-06-19 04:55:26 +02:00
nachoparker
9210fb26ef letsencrypt: install from debian package 2018-06-18 17:11:09 +02:00
nachoparker
5aa071e069 armbian: default to SSH disabled 2018-06-18 16:43:50 +02:00
nachoparker
7b2737bf5f nc-static-IP: autodetect default interface 2018-06-18 16:19:25 +02:00
nachoparker
7ac184752e docker: replace systemd for service 2018-06-18 16:19:25 +02:00
nachoparker
a4fb4f70e7 armbian: nc-ramlogs is active by default 2018-06-18 16:19:22 +02:00
nachoparker
676776f4e6 update to NC 13.0.4 2018-06-18 14:12:13 +02:00
nachoparker
57852ad209 nc-snapshot-sync: upgrade 2018-06-18 14:02:58 +02:00
nachoparker
0d7ceb5ca4 nc-datadir: make sure we have the correct permissions 2018-06-18 14:02:18 +02:00
nachoparker
005ed8076a nc-info: fix typo 2018-06-18 14:01:07 +02:00
nachoparker
3df542feb5 build: wizard not showing up first run 2018-06-18 14:00:36 +02:00
nachoparker
cef7cb456b nc-restore: fix redis restart in docker 2018-06-14 08:47:13 +02:00
nachoparker
598e1c87e5 docker: persist SSL certificates 2018-06-11 12:22:09 +02:00
nachoparker
75cfd80e6a ncp-web: fix sanitization for fail2ban 2018-06-11 11:35:27 +02:00
nachoparker
01b6349d16 silence file not found error 2018-06-08 17:17:15 +02:00
nachoparker
b78c9e2369 add ncc command, shortcut of occ 2018-06-06 17:11:47 +02:00
nachoparker
412eee2f98 NFS: fix dependency with automount 2018-06-06 17:00:23 +02:00
nachoparker
05c14ce868 ncp-web: sanitize the ref parameter 2018-06-04 19:29:32 +02:00
nachoparker
3c462f650b update README.md 2018-05-30 10:19:40 +02:00
nachoparker
3862eca0ed build: fix cleanup armbian images 2018-05-29 19:21:30 +02:00
nachoparker
6d1cd56883 build: added berryboot script 2018-05-29 18:57:26 +02:00
nachoparker
d578ef1568 general build improvements 2018-05-29 18:57:24 +02:00
nachoparker
b45e68f1f0 ncp-web: added chinese translations 2018-05-28 17:19:58 +02:00
nachoparker
b619457627 build: fix raspi-config integration in new build 2018-05-28 12:25:14 +02:00
nachoparker
03261fc952 nc-wifi: no need for QEMU workarounds anymore 2018-05-28 12:03:22 +02:00
nachoparker
82f333334e fix bad merge, move NC logs to /var/log 2018-05-28 11:32:13 +02:00
nachoparker
a070860a58 re-rename to NCPi 2018-05-28 11:32:13 +02:00
nachoparker
003c29c016 spDYN: install curl for docker 2018-05-28 11:32:10 +02:00
nachoparker
83bc077056 noip: fix download 2018-05-28 05:51:03 +02:00
nachoparker
ed0a368e71 nc-format-USB: fix when ZRAM active 2018-05-28 05:03:30 +02:00
nachoparker
5ea64fdc12 build: add bananapi build script 2018-05-27 21:12:55 +02:00
nachoparker
f64df286d3 build: add rock64 build script 2018-05-27 20:37:45 +02:00
nachoparker
fae7ba2dca ncp-config: silence connectivity errors 2018-05-27 20:35:02 +02:00
nachoparker
06c07d33ee Rework raspbian build system 2018-05-27 20:32:36 +02:00
nachoparker
027a2a02bd nc-ramlogs: fix docker installation from latest upstream changes 2018-05-25 13:33:23 +02:00
nachoparker
438e73d199 remove old systemd timer config in running systems 2018-05-24 12:21:09 +02:00
nachoparker
9e8fc92837 fix php cli tmpdir for running instances 2018-05-22 20:27:21 +02:00
bit67
99d9f4782e I've updated the Activate web page changing NextCloudPlus back to NextCloudPi (#512)
Changed NextCloudPlus to NextCloudPi in activate web page.
2018-05-22 20:12:18 +02:00
nachoparker
061d2ae3fc move NC httpd logs to /var/log 2018-05-22 15:36:06 +02:00
nachoparker
fac99a6289 fix update httpd log location in virtual host after nc-datadir 2018-05-20 16:32:54 +02:00
nachoparker
c97acf8a8e ncp-autoupdate: dont return 0 if no updates available 2018-05-20 13:38:16 +02:00
nachoparker
6150ee7dff re-rename to NCPi 2018-05-18 11:42:34 +02:00
nachoparker
cd32b30a70 nc-info: change port checker providers 2018-05-18 11:15:49 +02:00
nachoparker
93a94da182 build: move SSH root hardening. Make it specific to Raspbian 2018-05-17 14:12:59 +02:00
nachoparker
f04de1f0ae nc-update-nextcloud: make sure backup syncs to disk 2018-05-17 14:09:14 +02:00
nachoparker
9c7c994870 build: simplify armbian build script 2018-05-17 14:07:56 +02:00
nachoparker
741e79a857 nc-restore: refuse to restore from /var/www/nextcloud 2018-05-15 08:57:17 +02:00
nachoparker
88dcfefedb nc-update-nextcloud: rollback in case of power cut 2018-05-15 07:45:49 +02:00
nachoparker
9bd6f81fb6 added nc-autoupdate-nc 2018-05-15 07:36:00 +02:00
nachoparker
ee92111007 nc-autoupdate-ncp: fix wrong user 2018-05-15 06:46:50 +02:00
nachoparker
191ea16ec9 nc-update-netcloud: include version in backup name 2018-05-15 06:13:06 +02:00
nachoparker
2507cc6298 nc-backup: faster free space calculation. Minimize maintenance mode time 2018-05-15 05:36:37 +02:00
nachoparker
88cb01e123 nc-datadir: fix php cli tmpdir 2018-05-14 20:42:08 +02:00
nachoparker
d9ac3304a7 build: cleanup ncp.log 2018-05-14 20:41:27 +02:00
nachoparker
5e3da08c24 nc-backup: exclude ncp-update-nc backups 2018-05-14 19:10:58 +02:00
nachoparker
8d01fc476b added nc-update-nextcloud 2018-05-14 19:10:56 +02:00
nachoparker
8ef08816dd samba: fix permissions 2018-05-14 19:10:34 +02:00
nachoparker
b08e45f179 nc-nextcloud: fix upload tmp dir 2018-05-14 19:10:34 +02:00
nachoparker
eb1cf1a9f9 nc-restore: fix tmp dirs in backups without data 2018-05-14 19:10:30 +02:00
nachoparker
40a84318d0 nc-backup: make more robust to unexpected failure 2018-05-14 13:09:21 +02:00
nachoparker
2ef575c1ee nc-restore: make more robust to unexpected failure 2018-05-11 13:32:41 +02:00
nachoparker
b93aec5adc nc-restore: separate in its own executable 2018-05-11 09:28:26 +02:00
nachoparker
dbc3094674 nc-backup: better avoid duplicates 2018-05-11 08:54:11 +02:00
nachoparker
5dca250177 armbian: fix static IP 2018-05-10 13:55:27 +02:00
nachoparker
09741e1009 nc-notify-updates: fix wrong user 2018-05-10 13:03:56 +02:00
nachoparker
6dc636dc57 build: add tag -> changelog -> push script 2018-05-10 12:58:42 +02:00
nachoparker
688d6d8c70 armbian: fix mDNS 2018-05-10 12:33:41 +02:00
nachoparker
63f83da6cf avoid temp dir vulnerabilities 2018-05-09 18:21:27 +02:00
Thomas Kaiser
2dcc66c254 Improve tempdir handling (#499) 2018-05-09 13:09:28 +02:00
nachoparker
272fe72fbf update: silence dhcpcd not present 2018-05-03 12:03:53 +02:00
nachoparker
28d2332eb9 nc-datadir: avoid using occ for faster execution 2018-05-03 10:52:38 +02:00
nachoparker
73bc22ad7e samba: restart after configuration change 2018-05-03 10:51:49 +02:00
nachoparker
ff223116b3 armbian: fix postfix configuration hook 2018-04-27 16:14:44 +02:00
nachoparker
7e2b72d112 build: use certificates in wget 2018-04-27 14:25:10 +02:00
nachoparker
9a6d371f9c nc-snapshot-sync: upgrade 2018-04-27 14:05:44 +02:00
nachoparker
99f1e1e22c update to NC 13.0.2 2018-04-27 10:45:06 +02:00
nachoparker
cdbef35e9a nc-audit: fixes to armbian build system 2018-04-27 10:42:34 +02:00
nachoparker
b199121413 nc-info: provide timeout for wget 2018-04-25 09:48:01 +02:00
nachoparker
bc0c0d5a2c armbian: add dphys-swapfile 2018-04-24 20:15:49 +02:00
nachoparker
078f0b667d make nextcloud-domain restart if fails 2018-04-24 19:58:36 +02:00
nachoparker
fe38cd5eb2 armbian: fix nc-audit messing up with build process 2018-04-24 17:53:03 +02:00
nachoparker
879b8a4ba3 armbian: fix root SSH in build and other fixes 2018-04-23 22:32:12 +02:00
nachoparker
83fd26438b build: rename RPi and OdroidHC1 images 2018-04-23 20:07:29 +02:00
nachoparker
51274da74f armbian: remove automount from nc-info 2018-04-23 20:07:29 +02:00
nachoparker
ebdaea068e nc-ramlogs: check if already installed 2018-04-22 22:24:03 +02:00
nachoparker
d8f21790e7 nc-ramlogs: disable fix 2018-04-22 22:24:03 +02:00
nachoparker
b1475f7b05 build: avoid git dependency 2018-04-22 22:24:00 +02:00
nachoparker
3bb8cadcca nc-info: check for existance of ncp-baseimage 2018-04-22 21:48:41 +02:00
nachoparker
bba3d818e7 armbian: permit SSH root login 2018-04-22 20:05:36 +02:00
nachoparker
deda91067c build: cleanup trusted domain 2018-04-22 20:05:23 +02:00
nachoparker
20c734b068 fix double default gateway 2018-04-22 10:55:28 +02:00
nachoparker
1ddeebfd92 Update README.md 2018-04-22 10:03:02 +02:00
nachoparker
0977d90213 Update README.md 2018-04-21 19:23:29 +02:00
nachoparker
073e527c7e ncp-web: fix first run wizard box buttons 2018-04-21 12:55:22 +02:00
nachoparker
d543406642 clean update 2018-04-20 16:12:41 +02:00
nachoparker
9c600bd345 ncp-report: fix root execution 2018-04-20 16:09:00 +02:00
nachoparker
a9458f5265 renamed to NextCloudPlus 2018-04-20 14:38:58 +02:00
nachoparker
0d6c780911 ncp-web: added spanish translations 2018-04-18 17:29:11 +02:00
nachoparker
56d4f05340 Update README.md 2018-04-12 12:30:17 +02:00
nachoparker
5c1a9201f6 ncp-web: increase delay to redirect after activation for slower boards 2018-04-11 09:13:29 +02:00
nachoparker
8b90ec2d1a ncp-web: auto-retry upon activation whenever NCP has not yet fully initialized 2018-04-11 01:24:56 +02:00
nachoparker
f34a3ce9d4 docker: display message while the container inits for the first time 2018-04-11 01:24:53 +02:00
nachoparker
165be0c6f6 docker: support to mount any external directory 2018-04-11 00:12:28 +02:00
nachoparker
c02effea49 docker: only deactivate nextcloud virtual host in the full NCP container, not plain NC container 2018-04-10 16:30:04 +02:00
nachoparker
bfd11b0800 docker: fix provisioning for the plain NC container 2018-04-10 16:22:53 +02:00
nachoparker
c9bdf0221a ncp-config: silence file not yet present warning 2018-04-10 16:04:18 +02:00
nachoparker
d52edc9a8e docker: hide power button in ncp-web 2018-04-10 14:24:29 +02:00
nachoparker
8f36a2f253 update README.md 2018-04-10 14:12:07 +02:00
nachoparker
88531273c6 docker: fix updates from ncp-web 2018-04-10 13:54:07 +02:00
nachoparker
8c8d5b1848 docker: make ncp-web password persist 2018-04-10 13:21:54 +02:00
nachoparker
7081be39c9 docker: adapt ncp-apps to use cron instead of systemd timers 2018-04-10 13:02:57 +02:00
nachoparker
c5221415d1 docker: log NC to docker logs 2018-04-10 12:38:04 +02:00
nachoparker
86afa62355 docker: add updates 2018-04-09 20:41:48 +02:00
nachoparker
20c0d8098d ncp-web: added language dropdown selector 2018-04-09 19:52:03 +02:00
nachoparker
a9b37ab6c6 nc-automount: remove directories left from unclean shutdown 2018-04-09 10:38:46 +02:00
nachoparker
7aba9c5303 build: clean docker-env 2018-04-09 00:54:54 +02:00
nachoparker
3e52869315 docker: update armhf version 2018-04-08 23:18:18 +02:00
nachoparker
b9116e7215 ncp-web: faster first load by asynchronous call to is_active() 2018-04-06 09:58:55 +02:00
nachoparker
7eecd81dd3 ncp-web: force reload CSRF tokens every time 2018-04-05 02:27:53 +02:00
nachoparker
eece4d08c9 ncp-web: collapse sidebar menu when clicking in new sections 2018-04-05 02:11:30 +02:00
nachoparker
60314405d8 ncp-web: make config.php into a table 2018-04-05 00:31:12 +02:00
nachoparker
16e245cf69 ncp-web: check for updates upon first run 2018-04-04 19:32:07 +02:00
nachoparker
8a2d30a6b2 ncp-web: replace textarea with div for output 2018-04-04 18:36:23 +02:00
nachoparker
4f321ccfa4 ncp-web: refresh sidebar after launching actions 2018-04-04 15:57:18 +02:00
nachoparker
e652777b9d ncp-web: reload ncp-web after nc-update 2018-04-04 15:56:02 +02:00
nachoparker
df9e09ef20 ncp-web: implement is_active() 2018-04-04 14:20:11 +02:00
nachoparker
490d84dbd1 docker: add column command 2018-04-04 02:15:01 +02:00
nachoparker
fb2ad5d698 ncp-web: fix scroll bar 2018-04-04 02:10:50 +02:00
nachoparker
e559f740eb ncp-web: fix ncp-app selection 2018-04-04 02:09:22 +02:00
nachoparker
30da787f91 ncp-web: added nc-config and helper buttons 2018-04-03 18:15:41 +02:00
nachoparker
d133c73526 ncp-web: fix glitch showing power dialog 2018-04-03 14:04:22 +02:00
nachoparker
fa1ec759f5 ncp-web: implement dashboard 2018-04-03 13:58:47 +02:00
nachoparker
b94bcb4213 devel: fix permissions for docker devel container 2018-04-02 21:40:25 +02:00
nachoparker
d79e10a4a3 SSH: stop service upon activation 2018-04-02 21:03:58 +02:00
nachoparker
ca66dac120 ncp-web: fix update notification 2018-04-02 11:16:01 +02:00
nachoparker
925c6fe7e5 ncp-web: use random passwords for NC and ncp-web 2018-04-01 18:08:10 +02:00
nachoparker
f31caf4d04 docker fix development environment first initialization 2018-03-29 04:42:53 +02:00
nachoparker
3fee3bb46f armbian: small refactor 2018-03-27 20:04:13 +02:00
nachoparker
f1bbf57583 samba: dont force NAME_REGEX for username 2018-03-27 20:02:49 +02:00
nachoparker
062438b7e3 NFS: check user and group existence 2018-03-20 19:30:16 +01:00
nachoparker
e471e7b8bf build: fix tests for NC13 2018-03-19 19:44:12 +01:00
nachoparker
577a01ed2c update README.md 2018-03-19 12:38:29 +01:00
nachoparker
1830d774d1 nc-ramlogs: fix enabled by default upon installoation 2018-03-18 21:20:14 +01:00
nachoparker
1e12154fc6 build: fix SD card generation and provisioning 2018-03-18 21:18:46 +01:00
nachoparker
423ea0ed00 docker: fix development container script folder 2018-03-18 21:18:46 +01:00
nachoparker
85127d756c letsencrypt: remove .well-known dir after renewal 2018-03-18 21:18:43 +01:00
nachoparker
30f5756d10 fix web update to NC13.0.1 with .well-known existence 2018-03-17 12:35:44 +01:00
nachoparker
436cd9fd2e update to NC 13.0.1 2018-03-17 12:26:54 +01:00
nachoparker
1f8161182e build: small script adjustments 2018-03-17 12:26:05 +01:00
nachoparker
c6aeb4e873 docker: include nc-webui 2018-03-16 18:52:52 +01:00
nachoparker
ed261284cb added nc-rsync-auto 2018-03-16 17:20:09 +01:00
nachoparker
26c88d057c added nc-rsync 2018-03-16 17:19:25 +01:00
nachoparker
84f27f280e added nc-snapshot-sync 2018-03-16 17:19:22 +01:00
theCalcaholic
4ed6b52a8a Add template generation functionality to L10N.php (activate by setting constant GENERATE_TEMPLATES to true). 2018-03-16 15:48:51 +01:00
nachoparker
38dfa60508 fix for nc-automount-links 2018-03-16 14:59:03 +01:00
nachoparker
b3be948050 improve dependency of database with automount 2018-03-15 16:06:04 +01:00
nachoparker
2c1f8b4f16 update: make sure redis log exists 2018-03-10 09:42:10 +01:00
nachoparker
7a3976b0fd added nc-zram 2018-03-07 14:14:41 +01:00
nachoparker
1c23fa7bc1 nc-backup-auto: change to using cron 2018-03-07 14:14:38 +01:00
nachoparker
e912749dc6 nc-ramlogs: change implementation to use log2ram 2018-03-04 18:15:24 +01:00
nachoparker
a076fb5675 build: leave default raspbian kernel. It is similar to the one being updated. 2018-03-04 16:59:08 +01:00
nachoparker
b346cbe89b disable ncp user login 2018-03-04 16:59:08 +01:00
nachoparker
18e35dfdbb nc-automount: fix dependencies 2018-03-04 16:59:06 +01:00
nachoparker
45a8800cd8 build: fix systemd dir not existing 2018-03-03 10:07:45 +01:00
theCalcaholic
1a7c8b9b5e ncp-web: add localization (#372)
* Implement localization loader L10N.

Localize a few strings in index.php for testing.

* Determine language from HTTP_ACCEPT_LANGUAGE header.

* Fix parsing of available languages for localization.

* Fix parsing of language translations (for localization).

* Fix function L10N->find_language

* Change variable naming to comply with conventions.

* Add remaining localize calls in index.php.

Add more localization strings.

* Fix styles to prevent check mark from being hidden.

* Handle exception in case localization couldn't be loaded.

* Add module localization support.

* Fix detection of core module in L10N->load

* Remove module specific localization from core l10n file.

* Fix determination of module name in L10N->load.

* Add localization files for more modules.

* Ignore l10n directory in modules path.

* Add support for dropdown lists in module settings.

* Add support for saving dropdown menus.

* Fix regex for recognizing dropdown option lists.

* Fix dropdown list regex not recognizing active option.

* Fix typo in ncp-launcher.php

* Workaround for jquery's 'find' method not working. //TODO: Find proper fix.

* Fix parsing of dropdown lists when updating config.

* Load language setting from config if available.

* add ncp-provisioning to SD card images

* Add intellij config to gitignore

* Fix bug when loading language from nc-webui config.

* Remove redundant language definition.
Replace umlauts by html special char expressions.

* Change selected option markup from `*<option>*` to `_<option>_`.

* Remove ide metadata.

* Add translations for ncp-app nc-backup.

* Add translation hooks to ncp-launcher.php

* Fix type in translations for nc-backup

* Remove translation hooks for field contents in ncp-launcher.php
2018-02-26 20:29:49 +01:00
nachoparker
c4a111c289 ncp-web: fix responsive in iPad 2018-02-26 19:46:39 +01:00
Oliver V
9f819f4877 Added some useful comments for first time users 2018-02-23 11:54:37 +01:00
nachoparker
e3a19b983b disable unused services for SMB and NFS 2018-02-23 11:50:52 +01:00
nachoparker
d3c735426a update: print info first 2018-02-23 00:25:07 +01:00
nachoparker
36a803f021 add ncp-provisioning to SD card images 2018-02-23 00:24:38 +01:00
nachoparker
d05b069961 ncp-web: fix overlay z-index 2018-02-22 21:11:36 +01:00
nachoparker
0d6ad682b7 wizard: fix logbox overflow 2018-02-22 11:04:18 +01:00
nachoparker
d2318a4e98 wizard: animate side logs 2018-02-21 21:06:49 +01:00
nachoparker
6dd70a754a ncp-web: animate script textbox 2018-02-21 19:57:41 +01:00
nachoparker
8389ac7386 ncp-web: fix backend request without arguments 2018-02-21 19:57:41 +01:00
nachoparker
8d100b9d87 ncp-web: link to wizard and Nextcloud instance 2018-02-21 19:57:41 +01:00
nachoparker
63b74a8273 ncp-web: support for small screens 2018-02-20 21:33:41 +01:00
nachoparker
bf4d2fc476 UFW: make it work with nc-forward-ports 2018-02-19 19:58:53 +01:00
nachoparker
94bd3b9fba docker: use docker networks for x86 2018-02-19 13:23:23 +01:00
Aeon512
a9a18097e6 random password provisioning on boot/startup
During bootup of a new docker image, the redis
password might not match the nextcloud configuration.
Hence, we automatically update the nextcloud configuration.

For the MariaDB password the same method is applied.

Additionaly identical files have been moved to docker-common
to simplify changes in the future
2018-02-19 13:12:48 +01:00
nachoparker
648f53b88d ncp-web: re-style poweroff menu 2018-02-18 23:12:38 +01:00
nachoparker
7d03e84ff4 ncp-web: disable event handler after poweroff 2018-02-18 20:33:15 +01:00
theCalcaholic
f1d41e3846 Add dialog for shutdown. 2018-02-18 20:14:00 +01:00
nachoparker
26afda9281 remove redundant configuration from unattended upgrades 2018-02-18 20:08:48 +01:00
nachoparker
8546ea6ee7 lamp: enhance SSL security (chacha cypher), and OCSP stapling 2018-02-18 20:08:48 +01:00
nachoparker
f8381f42cd log all NCP actions to /var/log/ncp.log 2018-02-18 20:08:45 +01:00
nachoparker
51b1e5dd52 update: accept github branch as an argument to ncp-update to test development branch 2018-02-16 12:42:06 +01:00
nachoparker
f03931116f build: warn about missing variable FTPPASS 2018-02-16 12:42:06 +01:00
nachoparker
67a4093e5f lamp: protect apache fingerprinting 2018-02-16 10:40:36 +01:00
nachoparker
875ce59128 SSH: dont create user if it doesnt exist 2018-02-15 21:36:35 +01:00
nachoparker
cac81ec0f0 samba: create share per NC user 2018-02-13 20:05:37 +01:00
nachoparker
30a8bdd213 letsencrypt: only call update-rc.d in docker builds 2018-02-13 18:03:56 +01:00
Aeon512
df8703cac8 Restore LetsEncrypt after docker-compose up/down 2018-02-13 18:03:56 +01:00
nachoparker
34a3bd5d52 preactivate useful apps for a selfhosted instance 2018-02-13 18:03:56 +01:00
nachoparker
c14b05600d update: fix typo in check version 2018-02-12 08:58:32 +01:00
testbird
dc88dcb968 Update ncp-check-version 2018-02-10 11:09:30 +01:00
nachoparker
3b458f35de nc-backup: stronger permissions for backup file 2018-02-09 12:22:07 +01:00
nachoparker
9ed6228e51 build: separate file to automate packing of odroid HC1 2018-02-09 12:21:10 +01:00
nachoparker
07b38cb240 docker: fixes in build process for NC13 version 2018-02-09 09:16:25 +01:00
nachoparker
fc0d3f96f2 do not rely on pings, just return value of operations 2018-02-08 14:10:30 +01:00
nachoparker
ab865519e2 unattended upgrades: fix unattended upgrades not working because of modified files 2018-02-07 17:08:05 +01:00
nachoparker
91eeeea06c modsecurity: turn off logging, its too spammy for ramlogs 2018-02-07 17:08:04 +01:00
nachoparker
d7f253e25c ping to 4.2.2.2 because google is blocked in china 2018-02-07 17:07:56 +01:00
nachoparker
c8aa2a2ab5 update README.md 2018-02-07 00:38:46 +01:00
nachoparker
64f9673bf8 update to NC 13.0.0 2018-02-06 14:24:24 +01:00
nachoparker
048ee6af6f added ncp-config link to nextcloudpi-config 2018-02-06 14:22:15 +01:00
nachoparker
48a22b497f build: git is needed by update system 2018-02-06 14:21:02 +01:00
immae
257787abe3 lamp: add ldap support (#377)
added ldap support for php
2018-02-05 22:58:46 +01:00
nachoparker
4dce600678 nc-nextcloud: fixes for beta versions 2018-02-05 22:55:29 +01:00
Oliver V
776529f889 nc-nextcloud: add option to install beta (#354)
If yes it adds "pre"  to the download path
2018-02-05 21:58:36 +01:00
nachoparker
67b12bb9be nc-backup: fixes in checking space and auto 2018-02-05 20:14:12 +01:00
nachoparker
5452567300 build: fix cleanup: udisks depends on make and buildutils 2018-02-05 20:12:32 +01:00
nachoparker
ec40fe67c7 update to NC 12.0.5 2018-02-03 17:15:09 +01:00
nachoparker
85742a5203 nc-init and samba: default to ncp user 2018-01-10 14:39:23 +01:00
nachoparker
978781c7cd nc-ramlogs: limit tmpfs to 100M 2018-01-10 14:38:11 +01:00
nachoparker
7d105f8ebc letsencrypt: revert pip.conf pre-workaround, tweak cron 2018-01-10 14:36:17 +01:00
nachoparker
db322f2d09 nc-swapfile: improved, and take BTRFS into account 2018-01-10 14:31:55 +01:00
nachoparker
0587ca339c nc-restore: check validity of backup file 2018-01-07 19:16:32 +01:00
nachoparker
614c57d786 nc-restore: refresh trusted domains 2018-01-07 19:01:25 +01:00
nachoparker
0972d57573 nc-restore: fix bug detecting data 2018-01-07 16:31:19 +01:00
nachoparker
459fe39166 nc-restore: restore to a btrfs subvolume 2018-01-06 21:39:20 +01:00
nachoparker
3beff63189 nc-backup: make binary work standalone 2018-01-06 11:00:23 +01:00
nachoparker
f63a353bcd nc-restore: restore compressed backups 2018-01-05 18:41:27 +01:00
nachoparker
54631e245f nc-backup: compress backups and refactoring 2018-01-04 22:33:46 +01:00
nachoparker
a1a2f512e6 nc-restore: update redis password 2018-01-03 13:17:15 +01:00
nachoparker
fd71cb6d60 nc-export: protect file from read 2018-01-03 13:16:43 +01:00
nachoparker
d4d2dcdbbc build: use clone where possible 2018-01-03 11:39:44 +01:00
nachoparker
2687fdba96 nc-snapshot: update btrfs-snp 2018-01-01 19:51:29 +01:00
nachoparker
6fb4fef151 nc-snapshot: use btrfs-snp 2017-12-28 12:33:56 +01:00
nachoparker
9e1da027d9 added nc-snapshot-auto 2017-12-28 10:47:51 +01:00
nachoparker
e10dd39eca nc-datadir: use clone on btrfs systems 2017-12-26 10:11:08 +01:00
nachoparker
803a1f1c8d UFW: prettier output 2017-12-19 19:19:24 +01:00
nachoparker
66e50d8917 ncp-config: validate input 2017-12-19 19:14:17 +01:00
nachoparker
c0a9997b4e added nc-audit 2017-12-19 19:13:17 +01:00
nachoparker
71f676e21d added UFW 2017-12-19 19:12:45 +01:00
nachoparker
34fc851c24 security hardening part 3 2017-12-17 14:48:09 +01:00
nachoparker
af54edb121 security hardening part 2 2017-12-17 13:46:35 +01:00
nachoparker
bd5cb8e2b3 security hardening 2017-12-16 23:14:20 +01:00
nachoparker
f043feef9c build: cleanup adjustments 2017-12-16 23:14:16 +01:00
nachoparker
85c872255b dnsmasq: added interface 2017-12-16 09:59:37 +01:00
nachoparker
4b07f0b423 fix occ command without execute permissions 2017-12-14 13:01:21 +01:00
Nikolaos Perrakis
3f09cd500f Fixed configuration interoperability between nc-datadit and fail2ban. (#323)
looks perfect, many thanks!
2017-12-13 18:57:09 +01:00
nachoparker
f7030f56d4 replace ping to github.com to google.com 2017-12-12 10:20:31 +01:00
nachoparker
3fedf4f432 ncp-config: show changelog on updates 2017-12-05 17:42:24 +01:00
nachoparker
3896b7f530 nc-database: accept BTRFS filesystems 2017-12-05 13:50:17 +01:00
nachoparker
3c85b809a8 nc-limits: added PHP threads and Redis mem limits 2017-12-05 13:49:28 +01:00
nachoparker
89f77e7e02 build: cleanup all extras 2017-12-05 12:35:25 +01:00
nachoparker
30c34d8162 SSH: enhance security 2017-12-05 11:45:34 +01:00
nachoparker
36bb1dee32 build: no need to remove history 2017-12-05 09:49:41 +01:00
nachoparker
ed064bec1f update README.md 2017-12-05 09:20:26 +01:00
nachoparker
030bbedf75 nc-automount: check for USBdrive labeled drive case 2017-12-04 15:45:56 +01:00
nachoparker
29da1b5e86 nc-info: warn of long operation 2017-12-04 14:58:20 +01:00
nachoparker
ad26b87f17 updated to NC12.0.4 2017-12-04 12:08:14 +01:00
nachoparker
bf172cbb6c docker: update dockerignore 2017-12-03 22:28:58 +01:00
nachoparker
a13446ec59 build: fixes 2017-12-03 22:28:22 +01:00
nachoparker
d40360c82e added btrfs snapshots 2017-12-03 21:54:40 +01:00
nachoparker
beb8f1cb0c build: fixes armbian build 2017-11-30 18:16:05 +01:00
nachoparker
7726f099c9 nc-export: silent cd 2017-11-29 18:32:12 +01:00
nachoparker
7aaf31c231 nc-import: fix ncp-web appearing to fail when activating options that restart httpd 2017-11-29 18:40:56 +01:00
nachoparker
1e2de68468 motd: update logo 2017-11-28 04:34:02 +01:00
nachoparker
f8b328e396 added nc-export-ncp and nc-import-ncp 2017-11-27 20:11:28 +01:00
nachoparker
6c7cd4b8be nc-info: warn distro 2017-11-27 20:10:12 +01:00
nachoparker
58d4ca6244 added SSH 2017-11-27 11:12:55 +01:00
nachoparker
98c664938f build: autoupload ftp 2017-11-26 16:56:23 +01:00
nachoparker
39064cc5fc nc-info: provide suggestions 2017-11-25 12:15:42 +01:00
nachoparker
5d7188e818 dnsmasq: improve output 2017-11-25 12:14:40 +01:00
nachoparker
aae2b68dee update: silence overcommit memory 2017-11-25 12:10:08 +01:00
nachoparker
86ab526cd9 build: fix cleanup 2017-11-24 18:24:55 +01:00
nachoparker
c0cb88088c nc-nextcloud: preconfigure postfix 2017-11-23 19:11:38 +01:00
nachoparker
681dc69dc7 build: batch creation of all images and containers 2017-11-23 18:50:22 +01:00
nachoparker
56c900948d build: improve create_torrent 2017-11-23 14:42:32 +01:00
nachoparker
6883aa2da7 added armbian support 2017-11-22 19:26:29 +01:00
Nikolaos Perrakis
6fe08e6858 Using sites-available instead of sites-enabled directory to always find the file. 2017-11-21 16:25:07 +01:00
nachoparker
2c884b7008 nc-datadir: dont create dir if not exists 2017-11-20 10:21:09 +01:00
nachoparker
dd1d6e62e0 nc-restore: fix restore passwod 2017-11-19 23:16:23 +01:00
nachoparker
4593bc2d2f fix comments ncp-report 2017-11-19 23:16:23 +01:00
nachoparker
467176b6dc build: fix image name 2017-11-19 23:16:23 +01:00
nachoparker
81f0bd0f7a tests: correct new title 2017-11-19 23:16:23 +01:00
nachoparker
de4e0c7cb2 added nc-info 2017-11-19 11:46:32 +01:00
nachoparker
d1e529ea8e nc-diag: small fixes 2017-11-19 11:44:50 +01:00
nachoparker
c1eb9080d9 update: fix return value 2017-11-19 11:07:10 +01:00
nachoparker
4328831a76 build: add prepare_sshd 2017-11-19 11:07:07 +01:00
nachoparker
ede912f8db added ncp-diag and ncp-report 2017-11-18 15:00:40 +01:00
nachoparker
2c25fa91d3 nextcloudpi-config: inform changelog 2017-11-18 15:00:40 +01:00
nachoparker
bccbb5ba6c nc-datadir: make backup if non empty 2017-11-18 15:00:38 +01:00
nachoparker
75fe8d485f added nc-passwd 2017-11-17 01:37:32 +01:00
nachoparker
370fc74ac9 nc-datadir: refuse to move to SD card 2017-11-17 00:40:30 +01:00
nachoparker
ba765664f7 update: check existence ncp.conf 2017-11-16 19:54:33 +01:00
nachoparker
95240caadb update: check return code 2017-11-16 19:34:02 +01:00
nachoparker
7e126fdda9 improve IP detection 2017-11-16 19:21:42 +01:00
nachoparker
ac9989dd28 fail2ban: fix accidentally deleted line 2017-11-16 14:20:28 +01:00
nachoparker
509206cd23 ncp-web: only show wizard button if it exists, delete from docker 2017-11-15 20:23:07 +01:00
nachoparker
cd2e947144 docker: add update-rc.d function 2017-11-15 19:33:57 +01:00
nachoparker
fa51967336 docker: add postfix 2017-11-14 21:11:45 +01:00
nachoparker
f457852997 docker: remove spDYN for now 2017-11-14 21:02:59 +01:00
nachoparker
f8da70445e docker: avoid systemctl to restart apache 2017-11-14 20:13:00 +01:00
nachoparker
dc2ddd757b noip: fix return value 2017-11-14 20:00:27 +01:00
nachoparker
b96704bb6d docker: fix notifications 2017-11-14 18:50:04 +01:00
nachoparker
521475c978 update: cleanup old fixes 2017-11-14 16:56:40 +01:00
nachoparker
a7af6e41d2 nc-nextcloud: restart php after redis 2017-11-12 17:41:25 +01:00
nachoparker
72463fa20b build: install script more info 2017-11-12 17:38:31 +01:00
nachoparker
3b87dd7219 update README.md 2017-11-12 13:38:06 +01:00
nachoparker
3fa9a92e52 build: fix installation order 2017-11-12 10:09:37 +01:00
nachoparker
88815bb294 nc-init: install notifications 2017-11-12 10:09:33 +01:00
nachoparker
c2143b9049 redis: fix update bug 2017-11-12 07:23:18 +01:00
nachoparker
515154280a docker: add redis 2017-11-11 11:59:26 +01:00
nachoparker
a71ec05e01 redis: fix socket permissions 2017-11-11 10:50:37 +01:00
nachoparker
10488be24b update: wait running apt processes (fix) 2017-11-10 18:14:20 +01:00
nachoparker
fa5f56e2e7 redis: fixes with ramlogs and modsecurity 2017-11-10 18:14:17 +01:00
nachoparker
9657f7f25c redis: change overcommit memory on update 2017-11-10 09:15:38 +01:00
nachoparker
f557c8d8b6 Revert "update: wait running apt processes"
This reverts commit 31470473f8418a47156545d73e4952ef7edbcc48.
2017-11-10 09:15:38 +01:00
nachoparker
94b7021f1f nc-nextcloud: added more logging 2017-11-10 09:15:38 +01:00
nachoparker
958beefdd7 added NCP custom theme with new logo 2017-11-10 09:15:35 +01:00
nachoparker
7e2abc9133 added redis 2017-11-09 17:04:31 +01:00
nachoparker
9fbdb3e357 build: fix devel build clash with unattended 2017-11-09 14:06:13 +01:00
nachoparker
1955ecec9c nc-notify-updates: fixes 2017-11-09 13:07:34 +01:00
nachoparker
4329eea039 noip: manage many interfaces and fix return value 2017-11-08 18:16:24 +01:00
nachoparker
8dbd28246b update: wait running apt processes 2017-11-08 18:16:24 +01:00
nachoparker
01a33d4317 fail2ban: update logpath on nc-datadir or nc-restore 2017-11-08 18:16:19 +01:00
nachoparker
7c4d6f4af3 docker: add dnsmasq 2017-11-08 08:10:25 +01:00
nachoparker
a6165f0e06 docker: simplify networking for port forwarding 2017-11-07 19:43:43 +01:00
nachoparker
963542bd30 nc-notify-updates: rework for more accuracy 2017-11-06 15:17:50 +01:00
nachoparker
9212ecb09b build: installer script for debian 2017-11-06 14:39:14 +01:00
nachoparker
d0a839c09d added docker-x86: nc and ncp for development. Update docker-armhf 2017-11-05 13:36:15 +01:00
nachoparker
fa2279faa9 ncp-web: fix return value 2017-11-04 18:19:30 +01:00
nachoparker
961008cd46 build: replace user pi for user ncp 2017-11-04 13:44:20 +01:00
nachoparker
982feca34a build: rename batch.sh 2017-11-04 13:44:20 +01:00
nachoparker
d1773f4785 build: move installation of nextcloud accessory software 2017-11-04 13:44:16 +01:00
nachoparker
06294c5f8b spDYN: initial adjustments 2017-11-03 13:26:08 +01:00
TimmThaler
f2df560fe1 added spdns.de DynDNS service 2017-11-03 13:13:41 +01:00
nachoparker
74fd94c88a ncp-web: fix timeout in long operations 2017-11-03 13:10:10 +01:00
nachoparker
b27974fde3 build: expand filesystem during first boot 2017-10-31 18:43:34 +01:00
nachoparker
515b73151f nc-backup: check available space 2017-10-31 18:42:48 +01:00
nachoparker
706a48dc75 nc-restore: restore db password before occ command 2017-10-31 16:37:46 +01:00
nachoparker
6fdb761789 build: check ncp-launcher existence for old images 2017-10-30 02:10:24 +01:00
nachoparker
447585d2b5 letsencrypt: remove workaround. fixed upstream 2017-10-29 19:06:28 +01:00
nachoparker
6b1578d862 build: fix cleanup optional 2017-10-28 09:42:59 +02:00
nachoparker
36af04b8b1 nc-forward-ports: more info in output 2017-10-27 18:46:06 +02:00
nachoparker
a494e696c7 nc-format-USB: more info in output 2017-10-27 18:45:18 +02:00
nachoparker
0bc5e091b9 wizard: chain configurations and improved feedback 2017-10-27 18:44:47 +02:00
nachoparker
0a3289e654 freeDNS: launch immediately on configure 2017-10-26 12:24:19 +02:00
nachoparker
d8b6eb3867 nc-notify-updates: fix repeated lines 2017-10-26 12:17:51 +02:00
nachoparker
2f1a9c99e9 samba: disable homes share by default 2017-10-25 14:06:12 +02:00
nachoparker
84a2d61979 letsencrypt: fix return value 2017-10-25 11:55:45 +02:00
nachoparker
8f54ff7777 noip: make possible to reconfigure while running 2017-10-25 11:55:23 +02:00
lana-u
4c7e5625f4 freeDNS: fix periodic update typo 2017-10-23 20:55:29 +02:00
nachoparker
7ffc801673 ncp-web: improve password prompt permissions 2017-10-20 10:28:48 +02:00
nachoparker
c4917b4041 Revert "ncp-web: remove http2 push headers. They dont play well with pwauth (#224)"
This reverts commit e3ef9730bf54d68cb04a009db6b2786c190eabc9.
2017-10-20 10:28:48 +02:00
nachoparker
bd74eb477f ncp-web: integrate ncp-wizard with ncp-web 2017-10-20 10:28:45 +02:00
nachoparker
a5ce511469 letsencrypt: fix workaround for old images 2017-10-07 09:39:45 +02:00
nachoparker
dcbafb292f fail2ban: email notification (Closes #232) 2017-10-06 17:07:34 +02:00
nachoparker
a4e5df7c5b nc-backup: fix excludes 2017-10-04 21:06:44 +02:00
nachoparker
c00e1e9827 nc-forward-ports: exit status on failure 2017-10-04 16:40:12 +02:00
nachoparker
6eab4ff946 nc-wifi: improve instructions 2017-10-04 14:41:47 +02:00
nachoparker
6e129da180 ncp-web: small fixes 2017-10-04 14:41:47 +02:00
nachoparker
99126b6144 letsencrypt: dont change config if not successful 2017-10-04 14:41:47 +02:00
nachoparker
9623e484ca letsencrypt: fix external bug (Closes #230) 2017-10-03 19:07:17 +02:00
nachoparker
ba9d6fdf2d nc-format-USB: fix format disks >2TB and more (Closes #223) 2017-09-30 17:14:54 +02:00
nachoparker
cfcb53524b nc-format-USB: speed up ext4 creation with lazy initialization 2017-09-30 14:59:21 +02:00
nachoparker
b2500f3cf2 letsencrypt: fix uppercase domains cert path (Closes #229) 2017-09-30 14:17:27 +02:00
nachoparker
9dd2d32909 update README.md 2017-09-30 14:17:00 +02:00
nachoparker
2f83da0858 ncp-web: remove http2 push headers. They dont play well with pwauth (#224) 2017-09-30 11:30:15 +02:00
nachoparker
8c590e99b0 nc-static-IP: fix occ path 2017-09-28 18:40:07 +02:00
nachoparker
5b50ec3b99 wizard: connect backend with frontend. Modifications for first release 2017-09-27 22:41:00 +02:00
Panteleimon Sarantos
812fd0ba1b Initial commit of ncp-web-wizard. 2017-09-27 22:27:08 +02:00
nachoparker
0c535b5b5a reviewed duckDNS: small adaptations 2017-09-27 01:17:39 +02:00
stratacast
6ded346959 Create nc-duckdns.sh
Add script to handle DuckDNS
2017-09-27 01:09:10 +02:00
nachoparker
cde1842018 remove cleanup step from extras. Make it optional 2017-09-27 01:09:10 +02:00
nachoparker
192a9fcc50 nc-backup: apply limit before backup 2017-09-27 01:09:07 +02:00
nachoparker
3a5cc3fffb ncp-web: authentication fixes 2017-09-25 11:24:16 +02:00
Panteleimon Sarantos
d42cbb74b8 ncp-web authentication prompt 2017-09-24 22:53:42 +02:00
nachoparker
acbe26cc14 docker: updated to stretch and added NextCloudPi layer 2017-09-21 22:20:46 +02:00
nachoparker
786728c2ec changed hostname 2017-09-21 22:19:17 +02:00
nachoparker
a42e379a26 lamp: add fileinfo mcrypt packages 2017-09-21 22:19:17 +02:00
nachoparker
189e34b019 updated to NC12.0.3 2017-09-21 22:19:17 +02:00
nachoparker
78feb74170 more adaptations to docker build 2017-09-21 22:18:47 +02:00
nachoparker
c14198995c ncp-web: point changelog to master 2017-09-18 22:46:50 +02:00
nachoparker
261326c594 update: check for docker build for fixes 2017-09-18 19:51:58 +02:00
nachoparker
019c2f0da8 nc-static-IP: add new IP to trusted domain 2017-09-16 20:38:58 +02:00
nachoparker
4c79bcc9ca update github template 2017-09-15 09:23:34 +02:00
nachoparker
bd79fb9b75 added nc-static-IP 2017-09-14 10:39:46 +02:00
nachoparker
111cc78ba3 added nc-fix-permissions 2017-09-14 10:35:19 +02:00
nachoparker
bb91d83df7 split library.sh 2017-09-12 19:09:44 +02:00
nachoparker
020cfdcef9 fail2ban: autodetect log path 2017-09-12 18:49:54 +02:00
nachoparker
c982debf79 ncp-web: fix php exec with background restarting of processes 2017-09-12 09:31:41 +02:00
nachoparker
c20649d625 remove config txt output 2017-09-11 17:36:50 +02:00
nachoparker
ef402e736b nc-backup: small fixes 2017-09-11 17:36:47 +02:00
nachoparker
16304252ee ncp-web: link to wiki info for each extra 2017-09-11 17:16:43 +02:00
nachoparker
cdad339d13 ncp-web: minor tweaks 2017-09-10 17:42:08 +02:00
nachoparker
60711f3ca6 ncp-web: click version for changelog. click new version notification to nc-update 2017-09-10 15:15:45 +02:00
nachoparker
1da6b12672 nc-format-USB: silent mkfs output 2017-09-10 13:51:47 +02:00
nachoparker
70aac8e5f5 ncp-web: display info for each option 2017-09-10 13:51:20 +02:00
nachoparker
1f055f8933 nc-format-USB: adjust to the new automount system 2017-09-09 09:22:43 +02:00
nachoparker
b1c5fa6694 build devel: deactivate unattended upgrades 2017-09-08 10:19:20 +02:00
nachoparker
82d72e9759 tag images 2017-09-08 10:14:15 +02:00
nachoparker
4a0a1824cc backend: is_active() functionality 2017-09-08 10:01:14 +02:00
nachoparker
6e63b55274 letsencrypt: occ path fix 2017-09-08 08:46:54 +02:00
nachoparker
e7e07863ce refactor show_info(), make it only depend on variables 2017-09-07 22:38:44 +02:00
nachoparker
74c8d95609 ncp-web: link to changelog 2017-09-07 19:51:28 +02:00
nachoparker
b104108766 autogenerate changelog 2017-09-07 16:08:38 +02:00
nachoparker
4d01fd8182 added sendmail and mail configuration 2017-09-06 21:53:27 +02:00
nachoparker
abe0ee73b4 disable not needed apache modules 2017-09-06 20:02:36 +02:00
nachoparker
21832c1c06 modsecurity: fix in Stretch 2017-09-06 19:00:20 +02:00
nachoparker
b5f037ef42 apache: set default Servername 2017-09-06 18:59:42 +02:00
nachoparker
14dcde4405 nc-automount: more logging and safety delay 2017-09-06 16:56:01 +02:00
nachoparker
6a81ce686d update README.md 2017-09-05 22:14:39 +02:00
nachoparker
ce42e1af67 nc-automount: small fix 2017-09-05 11:26:27 +02:00
nachoparker
a5beae8d85 nc-autoupdate-ncp: ability to choose the user to notify 2017-09-05 09:48:07 +02:00
nachoparker
4c70d15148 cleanup: dont disable ssh in extras, only in nextcloudpi.sh 2017-09-04 18:29:13 +02:00
nachoparker
00e8c777fc samba: always use NC datadir 2017-09-04 18:26:17 +02:00
nachoparker
4074edaa11 samba: disable SMB1 2017-09-04 18:19:14 +02:00
nachoparker
6a2dd48add ncp-web: disable PHP restart in update, (doesnt work) (#176) 2017-09-04 17:31:40 +02:00
nachoparker
997f610af9 unattended upgrades: delete default config in stretch 2017-09-04 16:55:24 +02:00
nachoparker
87b150973c nc-automount: small fix 2017-09-03 22:55:50 +02:00
nachoparker
0b28b96a3a freeDNS: fix 2017-09-03 22:47:00 +02:00
nachoparker
88a7d5ec10 nc-automount: improve links more 2017-09-03 22:47:00 +02:00
nachoparker
5f943aca5b freeDNS: fixes 2017-09-03 22:47:00 +02:00
Panteleimon Sarantos
dd08a396a9 Add FreeDNS client installation for Raspbian 2017-09-03 22:47:00 +02:00
nachoparker
3393477268 nc-automount: improve links 2017-09-02 11:55:01 +02:00
nachoparker
ee74875871 nc-notify-updates: notify also of unattended upgrades 2017-09-01 23:32:24 +02:00
nachoparker
bb58ac7501 added nc-webui 2017-09-01 23:32:22 +02:00
nachoparker
e5790d4a85 fix IP regex 2017-09-01 23:32:22 +02:00
nachoparker
a695c16693 nc-notify-updates: allow specifying user 2017-09-01 23:32:22 +02:00
nachoparker
c4d2e41c1c nc-automount: complete overhaul 2017-09-01 23:32:19 +02:00
nachoparker
b25fd331df cleanup qemu rules 2017-09-01 23:32:19 +02:00
nachoparker
1a33e380e8 noip: update description 2017-09-01 23:32:19 +02:00
nachoparker
f492269701 use always no-install-recommends 2017-09-01 23:32:19 +02:00
nachoparker
009c82e6cf shellcheck style fixes 2017-09-01 23:32:16 +02:00
nachoparker
cfc759969a nc-backup: exclude opcachedir and logs 2017-08-31 07:23:36 +02:00
nachoparker
a86efea78e various extras: check internet connectivity 2017-08-31 06:12:33 +02:00
nachoparker
2c911be361 nc-automount: small fix 2017-08-30 19:47:23 +02:00
nachoparker
8374a704fe nc-news: remove it, it is already in the app store 2017-08-30 18:06:48 +02:00
nachoparker
9e212e69b9 fix nextcloud-domain service with ipv6 2017-08-30 07:51:01 +02:00
nachoparker
a8cfd17984 nc-automount: only modify fstab when active 2017-08-30 07:29:36 +02:00
nachoparker
263e15a4e3 adjust max PHP processes 2017-08-30 07:29:36 +02:00
nachoparker
8846df1ed7 samba: fix permissions 2017-08-29 18:56:52 +02:00
nachoparker
06a07cbb0c remove special characters from output, for ncp-web 2017-08-24 22:16:08 +02:00
nachoparker
f044c6d6b2 ncp-web: use SSE to display process output in real time. Exit status green/red 2017-08-24 21:35:17 +02:00
nachoparker
edccf4a7e1 fix fail2ban with stretch 2017-08-22 00:16:47 +02:00
nachoparker
5e711e9ffd update to Raspbian Stretch 2017-08-20 15:29:34 +02:00
nachoparker
3d8063221d ncp-web: poweroff button 2017-08-17 22:02:54 +02:00
nachoparker
ba953428c7 nc-notify-updates: simplify parameters 2017-08-17 10:07:25 +02:00
nachoparker
5d3357c99e update README.md 2017-08-17 10:01:43 +02:00
nachoparker
53c498bffd update to nextcloud 12.0.2 2017-08-16 16:55:05 +02:00
nachoparker
e10bf3bcd9 nc-notify-updates: only notify once 2017-08-16 16:51:26 +02:00
nachoparker
b95f6d5b8b nc-automount: added info 2017-08-16 16:51:26 +02:00
nachoparker
d638cf9459 added nc-autoupdate-ncp 2017-08-16 16:51:23 +02:00
nachoparker
bb88b512fc fix comment 2017-08-16 00:52:29 +02:00
nachoparker
8f349c938f faster remote updates and version checks 2017-08-16 00:37:50 +02:00
nachoparker
96685c2928 nc-automount: fixed persistence of links and more 2017-08-15 17:29:03 +02:00
nachoparker
9176473b2d nc-database: fail gracefully if mv fails 2017-08-14 11:27:28 +02:00
nachoparker
7dde92aa80 ncp-web: allow commas 2017-08-14 11:23:14 +02:00
nachoparker
5ebeaf12ec added nc-notify-updates 2017-08-12 09:51:42 +02:00
nachoparker
bd8f18472f nc-news: small improvements 2017-08-12 08:28:07 +02:00
nachoparker
c2ca13e4ab fix version check 2017-08-11 00:35:02 +02:00
nachoparker
20fea70254 alert of updates 2017-08-11 00:17:18 +02:00
nachoparker
611b5a9174 ncp-web: alert if update is available 2017-08-10 23:34:10 +02:00
nachoparker
a0154aaee2 ncp-web: show version 2017-08-10 23:17:56 +02:00
nachoparker
77567c40bb ncp-web: visually indicate selected extra 2017-08-10 23:17:56 +02:00
nachoparker
08b3e1fc2c ncp-web: active mark 2017-08-10 23:17:56 +02:00
nachoparker
f58ca622c7 nc-restore: inform of existing data backup 2017-08-10 23:17:56 +02:00
nachoparker
b1c307335f ncp-web: use checkboxes for yes/no fields 2017-08-10 23:17:56 +02:00
nachoparker
6f7465844c ncp-web: LAN access restrictions ipv6 2017-08-10 23:17:56 +02:00
nachoparker
390b313025 nc-restore: dont destroy existing datadir 2017-08-10 23:17:56 +02:00
nachoparker
3dd9945fd6 restore from other instance fix 2017-08-10 23:17:56 +02:00
nachoparker
a6b79b433f fix web update to NC12.0.1 2017-08-10 23:17:56 +02:00
nachoparker
f248c0fc09 stop qemu after tests 2017-08-10 23:17:56 +02:00
nachoparker
fc4ea8a623 update to nextcloud 12.0.1 2017-08-10 23:17:56 +02:00
nachoparker
4ecfccb225 dont install php-smbclient: breaks samba 2017-08-10 23:17:56 +02:00
nachoparker
bce67d3dbd letsencrypt: info about open ports 2017-08-10 23:17:56 +02:00
nachoparker
7111bb2c22 NFS: more info and rearrange code 2017-08-10 23:17:56 +02:00
nachoparker
744c716d0b stop script if noip config fails 2017-08-10 23:17:56 +02:00
nachoparker
97b372aad0 typo in issue template 2017-08-10 23:17:56 +02:00
nachoparker
6617f29d3c nc-backup: small fix 2017-08-10 23:17:56 +02:00
nachoparker
d819bbb625 simplify parameters 2017-08-10 23:17:56 +02:00
nachoparker
c4210c5a69 fix swapfile with automount 2017-08-10 23:17:56 +02:00
nachoparker
6f8d553510 output some more information in nc-backup-auto and nc-scan-auto 2017-08-10 23:17:56 +02:00
nachoparker
c5c5a8eab0 fix nc-scan-auto 2017-08-10 23:17:56 +02:00
nachoparker
e0d9aea83c use letsencrypt certificate for ncp-web 2017-08-10 23:17:56 +02:00
nachoparker
182c41a150 added nc-backup-auto 2017-08-10 23:17:56 +02:00
nachoparker
74c0f57d38 fix ncadmin password 2017-08-10 23:17:56 +02:00
nachoparker
6257eb6b6d refactor nc-scan-auto 2017-08-10 23:17:56 +02:00
nachoparker
90dd8d6689 backup/restore: include datadir 2017-08-10 23:17:56 +02:00
nachoparker
530e3a1e06 randomize database password (fixes) 2017-08-10 23:17:56 +02:00
nachoparker
558e3a5029 manage overwrite.cli.url 2017-08-10 23:17:56 +02:00
nachoparker
24ccde481b fix smbclient segfault 2017-08-10 23:17:56 +02:00
nachoparker
6df5f735b7 nc-restore: fix situation opcache dir was moved 2017-08-10 23:17:56 +02:00
nachoparker
edbfa672b5 randomize database password 2017-08-10 23:17:56 +02:00
nachoparker
3ee3a28219 added HTTP port to port forwarding rules 2017-08-10 23:17:56 +02:00
nachoparker
dd18897475 added github issue template 2017-08-10 23:17:56 +02:00
nachoparker
8127734d92 fix unattended-upgrades 2017-08-10 23:17:56 +02:00
nachoparker
00a483af08 output some more information in automount,datadir,unattended-upgrades 2017-08-10 23:17:56 +02:00
nachoparker
efa3a90a2e secure mysqld 2017-08-10 23:17:56 +02:00
nachoparker
20c35ea3fb nc-backup: make sure destination dir exists 2017-08-10 23:17:56 +02:00
nachoparker
47a9cafc8a nc-nextcloud: fixes for docker build process 2017-08-10 23:17:56 +02:00
nachoparker
c9a6c57e2f tests: review style and fixes 2017-08-10 23:17:56 +02:00
nachoparker
93a2b0ae05 nc-init: check mariaDB up 2017-08-10 23:17:56 +02:00
nachoparker
1344a7da0d dnsmasq detect ip 2017-08-10 23:17:56 +02:00
nachoparker
a7a463718c enable nc-news 2017-08-10 23:17:55 +02:00
nachoparker
49ded4f732 update README.md 2017-08-10 23:17:55 +02:00
nachoparker
90ff8b516e letsencrypt without restarting apache 2017-08-10 23:17:55 +02:00
nachoparker
bec9cdb38a ncp-web HTTPS only 2017-08-10 23:17:55 +02:00
nachoparker
1e98c8e93c restart HTTPd delayed on the bg, so it does not kill AJAX response 2017-08-10 23:17:55 +02:00
nachoparker
41e71b4cbb added ncp-web 2017-08-10 23:17:51 +02:00
nachoparker
c0a69703ae added automatic testing 2017-07-12 21:00:10 +02:00
nachoparker
33e01e7cd8 changed mysql config file location 2017-07-07 08:02:04 +02:00
nachoparker
a98bf796ee improve info letsencrypt 2017-07-05 21:31:03 +02:00
nachoparker
46c2487829 create torrent in library and batch 2017-07-04 09:03:53 +02:00
nachoparker
a82d2d1500 added nc-format-USB 2017-07-03 19:10:33 +02:00
nachoparker
83af8e7493 add smbclient for external storage 2017-06-30 12:28:12 +02:00
nachoparker
0e5d8ac058 nc-automount improvements 2017-06-30 12:28:12 +02:00
nachoparker
dbbdfea70f add nc-forward-ports 2017-06-29 15:13:38 +02:00
nachoparker
4aba04963c init noip service in installation step 2017-06-29 15:13:38 +02:00
nachoparker
ea1a3d61aa add info message nc-news 2017-06-29 06:11:07 +02:00
nachoparker
10a9d2e4f8 clear screen before nextcloudpi output 2017-06-29 06:11:03 +02:00
nachoparker
27830f5057 change config message 2017-06-29 04:48:41 +02:00
nachoparker
ce003aa6ee save partials in folder 2017-06-29 04:48:41 +02:00
nachoparker
88bf2c7718 nc-wifi and trusted domain fixes 2017-06-29 04:48:41 +02:00
nachoparker
c94bc52dc2 nc-automount fixes 2017-06-28 17:44:00 +02:00
nachoparker
bb61bb7c0e protect nextcloudpi-config files from reading. They can contain sensitive information 2017-06-28 17:44:00 +02:00
nachoparker
36b3f49d35 More warnings for nc-database 2017-06-28 17:44:00 +02:00
nachoparker
709cd60612 Show current version in MOTD when there is an update available 2017-06-28 17:44:00 +02:00
nachoparker
c33cabc537 nc-init as a nextcloudpi-config option 2017-06-28 17:43:54 +02:00
nachoparker
f2f0687104 nc-news, install news app 2017-06-28 07:15:43 +02:00
nachoparker
c03bb6fd8a support for utf8 4byte char 2017-06-28 07:15:43 +02:00
nachoparker
ecedf91306 check version format 2017-06-28 07:15:40 +02:00
nachoparker
338adfb1e3 instructions for dnsmasq and noip 2017-06-13 18:59:06 +02:00
nachoparker
7356998238 silence output of download and untar in nc-nextcloud.sh 2017-06-13 18:56:53 +02:00
nachoparker
c7cf262232 md5sum of the tar.bz2 file 2017-06-13 10:05:09 +02:00
nachoparker
aa6f5cab05 build docker container with QEMU environment (in progress) 2017-06-13 10:01:19 +02:00
nachoparker
2a90a83ad2 QEMU docker ARM environment 2017-06-12 22:55:15 +02:00
nachoparker
1357ed7240 refactor QEMU ncp construction 2017-06-08 16:31:10 +02:00
nachoparker
332523b9f9 docker container construction 2017-06-07 04:59:16 +02:00
nachoparker
463eee94d3 update trusted domains also from letsencrypt config 2017-06-06 18:33:32 +02:00
nachoparker
8f8b4e4242 update git URLs to new location 2017-06-06 07:19:16 +02:00
nachoparker
4733e56ef6 update README.md 2017-06-01 23:11:17 +02:00
nachoparker
0fba0e45fc more settings for big uploads 2017-05-29 16:55:16 +02:00
nachoparker
fb0ad989f8 nc-automount fixes 2017-05-28 21:14:57 +02:00
nachoparker
e917409291 nc-datadir detect occ errors 2017-05-28 20:42:52 +02:00
nachoparker
eb4e0d4bba protect ncp-update from self modifications. fix 2017-05-28 20:18:52 +02:00
nachoparker
eb438ed395 also ask to press a key if script fails, to see failed output 2017-05-28 12:15:50 +02:00
nachoparker
dd01b6427f rpi-update to prune old modules 2017-05-28 12:02:18 +02:00
nachoparker
b428b0f876 nc-datadir: move .opcache location too 2017-05-27 11:59:37 +02:00
nachoparker
2a58cc2536 more checks fail2ban 2017-05-26 17:58:17 +02:00
nachoparker
f0df477ac7 only show "press any key" if not canceled 2017-05-26 17:58:17 +02:00
nachoparker
a78d5ddf86 fix big uploads. upload tmp dir 2017-05-26 17:58:14 +02:00
nachoparker
3dbfd2b563 fix nextcloud-domain service with wicd service 2017-05-25 19:14:25 +02:00
nachoparker
59c981be8a press key after going back to menu ncp-config 2017-05-25 18:20:34 +02:00
nachoparker
c8ee570643 improvements for nc-backup and nc-restore 2017-05-25 18:20:34 +02:00
nachoparker
7ea3dbecd5 test for write permissions for mysql and www-data user for nc-datadir and nc-database 2017-05-25 18:20:34 +02:00
nachoparker
c02bc6b520 revisited modsecurity rules. Fixed photo uploads and notes app 2017-05-25 18:20:34 +02:00
nachoparker
e3a4878ef2 add automount feature 2017-05-24 18:41:29 +02:00
nachoparker
06423bf4ae if ACTIVE=yes by default, launch configure for that script on update 2017-05-23 18:44:47 +02:00
nachoparker
0479dbbea8 add NC12 2017-05-23 18:36:16 +02:00
nachoparker
7eaedb4e8c cal nextcloud-domain from nc-wifi 2017-05-23 16:47:36 +02:00
nachoparker
f77b769f64 add nc-backup and nc-restore 2017-05-23 16:47:36 +02:00
nachoparker
0909fce6d3 add nextcloud instance installation command to ncp-config 2017-05-23 16:47:33 +02:00
nachoparker
1df92f9eef split building steps 2017-05-22 18:55:45 +02:00
nachoparker
addd0a8bec check destination filesystem in nc-datadir nc-databasedir 2017-05-22 18:55:45 +02:00
nachoparker
0f0c8601ef add trusted domains also when setting up no-ip 2017-05-22 18:55:45 +02:00
nachoparker
aae76636cc show ✓ if an item is activated in nextcloudpi-config 2017-05-22 18:55:44 +02:00
nachoparker
092d22acbc fix update.sh 2017-05-20 10:57:40 +02:00
nachoparker
5977684cc0 add cleanup to remote-update 2017-04-27 22:47:58 +02:00
nachoparker
2877a2826d return to menu in nextcloudpi-config 2017-04-27 19:25:18 +02:00
nachoparker
8200602ee5 dont ask for confirmation on exiting config 2017-04-27 18:49:28 +02:00
nachoparker
be2e4e610b keep current configuration on remote updates 2017-04-27 18:49:27 +02:00
nachoparker
64bf42f2f3 added show_info() to nextcloudpi-config 2017-04-27 18:49:22 +02:00
nachoparker
fb994adc45 letsencrypt: git already installed by ncp-config 2017-04-27 07:44:18 +02:00
nachoparker
81a971a2aa make file permissions permanent so there is no clash with updater app. See https://github.com/nextcloud/server/issues/4509 2017-04-27 07:44:18 +02:00
nachoparker
117f72abca [update 11.0.3] split installation between base LAMP and NC. Cleaner to just update NC releases over the base 2017-04-27 07:43:57 +02:00
nachoparker
a67a6f5075 rename nextcloud.sh 2017-04-26 19:18:21 +02:00
nachoparker
cb7c5cab75 fix issue #6 First booting with a connected ethernet cable makes wicd daemon start with an empty wireless interface 2017-04-21 13:15:05 +02:00
nachoparker
1483c724ef do not cleanup as part of ncp-update 2017-04-16 18:30:10 +02:00
nachoparker
c726250172 added samba/cifs 2017-04-14 17:35:11 +02:00
nachoparker
5949152f13 disable QEMU graphics mode in launch-qemu 2017-04-14 09:08:09 +02:00
nachoparker
47f4c75391 NFS and nc-scan 2017-04-12 07:17:02 +02:00
nachoparker
714f6b2a79 fixes enabling services 2017-04-07 00:40:46 +02:00
nachoparker
a17c39313b disable dhcpcd when enabling wicd 2017-04-04 19:46:26 +02:00
nachoparker
a3400775c1 ncp-update: only root 2017-04-04 18:52:39 +02:00
nachoparker
c60ee017ab protect ncp-update from self modifications 2017-04-04 18:25:23 +02:00
nachoparker
1c19f4c362 fix ncp-update with no internet access 2017-04-04 17:38:21 +02:00
nachoparker
eaf3fe7c7b fix print version nextcloudpi-config 2017-04-04 17:19:56 +02:00
nachoparker
b70330bfa5 test-devel, to test builds from devel branch 2017-04-04 17:19:56 +02:00
nachoparker
f80c0ed841 ncp-update wrapper to generate images faster 2017-04-04 17:19:56 +02:00
nachoparker
f3634125a8 nc-wifi fixes: not enabled by default 2017-04-04 00:04:07 +02:00
nachoparker
9b5cd8126f check for updates (and update) upon launching nextcloudpi-config 2017-04-03 20:28:26 +02:00
nachoparker
138fecc9f6 fix empty wireless_interfaces in nc-wifi 2017-04-02 19:59:07 +02:00
nachoparker
aec77e4ee4 bugfixes RAM logs, swap and nc-database 2017-04-01 13:07:43 +02:00
nachoparker
e1c46b51b4 added RAM logs 2017-04-01 09:47:55 +02:00
nachoparker
ef12ceb53c added configure swap file 2017-03-31 17:58:30 +02:00
nachoparker
fd942a5039 added database location config 2017-03-31 17:58:21 +02:00
662 changed files with 76652 additions and 1456 deletions

11
.dockerignore Normal file
View File

@ -0,0 +1,11 @@
torrent/
tmp/
cache/
output/
raspbian_root/
raspbian_boot/
qemu-raspbian-network/
armbian/
*.img
*.tar.bz2
.git

31
.github/ISSUE_TEMPLATE/1_Bug_report.md vendored Normal file
View File

@ -0,0 +1,31 @@
---
name: 🐛 Bug Report
about: Report errors and problems
---
<!--
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/
For asking questions, please use the forums. https://help.nextcloud.com/c/support/appliances-docker-snappy-vm
### PROBLEMS
Please, look at the FAQ before posting a new issue. Also, make sure it has not been asked before. https://github.com/nextcloud/nextcloudpi/wiki/FAQ
Keep in mind that many problems come from faulty power sources and corrupted SD cards, so make sure this is not the case for you before reporting.
If you are running into problems, make sure to include the output of `sudo ncp-report`
-->
**System information**
<!-- Paste the output of `sudo ncp-report` -->

View File

@ -0,0 +1,12 @@
---
name: 🚀 Feature Request
about: RFC and ideas for new features and improvements
---
**Description**
<!-- A clear and concise description of the new feature. -->
**Example**
<!-- A simple example of the new feature in action (include PHP code, YAML config, etc.)
If the new feature changes an existing feature, include a simple before/after comparison. -->

View File

@ -0,0 +1,26 @@
---
name: ⛔ Support Question
about: Do NOT ask here - Use the forum
---
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/
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.
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`.
Note that quite probably your question has an answer in the [FAQ](https://github.com/nextcloud/nextcloudpi/wiki/FAQ).
Thank you!

View File

@ -0,0 +1,12 @@
---
name: ⛔ Documentation Issue
about: See the NextcloudPi Wiki
---
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
Thank you!

View File

@ -0,0 +1,35 @@
name: Create Test VM
description: Create NCP instance for testing in the Hetzner cloud
inputs:
version:
description: version (git rev / tag / branch) to install
required: true
uid:
description: A unique ID for labeling/naming generated resources
required: true
hcloud_token:
description: A auth token for Hetzner cloud
required: true
server_type:
description: Server type to use for hetzner servers
required: true
default: "cx22"
outputs:
server_address:
description: Adress of the test instance
snapshot_id:
description: ID of the generated postinstall snapshot
test_server_id:
description: ID of the created test server
runs:
using: docker
image: docker://thecalcaholic/ncp-test-automation:bullseye
env:
HCLOUD_TOKEN: ${{ inputs.hcloud_token }}
UID: ${{ inputs.uid }}
SERVER_TYPE: ${{ inputs.server_type }}
args:
- /ncp-test-automation/bin/actions/create-test-instance.sh
- ${{ inputs.version }}

View File

@ -0,0 +1,35 @@
name: Create Test VM
description: Create NCP instance for testing in the Hetzner cloud
inputs:
version:
description: version (git rev / tag / branch) to install
required: true
uid:
description: A unique ID for labeling/naming generated resources
required: true
hcloud_token:
description: A auth token for Hetzner cloud
required: true
server_type:
description: Server type to use for hetzner servers
required: true
default: "cx22"
outputs:
server_address:
description: Adress of the test instance
snapshot_id:
description: ID of the generated postinstall snapshot
test_server_id:
description: ID of the created test server
runs:
using: docker
image: docker://thecalcaholic/ncp-test-automation:latest
env:
HCLOUD_TOKEN: ${{ inputs.hcloud_token }}
UID: ${{ inputs.uid }}
SERVER_TYPE: ${{ inputs.server_type }}
args:
- /ncp-test-automation/bin/actions/create-test-instance.sh
- ${{ inputs.version }}

539
.github/workflows/build-docker.yml vendored Normal file
View File

@ -0,0 +1,539 @@
# https://www.docker.com/blog/docker-v2-github-action-is-now-ga/
# https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/
# https://docs.github.com/en/actions/guides/publishing-docker-images
name: 'Docker Integration Tests and Release'
on:
workflow_call:
inputs:
git_ref:
required: true
type: string
arch:
required: false
type: string
default: 'x86'
push:
branches:
- docker-stable
- docker-devel
pull_request:
branches:
- docker-stable
- docker-devel
- release/docker/*
jobs:
build:
if: ${{ github.repository == 'nextcloud/nextcloudpi' }}
runs-on: ubuntu-latest
env:
VERSION: "${{ inputs.git_ref || github.ref }}"
ARCH: "${{ inputs.arch || 'x86' }}"
LOG_DCKR: "\\033[1;34mDCKR::\\033[0m"
LOG_NCP: "\\033[1;36m~NCP::\\033[0m"
LOG_CICD: "\\033[1;35mCICD::\\033[0m"
LOG_TEST: "\\033[1;33mTEST::\\033[0m"
LOG_DIAG: "\\033[1;31mDIAG::\\033[0m"
steps:
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
- name: Checkout code
uses: actions/checkout@v3
with:
ref: "${{ env.VERSION }}"
- name: Login to docker
run: |
echo "${{ secrets.DOCKER_PASSWORD_INTERNAL }}" | docker login -u "${{ secrets.DOCKER_LOGIN_INTERNAL }}" --password-stdin
- name: Build images
id: build-container
run: |
./build/build-docker.sh "${ARCH?}"
docker tag "ownyourbits/nextcloudpi-${ARCH?}:latest" "thecalcaholic/ncp-internal-${ARCH?}:${{ github.run_id }}"
testing_image="ownyourbits/nextcloudpi-${ARCH?}:latest"
[[ "${ARCH?}" == "x86" ]] || testing_image="ownyourbits/ncp-qemu-fix-${ARCH?}:latest"
docker tag "${testing_image}" "thecalcaholic/ncp-internal-${ARCH?}:${{ github.run_id }}-testing"
docker push "thecalcaholic/ncp-internal-${ARCH?}:${{ github.run_id }}"
docker push "thecalcaholic/ncp-internal-${ARCH?}:${{ github.run_id }}-testing"
update-test:
# TODO: Fix update-test for armhf
# The issues are originating in a seemingly bug in apache2 that only occurs in the GH action and only
# if a docker volume or directory is mounted to /data.
# In this configuration, apache will serve the default placeholder page instead of the sites configured in ncp.
if: ${{ inputs.arch != 'armhf' }}
needs:
- build
runs-on: ubuntu-latest
env:
VERSION: "${{ inputs.git_ref || github.ref }}"
ARCH: "${{ inputs.arch || 'x86' }}"
LOG_DCKR: "\\033[1;34mDCKR::\\033[0m"
LOG_NCP: "\\033[1;36m~NCP::\\033[0m"
LOG_CICD: "\\033[1;35mCICD::\\033[0m"
LOG_TEST: "\\033[1;33mTEST::\\033[0m"
LOG_DIAG: "\\033[1;31mDIAG::\\033[0m"
steps:
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Checkout code
uses: actions/checkout@v3
with:
ref: "${{ env.VERSION }}"
fetch-depth: 0
- name: Get previous release
id: get_previous_version
shell: bash
run: |
set -ex
if [[ "${{ env.VERSION }}" == "refs/heads/devel" ]]
then
version="latest"
else
ref="${{ github.base_ref }}"
[[ -n "$ref" ]] || ref="${{ github.ref }}"
git checkout "$ref"
if [[ "${{ github.ref_type }}" != "tag" ]] || ! git describe --tags > /dev/null
then
git fetch -fu --tags origin "${ref}:${ref}"
fi
version="$(git describe --tags || true)"
[[ "$version" =~ .*-.*-.* ]] || {
git checkout HEAD~1
version="$(git describe --tags || echo latest)"
}
version="${version%-*-*}"
fi
curl "https://hub.docker.com/v2/repositories/ownyourbits/nextcloudpi-${ARCH}/tags/${version}" | grep 'errinfo' > /dev/null && {
echo "Image ownyourbits/nextcloudpi-${ARCH}:${version} does not exist - falling back to :latest"
version="latest"
}
version="${version#docker-}"
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@v3
- name: Enable qemu SUID
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes --credential yes
- name: Start ncp container
run: |
docker volume create ncdata
platform=linux/${ARCH?}
[[ "$ARCH" == 'x86' ]] && platform=linux/amd64
tmpdir=$(mktemp -d)
pushd "$tmpdir"
cat <<EOF > ./Dockerfile
FROM --platform=$platform ownyourbits/nextcloudpi:${{ steps.get_previous_version.outputs.previous_version }}
RUN echo 'Mutex posixsem' >> /etc/apache2/mods-available/ssl.conf
EOF
docker buildx build --platform "$platform" -t ncp-testing -f Dockerfile --load .
popd
rm -r "$tmpdir"
docker run --platform "$platform" -v ncdata:/data -d --rm -p 8443:443 -p 4443:4443 --name nextcloudpi ncp-testing localhost
- name: Checkout code
uses: actions/checkout@v3
with:
ref: "${{ env.VERSION }}"
- name: Setup Firefox
uses: browser-actions/setup-firefox@latest
- name: Setup GeckoDriver
uses: ChlodAlejandro/setup-geckodriver@latest
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Selenium
run: pip install selenium
- name: Wait for container startup
run: |
set -e
docker logs nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }"
echo -e "${LOG_DCKR} =========="
docker logs -f nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }" &
attempt=0
stage=0
success=false
for attempt in {1..30}
do
echo -e "${LOG_CICD} Waiting for container startup (attempt $attempt/30)..."
redis_pw="$(docker exec nextcloudpi bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"password'")"
redis_socket="$(docker exec nextcloudpi bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"host'")"
if [[ "$stage" == "0" ]] && docker logs nextcloudpi 2> /dev/null | grep '^Init done'
then
stage=1
elif [[ "$(docker exec nextcloudpi ncc maintenance:mode)" =~ .*disabled.* ]] \
&& docker exec nextcloudpi ncc status \
&& docker exec nextcloudpi redis-cli -s "$redis_socket" -a "$redis_pw" set redisready yes \
&& docker exec nextcloudpi redis-cli -s "$redis_socket" -a "$redis_pw" get redisready \
&& curl -k https://localhost:8443/activate/ > /dev/null
then
success=true
echo -e "${LOG_CICD} Startup successful"
break
fi
attempt=$((attempt + 1))
sleep 5
done
[[ "$success" == "true" ]] || {
echo -e "${LOG_CICD} Timeout reached."
exit 1
}
- name: Activate container
working-directory: ./tests
run: |
docker logs nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }"
echo -e "${LOG_DCKR} =========="
docker logs -f nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }" &
docker exec nextcloudpi bash -c 'tail -f /var/log/ncp.log' |& awk "{ print \"${LOG_NCP} \" \$0 }" &
cmd=(python activation_tests.py --no-gui localhost 8443 4443)
[[ "${ARCH?}" == "x86" ]] || { sleep 60; cmd+=(--timeout 300); }
success=false
for attempt in {1..10}
do
echo -e "${LOG_CICD} == Activation Tests (attempt $attempt/10) =="
"${cmd[@]}" |& awk "{ print \"${LOG_TEST} \" \$0 }"
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
tail -n 20 geckodriver.log |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
echo -e "${LOG_CICD} Activation test (attempt $attempt/10) failed!"
docker exec nextcloudpi bash /usr/local/bin/ncp-diag |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
cat /proc/sys/fs/binfmt_misc/qemu-aarch64 |& awk "{ print \"${LOG_DIAG} (qemu-aarch64) \" \$0 }" || true
cat /proc/sys/fs/binfmt_misc/qemu-arm |& awk "{ print \"${LOG_DIAG} (qemu-arm) \" \$0 }" || true
sleep 12
continue
}
success=true
break
done
[[ "$success" == "true" ]] || {
echo -e "${LOG_CICD} Activation test failed in all attempts!"
echo "Creating error report..."
docker exec nextcloudpi bash /usr/local/bin/ncp-report > error-report.txt
echo "done."
exit 1
}
echo -e "${LOG_CICD} Activation test successful"
- name: Start new container
run: |
docker stop nextcloudpi
docker run -d -v ncdata:/data --rm -p 8443:443 -p 4443:4443 -e NOBACKUP=true --name nextcloudpi thecalcaholic/ncp-internal-${ARCH?}:${{ github.run_id }}-testing localhost
- name: Wait for container startup
run: |
set -e
docker logs nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }"
echo -e "${LOG_DCKR} =========="
docker logs -f nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }" &
attempt=0
stage=0
for attempt in {1..200}
do
echo -e "${LOG_CICD} Waiting for container startup (attempt $attempt/30)..."
redis_pw="$(docker exec nextcloudpi bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"password'")"
redis_socket="$(docker exec nextcloudpi bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"host'")"
if [[ "$stage" == "0" ]] && docker logs nextcloudpi 2> /dev/null | grep '^Init done' > /dev/null
then
stage=1
elif [[ "$(docker exec nextcloudpi ncc maintenance:mode)" =~ .*disabled.* ]] \
&& docker exec nextcloudpi ncc status \
&& docker exec nextcloudpi redis-cli -s "$redis_socket" -a "$redis_pw" set redisready yes \
&& docker exec nextcloudpi redis-cli -s "$redis_socket" -a "$redis_pw" get redisready \
&& curl -k https://localhost:8443/activate/
then
echo -e "${LOG_CICD} Startup successful"
break
elif [[ "$attempt" -ge 30 ]]
then
echo -e "${LOG_CICD} Timeout reached."
exit 1
fi
attempt=$((attempt + 1))
sleep 5
done
echo "Wait one more minute..."
sleep 60
- name: Update Nextcloud
run: |
set -e
docker logs nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }"
echo -e "${LOG_DCKR} =========="
docker logs -f nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }" &
current_nc_version="$(docker exec nextcloudpi ncc status | grep "version:" | awk '{ print $3 }')"
latest_nc_version="$(docker exec nextcloudpi cat /usr/local/etc/ncp.cfg | jq -r '.nextcloud_version')"
if [[ "$current_nc_version" == "$latest_nc_version".* ]]
then
echo -e "${LOG_CICD} Nextcloud is up to date - skipping NC update test."
else
docker exec nextcloudpi bash -c "DBG=x ncp-update-nc ${latest_nc_version?}" |& awk "{ print \"${LOG_DCKR} \" \$0 }"
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
echo -e "${LOG_CICD} Nextcloud Update failed"
echo -e "${LOG_CICD} Creating error report..."
docker exec nextcloudpi bash /usr/local/bin/ncp-report > error-report.txt
docker exec nextcloudpi bash /usr/local/bin/ncp-diag |& awk "{ print \"${LOG_DIAG} \" \$0 }"
exit 1
}
fi
- name: Wait for update completion
run: |
set -e
docker logs nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }"
echo -e "${LOG_DCKR} =========="
docker logs -f nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }" &
attempt=0
for attempt in {1..30}
do
echo -e "${LOG_CICD} Waiting for update completion (attempt $attempt/30)..."
redis_pw="$(docker exec nextcloudpi bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"password'")"
redis_socket="$(docker exec nextcloudpi bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"host'")"
if [[ "$(docker exec nextcloudpi ncc maintenance:mode)" =~ .*disabled.* ]] \
&& docker exec nextcloudpi ncc status \
&& docker exec nextcloudpi redis-cli -s "$redis_socket" -a "$redis_pw" set redisready yes \
&& docker exec nextcloudpi redis-cli -s "$redis_socket" -a "$redis_pw" get redisready
then
echo -e "${LOG_CICD} Startup successful"
break
elif [[ "$attempt" -ge 30 ]]
then
echo -e "${LOG_CICD} Timeout reached."
exit 1
fi
attempt=$((attempt + 1))
sleep 5
done
- name: Integration Tests
working-directory: ./tests
run: |
docker logs nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }"
echo -e "${LOG_DCKR} =========="
docker logs -f nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }" &
docker exec nextcloudpi bash -c 'tail -f /var/log/ncp.log' |& awk "{ print \"${LOG_NCP} \" \$0 }" &
[[ "${ARCH?}" == "x86" ]] || sleep 240
sleep 20
success=false
for attempt in {1..5}
do
echo -e "${LOG_CICD} == System Tests (attempt $attempt/5) =="
python system_tests.py --no-ping --non-interactive |& awk "{ print \"${LOG_TEST} \" \$0 }"
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
echo -e "${LOG_CICD} System test (attempt $attempt) failed!"
sleep 12
continue
}
success=true
break
done
[[ "$success" == "true" ]] || {
echo -e "${LOG_CICD} System test failed in all attempts!"
echo -e "${LOG_CICD} Creating error report..."
docker exec nextcloudpi bash /usr/local/bin/ncp-report > error-report.txt
exit 1
}
echo -e "${LOG_CICD} System test successful"
success=false
for attempt in {1..3}
do
echo -e "${LOG_CICD} == Nextcloud Tests (attempt $attempt/5) =="
python nextcloud_tests.py --no-gui localhost 8443 4443 |& awk "{ print \"${LOG_TEST} \" \$0 }"
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
tail -n 20 geckodriver.log |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
echo -e "${LOG_CICD} Nextcloud test (attempt $attempt/3) failed!"
sleep 12
continue
}
success=true
break
done
[[ "$success" == "true" ]] || {
echo -e "${LOG_CICD} Nextcloud test failed in all attempts!"
echo -e "${LOG_CICD} Creating error report..."
docker exec nextcloudpi bash /usr/local/bin/ncp-report > error-report.txt
echo -e "${LOG_CICD} done."
exit 1
}
echo -e "${LOG_CICD} Nextcloud test successful"
docker exec nextcloudpi bash /usr/local/bin/ncp-diag |& awk "{ print \"${LOG_DIAG} \" \$0 }"
- name: "Upload error report"
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: ${{ github.run_id }}-docker-${{ env.ARCH }}-update-test-error-report
path: tests/error-report.txt
test:
needs:
- build
runs-on: ubuntu-latest
env:
VERSION: "${{ inputs.git_ref || github.ref }}"
ARCH: "${{ inputs.arch || 'x86' }}"
LOG_DCKR: "\\033[1;34mDCKR::\\033[0m"
LOG_NCP: "\\033[1;36m~NCP::\\033[0m"
LOG_CICD: "\\033[1;35mCICD::\\033[0m"
LOG_TEST: "\\033[1;33mTEST::\\033[0m"
LOG_DIAG: "\\033[1;31mDIAG::\\033[0m"
steps:
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
- name: Login to docker
run: |
echo "${{ secrets.DOCKER_PASSWORD_INTERNAL }}" | docker login -u "${{ secrets.DOCKER_LOGIN_INTERNAL }}" --password-stdin
- name: Start ncp container
run: |
docker run -d --rm -p 8443:443 -p 4443:4443 --name nextcloudpi thecalcaholic/ncp-internal-${ARCH?}:${{ github.run_id }}-testing localhost
- name: Checkout code
uses: actions/checkout@v3
with:
ref: "${{ env.VERSION }}"
- name: Setup Firefox
uses: browser-actions/setup-firefox@latest
- name: Setup GeckoDriver
uses: ChlodAlejandro/setup-geckodriver@latest
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Selenium
run: pip install selenium
- name: Wait for container startup
run: |
set -e
docker logs nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }"
echo -e "${LOG_DCKR} =========="
docker logs -f nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }" &
attempt=0
stage=0
for attempt in {1..200}
do
echo -e "${LOG_CICD} Waiting for container startup (attempt $attempt/30)..."
redis_pw="$(docker exec nextcloudpi bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"password'")"
redis_socket="$(docker exec nextcloudpi bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"host'")"
if [[ "$stage" == "0" ]] && docker logs nextcloudpi 2> /dev/null | grep '^Init done' > /dev/null
then
stage=1
elif [[ "$(docker exec nextcloudpi ncc maintenance:mode)" =~ .*disabled.* ]] \
&& docker exec nextcloudpi ncc status \
&& docker exec nextcloudpi redis-cli -s "$redis_socket" -a "$redis_pw" set redisready yes \
&& docker exec nextcloudpi redis-cli -s "$redis_socket" -a "$redis_pw" get redisready \
&& curl -k https://localhost:8443/activate/
then
echo -e "${LOG_CICD} Startup successful"
break
elif [[ "$attempt" -ge 30 ]]
then
echo -e "${LOG_CICD} Timeout reached."
exit 1
fi
attempt=$((attempt + 1))
sleep 5
done
- name: Integration Tests
working-directory: ./tests
run: |
docker logs nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }"
echo -e "${LOG_DCKR} =========="
docker logs -f nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }" &
docker exec nextcloudpi bash -c 'tail -f /var/log/ncp.log' |& awk "{ print \"${LOG_NCP} \" \$0 }" &
cmd=(python activation_tests.py --no-gui localhost 8443 4443)
[[ "${ARCH?}" == "x86" ]] || { sleep 60; cmd+=(--timeout 300); }
success=false
for attempt in {1..10}
do
echo -e "${LOG_CICD} == Activation Tests (attempt $attempt/10) =="
"${cmd[@]}" |& awk "{ print \"${LOG_TEST} \" \$0 }"
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
tail -n 20 geckodriver.log >&2 |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
echo -e "${LOG_CICD} Activation test (attempt $attempt/10) failed!"
docker exec nextcloudpi bash /usr/local/bin/ncp-diag |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
sleep 12
continue
}
success=true
break
done
[[ "$success" == "true" ]] || {
echo -e "${LOG_CICD} Activation test failed in all attempts!"
exit 1
}
echo -e "${LOG_CICD} Activation test successful"
success=false
for attempt in {1..5}
do
echo -e "${LOG_CICD} == System Tests (attempt $attempt/5) =="
python system_tests.py --no-ping --non-interactive |& awk "{ print \"${LOG_TEST} \" \$0 }"
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
echo -e "${LOG_CICD} System test (attempt $attempt) failed!"
sleep 12
continue
}
success=true
break
done
[[ "$success" == "true" ]] || {
echo -e "${LOG_CICD} System test failed in all attempts!"
exit 1
}
echo -e "${LOG_CICD} System test successful"
success=false
for attempt in {1..5}
do
echo -e "${LOG_CICD} == Nextcloud Tests (attempt $attempt/5) =="
python nextcloud_tests.py --no-gui localhost 8443 4443 |& awk "{ print \"${LOG_TEST} \" \$0 }"
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
tail -n 20 geckodriver.log >&2 |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
echo -e "${LOG_CICD} Nextcloud test (attempt $attempt/3) failed!"
sleep 12
continue
}
success=true
break
done
[[ "$success" == "true" ]] || {
echo -e "${LOG_CICD} Nextcloud test failed in all attempts!"
echo -e "${LOG_CICD} Creating error report..."
docker exec nextcloudpi bash /usr/local/bin/ncp-report > error-report.txt
echo -e "${LOG_CICD} done."
exit 1
}
echo -e "${LOG_CICD} Nextcloud test successful"
docker exec nextcloudpi bash /usr/local/bin/ncp-diag |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
- name: "Upload error report"
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: ${{ github.run_id }}-docker-${{ env.ARCH }}-install-test-error-report
path: tests/error-report.txt

775
.github/workflows/build-lxd.yml vendored Normal file
View File

@ -0,0 +1,775 @@
name: "Build and test LXD image"
on:
workflow_call:
inputs:
git_ref:
required: true
type: string
arch:
required: false
type: string
default: 'x86'
outputs:
lxd_artifact_name:
value: "${{ jobs.build-current.outputs.artifact_name }}"
lxd_artifact_file:
value: "${{ jobs.build-current.outputs.artifact_file }}"
lxc_artifact_name:
value: "${{ jobs.convert-to-lxc-image.outputs.artifact_name }}"
lxc_artifact_file:
value: "${{ jobs.convert-to-lxc-image.outputs.artifact_file }}"
push:
branches:
- "**"
pull_request:
branches:
- master
- devel
- release/*
jobs:
determine-runner:
env:
LXD_ARCH: "${{ inputs.arch || 'x86' }}"
runs-on: ubuntu-latest
outputs:
runner_label: ${{ steps.script.outputs.runner_label }}
lxc_cmd: ${{ steps.script.outputs.lxc_cmd }}
lxd_extra_profile: ${{ steps.script.outputs.lxd_extra_profile }}
steps:
- name: script
id: script
run: |
if [[ "${LXD_ARCH}" == "arm64" ]]
then
LXC_CMD="incus"
RUNNER_LABEL="ubuntu-20.04-arm64"
echo "lxd_extra_profile=network" | tee -a "$GITHUB_OUTPUT"
else
LXC_CMD="incus"
RUNNER_LABEL="ubuntu-latest"
fi
echo "runner_label=$RUNNER_LABEL" | tee -a $GITHUB_OUTPUT
echo "lxc_cmd=$LXC_CMD" | tee -a $GITHUB_OUTPUT
build-current:
needs:
- determine-runner
runs-on: ${{ needs.determine-runner.outputs.runner_label }}
outputs:
artifact_name: "${{ env.ARTIFACT_NAME }}"
artifact_file: "${{ steps.pack-lxd.outputs.artifact_file }}"
env:
VERSION: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
ARTIFACT_NAME: "${{ github.run_id }}-lxd-${{ inputs.arch || 'x86' }}-image"
LXD_ARCH: "${{ inputs.arch || 'x86' }}"
LXC: "${{ needs.determine-runner.outputs.lxc_cmd }}"
LXD_EXTRA_PROFILE: "${{ needs.determine-runner.outputs.lxd_extra_profile }}"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: "${{ env.VERSION }}"
- name: Setup incus
if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-20.04-arm64' }}
run: |
sudo apt-get install -y incus qemu-system incus-tools
sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
sudo incus admin init --auto
- name: Build LXD image
env:
USE_INCUS: "${{ needs.determine-runner.outputs.lxc_cmd == 'incus' && 'yes' || 'no' }}"
run: |
export CI
LXD_EXTRA_PROFILE="$LXD_EXTRA_PROFILE" BRANCH="${VERSION##refs/heads/}" ./build/build-LXD.sh
- name: Pack LXD image
id: pack-lxd
run: |
. ./build/buildlib.sh
ARTIFACT_FILE="NextcloudPi_LXD_${LXD_ARCH:-x86}_${VERSION//\//_}"
sudo "$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
uses: actions/upload-artifact@v4
with:
name: "${{ env.ARTIFACT_NAME }}"
path: "output/${{ steps.pack-lxd.outputs.artifact_file }}"
if-no-files-found: error
# build-previous:
# needs:
# - determine-runner
# runs-on: [ ubuntu-20.04 ]
# if: ${{ inputs.arch == 'x86' || inputs.arch == '' }}
# outputs:
# artifact_name: "${{ env.ARTIFACT_NAME }}"
# artifact_file: "${{ steps.pack-lxd.outputs.artifact_file }}"
# previous_version: "${{ steps.checkout_previous_version.outputs.previous_version }}"
# env:
# VERSION: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
# ARTIFACT_NAME: "${{ github.run_id }}-lxd-${{ inputs.arch || 'x86' }}-image-previous"
# LXD_ARCH: "${{ inputs.arch || 'x86' }}"
# LXC: "${{ needs.determine-runner.outputs.lxc_cmd }}"
# LXD_EXTRA_PROFILE: "${{ needs.determine-runner.outputs.lxd_extra_profile }}"
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# with:
# ref: "${{ env.VERSION }}"
# fetch-depth: 0
# - name: Checkout previous release
# id: checkout_previous_version
# shell: bash
# run: |
# set -e
# if [[ -n "${{ github.base_ref }}" ]]
# then
# version="${{ github.base_ref }}"
# elif [[ "${{ env.VERSION }}" == "refs/heads/devel" ]]
# then
# version="master"
# else
# if [[ "${{ github.ref_type }}" != "tag" ]] || ! git describe --tags > /dev/null
# then
# git fetch -fu --tags origin ${{ env.VERSION }}:${{ env.VERSION }}
# fi
# version="$(git describe --tags)"
# [[ "$version" =~ .*-.*-.* ]] || {
# git checkout HEAD~1
# version="$(git describe --tags)"
# }
# version="${version%-*-*}"
# fi
# echo "Previous version is '$version'"
# git checkout "$version"
# echo "VERSION=$version" >> "$GITHUB_ENV"
# echo "previous_version=${version}" >> $GITHUB_OUTPUT
# - name: Setup incus
# if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-20.04-arm64' }}
# run: |
# curl https://pkgs.zabbly.com/get/incus-stable | sudo sh -x
# sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT
# sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
# sudo incus admin init --auto
#
# - name: Build LXD image
# env:
# USE_INCUS: "${{ needs.determine-runner.outputs.lxc_cmd == 'incus' && 'yes' || 'no' }}"
# run: |
# export CI
# LXD_EXTRA_PROFILE="$LXD_EXTRA_PROFILE" BRANCH="${VERSION##refs/heads/}" ./build/build-LXD.sh
# - name: Pack LXD image
# id: pack-lxd
# run: |
# . ./build/buildlib.sh
# ARTIFACT_FILE="NextcloudPi_LXD_${LXD_ARCH:-x86}_${VERSION//\//_}"
# sudo "${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
# uses: actions/upload-artifact@v3
# with:
# name: "${{ env.ARTIFACT_NAME }}"
# path: "output/${{ steps.pack-lxd.outputs.artifact_file }}"
# if-no-files-found: error
#
# test-update:
# needs:
# - determine-runner
# - build-previous
# runs-on: ${{ needs.determine-runner.outputs.runner_label }}
# outputs:
# artifact_name: "${{ env.ARTIFACT_NAME }}"
# artifact_file: "${{ steps.pack-lxd.outputs.artifact_file }}"
# env:
# VERSION: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
# ARTIFACT_NAME: "${{ needs.build-previous.outputs.artifact_name }}"
# LXC: "${{ needs.determine-runner.outputs.lxc_cmd }}"
# USE_INCUS: "${{ needs.determine-runner.outputs.lxc_cmd == 'incus' && 'yes' || 'no' }}"
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# with:
# ref: "${{ env.VERSION }}"
# - name: Setup incus
# if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-20.04-arm64' }}
# run: |
# curl https://pkgs.zabbly.com/get/incus-stable | sudo sh -x
# sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT
# sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
# sudo incus admin init --auto
# - 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
# env:
# GH_TOKEN: ${{ github.token }}
# run: |
# arch=linux64
# if [[ "$RUNNER_ARCH" == "ARM64" ]]
# then
# arch="linux-aarch64"
# fi
# gh release download -R mozilla/geckodriver -p 'geckodriver-*-'"$arch.tar.gz"
# tar xf "geckodriver-"*"-$arch.tar.gz"
# sudo mv geckodriver /usr/local/bin/
# - name: Setup Selenium
# run: pip install selenium
# - name: download LXD image from artifact store
# uses: actions/download-artifact@v3
# with:
# name: ${{ needs.build-previous.outputs.artifact_name }}
# - name: Remove old lxd images
# if: ${{ inputs.arch == 'arm64' }}
# run: |
# for img in $("$LXC" image list -c f -f csv)
# do
# sudo "$LXC" image delete "$img"
# done
# - name: Launch ncp container
# run: |
# set -x
# sudo "$LXC" delete -q -f ncp || true
# sudo "$LXC" image import -q "./${{ needs.build-previous.outputs.artifact_file }}" --alias "ncp/update"
# systemd-run --user --scope -p "Delegate=yes" "$LXC" launch -q "ncp/test" ncp || \
# sudo systemd-run --scope -p "Delegate=yes" "$LXC" launch -q "ncp/test" ncp
# sudo "$LXC" exec ncp -- bash -c 'while [ "$(systemctl is-system-running 2>/dev/null)" != "running" ] && [ "$(systemctl is-system-running 2>/dev/null)" != "degraded" ]; do :; done'
# sudo "$LXC" exec ncp -- rm -f /opt/ncdata/data/nextcloud.log
# sleep 30
# ip="$(sudo "$LXC" list -c n4 -f csv | grep '^ncp' | cut -d ',' -f2)"
# ip="${ip/% *}"
# sudo sed -i 's/^.*nextcloudpi.local.*$//g' /etc/hosts
# echo "${ip} nextcloudpi.local" | sudo tee -a /etc/hosts
# - name: Activate and Test LXD Image
# working-directory: ./tests
# run: |
# sudo "$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" || true
# exit 1
# }
# python nextcloud_tests.py --no-gui --skip-release-check "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" || true
# echo "================"
# echo "nextcloud log: "
# datadir="$("$LXC" exec ncp -- ncc config:system:get datadirectory)"
# "$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
# exit 1
# }
# USE_INCUS="$USE_INCUS" python system_tests.py --non-interactive --skip-update-test || {
# echo "System test failed!"
# exit 1
# }
# - name: Update ncp
# env:
# HEAD_REF: "${{ github.head_ref }}"
# run: |
# set -ex
# BRANCH="${VERSION/refs\/heads\//}"
# BRANCH="${BRANCH/refs\/tags\//}"
# if [[ "$BRANCH" =~ "refs/pull/"* ]]
# then
# UPDATE_ARGS=("${HEAD_REF}" "$VERSION")
# else
# UPDATE_ARGS=("$BRANCH")
# fi
# echo "VERSION=${VERSION}" >> "$GITHUB_ENV"
# echo "Running update ${{ needs.build-previous.outputs.previous_version }} -> ${VERSION}"
#
# current_nc_version="$(sudo "$LXC" exec ncp -- ncc status | grep "version:" | awk '{ print $3 }')"
# latest_nc_version="$(cat etc/ncp.cfg | jq -r '.nextcloud_version')"
#
# sudo "$LXC" exec ncp -- bash -c "DBG=x ncp-update ${UPDATE_ARGS[*]}"
# sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
#
# if [[ "$current_nc_version" =~ "$latest_nc_version".* ]]
# then
# echo "Nextcloud is up to date - skipping NC update test."
# else
# sudo "$LXC" exec ncp -- bash -c "DBG=x ncp-update-nc ${latest_nc_version?}"
# fi
#
# sudo "$LXC" exec ncp -- rm -f /opt/ncdata/data/nextcloud.log
#
# sudo "$LXC" stop ncp
# - name: Relaunch container
# run: |
# set -x
# systemd-run --user --scope -p "Delegate=yes" "$LXC" start -q ncp || \
# sudo systemd-run --scope -p "Delegate=yes" "$LXC" start -q ncp
# sudo "$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="$(sudo "$LXC" list -c n4 -f csv | grep '^ncp' | cut -d ',' -f2)"
# ip="${ip/% *}"
# sudo sed -i 's/^.*nextcloudpi.local.*$//g' /etc/hosts
# echo "${ip} nextcloudpi.local" | sudo tee -a /etc/hosts
# - name: Test LXD Image
# working-directory: ./tests
# run: |
# sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
# python nextcloud_tests.py --no-gui --skip-release-check "nextcloudpi.local" 443 4443 || {
# echo "Nextcloud test failed!"
# echo "Geckodriver logs:"
# tail -n 20 geckodriver.log >&2 || true
# echo "================"
# echo "ncp.log: "
# sudo "$LXC" exec ncp -- "tail -n20 /var/log/ncp.log" || true
# echo "================"
# echo "nextcloud log: "
# datadir="$("$LXC" exec ncp -- ncc config:system:get datadirectory)"
# sudo "$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
# exit 1
# }
# USE_INCUS="$USE_INCUS" python system_tests.py --non-interactive || {
# echo "System test failed!"
# exit 1
# }
test-dist-upgrade:
if: false
needs:
- determine-runner
runs-on: ${{ needs.determine-runner.outputs.runner_label }}
env:
VERSION: "${{ inputs.git_ref || github.ref }}"
LXC: "${{ needs.determine-runner.outputs.lxc_cmd }}"
LXD_EXTRA_PROFILE: "${{ needs.determine-runner.outputs.lxd_extra_profile }}"
PREVIOUS_IMAGE_URL_ARM64: "https://github.com/nextcloud/nextcloudpi/releases/download/v1.53.2/NextcloudPi_LXD_arm64_v1.53.2.tar.gz"
PREVIOUS_IMAGE_URL_AMD64: "https://github.com/nextcloud/nextcloudpi/releases/download/v1.53.2/NextCloudPi_LXD_x86_v1.53.2.tar.gz"
USE_INCUS: "${{ needs.determine-runner.outputs.lxc_cmd == 'incus' && 'yes' || 'no' }}"
steps:
- name: Setup incus
if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-20.04-arm64' }}
run: |
sudo apt-get install -y incus qemu-system incus-tools
sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
sudo incus admin init --auto
- name: Checkout code
uses: actions/checkout@v3
with:
ref: "v1.54.3"
- name: Setup Firefox
if: ${{ runner.arch != 'ARM64' }}
continue-on-error: true
id: setup-firefox-browser-action
uses: browser-actions/setup-firefox@latest
- name: Setup Firefox from packages
if: ${{ runner.arch == 'ARM64' || steps.setup-firefox-browser-action.outcome == 'failure' }}
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends firefox
- name: Setup GeckoDriver
env:
GH_TOKEN: ${{ github.token }}
run: |
set -x
arch=linux64
if [[ "${{ runner.arch }}" == "ARM64" ]]
then
arch="linux-aarch64"
fi
gh release download -R mozilla/geckodriver -p 'geckodriver-*-'"$arch.tar.gz"
tar xf "geckodriver-"*"-$arch.tar.gz"
sudo mv geckodriver /usr/local/bin/
sudo chmod +x /usr/local/bin/geckodriver
echo "GECKODRIVER_PATH=/usr/local/bin/geckodriver" >> "$GITHUB_ENV"
geckodriver -V
- name: Setup Selenium
run: |
sudo apt-get -y install python3-venv
python3 -m venv ./.venv
./.venv/bin/pip install selenium
- name: download LXD image
run: |
image_url="${PREVIOUS_IMAGE_URL_AMD64?}"
if [[ "${{ runner.arch }}" == "ARM64" ]]
then
image_url="${PREVIOUS_IMAGE_URL_ARM64?}"
fi
wget -qO ./ncp.tar.gz "${image_url?}"
- name: Launch ncp container
run: |
set -x
sudo "$LXC" delete -q -f ncp || true
sudo "$LXC" image import -q "./ncp.tar.gz" --alias "ncp/update"
LXC_ARGS=(-p default)
[[ -z "$LXD_EXTRA_PROFILE" ]] || LXC_ARGS+=(-p "$LXD_EXTRA_PROFILE")
systemd-run --user --scope -p "Delegate=yes" "$LXC" launch -q "${LXC_ARGS[@]}" "ncp/update" ncp || \
sudo systemd-run --scope -p "Delegate=yes" "$LXC" launch -q "${LXC_ARGS[@]}" "ncp/update" ncp
sudo "$LXC" exec ncp -- bash -c 'while [ "$(systemctl is-system-running 2>/dev/null)" != "running" ] && [ "$(systemctl is-system-running 2>/dev/null)" != "degraded" ]; do :; done'
sudo "$LXC" exec ncp -- rm -f /opt/ncdata/data/nextcloud.log
sleep 30
ip="$(sudo "$LXC" list -c n4 -f csv | grep '^ncp' | cut -d ',' -f2)"
ip="${ip/% *}"
sudo sed -i 's/^.*nextcloudpi.local.*$//g' /etc/hosts
echo "${ip} nextcloudpi.local" | sudo tee -a /etc/hosts
- name: Activate and Test LXD Image
working-directory: ./tests
run: |
set -x
export GECKODRIVER_PATH="$GECKODRIVER_PATH"
export FF_BINARY_PATH="$(which firefox)"
sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
../.venv/bin/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: "
sudo "$LXC" exec ncp -- "tail -n20 /var/log/ncp.log" || true
exit 1
}
../.venv/bin/python nextcloud_tests.py --skip-release-check --no-gui "nextcloudpi.local" 443 4443 || {
echo "Nextcloud test failed!"
echo "Geckodriver logs:"
tail -n 20 geckodriver.log >&2 || true
echo "================"
echo "ncp.log: "
sudo "$LXC" exec ncp -- "tail -n20 /var/log/ncp.log" || true
echo "================"
echo "nextcloud log: "
datadir="$(sudo "$LXC" exec ncp -- ncc config:system:get datadirectory)"
sudo "$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
exit 1
}
USE_INCUS="$USE_INCUS" ../.venv/bin/python system_tests.py --non-interactive --skip-update-test || {
echo "System test failed!"
echo "ncp.log: "
sudo "$LXC" exec ncp -- "tail -n20 /var/log/ncp.log" || true
echo "================"
echo "nextcloud log: "
datadir="$(sudo "$LXC" exec ncp -- ncc config:system:get datadirectory)"
sudo "$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
exit 1
}
- name: Update ncp
env:
HEAD_REF: "${{ github.head_ref }}"
run: |
set -ex
BRANCH="${VERSION/refs\/heads\//}"
BRANCH="${BRANCH/refs\/tags\//}"
if [[ "$BRANCH" =~ "refs/pull/"* ]]
then
UPDATE_ARGS=("${HEAD_REF}" "$VERSION")
else
UPDATE_ARGS=("$BRANCH")
fi
echo "VERSION=${VERSION}" >> "$GITHUB_ENV"
echo "Running update to ${VERSION}"
current_nc_version="$(sudo "$LXC" exec ncp -- ncc status | grep "version:" | awk '{ print $3 }')"
latest_nc_version="29.0.9"
sudo "$LXC" exec ncp -- apt-get update ||:
sudo "$LXC" exec ncp -- apt-get install --no-install-recommends -y gnupg2
sudo "$LXC" exec ncp -- apt-key adv --fetch-keys https://packages.sury.org/php/apt.gpg
sudo "$LXC" exec ncp -- bash -c "DBG=x ncp-update ${UPDATE_ARGS[*]}"
sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
#if [[ "$current_nc_version" =~ "$latest_nc_version".* ]]
#then
# echo "Nextcloud is up to date - skipping NC update test."
#else
# sudo "$LXC" exec ncp -- bash -c "DBG=x ncp-update-nc ${latest_nc_version?}"
# sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
#fi
sudo "$LXC" exec ncp -- rm -f /opt/ncdata/data/nextcloud.log
sudo "$LXC" stop ncp
- name: Relaunch container
run: |
set -x
LXC_ARGS=()
[[ -z "$LXD_EXTRA_PROFILE" ]] || LXC_ARGS+=(-p "$LXD_EXTRA_PROFILE")
systemd-run --user --scope -p "Delegate=yes" "$LXC" start ncp || \
sudo systemd-run --scope -p "Delegate=yes" "$LXC" start ncp
sudo "$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="$(sudo "$LXC" list -c n4 -f csv | grep '^ncp' | cut -d ',' -f2)"
ip="${ip/% *}"
sudo sed -i 's/^.*nextcloudpi.local.*$//g' /etc/hosts
echo "${ip} nextcloudpi.local" | sudo tee -a /etc/hosts
- name: Test LXD Image
working-directory: ./tests
run: |
export GECKODRIVER_PATH="$GECKODRIVER_PATH"
export FF_BINARY_PATH="$(which firefox)"
../.venv/bin/python nextcloud_tests.py --no-gui --skip-release-check "nextcloudpi.local" 443 4443 || {
echo "Nextcloud test failed!"
echo "Geckodriver logs:"
tail -n 20 geckodriver.log >&2 || true
echo "================"
echo "ncp.log: "
sudo "$LXC" exec ncp -- "tail -n20 /var/log/ncp.log" || true
echo "================"
echo "nextcloud log: "
datadir="$(sudo "$LXC" exec ncp -- ncc config:system:get datadirectory)"
sudo "$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
exit 1
}
sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
USE_INCUS="$USE_INCUS" ../.venv/bin/python system_tests.py --non-interactive --skip-update-test || {
echo "System test failed!"
exit 1
}
- name: Checkout current version
run: |
git fetch origin
git checkout "${{ env.VERSION }}"
- name: NCP distupgrade
id: distupgrade
run: |
set -x
sudo "$LXC" exec ncp -- cat /etc/os-release | grep 'VERSION_ID="11"' || {
echo "can't upgrade from Debian $(sudo "$LXC" exec ncp -- cat /etc/os-release | grep VERSION_ID=)"
exit 1
}
current_nc_version="$(sudo "$LXC" exec ncp -- ncc status | grep "version:" | awk '{ print $3 }')"
latest_nc_version="$(cat etc/ncp.cfg | jq -r '.nextcloud_version')"
sudo "$LXC" exec ncp -- bash -c "DEBIAN_FRONTEND=noninteractive ncp-dist-upgrade"
sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
if [[ "$current_nc_version" =~ "$latest_nc_version".* ]]
then
echo "Nextcloud is up to date - skipping NC update test."
else
for i in {1..10};
do
echo "running nc update ($i/10)..."
sudo "$LXC" exec ncp -- bash -c "DBG=x ncp-update-nc ${latest_nc_version?}"
sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
current_nc_version_new="$(sudo "$LXC" exec ncp -- ncc status | grep "version:" | awk '{ print $3 }')"
if [[ "$current_nc_version_new" =~ "$latest_nc_version".* ]]
then
break
fi
if [[ "$current_nc_version" == "$current_nc_version_new" ]]
then
echo "failed to update to $latest_nc_version"
exit 1
fi
current_nc_version="$current_nc_version_new"
done
fi
sudo "$LXC" exec ncp -- rm -f /opt/ncdata/data/nextcloud.log
sudo "$LXC" stop ncp
- name: Relaunch container
run: |
set -x
LXC_ARGS=()
[[ -z "$LXD_EXTRA_PROFILE" ]] || LXC_ARGS+=(-p "$LXD_EXTRA_PROFILE")
systemd-run --user --scope -p "Delegate=yes" "$LXC" start ncp || \
sudo systemd-run --scope -p "Delegate=yes" "$LXC" start ncp
sudo "$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="$(sudo "$LXC" list -c n4 -f csv | grep '^ncp' | cut -d ',' -f2)"
ip="${ip/% *}"
sudo sed -i 's/^.*nextcloudpi.local.*$//g' /etc/hosts
echo "${ip} nextcloudpi.local" | sudo tee -a /etc/hosts
- name: Test LXD Image
working-directory: ./tests
run: |
set -x
export GECKODRIVER_PATH="$GECKODRIVER_PATH"
export FF_BINARY_PATH="$(which firefox)"
sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
../.venv/bin/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: "
sudo "$LXC" exec ncp -- "tail -n20 /var/log/ncp.log" || true
echo "================"
echo "nextcloud log: "
datadir="$(sudo "$LXC" exec ncp -- ncc config:system:get datadirectory)"
sudo "$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
exit 1
}
USE_INCUS="$USE_INCUS" ../.venv/bin/python system_tests.py --non-interactive || {
echo "System test failed!"
exit 1
}
sudo "$LXC" stop ncp
test-fresh-install:
needs:
- determine-runner
- build-current
runs-on: ${{ needs.determine-runner.outputs.runner_label }}
env:
VERSION: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
ARTIFACT_NAME: ${{ needs.build-current.outputs.artifact_name }}
ARTIFACT_FILE: ${{ needs.build-current.outputs.artifact_file }}
LXC: "${{ needs.determine-runner.outputs.lxc_cmd }}"
USE_INCUS: "${{ needs.determine-runner.outputs.lxc_cmd == 'incus' && 'yes' || 'no' }}"
LXD_EXTRA_PROFILE: "${{ needs.determine-runner.outputs.lxd_extra_profile }}"
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: "${{ env.VERSION }}"
- name: Setup incus
if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-20.04-arm64' }}
run: |
sudo apt-get install -y incus qemu-system incus-tools
sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
sudo incus admin init --auto
- name: Setup Firefox
if: ${{ runner.arch != 'ARM64' }}
continue-on-error: true
id: setup-firefox-browser-action
uses: browser-actions/setup-firefox@latest
- name: Setup Firefox from packages
if: ${{ runner.arch == 'ARM64' || steps.setup-firefox-browser-action.outcome == 'failure' }}
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends firefox
- name: Setup GeckoDriver
env:
GH_TOKEN: ${{ github.token }}
run: |
set -x
arch=linux64
if [[ "${{ runner.arch }}" == "ARM64" ]]
then
arch="linux-aarch64"
fi
gh release download -R mozilla/geckodriver -p 'geckodriver-*-'"$arch.tar.gz"
tar xf "geckodriver-"*"-$arch.tar.gz"
sudo mv geckodriver /usr/local/bin/
sudo chmod +x /usr/local/bin/geckodriver
echo "GECKODRIVER_PATH=/usr/local/bin/geckodriver" >> "$GITHUB_ENV"
geckodriver -V
- name: Setup Selenium
run: |
sudo apt-get install -y python3-venv
python3 -m venv ./.venv
./.venv/bin/pip install selenium
- name: download LXD image from artifact store
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
- name: Remove old lxd images
if: ${{ inputs.arch == 'arm64' }}
run: |
for img in $("$LXC" image list -c f -f csv)
do
sudo "$LXC" image delete "$img"
done
- name: Launch ncp container
run: |
set -x
. ./build/buildlib.sh
sudo "$LXC" delete -q -f ncp || true
sudo "$LXC" image import -q "./${ARTIFACT_FILE?}" --alias "ncp/test" || true
LXC_ARGS=(-p default)
[[ -z "$LXD_EXTRA_PROFILE" ]] || LXC_ARGS+=(-p "$LXD_EXTRA_PROFILE")
systemd-run --user --scope -p "Delegate=yes" "$LXC" launch -q "${LXC_ARGS[@]}" "ncp/test" ncp || \
sudo systemd-run --scope -p "Delegate=yes" "$LXC" launch -q "${LXC_ARGS[@]}" "ncp/test" ncp
sudo "$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="$(sudo "$LXC" list -c n4 -f csv | grep '^ncp' | cut -d ',' -f2)"
ip="${ip/% *}"
sudo sed -i 's/^.*nextcloudpi.local.*$//g' /etc/hosts
echo "${ip} nextcloudpi.local" | sudo tee -a /etc/hosts
- name: Test LXD Image
working-directory: ./tests
run: |
set -x
export GECKODRIVER_PATH="$GECKODRIVER_PATH"
export FF_BINARY_PATH="$(which firefox)"
sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
../.venv/bin/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: "
sudo "$LXC" exec ncp -- "tail -n20 /var/log/ncp.log" || true
echo "================"
echo "nextcloud log: "
datadir="$("$LXC" exec ncp -- ncc config:system:get datadirectory)"
sudo "$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
exit 1
}
../.venv/bin/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: "
sudo "$LXC" exec ncp -- "tail -n20 /var/log/ncp.log" || true
echo "================"
echo "nextcloud log: "
datadir="$(sudo "$LXC" exec ncp -- ncc config:system:get datadirectory)"
sudo "$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
exit 1
}
USE_INCUS="$USE_INCUS" ../.venv/bin/python system_tests.py --non-interactive || {
echo "System test failed!"
exit 1
}
sudo "$LXC" stop ncp
convert-to-lxc-image:
needs:
- build-current
runs-on: ubuntu-latest
outputs:
artifact_name: "${{ steps.lxd-to-lxc.outputs.artifact_name }}"
artifact_file: "${{ steps.lxd-to-lxc.outputs.artifact_file }}"
env:
VERSION: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
LXD_ARTIFACT_NAME: ${{ needs.build-current.outputs.artifact_name }}
LXD_ARTIFACT_FILE: ${{ needs.build-current.outputs.artifact_file }}
steps:
- name: download LXD image from artifact store
uses: actions/download-artifact@v4
with:
name: ${{ env.LXD_ARTIFACT_NAME }}
- name: convert to LXC image
id: lxd-to-lxc
run: |
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@v4
with:
name: "${{ steps.lxd-to-lxc.outputs.artifact_name }}"
path: "output/${{ steps.lxd-to-lxc.outputs.artifact_file }}"
if-no-files-found: error

869
.github/workflows/build-sd-images.yml vendored Normal file
View File

@ -0,0 +1,869 @@
name: "Build Armbian Images"
on:
workflow_call:
inputs:
git_ref:
required: true
type: string
board_id:
required: true
type: string
board_name:
required: true
type: string
require_test:
required: false
default: true
type: boolean
test_image_url:
required: false
type: string
default: ""
outputs:
artifact_name:
value: "${{ jobs.build.outputs.artifact_name }}"
artifact_file:
value: "${{ jobs.build.outputs.artifact_file }}"
jobs:
build:
runs-on: ubuntu-latest
env:
VERSION: "${{ inputs.git_ref }}"
LOG_GUEST: "\\033[1;34mGUEST::\\033[0m"
LOG_NCP: "\\033[1;36m~NCP::\\033[0m"
LOG_CICD: "\\033[1;35mCICD::\\033[0m"
LOG_TEST: "\\033[1;33mTEST::\\033[0m"
LOG_DIAG: "\\033[1;31mDIAG::\\033[0m"
defaults:
run:
shell: bash
outputs:
artifact_file: ${{ env.ARTIFACT_FILE }}
artifact_name: ${{ github.run_id }}-${{ inputs.board_id }}-image
steps:
- name: Set up QEMU
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
# do
# sed 's/:F$/:OC/' /usr/lib/binfmt.d/$conf | sudo tee /etc/binfmt/$conf
# done
- name: Checkout code
uses: actions/checkout@v3
with:
ref: "${{ env.VERSION }}"
# - name: Debug
# run: |
# which qemu-aarch64-static
# update-binfmts --display qemu-aarch64
# update-binfmts --display qemu-arm
- name: "Skip build"
if: "${{ inputs.test_image_url != '' }}"
run: |
echo "artifact_file=NextcloudPi_TestImage_${VERSION//\//_}.img" >> $GITHUB_OUTPUT
echo "ARTIFACT_FILE=NextcloudPi_TestImage_${VERSION//\//_}.img" >> $GITHUB_ENV
- name: "Build Armbian"
if: "${{ inputs.test_image_url == '' }}"
id: build-armbian
continue-on-error: true
run: |
set -ex
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 }}"
artifacts=("armbian/output/images/Armbian"*.img)
mkdir -p output
mv "${artifacts[0]}" "output/$IMG"
echo "artifact_file=${IMG}" >> $GITHUB_OUTPUT
echo "ARTIFACT_FILE=${IMG}" >> $GITHUB_ENV
- name: "Build Armbian (2nd attempt)"
if: ${{ steps.build-armbian.outcome == 'failure' }}
id: build-armbian-2nd
run: |
set -ex
echo -e "${LOG_CICD} Cleanup armbian build leftovers..."
sudo rm -rf armbian/ tmp/ output/
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 }}"
artifacts=("armbian/output/images/Armbian"*.img)
mkdir -p output
mv "${artifacts[0]}" "output/$IMG"
echo "artifact_file=${IMG}" >> $GITHUB_OUTPUT
echo "ARTIFACT_FILE=${IMG}" >> $GITHUB_ENV
- name: "Upload Armbian logs"
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: ${{ github.run_id }}-${{ inputs.board_id }}-logs
path: armbian/output
- name: upload image to artifact store
if: "${{ inputs.test_image_url == '' }}"
uses: actions/upload-artifact@v4
with:
name: ${{ github.run_id }}-${{ inputs.board_id }}-image
path: output/${{ env.ARTIFACT_FILE }}
if-no-files-found: error
test:
needs: build
runs-on: ubuntu-22.04
env:
VERSION: "${{ inputs.git_ref }}"
ARTIFACT_ID: ${{ needs.build.outputs.artifact_name }}
ARTIFACT_FILE: ${{ needs.build.outputs.artifact_file }}
LOG_GUEST: "\\033[1;34mGUEST::\\033[0m"
LOG_NCP: "\\033[1;36m~NCP::\\033[0m"
LOG_CICD: "\\033[1;35mCICD::\\033[0m"
LOG_TEST: "\\033[1;33mTEST::\\033[0m"
LOG_DIAG: "\\033[1;31mDIAG::\\033[0m"
defaults:
run:
shell: bash
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Disable apparmor
run: |
sudo systemctl disable apparmor
- name: Checkout code
uses: actions/checkout@v3
with:
ref: "${{ env.VERSION }}"
- uses: actions/download-artifact@v4
if: "${{ inputs.test_image_url == '' }}"
with:
name: ${{ env.ARTIFACT_ID }}
path: output
- name: Download Test Image
if: "${{ inputs.test_image_url != '' }}"
run: |
set -ex
mkdir -p output
sudo apt-get install -y pv
wget -nv "${{ inputs.test_image_url }}" -O - | pv -n --bytes --rate --timer -i 3 > "output/${ARTIFACT_FILE?}"
- name: Prepare test
run: |
set -x
mv "output/${ARTIFACT_FILE?}" ncp.img
sudo apt-get install -y systemd-container
python3 -m venv ./.venv
. ./.venv/bin/activate
./.venv/bin/pip install selenium
sudo rm -rf raspbian_root
. ./build/buildlib.sh
mount_raspbian "ncp.img"
sudo cat raspbian_root/etc/machine-id
sudo systemd-id128 new | sudo tee ./raspbian_root/etc/machine-id
sudo wget -nv https://github.com/multiarch/qemu-user-static/releases/latest/download/qemu-aarch64-static -O raspbian_root/usr/bin/qemu-aarch64-static
sudo wget -nv https://github.com/multiarch/qemu-user-static/releases/latest/download/qemu-arm-static -O raspbian_root/usr/bin/qemu-arm-static
sudo chmod +x raspbian_root/usr/bin/qemu-{arm,aarch64}-static
echo 'Mutex posixsem' | sudo tee -a raspbian_root/etc/apache2/mods-available/ssl.conf
echo 'ignore-warnings ARM64-COW-BUG' | sudo tee -a raspbian_root/etc/redis/redis.conf
sudo mkdir -p raspbian_root/etc/systemd/system/redis-server.service.d
echo '[Service]' | sudo tee raspbian_root/etc/systemd/system/redis-server.service.d/ncp.conf
echo 'PrivateUsers=false' | sudo tee -a raspbian_root/etc/systemd/system/redis-server.service.d/ncp.conf
sudo mkdir -p raspbian_root/etc/systemd/system/php8.3-fpm.service.d
echo '[Service]' | sudo tee raspbian_root/etc/systemd/system/php8.3-fpm.service.d/ncp.conf
echo 'ExecStartPre=mkdir -p /var/run/php' | sudo tee -a raspbian_root/etc/systemd/system/php8.3-fpm.service.d/ncp.conf
- name: Test image
id: test
run: |
log_err() {
rc="${1?}"
msg="${2?}"
echo -e "${LOG_DIAG} $msg" >&2
return $rc
}
sudo systemd-nspawn --boot -D ./raspbian_root/ -M ncp --hostname=nextcloudpi |& awk "{ print \"${LOG_GUEST} \" \$0 }" &
sleep 60
CONTAINER_CMD=(sudo systemd-run --machine=ncp -P --wait)
success=false
for attempt in {1..30}
do
echo -e "${LOG_CICD} == Wait until container network is available (attempt $attempt/30) =="
ip="$("${CONTAINER_CMD[@]}" bash -c '. /usr/local/etc/library.sh > /dev/null; get_ip')"
[[ -n "$ip" ]] && curl -k "https://$ip/activate/" > /dev/null || { sleep 6; continue; }
success=true
break
done
sudo cat ./raspbian_root/var/log/ncp.log |& awk "{ print \"${LOG_NCP} \" \$0 }"
sudo tail -n 0 -f ./raspbian_root/var/log/ncp.log |& awk "{ print \"${LOG_NCP} \" \$0 }" &
[[ "$success" == "true" ]] || {
echo -e "${LOG_CICD} Could not reach container. Aborting..."
exit 1
}
attempt=0
success=false
for attempt in {1..150}
do
echo -e "${LOG_CICD} Waiting for container startup (attempt $attempt/150)..."
redis_pw="$("${CONTAINER_CMD[@]}" bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"password'")" \
&& redis_socket="$("${CONTAINER_CMD[@]}" bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"host'")" \
|| log_err $? "Error retrieving redis credentials" || true
if { "${CONTAINER_CMD[@]}" -q ncc status |& awk "{ print \"${LOG_DIAG} \" \$0 }" || log_err $? "ncc status check failed"; } \
&& { [[ "$("${CONTAINER_CMD[@]}" ncc maintenance:mode)" =~ .*disabled.* ]] || log_err $? "Maintenance mode is enabled or could not be retrieved"; } \
&& { "${CONTAINER_CMD[@]}" redis-cli -s "$redis_socket" -a "$redis_pw" set redisready yes |& awk "{ print \"${LOG_DIAG} \" \$0 }" || log_err $? "Failed to set redis variable"; } \
&& { "${CONTAINER_CMD[@]}" redis-cli -s "$redis_socket" -a "$redis_pw" get redisready |& awk "{ print \"${LOG_DIAG} \" \$0 }" || log_err $? "Failed to read redis variable"; }
then
echo -e "${LOG_CICD} Startup successful"
success=true
break
fi
attempt=$((attempt + 1))
sleep 5
done
[[ "$success" == "true" ]] || {
echo -e "${LOG_CICD} ERR: Timeout reached."
"${CONTAINER_CMD[@]}" -q systemctl status mysql |& awk "{ print \"${LOG_DIAG} \" \$0 }" ||:
"${CONTAINER_CMD[@]}" -q systemctl status redis-server |& awk "{ print \"${LOG_DIAG} \" \$0 }" ||:
sudo journalctl --file ./raspbian_root/var/log/journal/"$(sudo cat ./raspbian_root/etc/machine-id)"/system.journal --no-pager -eu redis-server ||:
"${CONTAINER_CMD[@]}" -q journalctl --no-pager -eu redis-server
"${CONTAINER_CMD[@]}" -q systemctl status 'php*-fpm' |& awk "{ print \"${LOG_DIAG} \" \$0 }" ||:
"${CONTAINER_CMD[@]}" -q systemctl status apache2 |& awk "{ print \"${LOG_DIAG} \" \$0 }" ||:
"${CONTAINER_CMD[@]}" -q ncp-diag |& awk "{ print \"${LOG_DIAG} \" \$0 }" ||:
exit 1
}
set -x
set +e
success=false
for attempt in {1..5}
do
echo -e "${LOG_CICD} == Activation Tests (attempt $attempt/5) =="
./.venv/bin/python tests/activation_tests.py -t 300 --no-gui "$ip" 443 4443 |& awk "{ print \"${LOG_TEST} \" \$0 }"
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
echo -e "${LOG_CICD} Activation test failed!"
echo -e "${LOG_DIAG} Geckodriver logs:"
tail -n 20 geckodriver.log >&2 |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
echo "================"
echo -e "${LOG_DIAG} mysql: "
"${CONTAINER_CMD[@]}" -q ncp-diag |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
"${CONTAINER_CMD[@]}" -q systemctl status mysql |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
sleep 12
continue
}
success=true
break
done
[[ "$success" == "true" ]] || {
echo -e "${LOG_CICD} Activation test failed in all attempts!"
exit 1
}
success=false
for attempt in {1..5}
do
echo -e "${LOG_CICD} == System Tests (attempt $attempt/5) =="
USE_SUDO=yes ./.venv/bin/python tests/system_tests.py --non-interactive |& awk "{ print \"${LOG_TEST} \" \$0 }"
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
echo -e "${LOG_CICD} System test failed!"
sleep 12
continue
}
success=true
break
done
[[ "$success" == "true" ]] || {
echo -e "${LOG_CICD} System test failed in all attempts!"
exit 1
}
success=false
for attempt in {1..5}
do
echo -e "${LOG_CICD} == Nextcloud Tests (attempt $attempt/5) =="
./.venv/bin/python tests/nextcloud_tests.py --no-gui "$ip" 443 4443 |& awk "{ print \"${LOG_TEST} \" \$0 }"
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
echo -e "${LOG_CICD} Nextcloud test failed!"
echo -e "${LOG_DIAG} /etc/os-release:"
"${CONTAINER_CMD[@]}" -q ncp /bin/bash -c 'cat /etc/os-release'
echo -e "${LOG_DIAG} /usr/local/etc/ncp.cfg:"
"${CONTAINER_CMD[@]}" --pipe -q ncp /bin/bash -c 'cat /usr/local/etc/ncp.cfg'
cat ./raspbian_root/usr/local/etc/ncp.cfg
echo -e "${LOG_DIAG} /home/ncp-app-bridge config ncp"
sudo ls -l ./raspbian_root/home/www/ncp-app-bridge.sh
"${CONTAINER_CMD[@]}" --pipe --uid=33 ncp /bin/bash -c 'sudo /home/www/ncp-app-bridge.sh config ncp'
echo -e "{$LOG_DIAG} Geckodriver logs:"
tail -n 20 geckodriver.log >&2 |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
echo -e "${LOG_CICD} ================"
echo -e "${LOG_DIAG} ncp.log: "
"${CONTAINER_CMD[@]}" --pipe ncp /bin/bash -c "tail -n20 /var/log/ncp.log" |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
echo "================"
echo "${LOG_DIAG} Nextcloud log: "
"${CONTAINER_CMD[@]}" --pipe -q ncp /bin/bash -c 'ls -l /opt/ncdata/data/nextcloud.log' |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
"${CONTAINER_CMD[@]}" --pipe -q ncp /bin/bash -c 'cat /opt/ncdata/data/nextcloud.log' |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
sudo cat ./raspbian_root/opt/ncdata/data/nextcloud.log |& awk "{ print \"${LOG_DIAG} \" \$0 }"
sleep 12
continue
}
success=true
break
done
sudo machinectl terminate ncp
[[ "$success" == "true" ]] || {
echo -e "${LOG_CICD} Nextcloud test failed in all attempts!"
echo "Apache2 logs (error):"
sudo cat ./raspbian_root/var/log/apache2/error.log || true
echo "===================="
echo "Apache2 logs (nc-error):"
sudo cat ./raspbian_root/var/log/apache2/nc-error.log || true
echo "===================="
echo "PHP FPM logs:"
sudo cat ./raspbian_root/var/log/php*-fpm.log
echo "===================="
echo "Nextcloud logs:"
sudo cat ./raspbian_root/opt/ncdata/data/nextcloud.log
echo "===================="
echo "MySQL logs:"
sudo journalctl --file ./raspbian_root/var/log/journal/"$(sudo cat ./raspbian_root/etc/machine-id)"/system.journal --no-pager -eu mariadb || true
echo "===================="
echo "Redis logs:"
sudo journalctl --file ./raspbian_root/var/log/journal/"$(sudo cat ./raspbian_root/etc/machine-id)"/system.journal --no-pager -eu redis-server || true
echo "===================="
exit 1
}
# test-distupgrade:
# runs-on: ubuntu-latest
# env:
# VERSION: "${{ inputs.git_ref || github.ref }}"
# LOG_GUEST: "\\033[1;34mGUEST::\\033[0m"
# LOG_NCP: "\\033[1;36m~NCP::\\033[0m"
# LOG_CICD: "\\033[1;35mCICD::\\033[0m"
# LOG_TEST: "\\033[1;33mTEST::\\033[0m"
# LOG_DIAG: "\\033[1;31mDIAG::\\033[0m"
# PREVIOUS_VERSION: "v1.53.2"
# defaults:
# run:
# shell: bash
# steps:
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
# - name: Checkout code
# uses: actions/checkout@v3
# with:
# ref: "${{ env.VERSION }}"
# - name: Download previous image
# id: download-previous-image
# run: |
# set -x
# mkdir -p output
# cd output
# wgetrc=0
# wgeterr="$(wget -O ./ncp.zip "https://github.com/nextcloud/nextcloudpi/releases/download/${PREVIOUS_VERSION?}/NextcloudPi_${{ inputs.board_name }}_${PREVIOUS_VERSION}.zip" 2>&1)" || wgetrc=$?
# if [[ $wgetrc -ne 0 ]]
# then
# if echo "$wgeterr" | grep '404 Not Found'
# then
# echo "Board not found in previous release - skipping."
# echo "skipped=true" >> "$GITHUB_OUTPUT"
# exit 0
# else
# echo "$wgeterr"
# exit $wgetrc
# fi
# fi
# echo "skipped=false" >> "$GITHUB_OUTPUT"
# unzip ncp.zip
# rm ncp.zip
# mv NextcloudPi_${{ inputs.board_name }}_${PREVIOUS_VERSION}.img ./ncp.img
# echo "ARTIFACT_FILE=ncp.img" >> "$GITHUB_ENV"
# - name: Prepare test
# if: ${{ steps.download-previous-image.outputs.skipped == 'false' }}
# run: |
# set -x
# mv output/${ARTIFACT_FILE?} ncp.img
# sudo apt-get install -y systemd-container
# sudo pip install selenium
# sudo rm -rf raspbian_root
# . ./build/buildlib.sh
# mount_raspbian "ncp.img"
# sudo cat raspbian_root/etc/machine-id
# sudo systemd-id128 new | sudo tee ./raspbian_root/etc/machine-id
# sudo wget -nv https://github.com/multiarch/qemu-user-static/releases/latest/download/qemu-aarch64-static -O raspbian_root/usr/bin/qemu-aarch64-static
# sudo wget -nv https://github.com/multiarch/qemu-user-static/releases/latest/download/qemu-arm-static -O raspbian_root/usr/bin/qemu-arm-static
# sudo chmod +x raspbian_root/usr/bin/qemu-{arm,aarch64}-static
# echo 'Mutex posixsem' | sudo tee -a raspbian_root/etc/apache2/mods-available/ssl.conf
# echo 'ignore-warnings ARM64-COW-BUG' | sudo tee -a raspbian_root/etc/redis/redis.conf
# sudo mkdir -p raspbian_root/etc/systemd/system/redis-server.service.d
# echo '[Service]' | sudo tee raspbian_root/etc/systemd/system/redis-server.service.d/ncp.conf
# echo 'PrivateUsers=false' | sudo tee -a raspbian_root/etc/systemd/system/redis-server.service.d/ncp.conf
# - name: Test and activate image
# if: ${{ steps.download-previous-image.outputs.skipped == 'false' }}
# id: test
# run: |
#
# log_err() {
# rc="${1?}"
# msg="${2?}"
# echo -e "${LOG_DIAG} $msg" >&2
# return $rc
# }
#
# sudo systemd-nspawn --boot -D ./raspbian_root/ -M ncp --hostname=nextcloudpi |& awk "{ print \"${LOG_GUEST} \" \$0 }" &
# sleep 60
#
# CONTAINER_CMD=(sudo systemd-run --machine=ncp -P --wait)
#
# success=false
# for attempt in {1..30}
# do
# echo -e "${LOG_CICD} == Wait until container network is available (attempt $attempt/30) =="
# ip="$("${CONTAINER_CMD[@]}" bash -c '. /usr/local/etc/library.sh > /dev/null; get_ip')"
# [[ -n "$ip" ]] && curl -k "https://$ip/activate/" > /dev/null || { sleep 6; continue; }
# success=true
# break
# done
# sudo cat ./raspbian_root/var/log/ncp.log |& awk "{ print \"${LOG_NCP} \" \$0 }"
# sudo tail -n 0 -f ./raspbian_root/var/log/ncp.log |& awk "{ print \"${LOG_NCP} \" \$0 }" &
#
# [[ "$success" == "true" ]] || {
# echo -e "${LOG_CICD} Could not reach container. Aborting..."
# exit 1
# }
#
# attempt=0
# success=false
# for attempt in {1..150}
# do
# echo -e "${LOG_CICD} Waiting for container startup (attempt $attempt/150)..."
# "${CONTAINER_CMD[@]}" journalctl -eu redis.service || true
# "${CONTAINER_CMD[@]}" systemctl status php8.1-fpm.service || true
# redis_pw="$("${CONTAINER_CMD[@]}" bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"password'")" \
# && redis_socket="$("${CONTAINER_CMD[@]}" bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"host'")" \
# || log_err $? "Error retrieving redis credentials" || true
# if { "${CONTAINER_CMD[@]}" -q ncc status |& awk "{ print \"${LOG_DIAG} \" \$0 }" || log_err $? "ncc status check failed"; } \
# && { [[ "$("${CONTAINER_CMD[@]}" ncc maintenance:mode)" =~ .*disabled.* ]] || log_err $? "Maintenance mode is enabled or could not be retrieved"; } \
# && { "${CONTAINER_CMD[@]}" redis-cli -s "$redis_socket" -a "$redis_pw" set redisready yes |& awk "{ print \"${LOG_DIAG} \" \$0 }" || log_err $? "Failed to set redis variable"; } \
# && { "${CONTAINER_CMD[@]}" redis-cli -s "$redis_socket" -a "$redis_pw" get redisready |& awk "{ print \"${LOG_DIAG} \" \$0 }" || log_err $? "Failed to read redis variable"; }
# then
# echo -e "${LOG_CICD} Startup successful"
# success=true
# break
# fi
# attempt=$((attempt + 1))
# sleep 5
# done
#
# [[ "$success" == "true" ]] || {
# echo -e "${LOG_CICD} Timeout reached."
# "${CONTAINER_CMD[@]}" -q systemctl status mysql |& awk "{ print \"${LOG_DIAG} \" \$0 }"
# "${CONTAINER_CMD[@]}" -q systemctl status redis |& awk "{ print \"${LOG_DIAG} \" \$0 }"
# "${CONTAINER_CMD[@]}" -q systemctl status 'php*-fpm' |& awk "{ print \"${LOG_DIAG} \" \$0 }"
# "${CONTAINER_CMD[@]}" -q systemctl status apache2 |& awk "{ print \"${LOG_DIAG} \" \$0 }"
# "${CONTAINER_CMD[@]}" -q ncp-diag |& awk "{ print \"${LOG_DIAG} \" \$0 }"
# exit 1
# }
#
# set -x
# set +e
#
# success=false
# for attempt in {1..5}
# do
# echo -e "${LOG_CICD} == Activation Tests (attempt $attempt/5) =="
# python tests/activation_tests.py -t 300 --no-gui "$ip" 443 4443 |& awk "{ print \"${LOG_TEST} \" \$0 }"
# [[ ${PIPESTATUS[0]} -eq 0 ]] || {
# echo -e "${LOG_CICD} Activation test failed!"
# echo -e "${LOG_DIAG} Geckodriver logs:"
# tail -n 20 geckodriver.log >&2 |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
# echo "================"
# echo -e "${LOG_DIAG} mysql: "
# "${CONTAINER_CMD[@]}" -q ncp-diag |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
# "${CONTAINER_CMD[@]}" -q systemctl status mysql |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
# sleep 12
# continue
# }
# success=true
# break
# done
# [[ "$success" == "true" ]] || {
# echo -e "${LOG_CICD} Activation test failed in all attempts!"
# exit 1
# }
#
# success=false
# for attempt in {1..5}
# do
# echo -e "${LOG_CICD} == System Tests (attempt $attempt/5) =="
# sudo python tests/system_tests.py --non-interactive --skip-update-test |& awk "{ print \"${LOG_TEST} \" \$0 }"
# [[ ${PIPESTATUS[0]} -eq 0 ]] || {
# echo -e "${LOG_CICD} System test failed!"
# sleep 12
# continue
# }
# success=true
# break
# done
# [[ "$success" == "true" ]] || {
# echo -e "${LOG_CICD} System test failed in all attempts!"
# exit 1
# }
#
# success=false
# for attempt in {1..5}
# do
# echo -e "${LOG_CICD} == Nextcloud Tests (attempt $attempt/5) =="
# python tests/nextcloud_tests.py --no-gui --skip-release-check "$ip" 443 4443 |& awk "{ print \"${LOG_TEST} \" \$0 }"
# [[ ${PIPESTATUS[0]} -eq 0 ]] || {
# echo -e "${LOG_CICD} Nextcloud test failed!"
# echo -e "{$LOG_DIAG} Geckodriver logs:"
# tail -n 20 geckodriver.log >&2 |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
# echo -e "${LOG_CICD} ================"
# echo -e "${LOG_DIAG} ncp.log: "
# "${CONTAINER_CMD[@]}" -q ncp /bin/bash -c "tail -n20 /var/log/ncp.log" |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
# echo "================"
# echo "${LOG_DIAG} Nextcloud log: "
# "${CONTAINER_CMD[@]}" -q ncp /bin/bash -c 'ls -l /opt/ncdata/data/nextcloud.log' |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
# "${CONTAINER_CMD[@]}" -q ncp /bin/bash -c 'cat /opt/ncdata/data/nextcloud.log' |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
# sleep 12
# continue
# }
# success=true
# break
# done
#
# [[ "$success" == "true" ]] || {
# echo -e "${LOG_CICD} Nextcloud test failed in all attempts!"
# exit 1
# }
# - name: Update NCP
# if: ${{ steps.download-previous-image.outputs.skipped == 'false' }}
# run: |
# set -ex
#
# CONTAINER_CMD=(sudo systemd-run --machine=ncp -P --wait)
#
# BRANCH="${VERSION/refs\/heads\//}"
# BRANCH="${BRANCH/refs\/tags\//}"
# if [[ "$BRANCH" =~ "refs/pull/"* ]]
# then
# UPDATE_ARGS=("${{ github.head_ref }}" "$VERSION")
# else
# UPDATE_ARGS=("$BRANCH")
# fi
# current_nc_version="$("${CONTAINER_CMD[@]}" ncc status | grep "version:" | awk '{ print $3 }')"
# latest_nc_version="$(cat etc/ncp.cfg | jq -r '.nextcloud_version')"
#
# echo "Updating from $PREVIOUS_VERSION to $VERSION"
#
# "${CONTAINER_CMD[@]}" bash -c "DBG=x ncp-update ${UPDATE_ARGS[*]}"
# "${CONTAINER_CMD[@]}" /usr/local/bin/ncc status
# # "${CONTAINER_CMD[@]}" bash -c 'curl https://download.nextcloud.com/server/releases/nextcloud-28.0.4.tar.bz2 > /var/www/nextcloud-28.0.4.tar.bz2'
# k0nKat1Nation
#
# # if [[ "$current_nc_version" =~ "$latest_nc_version".* ]]
# # then
# # echo "Nextcloud is up to date - skipping NC update test."
# # else
# # "${CONTAINER_CMD[@]}" bash -c "DBG=x ncp-update-nc ${latest_nc_version?}"
# # fi
#
# sudo machinectl terminate ncp
# sudo rm -f ./raspbian_root/opt/ncdata/data/nextcloud.log
# - name: Test image after update
# if: ${{ steps.download-previous-image.outputs.skipped == 'false' }}
# run: |
#
# log_err() {
# rc="${1?}"
# msg="${2?}"
# echo -e "${LOG_DIAG} $msg" >&2
# return $rc
# }
#
# sudo systemd-nspawn --boot -D ./raspbian_root/ -M ncp --hostname=nextcloudpi |& awk "{ print \"${LOG_GUEST} \" \$0 }" &
# sleep 60
#
# CONTAINER_CMD=(sudo systemd-run --machine=ncp -P --wait)
#
# success=false
# for attempt in {1..30}
# do
# echo -e "${LOG_CICD} == Wait until container network is available (attempt $attempt/30) =="
# ip="$("${CONTAINER_CMD[@]}" bash -c '. /usr/local/etc/library.sh > /dev/null; get_ip')"
# [[ -n "$ip" ]] && curl -k "https://$ip/activate/" > /dev/null || { sleep 6; continue; }
# success=true
# break
# done
# sudo cat ./raspbian_root/var/log/ncp.log |& awk "{ print \"${LOG_NCP} \" \$0 }"
# sudo tail -n 0 -f ./raspbian_root/var/log/ncp.log |& awk "{ print \"${LOG_NCP} \" \$0 }" &
#
# [[ "$success" == "true" ]] || {
# echo -e "${LOG_CICD} Could not reach container. Aborting..."
# exit 1
# }
#
# attempt=0
# success=false
# for attempt in {1..150}
# do
# echo -e "${LOG_CICD} Waiting for container startup (attempt $attempt/150)..."
# "${CONTAINER_CMD[@]}" journalctl -eu redis.service || true
# "${CONTAINER_CMD[@]}" systemctl status php8.1-fpm.service || true
# redis_pw="$("${CONTAINER_CMD[@]}" bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"password'")" \
# && redis_socket="$("${CONTAINER_CMD[@]}" bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"host'")" \
# || log_err $? "Error retrieving redis credentials" || true
# if { "${CONTAINER_CMD[@]}" -q ncc status |& awk "{ print \"${LOG_DIAG} \" \$0 }" || log_err $? "ncc status check failed"; } \
# && { [[ "$("${CONTAINER_CMD[@]}" ncc maintenance:mode)" =~ .*disabled.* ]] || log_err $? "Maintenance mode is enabled or could not be retrieved"; } \
# && { "${CONTAINER_CMD[@]}" redis-cli -s "$redis_socket" -a "$redis_pw" set redisready yes |& awk "{ print \"${LOG_DIAG} \" \$0 }" || log_err $? "Failed to set redis variable"; } \
# && { "${CONTAINER_CMD[@]}" redis-cli -s "$redis_socket" -a "$redis_pw" get redisready |& awk "{ print \"${LOG_DIAG} \" \$0 }" || log_err $? "Failed to read redis variable"; }
# then
# echo -e "${LOG_CICD} Startup successful"
# success=true
# break
# fi
# attempt=$((attempt + 1))
# sleep 5
# done
#
# [[ "$success" == "true" ]] || {
# echo -e "${LOG_CICD} Timeout reached."
# "${CONTAINER_CMD[@]}" -q systemctl status mysql |& awk "{ print \"${LOG_DIAG} \" \$0 }"
# "${CONTAINER_CMD[@]}" -q systemctl status redis |& awk "{ print \"${LOG_DIAG} \" \$0 }"
# "${CONTAINER_CMD[@]}" -q systemctl status 'php*-fpm' |& awk "{ print \"${LOG_DIAG} \" \$0 }"
# "${CONTAINER_CMD[@]}" -q systemctl status apache2 |& awk "{ print \"${LOG_DIAG} \" \$0 }"
# "${CONTAINER_CMD[@]}" -q ncp-diag |& awk "{ print \"${LOG_DIAG} \" \$0 }"
# exit 1
# }
#
# set -x
# set +e
#
# success=false
# for attempt in {1..5}
# do
# echo -e "${LOG_CICD} == System Tests (attempt $attempt/5) =="
# sudo python tests/system_tests.py --non-interactive --skip-update-test |& awk "{ print \"${LOG_TEST} \" \$0 }"
# [[ ${PIPESTATUS[0]} -eq 0 ]] || {
# echo -e "${LOG_CICD} System test failed!"
# sleep 12
# continue
# }
# success=true
# break
# done
# [[ "$success" == "true" ]] || {
# echo -e "${LOG_CICD} System test failed in all attempts!"
# exit 1
# }
#
# success=false
# for attempt in {1..5}
# do
# echo -e "${LOG_CICD} == Nextcloud Tests (attempt $attempt/5) =="
# python tests/nextcloud_tests.py --no-gui --skip-release-check "$ip" 443 4443 |& awk "{ print \"${LOG_TEST} \" \$0 }"
# [[ ${PIPESTATUS[0]} -eq 0 ]] || {
# echo -e "${LOG_CICD} Nextcloud test failed!"
# echo -e "{$LOG_DIAG} Geckodriver logs:"
# tail -n 20 geckodriver.log >&2 |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
# echo -e "${LOG_CICD} ================"
# echo -e "${LOG_DIAG} ncp.log: "
# "${CONTAINER_CMD[@]}" -q ncp /bin/bash -c "tail -n20 /var/log/ncp.log" |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
# echo "================"
# echo "${LOG_DIAG} Nextcloud log: "
# "${CONTAINER_CMD[@]}" -q ncp /bin/bash -c 'ls -l /opt/ncdata/data/nextcloud.log' |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
# "${CONTAINER_CMD[@]}" -q ncp /bin/bash -c 'cat /opt/ncdata/data/nextcloud.log' |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
# sleep 12
# continue
# }
# success=true
# break
# done
#
# [[ "$success" == "true" ]] || {
# echo -e "${LOG_CICD} Nextcloud test failed in all attempts!"
# exit 1
# }
#
# - name: Run dist-upgrade
# if: ${{ steps.download-previous-image.outputs.skipped == 'false' }}
# run: |
# set -ex
#
# source ./library.sh
#
# echo "Updating from $PREVIOUS_VERSION to $VERSION
#
# CONTAINER_CMD=(sudo systemd-run --machine=ncp -P --wait)
#
# sudo grep 'VERSION="11"' ./raspbian_root/etc/os-release || {
# echo "Can't dist-upgrade from debian version $(sudo grep 'Version=' ./raspbian_root/etc/os-release)"
# exit 1
# }
# "${CONTAINER_CMD[@]}" DBG=x ncp-dist-upgrade "$VERSION"
#
# sudo machinectl terminate ncp
# sudo rm -f ./raspbian_root/opt/ncdata/data/nextcloud.log
#
# - name: Test image after dist-upgrade
# if: ${{ steps.download-previous-image.outputs.skipped == 'false' }}
# run: |
#
# log_err() {
# rc="${1?}"
# msg="${2?}"
# echo -e "${LOG_DIAG} $msg" >&2
# return $rc
# }
#
# sudo systemd-nspawn --boot -D ./raspbian_root/ -M ncp --hostname=nextcloudpi |& awk "{ print \"${LOG_GUEST} \" \$0 }" &
# sleep 60
#
# CONTAINER_CMD=(sudo systemd-run --machine=ncp -P --wait)
#
# success=false
# for attempt in {1..30}
# do
# echo -e "${LOG_CICD} == Wait until container network is available (attempt $attempt/30) =="
# ip="$("${CONTAINER_CMD[@]}" bash -c '. /usr/local/etc/library.sh > /dev/null; get_ip')"
# [[ -n "$ip" ]] && curl -k "https://$ip/activate/" > /dev/null || { sleep 6; continue; }
# success=true
# break
# done
# sudo cat ./raspbian_root/var/log/ncp.log |& awk "{ print \"${LOG_NCP} \" \$0 }"
# sudo tail -n 0 -f ./raspbian_root/var/log/ncp.log |& awk "{ print \"${LOG_NCP} \" \$0 }" &
#
# [[ "$success" == "true" ]] || {
# echo -e "${LOG_CICD} Could not reach container. Aborting..."
# exit 1
# }
#
# attempt=0
# success=false
# for attempt in {1..150}
# do
# echo -e "${LOG_CICD} Waiting for container startup (attempt $attempt/150)..."
# "${CONTAINER_CMD[@]}" journalctl -eu redis.service || true
# "${CONTAINER_CMD[@]}" systemctl status php8.1-fpm.service || true
# redis_pw="$("${CONTAINER_CMD[@]}" bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"password'")" \
# && redis_socket="$("${CONTAINER_CMD[@]}" bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"host'")" \
# || log_err $? "Error retrieving redis credentials" || true
# if { "${CONTAINER_CMD[@]}" -q ncc status |& awk "{ print \"${LOG_DIAG} \" \$0 }" || log_err $? "ncc status check failed"; } \
# && { [[ "$("${CONTAINER_CMD[@]}" ncc maintenance:mode)" =~ .*disabled.* ]] || log_err $? "Maintenance mode is enabled or could not be retrieved"; } \
# && { "${CONTAINER_CMD[@]}" redis-cli -s "$redis_socket" -a "$redis_pw" set redisready yes |& awk "{ print \"${LOG_DIAG} \" \$0 }" || log_err $? "Failed to set redis variable"; } \
# && { "${CONTAINER_CMD[@]}" redis-cli -s "$redis_socket" -a "$redis_pw" get redisready |& awk "{ print \"${LOG_DIAG} \" \$0 }" || log_err $? "Failed to read redis variable"; }
# then
# echo -e "${LOG_CICD} Startup successful"
# success=true
# break
# fi
# attempt=$((attempt + 1))
# sleep 5
# done
#
# [[ "$success" == "true" ]] || {
# echo -e "${LOG_CICD} Timeout reached."
# "${CONTAINER_CMD[@]}" -q systemctl status mysql |& awk "{ print \"${LOG_DIAG} \" \$0 }"
# "${CONTAINER_CMD[@]}" -q systemctl status redis |& awk "{ print \"${LOG_DIAG} \" \$0 }"
# "${CONTAINER_CMD[@]}" -q systemctl status 'php*-fpm' |& awk "{ print \"${LOG_DIAG} \" \$0 }"
# "${CONTAINER_CMD[@]}" -q systemctl status apache2 |& awk "{ print \"${LOG_DIAG} \" \$0 }"
# "${CONTAINER_CMD[@]}" -q ncp-diag |& awk "{ print \"${LOG_DIAG} \" \$0 }"
# exit 1
# }
#
# set -x
# set +e
#
# success=false
# for attempt in {1..5}
# do
# echo -e "${LOG_CICD} == Activation Tests (attempt $attempt/5) =="
# python tests/activation_tests.py -t 300 --no-gui "$ip" 443 4443 |& awk "{ print \"${LOG_TEST} \" \$0 }"
# [[ ${PIPESTATUS[0]} -eq 0 ]] || {
# echo -e "${LOG_CICD} Activation test failed!"
# echo -e "${LOG_DIAG} Geckodriver logs:"
# tail -n 20 geckodriver.log >&2 |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
# echo "================"
# echo -e "${LOG_DIAG} mysql: "
# "${CONTAINER_CMD[@]}" -q ncp-diag |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
# "${CONTAINER_CMD[@]}" -q systemctl status mysql |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
# sleep 12
# continue
# }
# success=true
# break
# done
# [[ "$success" == "true" ]] || {
# echo -e "${LOG_CICD} Activation test failed in all attempts!"
# exit 1
# }
#
# success=false
# for attempt in {1..5}
# do
# echo -e "${LOG_CICD} == System Tests (attempt $attempt/5) =="
# sudo python tests/system_tests.py --non-interactive |& awk "{ print \"${LOG_TEST} \" \$0 }"
# [[ ${PIPESTATUS[0]} -eq 0 ]] || {
# echo -e "${LOG_CICD} System test failed!"
# sleep 12
# continue
# }
# success=true
# break
# done
# [[ "$success" == "true" ]] || {
# echo -e "${LOG_CICD} System test failed in all attempts!"
# exit 1
# }
#
# success=false
# for attempt in {1..5}
# do
# echo -e "${LOG_CICD} == Nextcloud Tests (attempt $attempt/5) =="
# python tests/nextcloud_tests.py --no-gui "$ip" 443 4443 |& awk "{ print \"${LOG_TEST} \" \$0 }"
# [[ ${PIPESTATUS[0]} -eq 0 ]] || {
# echo -e "${LOG_CICD} Nextcloud test failed!"
# echo -e "{$LOG_DIAG} Geckodriver logs:"
# tail -n 20 geckodriver.log >&2 |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
# echo -e "${LOG_CICD} ================"
# echo -e "${LOG_DIAG} ncp.log: "
# "${CONTAINER_CMD[@]}" -q ncp /bin/bash -c "tail -n20 /var/log/ncp.log" |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
# echo "================"
# echo "${LOG_DIAG} Nextcloud log: "
# "${CONTAINER_CMD[@]}" -q ncp /bin/bash -c 'ls -l /opt/ncdata/data/nextcloud.log' |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
# "${CONTAINER_CMD[@]}" -q ncp /bin/bash -c 'cat /opt/ncdata/data/nextcloud.log' |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
# sleep 12
# continue
# }
# success=true
# break
# done
#
# [[ "$success" == "true" ]] || {
# echo -e "${LOG_CICD} Nextcloud test failed in all attempts!"
# exit 1
# }

17
.github/workflows/lxd-trigger.yml vendored Normal file
View File

@ -0,0 +1,17 @@
name: LXD Tests
on:
pull_request:
branches:
- master
- devel
- release/*
push:
branches:
- devel
jobs:
lxd:
uses: ./.github/workflows/build-lxd.yml
with:
git_ref: "${{ github.head_ref || github.ref_name }}"

View File

@ -0,0 +1,142 @@
name: "Organize Issues and PRs on GH project"
on:
issues:
types:
- opened
- reopened
- closed
- assigned
- labeled
- unlabeled
- milestoned
issue_comment:
types:
- created
permissions:
repository-projects: write
contents: write
issues: write
jobs:
add_issue_to_project:
if: ${{ github.event_name == 'issues' && (github.event.action == 'opened' || github.event.action == 'reopened') }}
runs-on: ubuntu-latest
steps:
- name: Get project data
env:
GITHUB_TOKEN: ${{ secrets.NCP_PROJECT_PAT }}
ORGANIZATION: nextcloud
PROJECT_NUMBER: 67
run: |
gh api graphql -f query='
query($org: String!, $number: Int!) {
organization(login: $org){
projectV2(number: $number) {
id
fields(first:20) {
nodes {
... on ProjectV2Field {
id
name
}
... on ProjectV2SingleSelectField {
id
name
options {
id
name
}
}
}
}
}
}
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
echo "BUGS_STATUS_FIELD_ID=$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json)" >> $GITHUB_ENV
echo "BUGS_STATUS_OPTION_NEW_ID=$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="New") |.id' project_data.json)" >> $GITHUB_ENV
echo "BUGS_STATUS_OPTION_BUG_ID=$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="Bugs") |.id' project_data.json)" >> $GITHUB_ENV
echo "DEVEL_STATUS_FIELD_ID=$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Development Status") | .id' project_data.json)" >> $GITHUB_ENV
echo "DEVEL_STATUS_OPTION_BACKLOG_ID=$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Development Status") | .options[] | select(.name=="Backlog") |.id' project_data.json)" >> $GITHUB_ENV
- name: Add Issue to project
env:
GH_TOKEN: ${{ secrets.NCP_PROJECT_PAT }}
ISSUE_ID: ${{ github.event.issue.node_id }}
run: |
item_id="$( gh api graphql -f query='
mutation($project:ID!, $issue:ID!) {
addProjectV2ItemById(input: {projectId: $project, contentId: $issue}) {
item {
id
}
}
}' -f project=$PROJECT_ID -f issue=$ISSUE_ID --jq '.data.addProjectV2ItemById.item.id')"
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
# - name: Set fields
# env:
# GH_TOKEN: ${{ secrets.NCP_PROJECT_PAT }}
# IS_ENHANCMENET: ${{ contains( github.event.issue.labels.*.name, 'enhancement') || contains( github.event.issue.labels.*.name, 'feature-request') || contains( github.event.issue.labels.*.name, 'roadmap') }}
# IS_BUG: ${{ contains( github.event.issue.labels.*.name, 'bug') }}
# run: |
#
# if [[ "$IS_ENHANCEMENT" == true ]]
# then
# STATUS_FIELD_ID="$DEVEL_STATUS_FIELD_ID"
# STATUS_OPTION_ID="$DEVEL_STATUS_OPTION_BACKLOG_ID"
# elif [[ "$IS_BUG" == true ]]
# then
# STATUS_FIELD_ID="$BUGS_STATUS_FIELD_ID"
# STATUS_OPTION_ID="$BUGS_STATUS_OPTION_BUG_ID"
# else
# STATUS_FIELD_ID="$BUGS_STATUS_FIELD_ID"
# STATUS_OPTION_ID="$BUGS_STATUS_OPTION_NEW_ID"
# fi
#
# echo "project=$PROJECT_ID
# item=$ITEM_ID
# status_field=$STATUS_FIELD_ID
# status_value=$STATUS_OPTION_ID"
#
# gh api graphql -f query='
# mutation(
# $project: ID!
# $item: ID!
# $status_field: ID!
# $status_value: String!
# ) {
# set_status: updateProjectV2ItemFieldValue(input: {
# projectId: $project
# itemId: $item
# fieldId: $status_field
# value: {
# singleSelectOptionId: $status_value
# }
# }) {
# projectV2Item {
# id
# }
# }
# }' \
# -f project=$PROJECT_ID \
# -f "item=$ITEM_ID" \
# -f "status_field=$STATUS_FIELD_ID" \
# -f "status_value=$STATUS_OPTION_ID" \
# --silent
set_update_label:
if: ${{ github.event_name == 'issue_comment' && !github.event.issue.pull_request && !contains( github.event.issue.assignees.*.login, github.event.comment.user.login ) }}
runs-on: ubuntu-latest
steps:
- name: Add update label to issue
if: ${{ ! contains( github.event.issue.labels.*.name, 'update' ) }}
env:
ISSUE_ID: ${{ github.event.issue.number }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh issue edit --repo "${{ github.repository }}" --add-label has-updates "$ISSUE_ID"

100
.github/workflows/publish-image.yml vendored Normal file
View File

@ -0,0 +1,100 @@
name: "Publish Images"
on:
workflow_call:
inputs:
git_ref:
required: true
type: string
artifact_id:
required: true
type: string
artifact_file:
required: true
type: string
dry_run:
required: false
type: boolean
default: false
jobs:
publish:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
env:
VERSION: "${{ inputs.git_ref }}"
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: "${{ env.VERSION }}"
- name: "Download artifact"
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact_id }}
path: artifacts
- name: "Publish artifact"
env:
IMG: "${{ inputs.artifact_file }}"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -ex
mkdir -p publish
mv "artifacts/${{ inputs.artifact_file }}" publish/
cd publish
asset="${IMG}"
[[ "$IMG" =~ .*".img" ]] && {
zip "${IMG%.img}.zip" "${IMG?}"
asset="${IMG%.img}.zip"
}
checksum="$(md5sum "$asset")"
echo "Artifact Checksum:
$checksum"
[[ "${{ inputs.dry_run }}" == "true" ]] && {
echo "Dry run only. Skipping release..."
exit 0
}
success=false
for i in {1..5}
do
body="$(gh release view --json body "${VERSION}" | jq -r '.body')"
if ! [[ "$body" =~ .*'**Checksums:**'.* ]]
then
body="${body}
**Checksums:**
\`\`\`
\`\`\`"
fi
body="${body%$'\n\`\`\`'*}
$checksum
\`\`\`"
gh release edit "${VERSION?}" -n "$body"
if gh release view --json body "${VERSION}" | jq -r '.body' | grep "$checksum"
then
success=true
break
else
WAIT_TIME="$((1 + $RANDOM % 20))"
echo "Checksum missing from release description. Retrying in $WAIT_TIME seconds..."
sleep "$WAIT_TIME"
fi
done
[[ "$success" == "true" ]] || {
echo "Updating release description failed."
exit 1
}
gh release upload "${VERSION?}" "${asset}"
echo "Image published successfully."

387
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,387 @@
name: 'Release'
on:
workflow_dispatch:
inputs:
git_ref:
description: git ref, branch or tag to test against
required: false
type: string
sd-images:
type: boolean
description: 'Build/test SD images?'
required: false
default: true
lxd:
type: boolean
description: 'Build/test LXD image?'
required: false
default: true
installer:
type: boolean
description: 'Run curl-installer/upgrade tests?'
required: false
default: true
release:
type: boolean
description: 'Release images to GH'
required: false
default: false
test_image_url:
type: string
description: 'URL for test image to test instead of actual armbian builds'
required: false
default: ''
push:
tags:
- "v*"
branches:
- master
permissions:
contents: write
jobs:
lxd-x86:
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' && !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
test-curl-installer:
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' && !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: rpi4b
board_name: RaspberryPi 4+
secrets: inherit
armbian-test-image:
if: ${{ inputs.test_image_url != '' }}
uses: ./.github/workflows/build-sd-images.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
board_id: testimage
board_name: TestImage
test_image_url: "${{ inputs.test_image_url }}"
secrets: inherit
# TODO: Fix 32bit armbian images
odroidxu4:
# if: ${{ inputs.sd-images || ( github.event_name != 'workflow_dispatch' && !startsWith(github.ref_name, 'docker-') ) }}
if: ${{ false }}
uses: ./.github/workflows/build-sd-images.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
board_id: odroidxu4
board_name: OdroidHC2
secrets: inherit
rockpro64:
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' && !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: rock64
board_name: Rock64
secrets: inherit
# TODO: Fix 32bit armbian images
bananapi:
# if: ${{ inputs.sd-images || ( github.event_name != 'workflow_dispatch' && !startsWith(github.ref_name, 'docker-') ) }}
if: ${{ false }}
uses: ./.github/workflows/build-sd-images.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
board_id: bananapi
board_name: BananaPi
secrets: inherit
odroidhc4:
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' && !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' && !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: odroidc2
board_name: OdroidC2
secrets: inherit
orangepi5:
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: orangepi5
board_name: OrangePi5
secrets: inherit
orangepi5plus:
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: orangepi5-plus
board_name: OrangePi5Plus
secrets: inherit
lxd-x86-release:
needs:
- github-release
- lxd-x86
if: ${{ inputs.lxd || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.lxd-x86.outputs.lxd_artifact_name }}"
artifact_file: "${{ needs.lxd-x86.outputs.lxd_artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
lxd-arm64-release:
needs:
- github-release
- lxd-arm64
if: ${{ inputs.lxd || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.lxd-arm64.outputs.lxd_artifact_name }}"
artifact_file: "${{ needs.lxd-arm64.outputs.lxd_artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
lxc-x86-release:
needs:
- github-release
- lxd-x86
if: ${{ inputs.lxd || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.lxd-x86.outputs.lxc_artifact_name }}"
artifact_file: "${{ needs.lxd-x86.outputs.lxc_artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
lxc-arm64-release:
needs:
- github-release
- lxd-arm64
if: ${{ inputs.lxd || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.lxd-arm64.outputs.lxc_artifact_name }}"
artifact_file: "${{ needs.lxd-arm64.outputs.lxc_artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
raspberrypi-release:
needs:
- raspberrypi
- github-release
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.raspberrypi.outputs.artifact_name }}"
artifact_file: "${{ needs.raspberrypi.outputs.artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
secrets: inherit
odroidxu4-release:
needs:
- odroidxu4
- github-release
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.odroidxu4.outputs.artifact_name }}"
artifact_file: "${{ needs.odroidxu4.outputs.artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
secrets: inherit
rockpro64-release:
needs:
- rockpro64
- github-release
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.rockpro64.outputs.artifact_name }}"
artifact_file: "${{ needs.rockpro64.outputs.artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
secrets: inherit
rock64-release:
needs:
- rock64
- github-release
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.rock64.outputs.artifact_name }}"
artifact_file: "${{ needs.rock64.outputs.artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
secrets: inherit
bananapi-release:
needs:
- bananapi
- github-release
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.bananapi.outputs.artifact_name }}"
artifact_file: "${{ needs.bananapi.outputs.artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
secrets: inherit
odroidhc4-release:
needs:
- odroidhc4
- github-release
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.odroidhc4.outputs.artifact_name }}"
artifact_file: "${{ needs.odroidhc4.outputs.artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
secrets: inherit
odroidc4-release:
needs:
- odroidc4
- github-release
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.odroidc4.outputs.artifact_name }}"
artifact_file: "${{ needs.odroidc4.outputs.artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
secrets: inherit
odroidc2-release:
needs:
- odroidc2
- github-release
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.odroidc2.outputs.artifact_name }}"
artifact_file: "${{ needs.odroidc2.outputs.artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
secrets: inherit
orangepi5-release:
needs:
- orangepi5
- github-release
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.orangepi5.outputs.artifact_name }}"
artifact_file: "${{ needs.orangepi5.outputs.artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
secrets: inherit
orangepi5plus-release:
needs:
- orangepi5plus
- github-release
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.orangepi5plus.outputs.artifact_name }}"
artifact_file: "${{ needs.orangepi5plus.outputs.artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
secrets: inherit
github-release:
if: ${{ github.event_name == 'workflow_dispatch' || !startsWith(github.ref_name, 'docker-') }}
needs:
- test-curl-installer
runs-on: ubuntu-latest
env:
UID: "${{ github.run_id }}-rpi"
VERSION: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
defaults:
run:
shell: bash
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
- name: Debug output
run: |
echo "do release?: ${{ inputs.release }}"
echo "event name: ${{ github.event_name }}"
echo "ref type: ${{ github.ref_type }}"
echo "protected?: ${{ github.ref_protected }}"
- name: Create Draft
if: ${{ (inputs.release || github.event_name != 'workflow_dispatch') && github.ref_type == 'tag' && (github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
NC_VERSION="$(jq -r '.nextcloud_version' < etc/ncp.cfg)"
PHP_VERSION="$(jq -r '.php_version' < etc/ncp.cfg)"
DEBIAN_VERSION="$(jq -r '.release' < etc/ncp.cfg)"
ARMBIAN_VERSIOn="$(cat build/armbian/armbian_version)"
subject="$(git tag -n10 --format="%(contents:subject)" "${{ env.VERSION }}")"
body="$(git tag -n30 --format="%(contents:body)" "${{ env.VERSION }}")"
separator="
---
"
gh release create --draft -F - "${{ env.VERSION }}" <<EOF
${subject:-No message found}
### Included Software
Nextcloud ${NC_VERSION} (can be automatically updated to latest minor version)
PHP ${PHP_VERSION}
Debian ${DEBIAN_VERSION}
Armbian ${ARMBIAN_VERSION}
${body:+${body}${separator}}
[Changelog](https://github.com/nextcloud/nextcloudpi/blob/${{ env.VERSION }}/changelog.md)
EOF

714
.github/workflows/vm-tests.yml vendored Normal file
View File

@ -0,0 +1,714 @@
name: 'VM Integration Tests'
on:
workflow_dispatch:
inputs:
git_ref:
description: git ref, branch or tag to test against
required: false
type: string
workflow_call:
inputs:
git_ref:
description: git ref, branch or tag to test against
required: false
type: string
push:
branches:
- master
jobs:
installation-test:
runs-on: ubuntu-latest
container:
image: thecalcaholic/ncp-test-automation:bookworm
env:
HCLOUD_TOKEN: "${{ secrets.TEST_AUTOMATION_HCLOUD_API_TOKEN }}"
UID: "${{ github.run_id }}-install"
outputs:
server_address: ${{ steps.create-test-instance.outputs.server_address }}
snapshot_id: ${{ steps.create-test-instance.outputs.snapshot_id }}
test_server_id: ${{ steps.create-test-instance.outputs.test_server_id }}
version: ${{ env.VERSION }}
test_result: ${{ steps.final_test.outputs.test_result }}
ssh_artifact_name: ${{ env.SSH_ARTIFACT_NAME }}
env:
VERSION: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
HOME: /root
SSH_ARTIFACT_NAME: "${{ github.run_id }}-install-ssh"
UID: "${{ github.run_id }}-install"
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
with:
path: /__w/nextcloudpi/nextcloudpi
- name: Generate ssh keypair
working-directory: /__w/nextcloudpi/nextcloudpi
run: |
set -e
mkdir -p .ssh
ssh-keygen -t ed25519 -f ".ssh/automation_ssh_key"
. /ncp-test-automation/bin/entrypoint.sh
- name: upload ssh private key to artifact store
uses: actions/upload-artifact@v4
with:
name: "${{ env.SSH_ARTIFACT_NAME }}"
path: /__w/nextcloudpi/nextcloudpi/.ssh
if-no-files-found: error
include-hidden-files: true
- id: create-test-instance
uses: ./.github/actions/create-test-instance
with:
version: ${{ env.VERSION }}
uid: "${{ env.UID }}"
hcloud_token: ${{ secrets.TEST_AUTOMATION_HCLOUD_API_TOKEN }}
server_type: "cx22"
- name: set instance variables
run: |
echo "SERVER_ADDRESS=${{ steps.create-test-instance.outputs.server_address }}" >> "$GITHUB_ENV"
echo "SNAPSHOT_ID=${{ steps.create-test-instance.outputs.snapshot_id }}" >> "$GITHUB_ENV"
- name: Test postinstall VM
id: final_test
working-directory: /ncp-test-automation/bin
run: |
set -e
echo "Setup ssh"
chmod 0600 /__w/nextcloudpi/nextcloudpi/.ssh/automation_ssh_key
eval "$(ssh-agent)"
ssh-add /__w/nextcloudpi/nextcloudpi/.ssh/automation_ssh_key
source ./library.sh
trap '[ $? -eq 0 ] || echo "test_result=failure" >> "$GITHUB_OUTPUT"; 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
set -x
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
}
echo "test_result=success" >> "$GITHUB_OUTPUT";
# update-test:
# runs-on: ubuntu-latest
# container:
# image: thecalcaholic/ncp-test-automation:bullseye
# env:
# HCLOUD_TOKEN: "${{ secrets.TEST_AUTOMATION_HCLOUD_API_TOKEN }}"
# UID: "${{ github.run_id }}-update"
# defaults:
# run:
# shell: bash
# outputs:
# server_address: ${{ steps.create-test-instance.outputs.server_address }}
# snapshot_id: ${{ steps.create-test-instance.outputs.snapshot_id }}
# test_server_id: ${{ steps.create-test-instance.outputs.test_server_id }}
# previous_version: ${{ steps.find-version.outputs.previous_version }}
# version: ${{ env.VERSION }}
# test_result: ${{ steps.final_test.outputs.test_result }}
# ssh_artifact_name: ${{ env.SSH_ARTIFACT_NAME }}
# env:
# VERSION: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
# HOME: /root
# SSH_ARTIFACT_NAME: "${{ github.run_id }}-update-ssh"
# UID: "${{ github.run_id }}-update"
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0
# path: /__w/nextcloudpi/nextcloudpi
# - name: find reference version
# working-directory: /__w/nextcloudpi/nextcloudpi
# shell: bash
# id: find-version
# run: |
# chown -R "$(id -u):$(id -g)" .
# set -e
# if [[ -n "${{ github.base_ref }}" ]]
# then
# version="${{ github.base_ref }}"
# elif [[ "${{ github.ref }}" == "refs/heads/devel" ]]
# then
# version="master"
# else
# git fetch -fu --tags origin ${{ github.ref }}:${{ github.ref }}
# version="$(git describe --tags)"
# [[ "$version" =~ .*-.*-.* ]] || {
# git checkout HEAD~1
# version="$(git describe --tags)"
# }
# version="${version%-*-*}"
# fi
# echo "Previous version is '$version'"
# #TODO: Revert to dynamically found version
# #echo "PREVIOUS_VERSION=${version}" >> "$GITHUB_ENV"
# echo "PREVIOUS_VERSION=v1.53.3" >> "$GITHUB_ENV"
# - name: Generate ssh key
# run: |
# set -x
# mkdir -p /__w/nextcloudpi/nextcloudpi/.ssh
# ssh-keygen -t ed25519 -f "/__w/nextcloudpi/nextcloudpi/.ssh/automation_ssh_key"
# . /ncp-test-automation/bin/entrypoint.sh
# - name: upload ssh private key to artifact store
# uses: actions/upload-artifact@v3
# with:
# name: "${{ env.SSH_ARTIFACT_NAME }}"
# path: /__w/nextcloudpi/nextcloudpi/.ssh
# if-no-files-found: error
# - id: create-test-instance
# uses: ./.github/actions/create-test-instance-bullseye
# with:
# version: "${{ env.PREVIOUS_VERSION }}"
# uid: "${{ env.UID }}"
# hcloud_token: ${{ secrets.TEST_AUTOMATION_HCLOUD_API_TOKEN }}
# server_type: "cx11"
# - name: Set instance variables
# run: |
# echo "SERVER_ADDRESS=${{ steps.create-test-instance.outputs.server_address }}" >> "$GITHUB_ENV"
# echo "SNAPSHOT_ID=${{ steps.create-test-instance.outputs.snapshot_id }}" >> "$GITHUB_ENV"
# - uses: actions/checkout@v3
# with:
# repository: 'theCalcaholic/ncp-test-automation'
# ref: "bullseye"
# path: /__w/nextcloudpi/nextcloudpi/ncp-test-automation
# - name: Activate and Test postinstall VM
# working-directory: /__w/nextcloudpi/nextcloudpi/ncp-test-automation/bin
# run: |
# set -e
# echo "Setup ssh"
# chmod 0600 /__w/nextcloudpi/nextcloudpi/.ssh/automation_ssh_key
# eval "$(ssh-agent)"
# ssh-add /__w/nextcloudpi/nextcloudpi/.ssh/automation_ssh_key
#
# 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" --nc-test-args "--skip-release-check" "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
# working-directory: /__w/nextcloudpi/nextcloudpi/ncp-test-automation/bin
# run: |
# set -e
#
# echo "Setup ssh"
# chmod 0600 /__w/nextcloudpi/nextcloudpi/.ssh/automation_ssh_key
# eval "$(ssh-agent)"
# ssh-add /__w/nextcloudpi/nextcloudpi/.ssh/automation_ssh_key
#
# source ./library.sh
#
# echo "Updating from $PREVIOUS_VERSION to $VERSION"
# ssh-keygen -f "$HOME/.ssh/known_hosts" -R "${SERVER_ADDRESS}" 2> /dev/null || true
# ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" "ncp-update '$VERSION'"
# - name: Run integration tests after update
# id: final_test
# working-directory: /__w/nextcloudpi/nextcloudpi/ncp-test-automation/bin
# run: |
# set -e
#
# echo "Setup ssh"
# eval "$(ssh-agent)"
# ssh-add /__w/nextcloudpi/nextcloudpi/.ssh/automation_ssh_key
#
# source ./library.sh
#
# trap '[ $? -eq 0 ] || echo "test_result=failure" >> "$GITHUB_OUTPUT"; terminate-ssh-port-forwarding "${SERVER_ADDRESS}"' EXIT 1 2
#
# echo "Run integration tests"
# setup-ssh-port-forwarding "$SERVER_ADDRESS"
# NC_TEST_ARGS=()
# ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" cat /etc/os-release | grep VERSION_ID=12 || NC_TEST_ARGS+=("--skip-release-check")
# set -x
# test-ncp-instance -f "$SNAPSHOT_ID" -b "${VERSION}" --nc-test-args "$NC_TEST_ARGS" --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
# }
#
# echo "test_result=success" >> "$GITHUB_OUTPUT";
dist-upgrade-test:
runs-on: ubuntu-latest
container:
image: thecalcaholic/ncp-test-automation:bullseye
env:
HCLOUD_TOKEN: "${{ secrets.TEST_AUTOMATION_HCLOUD_API_TOKEN }}"
UID: "${{ github.run_id }}-distupgrade"
defaults:
run:
shell: bash
outputs:
test_result: ${{ steps.final_test.outputs.test_result }}
ssh_artifact_name: ${{ env.SSH_ARTIFACT_NAME }}
server_address: ${{ steps.create-test-instance.outputs.server_address }}
snapshot_id: ${{ steps.create-test-instance.outputs.snapshot_id }}
test_server_id: ${{ steps.create-test-instance.outputs.test_server_id }}
previous_version: ${{ env.PREVIOUS_VERSION }}
version: ${{ env.VERSION }}
env:
PREVIOUS_VERSION: "v1.53.3"
VERSION: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
HOME: /root
SSH_ARTIFACT_NAME: "${{ github.run_id }}-distupgrade-ssh"
UID: "${{ github.run_id }}-distupgrade"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
path: /__w/nextcloudpi/nextcloudpi
- name: Generate ssh key
run: |
set -x
chown -R "$(id -u):$(id -g)" /__w/nextcloudpi/nextcloudpi
mkdir -p /__w/nextcloudpi/nextcloudpi/.ssh
ssh-keygen -t ed25519 -f "/__w/nextcloudpi/nextcloudpi/.ssh/automation_ssh_key"
. /ncp-test-automation/bin/entrypoint.sh
- name: upload ssh private key to artifact store
uses: actions/upload-artifact@v4
with:
name: "${{ env.SSH_ARTIFACT_NAME }}"
path: /__w/nextcloudpi/nextcloudpi/.ssh
if-no-files-found: error
include-hidden-files: true
- id: create-test-instance
uses: ./.github/actions/create-test-instance-bullseye
with:
version: "${{ env.PREVIOUS_VERSION }}"
uid: "${{ env.UID }}"
hcloud_token: ${{ secrets.TEST_AUTOMATION_HCLOUD_API_TOKEN }}
server_type: "cx22"
- name: Set instance variables
run: |
echo "SERVER_ADDRESS=${{ steps.create-test-instance.outputs.server_address }}" >> "$GITHUB_ENV"
echo "SNAPSHOT_ID=${{ steps.create-test-instance.outputs.snapshot_id }}" >> "$GITHUB_ENV"
- uses: actions/checkout@v3
with:
repository: 'theCalcaholic/ncp-test-automation'
ref: "bullseye"
path: /__w/nextcloudpi/nextcloudpi/ncp-test-automation
- name: Activate and Test postinstall VM
working-directory: /__w/nextcloudpi/nextcloudpi/ncp-test-automation/bin
run: |
set -e
echo "Setup ssh"
chmod 0600 /__w/nextcloudpi/nextcloudpi/.ssh/automation_ssh_key
eval "$(ssh-agent)"
ssh-add /__w/nextcloudpi/nextcloudpi/.ssh/automation_ssh_key
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 "v1.54.3" --systemtest-args "--skip-update-test" --nc-test-args "--skip-release-check" "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
working-directory: /__w/nextcloudpi/nextcloudpi/ncp-test-automation/bin
run: |
set -e
echo "Setup ssh"
chmod 0600 /__w/nextcloudpi/nextcloudpi/.ssh/automation_ssh_key
eval "$(ssh-agent)"
ssh-add /__w/nextcloudpi/nextcloudpi/.ssh/automation_ssh_key
source ./library.sh
echo "Updating from $PREVIOUS_VERSION to $VERSION"
ssh-keygen -f "$HOME/.ssh/known_hosts" -R "${SERVER_ADDRESS}" 2> /dev/null || true
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" "ncp-update '$VERSION'"
- name: Run integration tests after update
working-directory: /__w/nextcloudpi/nextcloudpi/ncp-test-automation/bin
run: |
set -e
echo "Setup ssh"
eval "$(ssh-agent)"
ssh-add /__w/nextcloudpi/nextcloudpi/.ssh/automation_ssh_key
source ./library.sh
trap 'terminate-ssh-port-forwarding "${SERVER_ADDRESS}"' EXIT 1 2
echo "Run integration tests"
setup-ssh-port-forwarding "$SERVER_ADDRESS"
NC_TEST_ARGS=()
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" cat /etc/os-release | grep VERSION_ID=12 || NC_TEST_ARGS+=("--skip-release-check")
set -x
test-ncp-instance -f "$SNAPSHOT_ID" -b "v1.54.3" --nc-test-args "$NC_TEST_ARGS" --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: NCP distupgrade
id: distupgrade
working-directory: /__w/nextcloudpi/nextcloudpi/ncp-test-automation/bin
run: |
set -e
echo "Setup ssh"
eval "$(ssh-agent)"
ssh-add /__w/nextcloudpi/nextcloudpi/.ssh/automation_ssh_key
source ./library.sh
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" cat /etc/os-release | grep 'VERSION_ID="11"' || {
echo "Can't upgrade from Debian $(ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" grep 'VERSION_ID=' /etc/os-release)"
echo "skipped=yes" | tee -a $GITHUB_OUTPUT
exit 1
}
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" DEBIAN_FRONTEND=noninteractive ncp-dist-upgrade
echo "skipped=no" | tee -a $GITHUB_OUTPUT
- name: Update Nextcloud
working-directory: /__w/nextcloudpi/nextcloudpi/ncp-test-automation/bin
run: |
set -ex
apk add jq
echo "Setup ssh"
eval "$(ssh-agent)"
ssh-add /__w/nextcloudpi/nextcloudpi/.ssh/automation_ssh_key
source ./library.sh
current_nc_version="$(ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" "ncc status" | grep "version:" | awk '{ print $3 }')"
latest_nc_version="$(cat ../../etc/ncp.cfg | jq -r '.nextcloud_version')"
if [[ "$current_nc_version" =~ "$latest_nc_version".* ]]
then
echo "Nextcloud is up to date - skipping NC update test."
else
for i in {1..10};
do
echo "running nc update ($i/10)..."
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" "bash -c 'DBG=x ncp-update-nc ${latest_nc_version?}'"
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" /usr/local/bin/ncc status
current_nc_version_new="$(ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" "ncc status" | grep "version:" | awk '{ print $3 }')"
if [[ "$current_nc_version_new" =~ "$latest_nc_version".* ]]
then
break
fi
if [[ "$current_nc_version" == "$current_nc_version_new" ]]
then
echo "failed to update to $latest_nc_version"
exit 1
fi
current_nc_version="$current_nc_version_new"
done
fi
- name: Run integration tests after dist-upgrade
id: final_test
working-directory: /ncp-test-automation/bin
run: |
set -e
echo "Setup ssh"
eval "$(ssh-agent)"
ssh-add /__w/nextcloudpi/nextcloudpi/.ssh/automation_ssh_key
source ./library.sh
trap '[ $? -eq 0 ] || echo "test_result=failure" >> "$GITHUB_OUTPUT"; terminate-ssh-port-forwarding "${SERVER_ADDRESS}"' EXIT 1 2
echo "Run integration tests"
setup-ssh-port-forwarding "$SERVER_ADDRESS"
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:"
echo "==========================================="
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" tail /var/log/ncp-install.log;
echo "==========================================="
echo "ncp.log:"
echo "==========================================="
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" tail /var/log/ncp.log;
echo "==========================================="
echo "nextcloud.log:"
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" tail /opt/ncdata/data/nextcloud.log;
exit 1
}
echo "test_result=success" >> "$GITHUB_OUTPUT"
install-postactivation-snapshot:
if: ${{ always() }}
needs:
- installation-test
runs-on: ubuntu-latest
container:
image: thecalcaholic/ncp-test-automation:latest
env:
HCLOUD_TOKEN: "${{ secrets.TEST_AUTOMATION_HCLOUD_API_TOKEN }}"
env:
TEST_TYPE: install
SERVER_ADDRESS: ${{ needs.installation-test.outputs.server_address }}
TEST_RESULT: ${{ needs.installation-test.test_result }}
TEST_SERVER_ID: ${{ needs.installation-test.outputs.test_server_id }}
VERSION: ${{ needs.installation-test.outputs.version }}
SSH_ARTIFACT_NAME: "${{ needs.installation-test.outputs.ssh_artifact_name }}"
UID: ${{ github.run_id }}-install
steps:
- name: download ssh private key from artifact store
uses: actions/download-artifact@v4
if: ${{ contains('success|failure', env.TEST_RESULT) }}
with:
name: ${{ env.SSH_ARTIFACT_NAME }}
path: /github/workspace/.ssh
- name: Shutdown server
if: ${{ contains('success|failure', env.TEST_RESULT) }}
run: |
chmod 0600 /github/workspace/.ssh/automation_ssh_key
export SSH_PUBLIC_KEY="$(cat /github/workspace/.ssh/automation_ssh_key.pub)"
bash /ncp-test-automation/bin/entrypoint.sh
eval "$(ssh-agent)"
ssh-add /github/workspace/.ssh/automation_ssh_key
ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null" "root@${SERVER_ADDRESS?}" <<EOF
systemctl stop mariadb
systemctl poweroff
EOF
- name: Create Snapshot
if: ${{ contains('success|failure', env.TEST_RESULT) }}
shell: bash
working-directory: /ncp-test-automation/bin
run: |
set -x
echo "${TEST_SERVER_ID?}"
. ./library.sh
tf-init "$TF_SNAPSHOT"
tf-apply "$TF_SNAPSHOT" "$TF_VAR_FILE" -var="branch=${VERSION?}" -var="snapshot_provider_id=${TEST_SERVER_ID?}" -var="snapshot_type=ncp-postactivation" -state="${TF_SNAPSHOT}/${VERSION//\//.}.postactivation.tfstate"
snapshot_id="$(tf-output "$TF_SNAPSHOT" -state="${TF_SNAPSHOT}/${VERSION//\//.}.postactivation.tfstate" snapshot_id)"
hcloud image add-label -o "$snapshot_id" "test-result=${TEST_RESULT?}"
# update-postactivation-snapshot:
# if: ${{ always() }}
# needs:
# - update-test
# runs-on: ubuntu-latest
# container:
# image: thecalcaholic/ncp-test-automation:latest
# env:
# HCLOUD_TOKEN: "${{ secrets.TEST_AUTOMATION_HCLOUD_API_TOKEN }}"
#
# env:
# TEST_TYPE: update
# SERVER_ADDRESS: ${{ needs.update-test.outputs.server_address }}
# TEST_RESULT: ${{ needs.update-test.test_result }}
# TEST_SERVER_ID: ${{ needs.update-test.outputs.test_server_id }}
# VERSION: ${{ needs.update-test.outputs.version }}
# UID: ${{ github.run_id }}-update
# SSH_ARTIFACT_NAME: "${{ needs.update-test.outputs.ssh_artifact_name }}"
# steps:
# - name: download ssh private key from artifact store
# uses: actions/download-artifact@v3
# if: ${{ contains('success|failure', env.TEST_RESULT) }}
# with:
# name: ${{ env.SSH_ARTIFACT_NAME }}
# path: /github/workspace/.ssh
# - name: Shutdown server
# if: ${{ contains('success|failure', env.TEST_RESULT) }}
# run: |
# chmod 0600 /github/workspace/.ssh/automation_ssh_key
# export SSH_PUBLIC_KEY="$(cat /github/workspace/.ssh/automation_ssh_key.pub)"
# bash /ncp-test-automation/bin/entrypoint.sh
# eval "$(ssh-agent)"
# ssh-add /github/workspace/.ssh/automation_ssh_key
#
# ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null" "root@${SERVER_ADDRESS?}" <<EOF
# systemctl stop mariadb
# systemctl poweroff
# EOF
# - name: Create Snapshot
# if: ${{ contains('success|failure', env.TEST_RESULT) }}
# shell: bash
# working-directory: /ncp-test-automation/bin
# run: |
# set -x
# echo "${{ needs.update-test.outputs.test_server_id }}"
# echo "${TEST_SERVER_ID?}"
#
# . ./library.sh
#
# tf-init "$TF_SNAPSHOT"
# tf-apply "$TF_SNAPSHOT" "$TF_VAR_FILE" -var="branch=${VERSION?}" -var="snapshot_provider_id=${TEST_SERVER_ID?}" -var="snapshot_type=ncp-postactivation" -state="${TF_SNAPSHOT}/${VERSION//\//.}.postactivation.tfstate"
# snapshot_id="$(tf-output "$TF_SNAPSHOT" -state="${TF_SNAPSHOT}/${VERSION//\//.}.postactivation.tfstate" snapshot_id)"
# hcloud image add-label -o "$snapshot_id" "test-result=${TEST_RESULT?}"
dist-upgrade-postactivation-snapshot:
if: ${{ always() }}
needs:
- dist-upgrade-test
runs-on: ubuntu-latest
container:
image: thecalcaholic/ncp-test-automation:latest
env:
HCLOUD_TOKEN: "${{ secrets.TEST_AUTOMATION_HCLOUD_API_TOKEN }}"
env:
TEST_TYPE: distupgrade
SERVER_ADDRESS: ${{ needs.dist-upgrade-test.outputs.server_address }}
TEST_RESULT: ${{ needs.dist-upgrade-test.outputs.test_result }}
TEST_SERVER_ID: ${{ needs.dist-upgrade-test.outputs.test_server_id }}
VERSION: ${{ needs.dist-upgrade-test.outputs.version }}
UID: ${{ github.run_id }}-distupgrade
SSH_ARTIFACT_NAME: "${{ needs.dist-upgrade-test.outputs.ssh_artifact_name }}"
steps:
- name: download ssh private key from artifact store
uses: actions/download-artifact@v4
if: ${{ contains('success|failure', env.TEST_RESULT) }}
with:
name: ${{ env.SSH_ARTIFACT_NAME }}
path: /github/workspace/.ssh
- name: Shutdown server
if: ${{ contains('success|failure', env.TEST_RESULT) }}
run: |
chmod 0600 /github/workspace/.ssh/automation_ssh_key
export SSH_PUBLIC_KEY="$(cat /github/workspace/.ssh/automation_ssh_key.pub)"
bash /ncp-test-automation/bin/entrypoint.sh
eval "$(ssh-agent)"
ssh-add /github/workspace/.ssh/automation_ssh_key
ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null" "root@${SERVER_ADDRESS?}" <<EOF
systemctl stop mariadb
systemctl poweroff
EOF
- name: Create Snapshot
if: ${{ contains('success|failure', env.TEST_RESULT) }}
shell: bash
working-directory: /ncp-test-automation/bin
run: |
set -x
echo "${{ needs.dist-upgrade-test.outputs.test_server_id }}"
echo "${TEST_SERVER_ID?}"
. ./library.sh
tf-init "$TF_SNAPSHOT"
tf-apply "$TF_SNAPSHOT" "$TF_VAR_FILE" -var="branch=${VERSION?}" -var="snapshot_provider_id=${TEST_SERVER_ID?}" -var="snapshot_type=ncp-postactivation" -state="${TF_SNAPSHOT}/${VERSION//\//.}.postactivation.tfstate"
snapshot_id="$(tf-output "$TF_SNAPSHOT" -state="${TF_SNAPSHOT}/${VERSION//\//.}.postactivation.tfstate" snapshot_id)"
hcloud image add-label -o "$snapshot_id" "test-result=${TEST_RESULT?}"
cleanup:
if: ${{ always() }}
needs:
- install-postactivation-snapshot
#- update-postactivation-snapshot
- dist-upgrade-postactivation-snapshot
runs-on: ubuntu-latest
container:
image: thecalcaholic/ncp-test-automation:latest
env:
HCLOUD_TOKEN: "${{ secrets.TEST_AUTOMATION_HCLOUD_API_TOKEN }}"
strategy:
matrix:
uid: ["${{ github.run_id }}-install", "${{ github.run_id }}-update", "${{ github.run_id }}-distupgrade"]
fail-fast: false
env:
HOME: '/root'
UID: ${{ matrix.uid }}
defaults:
run:
shell: bash
working-directory: /ncp-test-automation/bin
steps:
- name: Teardown VMs
run: |
for server in $(hcloud server list -o noheader -o columns=id -l "ci=${UID?}")
do
echo "Deleting server '$server'..."
hcloud server delete "$server"
echo "done."
done
- name: Delete ssh key
run: |
source ./library.sh
hcloud-clear-root-key
cleanup-snapshots:
if: ${{ always() }}
needs:
- install-postactivation-snapshot
#- update-postactivation-snapshot
- dist-upgrade-postactivation-snapshot
runs-on: ubuntu-latest
container:
image: thecalcaholic/ncp-test-automation:latest
env:
HCLOUD_TOKEN: "${{ secrets.TEST_AUTOMATION_HCLOUD_API_TOKEN }}"
env:
HOME: '/root'
steps:
- name: Delete old snapshots
run: |
for snapshot in $(hcloud image list -t snapshot -o noheader -o columns=id | head -n -12)
do
echo "Deleting snapshot '$snapshot'..."
hcloud image delete "$snapshot"
echo "done."
done

15
.gitignore vendored
View File

@ -1,3 +1,14 @@
.*.swp
*.img
*.bz2
/qemu-raspbian-network/
/archive/
/output/
/cache/
/torrent/
/armbian/
/raspbian_root
/raspbian_boot
/ncp-web/wizard.cfg
/ncp-web/ncp-web.cfg
/docker-armhf/qemu-arm-static
.vagrant/
/.idea/

6
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,6 @@
# Contributing
Check this wiki article if you want to learn how you can help.
[Ways to contribute](https://help.nextcloud.com/t/contribute-to-nextcloudpi/126384)

14
FUNDING.yml Normal file
View File

@ -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']

340
README.md
View File

@ -1,47 +1,325 @@
# NextCloudPi generator
English | [Traditional Chinese 繁體中文](i18n/README-zh_TW.md) | [Simplified Chinese 简体中文](i18n/README-zh_CN.md)
![NC Logo](/resources/nextcloud-square-logo.png)
_(The translated README pages are not updated at this time)_
Use QEMU to automatically generate Raspbian Images with Nextcloud
# NextcloudPi
[![Telegram icon][telegram-badge]][chat-telegram] [![Matrix icon][matrix-badge]][chat-matrix] [![Nextcloud icon][nc-badge]][nc-github]
[![Forum icon][forum-badge]][nc-forum-support]
<p align="center">
<img src="https://github.com/nextcloud/nextcloudpi/blob/master/ncp-app/img/app.svg"
width="120"
height="85"
alt="NextcloudPi logo">
</p>
This is the build code for the [NextcloudPi][ncp-website] open-source community project.
NextcloudPi is a ready to use image for Virtual Machines, Raspberry Pi, Odroid HC1, Rock64 and other boards. ([⇒ Downloads][ncp-releases])
This code also generates the NextcloudPi LXD and LXC containers and there is an install script for the latest supported Debian based system as well.
Find the documentation at [docs.nextcloudpi.com][ncp-docs-website], the documentation is all written by volunteers.
Please reach out in the [Matrix][chat-matrix-wiki] or [Telegram][chat-telegram-wiki] Wiki group chats if you want to help out to keep them up-to-date and we'll add you to the [Wiki Group][nc-forum-wiki-group] on the [forum][nc-forum].
---
### Test Status
`master`
[![Release](https://github.com/nextcloud/nextcloudpi/actions/workflows/release.yml/badge.svg)](https://github.com/nextcloud/nextcloudpi/actions/workflows/release.yml)
`devel`
[![Release](https://github.com/nextcloud/nextcloudpi/actions/workflows/release.yml/badge.svg?branch=devel)](https://github.com/nextcloud/nextcloudpi/actions/workflows/release.yml)
---
## Features
* Raspbian 8 Jessie
* Nextcloud 11.0.2
* Apache 2.4.25, with HTTP2 enabled
* PHP 7.0 (double the speed of PHP5!)
* MariaDB 10
* 4.9.13 Linux Kernel ( NEW 03-13-2017 )
* nextcloudpi-config for easy setup
* Automatic redirection to HTTPS
* ACPU PHP cache
* PHP Zend OPcache enabled with file cache
* HSTS
* Cron jobs for Nextcloud
* Sane configuration defaults
* Lets Ecrypt for trusted HTTPS certificates.( NEW 03-16-2017 )
* Fail2Ban protection against brute force attacks. ( NEW 02-24-2017 )
* Dynamic DNS support for no-ip.org ( NEW 03-05-2017 )
* dnsmasq DNS server with DNS cache ( NEW 03-09-2017 )
* Automatic security updates, activated by default. ( NEW 03-21-2017 )
* ModSecurity Web Application Firewall ( NEW 03-23-2017 )
* Raspberry Pi OS/Debian 12 _(Bookworm)_
* Nextcloud
* Apache, with HTTP2 enabled
* PHP 8.1
* MariaDB
* Redis memory cache
* ncp-config TUI for easy setup ( RAM logs, USB drive and more )
* Automatic redirection to HTTPS
* APCu PHP cache
* PHP Zend OPcache enabled with file cache
* HSTS
* Cron jobs for Nextcloud
* Sane configuration defaults
* Full emoji support
* Postfix email
* Secure
## Usage
## Extras
* Setup wizard
* NextcloudPi Web Panel
* Wi-Fi ready
* Ram logs
* Automatic security updates, activated by default.
* Lets Encrypt for trusted HTTPS certificates.
* Fail2Ban protection against brute force attacks.
* UFW firewall
* Dynamic DNS support for no-ip.org
* Dynamic DNS support for freeDNS
* Dynamic DNS support for duckDNS
* Dynamic DNS support for spDYN
* Dynamic DNS support for Namecheap
* dnsmasq DNS server with DNS cache
* ModSecurity Web Application Firewall
* NFS ready to mount your files over LAN
* SAMBA ready to share your files with Windows/Mac/Linux
* USB automount
* Remote updates
* Automatic NCP updates
* Automatic Nextcloud updates
* Update notifications
* Nextcloud backup and restore
* Nextcloud online installation
* Format USB drive to BTRFS
* BTRFS snapshots
* Automatic BTRFS snapshots
* BTRFS snapshot auto sync
* scheduled rsync
* UPnP automatic port forwarding
* Security audits with Lynis and Debsecan
* ZRAM
* SMART hard drive health monitoring
Extras can be activated and configured using the web interface at HTTPS port 4443
![ncp-web][ncp-web-image]
Or from the command line using
```
git clone https://github.com/nachoparker/nextcloud-raspbian-generator.git
cd nextcloud-raspbian-generator
./batch.sh 192.168.0.145 # change to your QEMU raspbian IP
sudo ncp-config
```
Extras can be activated and configured using
![NCP-config][ncp-config-image]
## Docker has been discontinued
Docker has been discontinued for the time being, please read the announcement here: https://help.nextcloud.com/t/nextcloudpi-planning-to-discontinue-its-docker-version-with-nc-25/158895
## Run in LXD
```
sudo nextcloudpi-config
# Imports the LXC image, replace the X's with version number
lxc image import "NextcloudPi_LXD_vX.XX.X.tar.gz" --alias "nextcloudpi"
# Launches a container from the image
lxc launch "nextcloudpi" ncp
# Starts the container you've launched from the imported image
lxc start ncp
```
![NCP-config](/resources/ncp-config.jpg)
## Run in Proxmox
Get the image, find details and more instructions at
There are two ways to run NCP on Proxmox:
https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/
### 1. Using the official release image
In your Proxmox web interface, head to any storage pool that has CT Templates enabled, go to CT Templates,
click "Download from URL" and enter the link to the latest LXC image from the [Nextcloudpi releases page](https://github.com/nextcloud/nextcloudpi/releases)
and press "Download".
<img height="300" alt="Download from URL dialog" src="https://nextcloudpi.com/images/ncp-proxmox-download-screenshot.png">
Optionally, you can copy the corresponding md5 sum from the releases page and paste it in the "Checksum" field to have
Proxmox check that the downloaded image was not corrupted
### 2. Installer by community-scripts (formerly tteck)
Use the [install script][ncp-proxmox-install-script-v5] from [community-scripts][community-scripts-profile] to install the LXC container on your Proxmox instance
[community-scripts][community-scripts-profile] has multiple helper scripts available for Proxmox on their [website][website-helper-scripts], go have a look if you're using Proxmox. :+1:
Installation: `bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/nextcloudpi.sh)"`
Default Settings: `2GB RAM - 8GB Storage - 2vCPU`
_(Check their [website][website-helper-scripts] if this has changed and we haven't had the time to update it here yet, it's located under: Operating-Systems > NextcloudPi LXC)_
Thank you to the [community-scripts][community-scripts-profile] organisation :heart: for making the helper script & letting us use this for Proxmox installations :pray:
You can find the GitHub repository with the helper scripts here: [here][gh-helper-scripts-repo].
## How to build
Packages
- `apt-utils`
- `apt-transport-https`
- `build-essential`
- `binfmt-support`
- `binutils`
- `bzip2`
- `ca-certificates`
- `chroot`
- `cron`
- `curl`
- `dialog`
- `lsb-release`
- `jq`
- `git`
- `psmisc`
- `procps`
- `wget`
- `whiptail`
- `qemu`
- `qemu-user-static`
### Raspberry Pi IMG
```
git clone https://github.com/nextcloud/nextcloudpi.git
cd nextcloudpi
./build/build-SD-rpi.sh
```
### Armbian-based board
```
./build-SD-armbian.sh odroidxu4 # supported board code name
```
### LXD
```
./build/build-LXD.sh
```
NextcloudPi can be installed in any architecture running the latest Debian
_Note: this assumes a clean Debian install, and there is no rollback method_
### Curl install scripts
This is executed as `root` as indicated by the `#`
```
# curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | bash
```
If you're not `root` you can run it with `sudo` like so
```
curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | sudo bash
```
## Links
[Website][ncp-website]
[Downloads][ncp-releases]
<!-- [Docker Hub][ncp-docker-hub] -->
[Nextcloud Forum][nc-forum]
[Nextcloud Forum Support][nc-forum-support]
_(Use the Forum for Support questions please, there's a NCP tag available, it will bridge your post to the Matrix and Telegram chats)_
## Contact
You can find us on the [Forum][nc-forum], [Telegram][chat-telegram] or [Matrix][chat-matrix]
<!-- LINKS -->
[ncp-website]: https://nextcloudpi.com
[ncp-docs-website]: http://docs.nextcloudpi.com
[ncp-docker-hub]: https://hub.docker.com/r/ownyourbits/nextcloudpi
[ncp-releases]: https://github.com/nextcloud/nextcloudpi/releases
[nc-github]: https://github.com/nextcloud
<!-- FORUM -->
[nc-forum]: https://help.nextcloud.com/
[nc-forum-support]: https://help.nextcloud.com/c/support/appliances-docker-snappy-vm
[nc-forum-wiki-group]: https://help.nextcloud.com/g/NCP_Wiki_Team/members
<!-- CHAT -->
[chat-matrix]: https://matrix.to/#/#nextcloudpi:matrix.org
[chat-matrix-wiki]: https://matrix.to/#/#NCP_Wiki_Team:matrix.org
[chat-telegram]: https://t.me/NextcloudPi
[chat-telegram-wiki]: https://t.me/NCP_Wiki_Team
<!-- TESTS -->
[vm-tests]: https://github.com/nextcloud/nextcloudpi/actions/workflows/vm-tests.yml
[docker-tests]: https://github.com/nextcloud/nextcloudpi/actions/workflows/build-docker.yml
<!-- BADGES -->
[gh-vm-tests-badge]: https://github.com/nextcloud/nextcloudpi/actions/workflows/vm-tests.yml/badge.svg
[gh-docker-tests-badge]: https://github.com/nextcloud/nextcloudpi/actions/workflows/build-docker.yml/badge.svg
[gh-vm-tests-badge-devel]: https://github.com/nextcloud/nextcloudpi/actions/workflows/vm-tests.yml/badge.svg?branch=devel
[gh-docker-tests-badge-devel]: https://github.com/nextcloud/nextcloudpi/actions/workflows/build-docker.yml/badge.svg?branch=devel
[vm-tests-badge]: https://github.com/nextcloud/nextcloudpi/workflows/VM%20Integration%20Tests/badge.svg
[docker-tests-badge]: https://github.com/nextcloud/nextcloudpi/actions/workflows/build-docker.yml/badge.svg
[telegram-badge]: https://img.shields.io/badge/Telegram-2CA5E0?style=for-the-badge&logo=telegram&logoColor=white
[matrix-badge]: https://img.shields.io/badge/matrix-000000?style=for-the-badge&logo=Matrix&logoColor=white
[forum-badge]: https://img.shields.io/badge/help-forums-blue.svg
[nc-badge]: https://img.shields.io/badge/Nextcloud-0082C9?style=for-the-badge&logo=Nextcloud&logoColor=white
<!-- COMMUNITY-SCRIPTS -->
[community-scripts-profile]: https://github.com/community-scripts/
[gh-helper-scripts-repo]: https://github.com/community-scripts/ProxmoxVE
[website-helper-scripts]: https://community-scripts.github.io/ProxmoxVE/
[ncp-proxmox-install-script-v5]: https://github.com/community-scripts/ProxmoxVE/blob/main/install/nextcloudpi-install.sh
<!-- IMAGES -->
[ncp-web-image]: https://user-images.githubusercontent.com/21343324/136853829-f4e99ec0-6307-431f-b4c7-21b2330cae7f.png
[ncp-config-image]: https://help.nextcloud.com/uploads/default/original/3X/b/3/b3d157022a32296ab54428b14b5df02104a91f18.png
<!-- EXTRAS & BACKUPS
[telegram-badge]: https://patrolavia.github.io/telegram-badge/chat.png
[rpi-badge]: https://img.shields.io/badge/Raspberry%20Pi-A22846?style=for-the-badge&logo=Raspberry%20Pi&logoColor=white
[linux-badge]: https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black
[debian-badge]: https://img.shields.io/badge/Debian-A81D33?style=for-the-badge&logo=debian&logoColor=white
[gh-badge]: https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white
-->

View File

@ -1,46 +0,0 @@
#!/bin/bash
# Batch creation of NextCloudPi image
# Tested with 2017-03-02-raspbian-jessie-lite.img
#
# 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!
#
# Usage:
#
source etc/library.sh # initializes $IMGNAME
IP=$1 # First argument is the QEMU Raspbian IP address
IMGFILE="NextCloudPi_$( date "+%m-%d-%y" ).img"
NO_CONFIG=1 NO_HALT_STEP=1 ./install-nextcloud.sh $IP $IMGFILE
NO_CONFIG=1 NO_CFG_STEP=1 ./installer.sh fail2ban.sh $IP $( ls -1t *.img | head -1 )
NO_CONFIG=1 NO_CFG_STEP=1 ./installer.sh no-ip.sh $IP $( ls -1t *.img | head -1 )
NO_CONFIG=1 NO_CFG_STEP=1 ./installer.sh dnsmasq.sh $IP $( ls -1t *.img | head -1 )
NO_CONFIG=1 NO_CFG_STEP=1 ./installer.sh letsencrypt.sh $IP $( ls -1t *.img | head -1 )
NO_CONFIG=1 ./installer.sh unattended-upgrades.sh $IP $( ls -1t *.img | head -1 )
NO_CONFIG=1 NO_CFG_STEP=1 ./installer.sh modsecurity.sh $IP $( ls -1t *.img | head -1 )
IMGOUT=$( ls -1t *.img | head -1 )
IMGFULL=$( basename "$IMGFILE" .img )_FULL.img
pack_image "$IMGOUT" "$IMGFULL"
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

36
bin/nc-broadcast Executable file
View File

@ -0,0 +1,36 @@
#!/usr/bin/env bash
if [[ ${EUID} -ne 0 ]]; then
printf "Must be run as root. Try 'sudo %s'\n" "$( basename "$0" )"
exit 1
fi
if [[ " $* " =~ " "(--help|-h)" " ]]
then
echo 'Description:
Generate notifications for all Nextcloud users
Usage:
nc-broadcast <short-message> [options]
Arguments:
short-message Short message to be sent to the user (max. 255 characters)
Options:
-l, --long-message=LONG-MESSAGE Long message to be sent to the users (max. 4000 characters) [default: ""]
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display ncc/occ version
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
--no-warnings Skip global warnings, show command output only
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'
exit 0
fi
ncc user:list --output=json | jq -r 'keys[]' | while read -r user
do
echo "Sending notification to $user"
ncc notification:generate "${@:2}" "$user" "$1"
done
echo "All users have been notified."

106
bin/ncp-backup Executable file
View File

@ -0,0 +1,106 @@
#!/bin/bash
set -eE
source /usr/local/etc/library.sh
if [ "$1" = "--help" ]; then
echo "$0 <destdir> <includedata> <compress> <backuplimit>"
echo " <includedata> and <compress> are 'yes' or 'no'"
echo " <backuplimit> integer >= 1 or 0 for no limit"
exit 0
fi
destdir="${1:-/media/USBdrive/ncp-backups}"
includedata="${2:-no}"
compress="${3:-no}"
backuplimit="${4:-0}"
destfile="$destdir"/nextcloud-bkp_$( date +"%Y%m%d_%s" ).tar
dbbackup=nextcloud-sqlbkp_$( date +"%Y%m%d" ).bak
[[ -f /.docker-image ]] && basedir=/data || basedir=/var/www
[[ "$compress" == "yes" ]] && destfile="$destfile".gz
datadir=$( get_nc_config_value datadirectory ) || {
echo "Error reading data directory. Is NextCloud running and configured?";
exit 1;
}
cleanup(){ local ret=$?; rm -f "${dbbackup}" ; restore_maintenance_mode; exit $ret; }
fail() { local ret=$?; echo "Abort..." ; rm -f "${dbbackup}" "${destfile}"; restore_maintenance_mode; exit $ret; }
trap cleanup EXIT
trap fail INT TERM HUP ERR
echo "check free space..." # allow at least ~500 extra MiB
mkdir -p "$destdir"
nsize=$(du -sb "$basedir/nextcloud" | awk '{ print $1 }')
[[ -d "$basedir/nextcloud"/data ]] && \
dsize=$(du -sb "$basedir/nextcloud"/data | awk '{ print $1 }')
margin=$((500*1024*1024)) # safety margin for database and some extra
if [[ "$includedata" == "yes" ]]; then
datasize=$(du -sb "$datadir" | awk '{ print $1 }')
size=$((nsize - dsize + margin + datasize))
else
size=$((nsize - dsize + margin))
fi
free=$( df -B1 "$destdir" | tail -1 | awk '{ print $4 }' )
[ $size -ge $free ] && {
echo "free space check failed. Need $size Bytes";
exit 1;
}
# delete older backups
[[ $backuplimit != 0 ]] && {
numbkps=$( ls "$destdir"/nextcloud-bkp_* 2>/dev/null | wc -l )
[[ $numbkps -ge $backuplimit ]] && \
ls -t $destdir/nextcloud-bkp_* | tail -$(( numbkps - backuplimit + 1 )) | while read -r f; do
echo "clean up old backup $f"
rm "$f"
done
}
# database
save_maintenance_mode
cd "$basedir" || exit 1
echo "backup database..."
mysqldump -u root --single-transaction nextcloud > "$dbbackup"
# files
echo "backup files..."
[[ "$includedata" == "yes" ]] && data="$(basename "$datadir")"
[[ "$compress" == "yes" ]] && compress_arg="-I pigz"
mkdir -p "$destdir"
tar $compress_arg -cf "$destfile" \
\
"$dbbackup" \
\
--exclude "$data/.opcache" \
--exclude "nextcloud/data/access.log" \
--exclude "nextcloud/data/error.log" \
--exclude "nextcloud/data/nextcloud.log" \
--exclude "$data/ncp-update-backups" \
-C "$(dirname "$datadir"/)" $data \
\
--exclude "nextcloud/data/*/files/*" \
--exclude "nextcloud/data/.opcache" \
--exclude "nextcloud/data/access.log" \
--exclude "nextcloud/data/error.log" \
--exclude "nextcloud/data/nextcloud.log" \
--exclude "nextcloud/data/appdata_*/preview/*" \
--exclude "nextcloud/data/*/uploads/*" \
--exclude "nextcloud/data/*/cache/*" \
--exclude "nextcloud/data/*/files_trashbin/*" \
--exclude "nextcloud/data/*/files_versions/*" \
--exclude "nextcloud/data/ncp-update-backups" \
--exclude "nextcloud/data/__groupfolders" \
--exclude "nextcloud/.data_*" \
-C $basedir nextcloud/ \
|| {
echo "error generating backup"
exit 1
}
rm "$dbbackup"
chmod 640 "$destfile"
chown :www-data "$destfile"
echo "backup $destfile generated"

28
bin/ncp-check-nc-version Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
# notify latest available NC version
set -e
source /usr/local/etc/library.sh # sets NCLATESTVER
CURRENT="$(nc_version)"
NEXT_VERSION="$(determine_nc_update_version "${CURRENT}" "${NCLATESTVER?}")"
if [[ -z "$NEXT_VERSION" ]] || [[ "$NEXT_VERSION" == "${CURRENT}" ]]
then
exit 0
fi
NOTIFIED=/var/run/.nc-version-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 "${NEXT_VERSION}" "${CURRENT}"; then
notify_admin \
"Nextcloud update" \
"Update from ${CURRENT} to ${NEXT_VERSION} is available. Update from https://$(get_ip):4443"
echo "${NEXT_VERSION}" > "${NOTIFIED}"
fi

13
bin/ncp-check-updates Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
# print message if an update is available
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 "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"
fi

42
bin/ncp-check-version Executable file
View File

@ -0,0 +1,42 @@
#!/bin/bash
# update latest available version in /var/run/.ncp-latest-version
TEMPDIR="$( mktemp -d /tmp/ncp-check.XXXXXX || ( echo "Failed to create temp dir. Exiting" >&2; exit 1 ) )"
trap "rm -rf \"${TEMPDIR}\"; exit 0" 0 1 2 3 15
BRANCH="master"
{ [[ -f /.dockerenv ]] || [[ -f /.docker-image ]] || [[ "$DOCKERBUILD" == 1 ]]; } && BRANCH="docker-stable"
git clone -b "$BRANCH" --depth 20 -q --bare https://github.com/nextcloud/nextcloudpi.git "$TEMPDIR" || {
echo "The git clone command failed: No connectivity to https://github.com ?" >&2
exit 1
}
cd "$TEMPDIR" || exit 1
VER=$( git describe --always --tags | grep -oP "v\d+\.\d+\.\d+" )
canary="$(. /usr/local/etc/library.sh; find_app_param ncp-community.sh CANARY)"
[[ "$canary" != "yes" ]] && [[ -f "/usr/local/etc/instance.cfg" ]] && {
cohorte_id="$(jq .cohorteId /usr/local/etc/instance.cfg)"
[[ -f "./staged_rollouts/${VER}.txt" ]] && {
grep "^${cohorte_id}$" "./staged_rollouts/${VER}.txt" || {
echo "Skipping version $VER - cohorte ${cohorte_id} not yet active"
cd / || exit 1
exit 0
}
}
}
grep -qP "v\d+\.\d+\.\d+" <<< "$VER" && { # check format
echo "$VER" > /var/run/.ncp-latest-version
# write changelog
git log --graph --oneline --decorate \
--pretty=format:"[%D] %s" --date=short | \
grep 'tag: v' | \
sed '/HEAD ->\|origin/s|\[.*\(tag: v[0-9]\+\.[0-9]\+\.[0-9]\+\).*\]|[\1]|' | \
sed 's|* \[tag: |[|' > /usr/local/etc/ncp-changelog
}
cd / || exit 1

132
bin/ncp-config Executable file
View File

@ -0,0 +1,132 @@
#!/bin/bash
# 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!
#
# Usage:
# sudo ncp-config
#
# More at https://ownyourbits.com/2017/03/13/nextcloudpi-gets-nextcloudpi-config/
#
BINDIR=/usr/local/bin/ncp
source /usr/local/etc/library.sh
{
ncpversion="$(cat /usr/local/etc/ncp-version)"
chlogfile=/usr/local/etc/ncp-changelog
# ask for update if outdated
ncp-test-updates 2>/dev/null && {
[[ -f "$chlogfile" ]] && changelog=$( head -4 "$chlogfile" )
latest_ver="$(cat /var/run/.ncp-latest-version 2>/dev/null)"
whiptail --backtitle "$backtitle $ncpversion" \
--title "NextcloudPi update available" \
--clear --yesno "Update to $latest_ver?\n\n$changelog" \
15 70
[[ $? -eq $dialog_ok ]] && ncp-update
}
function generate_list()
{
local dir="$1"
unset list
for item in "$dir"/*; do
# directories
[[ -d "$item" ]] && {
local dir="$( basename "$item" )"
list+=(" $dir" "")
continue
}
[[ "$item" =~ ".sh" ]] || continue
# regular ncp_apps
local app="$( basename "$item" .sh )"
local cfg="$cfgdir/$app".cfg
[[ -f "$cfg" ]] && local desc=$( jq -r .description "$cfg" ) || local desc="No description."
is_active_app "$app" "$dir" && local on="*" || local on=" "
list+=( "$on $app" "$desc" )
done
}
function config_menu()
{
local dir="$1"
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
local desc cfg ncp_app
while true; do
# menu items
generate_list "$dir"
# 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)" \
--cancel-button $cancel_btn --ok-button Select \
--menu "Select ncp-app to configure or activate:" 20 105 10 \
"${list[@]}" \
3>&1 1>&2 2>&3 )
[[ $? -ne $dialog_ok ]] || [[ "$ncp_app" == "" ]] && {
[[ "$dir" == "$BINDIR" ]] && return 0
dir="$(dirname "$dir")"
continue
}
# remove * and spaces
ncp_app=$( sed 's=*\| ==g' <<< "$ncp_app" )
# directory selection
[[ -d "$dir/$ncp_app" ]] && {
dir="$dir/$ncp_app"
config_menu "$dir"
return
}
# launch selected ncp_app
info_app "$ncp_app" || continue
configure_app "$ncp_app" && \
run_app "$ncp_app"
echo "Done. Press any key..."
read -r
done
}
if [[ ${EUID} -ne 0 ]]; then
printf "Must be run as root. Try 'sudo $( basename "$0" )'\n"
exit 1
fi
config_menu "$BINDIR"
exit $?
} # force to read the whole thing into memory, as its contents might change in update.sh
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

181
bin/ncp-diag Normal file
View File

@ -0,0 +1,181 @@
#!/bin/bash
# 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!
#
# Usage:
# sudo ncp-diag
#
# More at https://ownyourbits.com
#
# shellcheck disable=SC1091
source /usr/local/etc/library.sh
# Distro, NCP version and tag
echo "NextcloudPi version|$( cat /usr/local/etc/ncp-version )"
[[ -f /usr/local/etc/ncp-baseimage ]] && echo "NextcloudPi image|$( cat /usr/local/etc/ncp-baseimage )"
echo "OS|$(sed 's| \\n \\l||' /etc/issue). $(uname -r) ($(uname -m))"
# Data
DATADIR="$( grep datadirectory /var/www/nextcloud/config/config.php |
awk '{ print $3 }' | grep -oP "[^']*[^']" | head -1 )"
test -d "$DATADIR" || DIRINFO=" (doesn't exist)"
USBDEVS="$( lsblk -S -o NAME,TRAN | awk '{ if ( $2 == "usb" ) print $1; }' | tr '\n' ' ' )"
[[ "$USBDEVS" == "" ]] && USBDEVS="none"
am_cfg="/usr/local/etc/ncp-config.d/nc-automount.cfg"
[[ -f "$am_cfg" ]] && [[ "$(jq -r ".params[0].value" "$am_cfg")" == "yes" ]] && echo "automount|yes" || echo "automount|no"
echo "USB devices|$USBDEVS"
echo "datadir|$DATADIR$DIRINFO"
[[ "$DIRINFO" == "" ]] && {
echo "data in SD|$( [[ $( stat -fc%d / ) == $( stat -fc%d "$DATADIR" ) ]] && echo yes || echo no )"
echo "data filesystem|$( stat -fc%T "$DATADIR" )"
echo "data disk usage|$( df -h "$DATADIR" | tail -1 | awk '{ print $3"/"$2 }')"
}
echo "rootfs usage|$( df -h / | tail -1 | awk '{ print $3"/"$2 }')"
SWP="$( swapon | tail -1 | awk '{ print $1 }' )"
[[ "$SWP" == "" ]] && SWP="none"
echo "swapfile|$SWP"
# Database
DBDIR=$( grep datadir /etc/mysql/mariadb.conf.d/90-ncp.cnf | awk -F "= " '{ print $2 }' )
test -d "$DBDIR" || DBDIRINFO=" (doesn't exist)"
echo "dbdir|$DBDIR$DBDIRINFO"
# Nextcloud
VERSION="$( ncc status | grep "version:" | awk '{ print $3 }' )"
if [[ "$VERSION" != "" ]]; then
echo "Nextcloud check|ok"
echo "Nextcloud version|$VERSION"
else
echo "Nextcloud check|error"
fi
# Services
echo "HTTPD service|$( pgrep -c apache2 &>/dev/null && echo up || echo down )"
echo "PHP service|$( pgrep -c php-fpm &>/dev/null && echo up || echo down )"
echo "MariaDB service|$( (pgrep -c mysqld || pgrep -c mariadb) &>/dev/null && echo up || echo down )"
echo "Redis service|$( pgrep -c redis-server &>/dev/null && echo up || echo down )"
echo "HPB service|$( ncc notify_push:self-test &>/dev/null && echo up || echo down )"
echo "Postfix service|$( pgrep -fc postfix &>/dev/null && echo up || echo down )"
# WAN
echo "Internet check|$( ping -W 2 -w 1 -q github.com &>/dev/null && echo ok || echo no )"
function is_port_open()
{
# The URL leads to an application I've deployed for NCP on https://fly.io using a Docker container I made.
# The image for the container is available on Docker Hub (zendai/checkport:sanic) if you wish to deploy one yourself.
# The code for the Sanic server and Docker image is available at: https://github.com/ZendaiOwl/Build/tree/master/Docker/Python/Sanic/checkport
# I only have a free tier with limited outbound data per month, 100GB p/month.
# If we go over 100GB outbound data in a month, I will start being charged for the data going over that limit.
# I used a low level Python socket library & fortunately each request only consumes aprox. ~ 60-74 bytes p/second.
# Meaning 100GB should be plenty, it should be enough to handle a little less
# than 450 request p/second a month, unless my calculations are wrong.
# Thank you :pray: from Victor-ray, S. https://github.com/ZendaiOwl
local -r PORTURL="https://checkport.zendai.net.eu.org/check"
local TYPE="${1?}" IPType
# Checks both port 80 & 443 for IPv4/IPv6 and returns the result or [N/A] [N/A]
if ! [[ "$TYPE" =~ ^(0|4|6)$ ]]
then
# As this echo is redirected to STDERR it will not be
# asssigned in the arrays of the if-statement below this function
echo "Invalid type: $TYPE" 1>&2
return 1
elif [[ "$TYPE" == 0 ]]
then
# Public IPv4/6 is not available
echo -e "[N/A]\n[N/A]"
else
IPType="--ipv6"
[[ "$TYPE" -eq 6 ]] || IPType="--ipv4"
curl --silent --max-time 4 "$IPType" "$PORTURL" | jq -r '."80",."443"'
fi
}
publicIPv4=$(curl --silent --max-time 4 --ipv4 "https://ipv4.icanhazip.com" 2>/dev/null) || unset publicIPv4
echo "Public IPv4|${publicIPv4:-"not found"}"
publicIPv6=$(curl --silent --max-time 4 --ipv6 "https://ipv6.icanhazip.com" 2>/dev/null) || unset publicIPv6
echo "Public IPv6|${publicIPv6:-"not found"}"
# Declares the array variables for mapfile to work
declare -a IPv4PORTS
declare -a IPv6PORTS
# Mapfile reads lines from standard input into an indexed array variable
if [[ -n "$publicIPv4" ]]
then
mapfile -t IPv4PORTS < <(is_port_open 4)
else
mapfile -t IPv4PORTS < <(is_port_open 0)
fi
if [[ -n "$publicIPv6" ]]
then
mapfile -t IPv6PORTS < <(is_port_open 6)
else
mapfile -t IPv6PORTS < <(is_port_open 0)
fi
# Checks if Port 80 is open on IPv4 or IPv6
if [[ "${IPv4PORTS[0]}" == "open" ]] || [[ "${IPv6PORTS[0]}" == "open" ]]
then
PORT80="open"
elif [[ "${IPv4PORTS[0]}" == "[N/A]" ]] && [[ "${IPv6PORTS[0]}" == "[N/A]" ]]
then
PORT80="[N/A]"
else
PORT80="closed"
fi
# Checks if Port 443 is open on IPv4 or IPv6
if [[ "${IPv4PORTS[1]}" == "open" ]] || [[ "${IPv6PORTS[1]}" == "open" ]]
then
PORT443="open"
elif [[ "${IPv4PORTS[1]}" == "[N/A]" ]] && [[ "${IPv6PORTS[1]}" == "[N/A]" ]]
then
PORT443="[N/A]"
else
PORT443="closed"
fi
echo "Port 80|$PORT80"
echo "Port 443|$PORT443"
# LAN
IFACE=$( ip r | grep "default via" | awk '{ print $5 }' | head -1 )
GW=$( ip r | grep "default via" | awk '{ print $3 }' | head -1 )
IP="$(get_ip)"
echo "IP|$IP"
echo "Gateway|$GW"
echo "Interface|$IFACE"
# Certificates
CERTS="$( grep "SSLCertificateFile */etc/letsencrypt/live/" /etc/apache2/sites-available/001-nextcloud.conf \
| sed 's|.*SSLCertificateFile */etc/letsencrypt/live/||;s|/fullchain.pem||' )"
[[ "$CERTS" == "" ]] && CERTS=none
echo "Certificates|$CERTS"
RESOLV="$( ping -c1 -w1 "$CERTS" 2>/dev/null | head -1 | grep -oP '\d{1,3}(.\d{1,3}){3}' )"
echo "NAT loopback|$( [[ "$RESOLV" == "$IP" ]] && echo yes || echo no )"
# Other
echo "Uptime|$( uptime | cut -f1 -d',' | awk '{ $1=""; $2=""; print }' | tr -d " " )"
# Get kernel version
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

35
bin/ncp-dist-upgrade Executable file
View File

@ -0,0 +1,35 @@
#!/usr/bin/env bash
set -e
[[ "${EUID}" -eq 0 ]] || {
echo "ERROR: Must be run as root (try sudo ncp-dist-upgrade)"
exit 1
}
. /etc/os-release
if [[ "$VERSION_ID" -eq 10 ]]
then
UPGRADE_CMD=(bash /usr/local/bin/ncp-dist-upgrade.d/debian-10.sh)
elif [[ "$VERSION_ID" -eq 11 ]]
then
UPGRADE_CMD=(bash /usr/local/bin/ncp-dist-upgrade.d/debian-11.sh)
else
echo "No dist-upgrade available for OS version: Debian ${VERSION}."
exit 0
fi
if { [ "$TERM" = "screen" ] && [ -n "$TMUX" ]; } || [[ "${DEBIAN_FRONTEND:-}" == "noninteractive" ]] || ! [[ -t 0 ]]
then
"${UPGRADE_CMD[@]}" |& tee /var/log/ncp-dist-upgrade.log
else
tmux list-sessions | grep ncp-distupgrade && {
echo "Existing distupgrade process detected. Connecting..."
sleep 5
tmux attach -t ncp-distupgrade
exit 0
}
tmux new-session -s ncp-distupgrade bash -c "${UPGRADE_CMD[*]} |& tee /var/log/ncp-dist-upgrade.log; bash"
fi

View File

@ -0,0 +1,137 @@
#!/bin/bash
set -eu -o pipefail
[[ -f /.dockerenv ]] && { echo "Not supported in Docker. Upgrade the container instead"; exit 0; }
new_cfg=/usr/local/etc/ncp-recommended.cfg
[[ -f "${new_cfg}" ]] || { echo "Already on the lastest recommended distribution. Abort." >&2; exit 1; }
APTINSTALL="apt-get install -y --no-install-recommends"
export DEBIAN_FRONTEND=noninteractive
echo "
>>> ATTENTION <<<
This is a dangerous process that is only guaranteed to work properly if you
have not made manual changes in the system. Backup the SD card first and
proceed at your own risk.
Note that this is not a requirement for NCP to continue working properly.
The current distribution will keep receiving updates for some time.
Do you want to continue? [y/N]"
read key
[[ "$key" == y ]] || exit 0
source /usr/local/etc/library.sh # sets NCPCFG RELEASE PHPVER
old_cfg="${NCPCFG}"
trap "echo 'Something went wrong. Fix it and try again'" EXIT
save_maintenance_mode
# Fix grub-pc issue in VM
if apt show grub-pc-bin &>/dev/null; then
$APTINSTALL grub
fi
apt-get update
apt-get upgrade -y
# remove old PHP version
set +e
apt-get purge -y php${PHPVER} php${PHPVER}-curl php${PHPVER}-gd php${PHPVER}-fpm php${PHPVER}-cli php${PHPVER}-opcache \
php${PHPVER}-mbstring php${PHPVER}-xml php${PHPVER}-zip php${PHPVER}-fileinfo php${PHPVER}-ldap \
php${PHPVER}-intl php${PHPVER}-bz2 php${PHPVER}-json
apt-get purge -y php${PHPVER}-mysql
apt-get purge -y php${PHPVER}-redis
apt-get purge -y php${PHPVER}-exif
apt-get purge -y php${PHPVER}-bcmath
apt-get purge -y php${PHPVER}-gmp
apt-get purge -y php${PHPVER}-imagick
set -e
# update sources
sed -i 's/buster/bullseye/g' /etc/apt/sources.list
sed -i 's/buster/bullseye/g' /etc/apt/sources.list.d/* || true
sed -i 's/bullseye\/updates/bullseye-security/g' /etc/apt/sources.list
rm -f /etc/apt/sources.list.d/php.list
# fix DHCP systemd service command https://forums.raspberrypi.com/viewtopic.php?t=320383 in raspbian
if [[ -f /usr/bin/raspi-config ]]; then
sed -i 's|ExecStart=/usr/lib/dhcpcd5/dhcpcd -q -w|ExecStart=/usr/sbin/dhcpcd -q -w|g' /etc/systemd/system/dhcpcd.service.d/wait.conf
fi
# install latest distro
apt-get update
apt-get dist-upgrade -y
# install latest PHP version
release_new=$(jq -r '.release' < "${new_cfg}")
# the default repo in bullseye is bullseye-security - use bullseye if it is not available
grep -Eh '^deb ' /etc/apt/sources.list | grep 'bullseye-security' > /dev/null && release_new="${release_new}-security"
php_ver_new=$(jq -r '.php_version' < "${new_cfg}")
# PHP 8.1 is only supported via the
[[ "$php_ver_new" != 8.1 ]] || php_ver_new=7.4
$APTINSTALL -t ${release_new} php${php_ver_new} php${php_ver_new}-curl php${php_ver_new}-gd php${php_ver_new}-fpm php${php_ver_new}-cli php${php_ver_new}-opcache \
php${php_ver_new}-mbstring php${php_ver_new}-xml php${php_ver_new}-zip php${php_ver_new}-fileinfo php${php_ver_new}-ldap \
php${php_ver_new}-intl php${php_ver_new}-bz2 php${php_ver_new}-json
$APTINSTALL php${php_ver_new}-mysql
$APTINSTALL -t ${release_new} php${php_ver_new}-redis
$APTINSTALL -t ${release_new} smbclient exfat-fuse exfat-utils
sleep 2 # avoid systemd thinking that PHP is in a crash/restart loop
$APTINSTALL -t ${release_new} php${php_ver_new}-exif
sleep 2 # avoid systemd thinking that PHP is in a crash/restart loop
$APTINSTALL -t ${release_new} php${php_ver_new}-bcmath
sleep 2 # avoid systemd thinking that PHP is in a crash/restart loop
$APTINSTALL -t ${release_new} php${php_ver_new}-gmp
#$APTINSTALL -t ${release_new} imagemagick php${php_ver_new}-imagick ghostscript
# Reinstall prometheus-node-exporter, specifically WITH install-recommends to include collectors on bullseye and later
{ dpkg -l | grep '^ii.*prometheus-node-exporter' >/dev/null && apt-get install -y prometheus-node-exporter-collectors; } || true
apt-get autoremove -y
apt-get clean
cat > /etc/php/${php_ver_new}/fpm/conf.d/90-ncp.ini <<EOF
; disable .user.ini files for performance and workaround NC update bugs
user_ini.filename =
; from Nextcloud .user.ini
upload_max_filesize=10G
post_max_size=10G
memory_limit=768M
mbstring.func_overload=0
always_populate_raw_post_data=-1
default_charset='UTF-8'
output_buffering=0
; slow transfers will be killed after this time
max_execution_time=3600
max_input_time=3600
EOF
# restart services
service php${php_ver_new}-fpm restart
a2enconf php${php_ver_new}-fpm
service apache2 restart
is_active_app unattended-upgrades && run_app unattended-upgrades || true
# mark as successful
mv "${new_cfg}" "${old_cfg}"
install_template "php/opcache.ini.sh" "/etc/php/${php_ver_new}/mods-available/opcache.ini" --defaults
clear_opcache
source /usr/local/etc/library.sh # refresh NCPCFG RELEASE PHPVER
run_app nc-limits
restore_maintenance_mode
rm -f /etc/update-motd.d/30ncp-dist-upgrade
echo "Upgrade to ${release_new} successful"
trap '' EXIT

View File

@ -0,0 +1,86 @@
#!/bin/bash
set -eu -o pipefail
new_cfg=/usr/local/etc/ncp-recommended.cfg
[[ -f "${new_cfg}" ]] || { echo "Already on the lastest recommended distribution. Abort." >&2; exit 1; }
echo "
>>> ATTENTION <<<
This is a dangerous process that is only guaranteed to work properly if you
have not made manual changes in the system. Backup the SD card first and
proceed at your own risk.
Note that this is not a requirement for NCP to continue working properly.
The current distribution will keep receiving updates for some time.
Do you want to continue? [y/N]"
if [[ "${DEBIAN_FRONTEND:-}" == "noninteractive" ]] || ! [[ -t 0 ]]
then
echo "Noninteractive environment detected. Automatically proceeding in 30 seconds..."
sleep 30
else
read -n1 -r key
[[ "${key,,}" == y ]] || exit 0
fi
export DEBIAN_FRONTEND=noninteractive
source /usr/local/etc/library.sh
is_more_recent_than "${PHPVER}.0" "8.0.0" || {
echo "You still have PHP version ${PHPVER} installed. Please update to the latest supported version of nextcloud (which will also update your PHP version) before proceeding with the distribution upgrade."
echo "Exiting."
exit 1
}
save_maintenance_mode
# Perform dist-upgrade
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"
done
for aptlist in /etc/apt/sources.list.d/*.list
do
[[ "$aptlist" =~ "/etc/apt/sources.list.d/"(php|armbian|raspi)".list" ]] || {
echo "Disabling repositories from \"$aptlist\""
sed -i -e "s/deb/#deb/g" "$aptlist"
}
done
apt-get update
apt-get upgrade -y dpkg
apt-get upgrade -y --without-new-pkgs
if is_lxc
then
# Required to avoid breakage of /etc/resolv.conf
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
#mkdir -p /etc/systemd/system/php8.1-fpm.service.d
#echo '[Service]' > /etc/systemd/system/php8.1-fpm.service.d/ncp.conf
#echo 'ExecStartPre=mkdir -p /var/run/php' >> /etc/systemd/system/php8.1-fpm.service.d/ncp.conf
#[[ "$INIT_SYSTEM" != "systemd" ]] || { systemctl daemon-reload && systemctl restart php8.1-fpm; }
restore_maintenance_mode
cfg="$(jq "." "$NCPCFG")"
cfg="$(jq ".release = \"bookworm\"" <<<"$cfg")"
echo "$cfg" > "$NCPCFG"
rm -f /etc/update-motd.d/30ncp-dist-upgrade
rm -f /usr/local/etc/ncp-recommended.cfg
echo "Update to Debian 12 (bookworm) successful."
is_active_app unattended-upgrades && {
echo "Setting up unattended upgrades..."
run_app unattended-upgrades || true
echo "done."
}

11
bin/ncp-docker-hook Normal file
View File

@ -0,0 +1,11 @@
# Here we have the opportunity to make changes in the persistent volume configuration before
# anything is started, after pulling a new image
# adjust PHP version (in case of php upgrade)
if php --version | grep -q v7.4 && [[ -f /data/etc/apache2/conf-available/php7.3-fpm.conf ]]; then
a2disconf php7.3-fpm
mv /data/etc/apache2/conf-available/php7.{3,4}-fpm.conf
sed -i 's|php7.3|php7.4|g' /data/etc/apache2/conf-available/php7.4-fpm.conf
a2enconf php7.4-fpm
fi

94
bin/ncp-provisioning.sh Normal file
View File

@ -0,0 +1,94 @@
#!/bin/bash
# this script runs at startup to provide an unique random passwords for each instance
source /usr/local/etc/library.sh
set -x
## redis provisioning
CFG=/var/www/nextcloud/config/config.php
REDISPASS="$( grep "^requirepass" /etc/redis/redis.conf | cut -f2 -d' ' )"
### IF redis password is the default one, generate a new one
[[ "$REDISPASS" == "default" ]] && {
REDISPASS="$( openssl rand -base64 32 )"
echo Provisioning Redis password
sed -i -E "s|^requirepass .*|requirepass $REDISPASS|" /etc/redis/redis.conf
chown redis:redis /etc/redis/redis.conf
is_docker || systemctl restart redis
}
### If there exists already a configuration adjust the password
[[ -f "$CFG" ]] && {
echo "Updating NextCloud config with Redis password"
sed -i "s|'password'.*|'password' => '$REDISPASS',|" "$CFG"
}
## mariaDB provisioning
DBADMIN=ncadmin
DBPASSWD=$( grep password /root/.my.cnf | sed 's|password=||' )
[[ "$DBPASSWD" == "default" ]] && {
DBPASSWD=$( openssl rand -base64 32 )
echo Provisioning MariaDB password
echo -e "[client]\npassword=$DBPASSWD" > /root/.my.cnf
chmod 600 /root/.my.cnf
mysql <<EOF
GRANT USAGE ON *.* TO '$DBADMIN'@'localhost' IDENTIFIED BY '$DBPASSWD';
DROP USER '$DBADMIN'@'localhost';
CREATE USER '$DBADMIN'@'localhost' IDENTIFIED BY '$DBPASSWD';
GRANT ALL PRIVILEGES ON nextcloud.* TO $DBADMIN@localhost;
FLUSH PRIVILEGES;
EXIT
EOF
}
[[ -f "$CFG" ]] && {
echo "Updating NextCloud config with MariaDB password"
sed -i "s|'dbpassword' =>.*|'dbpassword' => '$DBPASSWD',|" "$CFG"
}
## nc.limits.sh (auto)adjustments: number of threads, memory limits...
source /usr/local/etc/library.sh
run_app nc-limits
## Check for interrupted upgrades and rollback
BKP="$( ls -1t /var/www/nextcloud-bkp_*.tar.gz 2>/dev/null | head -1 )"
[[ -f "$BKP" ]] && [[ "$( stat -c %U "$BKP" )" == "root" ]] && [[ "$( stat -c %a "$BKP" )" == 600 ]] && {
echo "Detected interrupted upgrade. Restoring..."
BKP_NEW="failed_$BKP"
mv "$BKP" "$BKP_NEW"
ncp-restore "$BKP_NEW" && rm "$BKP_NEW"
}
## Check for encrypted data and ask for password
if needs_decrypt; then
echo "Detected encrypted instance"
a2dissite ncp 001-nextcloud
a2ensite ncp-activation
apache2ctl -k graceful
fi
[[ -f /usr/local/etc/instance.cfg ]] || {
cohorte_id=$((RANDOM % 100))
cat > /usr/local/etc/instance.cfg <<EOF
{
"cohorteId": ${cohorte_id}
}
EOF
cat /usr/local/etc/instance.cfg
}
systemctl is-enabled -q nextcloud-ai-worker@1.service || {
max="$(nproc || echo '2')"
max="$((max-1))"
for i in $(seq 1 "$max")
do
systemctl enable --now "nextcloud-ai-worker@${i}.service"
done
}
exit 0

87
bin/ncp-report Executable file
View File

@ -0,0 +1,87 @@
#!/bin/bash
# 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!
#
# Usage:
# sudo ncp-report
#
# More at https://ownyourbits.com
#
function open_summary()
{
echo "
<details>
<summary>$*</summary>
\`\`\`
"
}
function close_summary()
{
echo "
\`\`\`
</details>
"
}
[[ ${EUID} -ne 0 ]] && {
printf "Must be run as root. Try 'sudo $0'\n"
exit 1
}
echo "<--! Paste this in GitHub report -->"
##
open_summary "NextcloudPi diagnostics"
bash /usr/local/bin/ncp-diag | sed -r 's=(IP|Certificates|Gateway|Public IPv4|Public IPv6).*=\1|***REMOVED SENSITIVE VALUE***=g' | column -t -s'|'
close_summary
##
open_summary "Nextcloud configuration"
sudo -u www-data php /var/www/nextcloud/occ config:list system 2>&1 || true
close_summary
##
open_summary "HTTPd logs"
tail -20 /var/log/apache2/error.log 2>&1 || true
close_summary
##
open_summary "Database logs"
tail -20 /var/log/mysql/*.log 2>&1 || true
close_summary
##
DATADIR="$( grep datadirectory /var/www/nextcloud/config/config.php |
awk '{ print $3 }' | grep -oP "[^']*[^']" | head -1 )"
open_summary "Nextcloud logs"
tail -20 "$DATADIR"/nextcloud.log 2>&1 || true
close_summary
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

186
bin/ncp-restore Executable file
View File

@ -0,0 +1,186 @@
#!/bin/bash
set -eE
BACKUPFILE="$1"
DBADMIN=ncadmin
DBPASSWD="$( grep password /root/.my.cnf | sed 's|password=||' )"
source /usr/local/etc/library.sh # sets PHPVER
DIR="$( cd "$( dirname "$BACKUPFILE" )" &>/dev/null && pwd )" #abspath
[[ -f /.docker-image ]] && NCDIR=/data/nextcloud || NCDIR=/var/www/nextcloud
[[ $# -eq 0 ]] && { echo "missing first argument" ; exit 1; }
[[ -f "$BACKUPFILE" ]] || { echo "$BACKUPFILE not found" ; exit 1; }
[[ "$DIR" =~ "$NCDIR".* ]] && { echo "Refusing to restore from $NCDIR"; exit 1; }
TEMPDIR="$( mktemp -d "$( dirname "$BACKUPFILE" )"/ncp-restore.XXXXXX )" || { echo "Failed to create temp dir" >&2; exit 1; }
[[ "$(stat -fc%T "${TEMPDIR}")" =~ ext|btrfs|zfs ]] || { echo "Can only restore from ext/btrfs/zfs filesystems (found '$(stat -fc%T "${TEMPDIR}")" >&2; exit 1; }
TEMPDIR="$( cd "$TEMPDIR" &>/dev/null && pwd )" || { echo "$TEMPDIR not found"; exit 1; } #abspath
cleanup(){ local RET=$?; echo "Cleanup..."; rm -rf "${TEMPDIR}"; trap "" EXIT; exit $RET; }
trap cleanup INT TERM HUP ERR EXIT
rm -rf "$TEMPDIR" && mkdir -p "$TEMPDIR"
[[ "$BACKUPFILE" =~ .*".tar.gz" ]] && compress_arg="-I pigz"
# CHECK FREE SPACE IN $TEMPDIR
echo "check free space..." # allow at least ~100 extra MiB
extractedsize=$(tar $compress_arg -tvf "$BACKUPFILE" | awk '{s+=$3} END{printf "%.0f", (s/1024)}') # Size of extracted files in "KB"
size=$(($extractedsize + 100*1024))
free=$( df "$TEMPDIR" | tail -1 | awk '{ print $4 }' )
[ $size -ge $free ] && {
echo "free space check failed. Need $size KB in $TEMPDIR";
exit 1;
}
# EXTRACT FILES
echo "extracting backup file $BACKUPFILE..."
tar $compress_arg -xf "$BACKUPFILE" -C "$TEMPDIR" || exit 1
## SANITY CHECKS
[[ -d "$TEMPDIR"/nextcloud ]] && [[ -f "$( ls "$TEMPDIR"/nextcloud-sqlbkp_*.bak 2>/dev/null )" ]] || {
echo "invalid backup file. Abort"
exit 1
}
## RESTORE FILES
echo "restore files..."
[[ -d "$NCDIR/data" ]] && {
DATA_BKP_DIR="$(mktemp -d -p "$NCDIR/.." nc-data-XXXXXX)"
mv -T "$NCDIR/data" "$DATA_BKP_DIR/"
}
rm -rf "$NCDIR"
mv -T "$TEMPDIR"/nextcloud "$NCDIR" || { echo "Error restoring base files"; exit 1; }
if [[ -n "$DATA_BKP_DIR" ]]
then
target="$NCDIR/data"
[[ -d "$target" ]] && {
target="$NCDIR/.data_$(date '+%FT%s')"
echo "DATA CONFLICT! Your old '$NCDIR/data' directory can be found in '$target' after the restore script is done. The new '$NCDIR/data' directory will be restored from the backup. You can manually merge these directories with this command (run nc-fix-permissions and nc-scan afterwards): cp -rn '$target/'* '$target/'.[!.]* '$NCDIR/data/'"
}
echo "Restoring old '$NCDIR/data' to '$target'..."
mv -T "$DATA_BKP_DIR" "$target"
fi
# update NC database password to this instance
sed -i "s|'dbpassword' =>.*|'dbpassword' => '$DBPASSWD',|" /var/www/nextcloud/config/config.php
# update redis credentials
REDISPASS="$( grep "^requirepass" /etc/redis/redis.conf | cut -f2 -d' ' )"
[[ "$REDISPASS" != "" ]] && \
sed -i "s|'password'.*|'password' => '$REDISPASS',|" /var/www/nextcloud/config/config.php
service redis-server restart
## RE-CREATE DATABASE TABLE
echo "restore database..."
mysql -u root <<EOFMYSQL
DROP DATABASE IF EXISTS nextcloud;
CREATE DATABASE nextcloud;
GRANT USAGE ON *.* TO '$DBADMIN'@'localhost' IDENTIFIED BY '$DBPASSWD';
DROP USER '$DBADMIN'@'localhost';
CREATE USER '$DBADMIN'@'localhost' IDENTIFIED BY '$DBPASSWD';
GRANT ALL PRIVILEGES ON nextcloud.* TO $DBADMIN@localhost;
EXIT
EOFMYSQL
# shellcheck disable=SC2181
[ $? -ne 0 ] && { echo "Error configuring nextcloud database"; exit 1; }
mysql -u root nextcloud < "$TEMPDIR"/nextcloud-sqlbkp_*.bak || { echo "Error restoring nextcloud database"; exit 1; }
## RESTORE DATADIR
DATADIR="$(get_nc_config_value datadirectory)"
if is_docker && [[ "$DATADIR" == "/var/www/nextcloud/data" ]]; then
DATADIR=/data/nextcloud/data
fi
[[ "$DATADIR" == "" ]] && { echo "Error reading data directory"; exit 1; }
cd "$NCDIR"
### INCLUDEDATA=yes situation
NUMFILES=2
if [[ $( ls "$TEMPDIR" | wc -l ) -eq $NUMFILES ]]; then
[[ -e "$DATADIR" ]] && {
bk_target="$DATADIR-$( date '+%FT%s' )"
echo "backing up existing $DATADIR to ${bk_target}..."
mv "$DATADIR" "${bk_target}" || exit 1
}
echo "restore datadir to $DATADIR..."
mkdir -p "$DATADIR"
grep -q "btrfs" <(stat -fc%T "$DATADIR") && which btrfs &>/dev/null && {
rmdir "$DATADIR" || exit 1
btrfs subvolume create "$DATADIR" || exit 1
}
chown www-data: "$DATADIR"
TMPDATA="$TEMPDIR/$( basename "$DATADIR" )"
mv "$TMPDATA"/* "$TMPDATA"/.[!.]* "$DATADIR" || exit 1
rmdir "$TMPDATA" || exit 1
ncc maintenance:mode --off
### INCLUDEDATA=no situation
else
echo "No datadir found in backup"
[[ -e "$DATADIR" ]] || {
echo -n "${DATADIR} not found."
DATADIR="/data/ncdata/data"
is_docker || DATADIR="/opt/data"
echo "Resetting to ${DATADIR}"
mkdir -p "${DATADIR}"
touch "${DATADIR}"/.ocdata
chown -R www-data: "${DATADIR}"
}
ncc maintenance:mode --off
ncc files:scan --all
# cache needs to be cleaned as of NC 12
NEED_RESTART=1
fi
sed -i "s|'datadirectory' =>.*|'datadirectory' => '${DATADIR}',|" "${NCDIR}"/config/config.php
# Just in case we moved the opcache dir
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER}/mods-available/opcache.ini"
# tmp upload dir
mkdir -p "$DATADIR/tmp"
chown www-data: "$DATADIR/tmp"
ncc config:system:set tempdirectory --value "$DATADIR/tmp"
sed -i "s|^;\?upload_tmp_dir =.*$|upload_tmp_dir = $DATADIR/tmp|" "/etc/php/${PHPVER}/cli/php.ini"
sed -i "s|^;\?upload_tmp_dir =.*$|upload_tmp_dir = $DATADIR/tmp|" "/etc/php/${PHPVER}/fpm/php.ini"
sed -i "s|^;\?sys_temp_dir =.*$|sys_temp_dir = $DATADIR/tmp|" "/etc/php/${PHPVER}/fpm/php.ini"
# logs
ncc config:system:set logfile --value="$DATADIR/nextcloud.log"
# update fail2ban logpath
[[ -f /etc/fail2ban/jail.conf ]] && {
sed -i "s|logpath =.*|logpath = $DATADIR/nextcloud.log|" /etc/fail2ban/jail.conf
pgrep fail2ban &>/dev/null && service fail2ban restart
}
# refresh nextcloud trusted domains
bash /usr/local/bin/nextcloud-domain.sh
# update the systems data-fingerprint
ncc maintenance:data-fingerprint
# refresh thumbnails
ncc files:scan-app-data
# restart PHP if needed
[[ "$NEED_RESTART" == "1" ]] && {
bash -c "sleep 5; source /usr/local/etc/library.sh; clear_opcache; service php${PHPVER}-fpm restart" &>/dev/null &
}

38
bin/ncp-suggestions Normal file
View File

@ -0,0 +1,38 @@
#!/bin/bash
#
# 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!
#
# Usage:
# sudo ncp-suggestions "$( ncp-diag )"
#
# More at https://ownyourbits.com
#
OUT="$@"
source /usr/local/etc/library.sh
check_distro || \
echo -e "You are using an outdated distro release. You should upgrade to latest Debian/Raspbian"
is_active_app dnsmasq && \
grep -q "NAT loopback|no" <<<"$OUT" && \
echo -e "\nYou should enable dnsmasq to use your domain inside home"
grep -q "Certificates|none" <<<"$OUT" && \
echo -e "\nYou should run Lets Encrypt for trusted encrypted access"
grep -q "Port .*|closed" <<<"$OUT" && \
echo -e "\nYou should open your ports for Lets Encrypt and external access"
grep -q "USB devices|none" <<<"$OUT" || {
grep -q "data in SD|yes" <<<"$OUT" && \
echo -e "\nYou should use nc-datadir to move your files to your plugged in USB drive"
grep -q "automount|no" <<<"$OUT" && \
echo -e "\nYou should enable automount to use your plugged in USB drive"
}

28
bin/ncp-test-updates Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
# given in disk version information, return 0 if an update is available
NEED_UPDATE=false
VERFILE=/var/run/.ncp-latest-version
[[ $( cat $VERFILE 2>/dev/null | wc -c ) -eq 0 ]] && ncp-check-version
if grep -qP "v\d+\.\d+\.\d+" $VERFILE; then
MAJOR=$( grep -oP "\d+\.\d+\.\d+" $VERFILE | cut -d. -f1 )
MINOR=$( grep -oP "\d+\.\d+\.\d+" $VERFILE | cut -d. -f2 )
PATCH=$( grep -oP "\d+\.\d+\.\d+" $VERFILE | cut -d. -f3 )
MAJ=$( grep -oP "\d+\.\d+\.\d+" /usr/local/etc/ncp-version | cut -d. -f1 )
MIN=$( grep -oP "\d+\.\d+\.\d+" /usr/local/etc/ncp-version | cut -d. -f2 )
PAT=$( grep -oP "\d+\.\d+\.\d+" /usr/local/etc/ncp-version | cut -d. -f3 )
if [ "$MAJOR" -gt "$MAJ" ]; then
NEED_UPDATE=true
elif [ "$MAJOR" -eq "$MAJ" ] && [ "$MINOR" -gt "$MIN" ]; then
NEED_UPDATE=true
elif [ "$MAJOR" -eq "$MAJ" ] && [ "$MINOR" -eq "$MIN" ] && [ "$PATCH" -gt "$PAT" ]; then
NEED_UPDATE=true
fi
fi
[[ "$NEED_UPDATE" == "true" ]] && exit 0

67
bin/ncp-update Executable file
View File

@ -0,0 +1,67 @@
#!/bin/bash
# update latest NextcloudPi code from github
[[ -z "$DBG" ]] || set -$DBG
if [[ -f /.dockerenv ]] || [[ -f /.docker-image ]] || [[ "$DOCKERBUILD" == 1 ]]
then
echo "WARNING: Docker images should be updated by replacing the container from the latest docker image" \
"(refer to the documentation for instructions: https://docs.nextcloudpi.com)." \
"If you are sure that you know what you are doing, you can still execute the update script by running it like this:"
echo "> ALLOW_UPDATE_SCRIPT=1 ncp-update"
[[ "$ALLOW_UPDATE_SCRIPT" == "1" ]] || exit 1
fi
{
[ "$(id -u)" -ne 0 ] && { printf "Must be run as root. Try 'sudo $0'\n"; exit 1; }
BRANCH="${1:-master}"
[[ "$BRANCH" != "master" ]] && echo "INFO: updating to development branch '$BRANCH'"
TEMPDIR="$( mktemp -d /tmp/ncp-update.XXXXXX || ( echo "Failed to create temp dir. Exiting" >&2; exit 1 ) )"
trap 'cd /; rm -rf "${TEMPDIR}"' EXIT
echo -e "Downloading updates"
git clone --depth 20 -b "$BRANCH" -q https://github.com/nextcloud/nextcloudpi.git "$TEMPDIR" || {
echo "No internet connectivity"
exit 1
}
# shellcheck disable=SC2164
[[ -f /.ncp-image ]] || {
cd "$TEMPDIR" # update locally during build
[[ -z "$2" ]] || {
git fetch origin "$2" || {
echo "Error: Could not fetch $2"
exit 1
}
git checkout FETCH_HEAD
}
}
echo -e "Performing updates"
./update.sh || exit $?
cd "$TEMPDIR" || exit 1
git describe --always --tags --abbrev=0 2>/dev/null | grep -qoP "v\d+\.\d+\.\d+" || git fetch --unshallow --tags -q
VER=$( git describe --always --tags --abbrev=0 | grep -oP "v\d+\.\d+\.\d+" )
# check format
grep -qP "v\d+\.\d+\.\d+" <<< "$VER" || { echo "Error: missing version"; exit 1; }
echo "$VER" > /usr/local/etc/ncp-version
echo "$VER" > /var/run/.ncp-latest-version
# write changelog
git log --graph --oneline --decorate \
--pretty=format:"[%D] %s" --date=short | \
grep 'tag: v' | \
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"
exit 0
} # force to read the whole thing into memory, as its contents might change in update.sh

68
bin/ncp-update-nc Executable file
View File

@ -0,0 +1,68 @@
#!/bin/bash
# Upgrade to a different Nextcloud version
#
# 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!
#
# Usage:
# ncp-update-nc <version>
#
# More at https://ownyourbits.com
#
# test cases
####################
# - with and without moving datadir
# - failure at each test point
# -> must pass basic NC in tests.py ( meaning it's not in a broken state )
set -eE${DBG}
BIN="${0##*/}"
VER="$1"
[[ "$VER" == "" ]] && { echo "Usage ${BIN} <version>"; exit 1; }
connect_to_nc_update() {
tail -n 100 -f "/var/log/ncp-update-nc.log" &
tail_pid=$!
trap "kill '$tail_pid'" EXIT
while [[ "$(systemctl is-active ncp-update-nc ||:)" =~ ^(active|activating|deactivating)$ ]]
do
sleep 3
done
if [[ "$(systemctl is-active ncp-update-nc ||:)" == "inactive" ]]
then
echo "Nextcloud update finished successfully."
return 0
elif [[ "$(systemctl is-active ncp-update-nc ||:)" == "failed" ]]
then
echo "Nextcloud update failed (or was installed already)."
return 1
else
echo "Nextcloud update was not found or failed (unexpected status: '$(systemctl is-active ncp-update-nc ||:)')"
fi
}
if [[ "$(systemctl is-active ncp-update-nc ||:)" =~ ^(active|activating|deactivating)$ ]]
then
echo "Existing ncp-update-nc process detected. Connecting..."
connect_to_nc_update
exit $?
fi
systemctl reset-failed ncp-update-nc 2>/dev/null ||:
systemd-run -u 'ncp-update-nc' --service-type=oneshot --no-block -p TimeoutStartSec="24h" -p TimeoutStopSec="1h" \
bash -c "set -o pipefail; DBG='${DBG:-}' /usr/local/bin/ncp-update-nc.d/update-nc.sh '${VER}' |& tee /var/log/ncp-update-nc.log"
sleep 1
if ! [[ "$(systemctl is-active ncp-update-nc ||:)" =~ ^(active|inactive|activating|deactivating)$ ]]
then
echo "Failed to start ncp-update-nc"
[[ -f /var/log/ncp-update-nc.log ]] && cat /var/log/ncp-update-nc.log
systemctl status --no-pager ncp-update-nc ||:
exit 1
fi
connect_to_nc_update

261
bin/ncp-update-nc.d/update-nc.sh Executable file
View File

@ -0,0 +1,261 @@
#!/bin/bash
set -eE${DBG}
VER="$1"
source /usr/local/etc/library.sh
export RELEASE
export PHPVER
# pre-checks
####################
BASEDIR=/var/www
cd "$BASEDIR"
DATADIR="$( get_nc_config_value datadirectory )"
ncc status &>/dev/null || { [[ "$DBG" == x ]] && ncc status; echo "Nextcloud is currently down"; exit 1; }
[[ -d "${BASEDIR}/nextcloud-old" ]] && { echo "Nextcloud backup directory found. Interrupted or already running installation?"; exit 1; }
[[ -d "${BASEDIR}/nextcloud" ]] || { echo "Nextcloud directory not found" ; exit 1; }
[[ -d "$DATADIR" ]] || { echo "Nextcloud data directory not found" ; exit 1; }
# check version
####################
[[ ${EUID} -eq 0 ]] && SUDO="sudo -u www-data"
CURRENT="$(nc_version)"
if [[ "$VER" == "0" ]] || [[ "$VER" == "" ]]
then
REQUESTED_VERSION="latest"
else
REQUESTED_VERSION="$VER"
fi
TARGET_VERSION="$(determine_nc_update_version "${CURRENT?}" "${NCLATESTVER}" "${REQUESTED_VERSION}")"
[[ "$TARGET_VERSION" == "$CURRENT" ]] && {
echo "Nextcloud version ${CURRENT} is already installed. Nothing to do."
exit 1
}
[[ -n "$TARGET_VERSION" ]] || {
echo "Could not find a valid upgrade path from '${CURRENT}' to '${TARGET_VERSION}'. Nothing to update."
exit 1
}
MAJOR_NEW="${TARGET_VERSION%%.*}"
DEBIAN_VERSION="$(. /etc/os-release; echo "$VERSION_ID")"
if [[ "$MAJOR_NEW" -ge 24 ]] && [[ $DEBIAN_VERSION -le 10 ]]
then
echo -e "NCP doesn't support Nextcloud versions greater than 23 with Debian 10 (Buster). Please run ncp-dist-upgrade."
exit 1
fi
if [[ "$MAJOR_NEW" -ge 29 ]] && [[ $DEBIAN_VERSION -le 11 ]]
then
echo -e "NCP doesn't support Nextcloud versions greater than 28 with Debian 11 (Bullseye). Please run ncp-dist-upgrade."
exit 1
fi
grep -qP "\d+\.\d+\.\d+" <<<"$CURRENT" || { echo "Malformed version $CURRENT"; exit 1; }
grep -qP "\d+\.\d+\.\d+" <<<"$TARGET_VERSION" || { echo "Malformed version $TARGET_VERSION" ; exit 1; }
echo "Current Nextcloud version $CURRENT"
echo "Requested Nextcloud version $REQUESTED_VERSION"
echo "Selected Nextcloud version $TARGET_VERSION"
if [[ "$REQUESTED_VERSION" == "latest" ]]
then
echo "INFO: You have requested an update to the latest available version that can be performed directly, which is '${TARGET_VERSION}'. Updates can only performed to the next major version (or the latest minor version of the current major version). If you run ncp-update-nc again after this update completes, a new version might be available."
sleep 3
elif [[ "$TARGET_VERSION" != "$REQUESTED_VERSION" ]]
then
echo "INFO: You have requested an update to '${REQUESTED_VERSION}', but a direct update to '${REQUESTED_VERSION}' cannot be performed, so the latest available version that can be updated to (${TARGET_VERSION}) has been selected automatically."
sleep 3
fi
# make sure that cron.php is not running and there are no pending jobs
# https://github.com/nextcloud/server/issues/10949
pgrep -cf cron.php &>/dev/null && { pkill -f cron.php; sleep 3; }
pgrep -cf cron.php &>/dev/null && { echo "cron.php running. Abort"; exit 1; }
mysql nextcloud <<<"UPDATE ${DB_PREFIX}jobs SET reserved_at=0;"
# cleanup
####################
cleanup() {
local RET=$?
set +eE
echo "Clean up..."
rm -rf "$BASEDIR"/nextcloud.tar.bz2 "$BASEDIR"/nextcloud-old
trap "" EXIT
exit $RET
}
trap cleanup EXIT
# get new code
####################
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
####################
BKPDIR="$BASEDIR"
WITH_DATA=no
COMPRESSED=yes
LIMIT=0
echo "Back up current instance..."
set +eE
ncp-backup "$BKPDIR" "$WITH_DATA" "$COMPRESSED" "$LIMIT" # && false # test point
RET=$?
sync
set -eE
BKP_="$( ls -1t "$BKPDIR"/nextcloud-bkp_*.tar.gz 2>/dev/null | head -1 )"
[[ -f "$BKP_" ]] || { set +eE; echo "Error backing up"; false || cleanup; }
[[ $RET -ne 0 ]] && { rm -f "$BKP_"; set +eE; echo "Error backing up"; false || cleanup; }
BKP="$( dirname "$BKP_" )/$( basename "$BKP_" .tar.gz )-${CURRENT}.tar.gz"
echo "Storing backup at '$BKP'..."
mv "$BKP_" "$BKP"
# simple restore if anything fails from here
####################
rollback_simple() {
set +eE
trap "" INT TERM HUP ERR
echo -e "Abort\nSimple roll back..."
rm -rf "$BASEDIR"/nextcloud
mv "$BASEDIR"/nextcloud-old "$BASEDIR"/nextcloud
false || cleanup # so cleanup exits with 1
}
trap rollback_simple INT TERM HUP ERR
# replace code
####################
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
# copy old config
####################
cp nextcloud-old/config/config.php nextcloud/config/
# copy old themes
####################
cp -raT nextcloud-old/themes/ nextcloud/themes/
# copy old NC apps
####################
for app in nextcloud-old/apps/*; do
if ! [[ -d /var/www/nextcloud/apps/"$(basename "$app")" ]]
then
cp -r -L "${app}" /var/www/nextcloud/apps/
fi
done
#false # test point
# copy data if it was at the default location
####################
if [[ "$DATADIR" == "/var/www/nextcloud/data" ]] || [[ "$DATADIR" == "/data/nextcloud/data" ]]; then
echo "Restore data..."
mv -T nextcloud-old/data nextcloud/data
fi
# nc-restore if anything fails from here
####################
rollback() {
set +eE
trap "" INT TERM HUP ERR EXIT
echo -e "Abort\nClean up..."
rm -rf /var/www/nextcloud.tar.bz2 "$BASEDIR"/nextcloud-old
echo "Rolling back to backup $BKP..."
local TMPDATA
mkdir -p "$BASEDIR/recovery/"
TMPDATA="$( mktemp -d "$BASEDIR/recovery/ncp-data.XXXXXX" )" || { echo "Failed to create temp dir" >&2; exit 1; }
[[ "$DATADIR" == "$BASEDIR/nextcloud/data" ]] && mv -T "$DATADIR" "$TMPDATA"
ncp-restore "$BKP" || { echo "Rollback failed! Data left at $TMPDATA"; exit 1; }
[[ "$DATADIR" == "$BASEDIR/nextcloud/data" ]] && { rm -rf "$DATADIR"; mv -T "$TMPDATA" "$DATADIR"; }
rm "$BKP"
echo "Rollback successful. Nothing was updated"
exit 1
}
trap rollback INT TERM HUP ERR
# fix permissions
####################
echo "Fix permissions..."
chown -R www-data:www-data nextcloud
find nextcloud/ -type d -exec chmod 750 {} \;
find nextcloud/ -type f -exec chmod 640 {} \;
# upgrade
####################
echo "Upgrade..."
ncc='sudo -u www-data php nextcloud/occ'
$ncc upgrade # && false # test point
$ncc | grep -q db:add-missing-indices && $ncc db:add-missing-indices -n
$ncc | grep -q db:add-missing-columns && $ncc db:add-missing-columns -n
$ncc | grep -q db:add-missing-primary-keys && $ncc db:add-missing-primary-keys -n
$ncc | grep -q db:convert-filecache-bigint && $ncc db:convert-filecache-bigint -n
$ncc | grep -q db:convert-mysql-charset && $ncc db:convert-mysql-charset -n
$ncc maintenance:repair --help | grep -q -e '--include-expensive' && $ncc maintenance:repair --include-expensive
if $ncc app_api:daemon:list | grep 'No registered daemon configs.' > /dev/null 2>&1
then
$ncc app:disable app_api
fi
# use the correct version for custom apps
NCVER="$(nc_version)"
if is_more_recent_than "21.0.0" "${NCVER}"; then
NCPREV=/var/www/ncp-previewgenerator/ncp-previewgenerator-nc20
else
# Install notify_push if not installed
if ! is_app_enabled notify_push; then
ncc app:install notify_push
ncc app:enable notify_push
install_template nextcloud.conf.sh /etc/apache2/sites-available/nextcloud.conf
a2enmod proxy proxy_http proxy_wstunnel
apachectl -k graceful
## make sure the notify_push daemon is runnnig
install_template systemd/notify_push.service.sh /etc/systemd/system/notify_push.service
start_notify_push
nc_domain="$(ncc config:system:get overwrite.cli.url)"
set-nc-domain "${nc_domain}" || {
echo "notify_push setup failed. You are probably behind a proxy"
echo "Run 'ncc config:system:set trusted_proxies 15 --value=<proxy_IP>' and then 'ncc notify_push:setup https://<domain>/push to enable"
echo "Check https://help.nextcloud.com/tags/ncp for support"
}
fi
NCPREV=/var/www/ncp-previewgenerator/ncp-previewgenerator-nc21
fi
rm -rf /var/www/nextcloud/apps/previewgenerator
ln -snf "${NCPREV}" /var/www/nextcloud/apps/previewgenerator
if ! is_more_recent_than "24.0.0" "${NCVER}" && is_more_recent_than "8.1.0" "${PHPVER}.0"
then
/usr/local/bin/ncp-update-nc.d/upgrade-php-bullseye-8.1.sh
# Reload library.sh to reset PHPVER
source /usr/local/etc/library.sh
elif ! is_more_recent_than "29.0.0" "${NCVER}" && is_more_recent_than "8.3.0" "${PHPVER}.0" && [[ "$DEBIAN_VERSION" -ge 12 ]]
then
/usr/local/bin/ncp-update-nc.d/upgrade-php-bookworm-8.3.sh
# Reload library.sh to reset PHPVER
source /usr/local/etc/library.sh
fi
# refresh completions
ncc _completion -g --shell-type bash -p ncc | sed 's|/var/www/nextcloud/occ|ncc|g' > /usr/share/bash-completion/completions/ncp
echo "Update completed successfully."
# done
####################
mkdir -p "$DATADIR"/ncp-update-backups
mv "$BKP" "$DATADIR"/ncp-update-backups
chown -R www-data:www-data "$DATADIR"/ncp-update-backups
BKP="$DATADIR"/ncp-update-backups/"$( basename "$BKP" )"
echo "Backup stored at $BKP"
bash -c "sleep 5; source /usr/local/etc/library.sh; clear_opcache;" &>/dev/null &

View File

@ -0,0 +1,68 @@
#!/usr/bin/env bash
source /usr/local/etc/library.sh
echo "Upgrading PHP..."
export DEBIAN_FRONTEND=noninteractive
PHPVER_OLD="$PHPVER"
PHPVER_NEW="8.3"
PHP_PACKAGES_OLD=("php${PHPVER_OLD}" \
"php${PHPVER_OLD}"-{curl,gd,fpm,cli,opcache,mbstring,xml,zip,fileinfo,ldap,intl,bz2,mysql,bcmath,gmp,redis,common})
PHP_PACKAGES_NEW=("php${PHPVER_NEW}" \
"php${PHPVER_NEW}"-{curl,gd,fpm,cli,opcache,mbstring,xml,zip,fileinfo,ldap,intl,bz2,mysql,bcmath,gmp,redis,common})
php_restore() {
trap "" INT TERM HUP ERR
echo "Something went wrong while upgrading PHP. Rolling back to version ${PHPVER_OLD}..."
set +e
service "php${PHPVER_NEW}-fpm" stop
a2disconf php${PHPVER_NEW}-fpm
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ ${RELEASE%-security} main" > /etc/apt/sources.list.d/php.list
apt-get update
apt-get remove --purge -y "${PHP_PACKAGES_NEW[@]}"
apt-get install -y --no-install-recommends -t "$RELEASE" "${PHP_PACKAGES_OLD[@]}"
set_ncpcfg "php_version" "${PHPVER_OLD}"
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER_NEW}/mods-available/opcache.ini"
run_app nc-limits
a2enconf "php${PHPVER_OLD}-fpm"
service "php${PHPVER_OLD}-fpm" start
service apache2 restart
echo "PHP upgrade has been successfully reverted"
set -e
}
trap php_restore INT TERM HUP ERR
apt-get update
clear_opcache
echo "Stopping apache and php-fpm..."
service "php${PHPVER_OLD}-fpm" stop
service apache2 stop
echo "Remove old PHP (${PHPVER_OLD})..."
a2disconf "php${PHPVER_OLD}-fpm"
apt-get remove --purge -y "${PHP_PACKAGES_OLD[@]}"
echo "Install PHP ${PHPVER_NEW}..."
install_with_shadow_workaround --no-install-recommends systemd
apt-get install -y --no-install-recommends -t "$RELEASE" "${PHP_PACKAGES_NEW[@]}"
set_ncpcfg "php_version" "${PHPVER_NEW}"
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER_NEW}/mods-available/opcache.ini"
( set -e; export PHPVER="${PHPVER_NEW}"; run_app nc-limits )
a2enconf "php${PHPVER_NEW}-fpm"
[[ -f "/etc/systemd/system/php${PHPVER_OLD}-fpm.service.d/ncp.conf" ]] && {
mkdir -p "/etc/systemd/system/php${PHPVER_NEW}-fpm.service.d"
cp "/etc/systemd/system/php${PHPVER_OLD}-fpm.service.d/ncp.conf" "/etc/systemd/system/php${PHPVER_NEW}-fpm.service.d/ncp.conf"
}
echo "Starting apache and php-fpm..."
service "php${PHPVER_NEW}-fpm" start
service apache2 start
ncc status

View File

@ -0,0 +1,65 @@
#!/usr/bin/env bash
source /usr/local/etc/library.sh
echo "Upgrading PHP..."
export DEBIAN_FRONTEND=noninteractive
PHPVER_OLD="$PHPVER"
PHPVER_NEW="8.1"
PHP_PACKAGES_OLD=(php-{common,igbinary,redis,json} "php${PHPVER_OLD}" \
"php${PHPVER_OLD}"-{curl,gd,fpm,cli,opcache,mbstring,xml,zip,fileinfo,ldap,intl,bz2,json,common,readline,mysql,bcmath,gmp})
PHP_PACKAGES_NEW=("php${PHPVER_NEW}" \
"php${PHPVER_NEW}"-{curl,gd,fpm,cli,opcache,mbstring,xml,zip,fileinfo,ldap,intl,bz2,mysql,bcmath,gmp,redis,common})
php_restore() {
trap "" INT TERM HUP ERR
echo "Something went wrong while upgrading PHP. Rolling back to version ${PHPVER_OLD}..."
set +e
service "php${PHPVER_NEW}-fpm" stop
a2disconf php${PHPVER_NEW}-fpm
rm /etc/apt/sources.list.d/php.list
apt-get update
apt-get remove --purge -y "${PHP_PACKAGES_NEW[@]}"
apt-get install -y --no-install-recommends -t "$RELEASE" "${PHP_PACKAGES_OLD[@]}"
set_ncpcfg "php_version" "${PHPVER_OLD}"
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER_NEW}/mods-available/opcache.ini"
run_app nc-limits
a2enconf "php${PHPVER_OLD}-fpm"
service "php${PHPVER_OLD}-fpm" start
service apache2 restart
echo "PHP upgrade has been successfully reverted"
set -e
}
trap php_restore INT TERM HUP ERR
# Setup apt repository for php 8
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ ${RELEASE%-security} main" > /etc/apt/sources.list.d/php.list
apt-get update
clear_opcache
echo "Stopping apache and php-fpm..."
service "php${PHPVER_OLD}-fpm" stop
service apache2 stop
echo "Remove old PHP (${PHPVER_OLD})..."
a2disconf "php${PHPVER_OLD}-fpm"
apt-get remove --purge -y "${PHP_PACKAGES_OLD[@]}"
echo "Install PHP ${PHPVER_NEW}..."
install_with_shadow_workaround --no-install-recommends systemd
apt-get install -y --no-install-recommends -t "$RELEASE" "${PHP_PACKAGES_NEW[@]}"
set_ncpcfg "php_version" "${PHPVER_NEW}"
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER_NEW}/mods-available/opcache.ini"
( set -e; export PHPVER="${PHPVER_NEW}"; run_app nc-limits )
a2enconf "php${PHPVER_NEW}-fpm"
echo "Starting apache and php-fpm..."
service "php${PHPVER_NEW}-fpm" start
service apache2 start
ncc status

View File

@ -0,0 +1,89 @@
#!/bin/bash
# Nextcloud backups
#
# 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!
#
# More at https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/
#
tmpl_get_destination() {
(
. /usr/local/etc/library.sh
find_app_param nc-backup-auto DESTDIR
)
}
configure()
{
[[ $ACTIVE != "yes" ]] && {
rm -f /etc/cron.d/ncp-backup-auto
service cron restart
echo "automatic backups disabled"
return 0
}
cat > /usr/local/bin/ncp-backup-auto <<EOF
#!/bin/bash
source /usr/local/etc/library.sh
failed=
run_script()
{
if [ -x /usr/local/bin/ncp-backup-auto-\$1 ]
then
/usr/local/bin/ncp-backup-auto-\$1 || failed="\$failed\${failed:+, } \$1"
fi
}
run_script before
save_maintenance_mode
/usr/local/bin/ncp-backup "$DESTDIR" "$INCLUDEDATA" "$COMPRESS" "$BACKUPLIMIT" || failed="\$failed\${failed:+, } main"
restore_maintenance_mode
run_script after
if [[ -n "\$failed" ]]
then
notify_admin "Auto-backup failed" "The \$failed backup script(s) failed"
fi
EOF
chmod +x /usr/local/bin/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
(
. "${BINDIR}/SYSTEM/metrics.sh"
reload_metrics_config
)
echo "automatic backups enabled"
}
install() { :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,48 @@
#!/bin/bash
# Nextcloud backups
#
# 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!
#
# More at https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/
#
tmpl_get_destination() {
(
. /usr/local/etc/library.sh
find_app_param nc-backup DESTDIR
)
}
install()
{
apt-get update
apt-get install -y --no-install-recommends pigz
}
configure()
{
(
. "${BINDIR}/SYSTEM/metrics.sh"
reload_metrics_config
)
ncp-backup "$DESTDIR" "$INCLUDEDATA" "$COMPRESS" "$BACKUPLIMIT"
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,42 @@
#!/bin/bash
# Export NextcloudPi configuration
#
#
# Copyleft 2017 by Courtney Hicks
# GPL licensed (see end of file) * Use at your own risk!
#
configure()
{
[[ -d "$DIR" ]] || { echo "directory $DIR does not exist"; return 1; }
local destfile
destfile="$DIR"/ncp-config_$(date +"%Y%m%d").tar
tar -cf "$destfile" -C /usr/local/etc/ncp-config.d .
chmod 600 "$destfile"
echo -e "configuration exported to $destfile"
}
install() { :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,58 @@
#!/bin/bash
# Import NextcloudPi configuration
#
#
# Copyleft 2017 by Courtney Hicks
# GPL licensed (see end of file) * Use at your own risk!
#
configure()
{
[[ -f "$FILE" ]] || { echo "export file $FILE does not exist"; return 1; }
cd "$CFGDIR" || return 1
# extract export
tar -xf "$FILE" -C "$CFGDIR"
# activate ncp-apps
find "${CFGDIR}/" -name '*.cfg' | while read -r cfg; do
app="$(basename "${cfg}" .cfg)"
if [[ "${app}" == "letsencrypt" ]] || [[ "${app}" == "dnsmasq" ]]; then
continue
fi
is_active_app "${app}" && run_app "${app}"
done
# order is important for these
is_active_app "dnsmasq" && run_app "dnsmasq"
is_active_app "letsencrypt" && run_app "letsencrypt"
echo -e "\nconfiguration restored"
# delayed in bg so it does not kill the connection, and we get AJAX response
apachectl -k graceful
}
install() { :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,64 @@
#!/bin/bash
#!/bin/bash
# Nextcloud restore backup
#
# 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!
#
# More at nextcloudpi.com
#
install() { :; }
configure()
{
[[ -d "$SNAPSHOT" ]] || { echo "$SNAPSHOT doesn't exist"; return 1; }
local datadir mountpoint
datadir=$( get_nc_config_value datadirectory ) || {
echo -e "Error reading data directory. Is NextCloud running?";
return 1;
}
# file system check
mountpoint="$( stat -c "%m" "$datadir" )" || return 1
[[ "$( stat -fc%T "$mountpoint" )" != "btrfs" ]] && {
echo "$datadir is not in a BTRFS filesystem"
return 1
}
# file system check
btrfs subvolume show "$SNAPSHOT" &>/dev/null || {
echo "$SNAPSHOT is not a BTRFS snapshot"
return 1
}
btrfs-snp $mountpoint autobackup 0 0 ../ncp-snapshots || return 1
save_maintenance_mode
btrfs subvolume delete "$datadir" || return 1
btrfs subvolume snapshot "$SNAPSHOT" "$datadir"
restore_maintenance_mode
ncp-scan
echo "snapshot $SNAPSHOT restored"
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,35 @@
#!/bin/bash
#!/bin/bash
# Nextcloud restore backup
#
# 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!
#
# More at https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/
#
install() { :; }
configure()
{
ncp-restore "$BACKUPFILE"
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,72 @@
#!/bin/bash
# Periodically sync Nextcloud datafolder through rsync
#
# 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!
#
# More at https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/
#
install()
{
apt-get update
apt-get install --no-install-recommends -y rsync
}
configure()
{
[[ $ACTIVE != "yes" ]] && {
rm -f /etc/cron.d/ncp-rsync-auto
echo "automatic rsync disabled"
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?";
return 1;
}
# Check if the ssh access is properly configured. For this purpose the command : or echo is called remotely.
# If one of the commands works, the test is successful.
[[ "$DESTINATION" =~ : ]] && {
local NET="$( sed 's|:.*||' <<<"$DESTINATION" )"
local SSH=( ssh -o "BatchMode=yes" -p "$PORTNUMBER" "$NET" )
${SSH[@]} echo || { echo "SSH non-interactive not properly configured"; return 1; }
}
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
echo "automatic rsync enabled"
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,48 @@
#!/bin/bash
# Sync Nextcloud datafolder through rsync
#
# 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!
#
# More at https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/
#
install()
{
apt-get update
apt-get install --no-install-recommends -y rsync openssh-client
}
configure()
{
save_maintenance_mode
local DATADIR
DATADIR=$( get_nc_config_value datadirectory ) || {
echo -e "Error reading data directory. Is NextCloud running and configured?";
return 1;
}
rsync -ax -e "ssh -p $PORTNUMBER" --delete "$DATADIR" "$DESTINATION"
restore_maintenance_mode
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,70 @@
#!/bin/bash
#
# 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!
#
# More at https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/
#
install()
{
wget https://raw.githubusercontent.com/nachoparker/btrfs-snp/master/btrfs-snp -O /usr/local/bin/btrfs-snp
chmod +x /usr/local/bin/btrfs-snp
}
configure()
{
[[ "$ACTIVE" != "yes" ]] && {
rm -f /etc/cron.hourly/btrfs-snp
echo "automatic snapshots disabled"
return 0
}
cat > /etc/cron.hourly/btrfs-snp <<EOF
#!/bin/bash
source /usr/local/etc/library.sh
DATADIR="\$(get_nc_config_value datadirectory)" || {
echo -e "Error reading data directory. Is NextCloud running and configured?";
exit 1;
}
# file system check
MOUNTPOINT="\$(stat -c "%m" "\$DATADIR")" || return 1
[[ "\$( stat -fc%T "\$MOUNTPOINT" )" != "btrfs" ]] && {
echo "\$MOUNTPOINT is not in a BTRFS filesystem"
exit 1
}
/usr/local/bin/btrfs-snp \$MOUNTPOINT hourly 24 3600 ../ncp-snapshots
/usr/local/bin/btrfs-snp \$MOUNTPOINT daily 7 86400 ../ncp-snapshots
/usr/local/bin/btrfs-snp \$MOUNTPOINT weekly 4 604800 ../ncp-snapshots
/usr/local/bin/btrfs-snp \$MOUNTPOINT monthly 12 2592000 ../ncp-snapshots
EOF
chmod 755 /etc/cron.hourly/btrfs-snp
echo "automatic snapshots enabled"
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,104 @@
#!/bin/bash
# Sync Nextcloud 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!
#
# More at https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/
#
tmpl_get_destination() {
(
. /usr/local/etc/library.sh
find_app_param nc-snapshot-sync DESTINATION
)
}
tmpl_is_destination_local() {
(
. /usr/local/etc/library.sh
is_active_app nc-snapshot-sync || exit 1
! [[ "$(find_app_param nc-snapshot-sync DESTINATION)" =~ .*"@".*":".* ]]
)
}
is_active() {
[[ $ACTIVE == "yes" ]]
}
install()
{
apt-get update
apt-get install -y --no-install-recommends pv openssh-client
wget https://raw.githubusercontent.com/nachoparker/btrfs-sync/master/btrfs-sync -O /usr/local/bin/btrfs-sync
chmod +x /usr/local/bin/btrfs-sync
}
configure()
{
[[ $ACTIVE != "yes" ]] && {
rm -f /etc/cron.d/ncp-snapsync-auto
service cron restart
echo "snapshot sync disabled"
return 0
}
# 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
[[ "$DESTINATION" =~ : ]] && {
local NET="$( sed 's|:.*||' <<<"$DESTINATION" )"
local DST="$( sed 's|.*:||' <<<"$DESTINATION" )"
local SSH=( ssh -o "BatchMode=yes" "$NET" )
${SSH[@]} : || { echo "SSH non-interactive not properly configured"; return 1; }
} || DST="$DESTINATION"
[[ "$( ${SSH[@]} stat -fc%T "$DST" )" != "btrfs" ]] && {
echo "$DESTINATION is not in a BTRFS filesystem"
return 1
}
[[ "$COMPRESSION" == "yes" ]] && ZIP="-z"
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
(
. "${BINDIR}/SYSTEM/metrics.sh"
reload_metrics_config
)
echo "snapshot sync enabled"
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,56 @@
#!/bin/bash
# Nextcloud 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!
#
# More at https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/
#
install()
{
wget https://raw.githubusercontent.com/nachoparker/btrfs-snp/master/btrfs-snp -O /usr/local/bin/btrfs-snp
chmod +x /usr/local/bin/btrfs-snp
}
configure()
{
save_maintenance_mode
local DATADIR MOUNTPOINT
DATADIR=$( get_nc_config_value datadirectory ) || {
echo -e "Error reading data directory. Is NextCloud running?";
return 1;
}
# file system check
MOUNTPOINT="$( stat -c "%m" "$DATADIR" )" || return 1
[[ "$( stat -fc%T "$MOUNTPOINT" )" != "btrfs" ]] && {
echo "$MOUNTPOINT is not in a BTRFS filesystem"
return 1
}
btrfs-snp "${MOUNTPOINT}" manual "${LIMIT}" 0 ../ncp-snapshots
restore_maintenance_mode
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -1,32 +1,27 @@
#!/bin/bash
# System limit configurator for NextCloudPi
# Tested with 2017-03-02-raspbian-jessie-lite.img
# Change password for the Nextcloud admin user
#
# 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!
#
# Usage:
#
# ./installer.sh nc-limits.sh <IP> (<img>)
#
# See installer.sh instructions for details
#
# More at https://ownyourbits.com/2017/03/13/nextcloudpi-gets-nextcloudpi-config/
# More at: https://ownyourbits.com
#
DESCRIPTION="Configure system limits for NextCloudPi"
MAXFILESIZE_=768M
configure()
{
sed -i "s/post_max_size=.*/post_max_size=$MAXFILESIZE_/" /var/www/nextcloud/.user.ini
sed -i "s/upload_max_filesize=.*/upload_max_filesize=$MAXFILESIZE_/" /var/www/nextcloud/.user.ini
sed -i "s/memory_limit=.*/memory_limit=$MAXFILESIZE_/" /var/www/nextcloud/.user.ini
[[ "$PASSWORD" == "" ]] && { echo "empty password"; return 1; }
[[ "$USER" == "" ]] && { echo "empty user" ; return 1; }
[[ "$PASSWORD" == "$CONFIRM" ]] || { echo "passwords do not match"; return 1; }
OC_PASS="$PASSWORD" \
sudo -E -u www-data php /var/www/nextcloud/occ \
user:resetpassword --password-from-env "$USER"
}
install() { :; }
cleanup() { :; }
# License
#
@ -44,4 +39,3 @@ cleanup() { :; }
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,76 @@
#!/bin/bash
# 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!
#
# More at https://ownyourbits.com/
#
is_active()
{
local SRCDIR=$( grep datadir /etc/mysql/mariadb.conf.d/90-ncp.cnf | awk -F "= " '{ print $2 }' )
[[ "$SRCDIR" != "/var/lib/mysql" ]]
}
tmpl_db_dir() {
if is_active_app nc-database; then
find_app_param nc-database DBDIR
fi
}
configure()
{
local SRCDIR=$( grep datadir /etc/mysql/mariadb.conf.d/90-ncp.cnf | awk -F "= " '{ print $2 }' )
[ -d "$SRCDIR" ] || { echo -e "database directory $SRCDIR not found"; return 1; }
[ -d "$DBDIR" ] && {
[[ $( find "$DBDIR" -maxdepth 0 -empty | wc -l ) == 0 ]] && {
echo "$DBDIR is not empty"
return 1
}
rmdir "$DBDIR"
}
local BASEDIR=$( dirname "$DBDIR" )
mkdir -p "$BASEDIR"
[[ "$(stat -fc%T "${BASEDIR}")" =~ ext|btrfs|zfs ]] || { echo -e "Only ext/btrfs/zfs filesystems can hold the data directory (found '$(stat -fc%T "${BASEDIR}")"; return 1; }
sudo -u mysql test -x "$BASEDIR" || { echo -e "ERROR: the user mysql does not have access permissions over $BASEDIR"; return 1; }
[[ $( stat -fc%d / ) == $( stat -fc%d "$BASEDIR" ) ]] && \
echo -e "INFO: moving database to the SD card\nIf you want to use an external mount, make sure it is properly set up"
save_maintenance_mode
echo "moving database to $DBDIR..."
service mysql stop
mv "$SRCDIR" "$DBDIR"
install_template "mysql/90-ncp.cnf.sh" "/etc/mysql/mariadb.conf.d/90-ncp.cnf"
service mysql start
restore_maintenance_mode
}
install(){ :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,180 @@
#!/bin/bash
# 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!
#
# More at https://ownyourbits.com/2017/03/13/nextcloudpi-gets-nextcloudpi-config/
#
is_active()
{
local SRCDIR
SRCDIR="$( grep datadirectory /var/www/nextcloud/config/config.php | awk '{ print $3 }' | grep -oP "[^']*[^']" | head -1 )" || return 1
[[ "$SRCDIR" != "/var/www/nextcloud/data" ]]
}
install()
{
apt_install btrfs-progs
}
tmpl_opcache_dir() {
DATADIR="$(get_nc_config_value datadirectory || find_app_param nc-datadir DATADIR)"
echo -n "${DATADIR}/.opcache"
#[[ $( stat -fc%d / ) == $( stat -fc%d "$DATADIR" ) ]] && echo "/tmp" || echo "${DATADIR}/.opcache"
}
tmpl_tmp_upload_dir() {
DATADIR="$(get_nc_config_value datadirectory || find_app_param nc-datadir DATADIR)"
echo -n "${DATADIR}/tmp"
}
create_opcache_dir() {
OPCACHE_DIR="$(tmpl_opcache_dir)"
mkdir -p "$OPCACHE_DIR"
chown -R www-data:www-data "$OPCACHE_DIR"
if [[ "$(stat -fc%T "${BASEDIR}")" == "btrfs" ]]
then
chattr -R +C "$OPCACHE_DIR"
fi
}
create_tmp_upload_dir() {
UPLOAD_DIR="$(tmpl_tmp_upload_dir)"
mkdir -p "${UPLOAD_DIR}"
chown www-data:www-data "${UPLOAD_DIR}"
if [[ "$(stat -fc%T "${BASEDIR}")" == "btrfs" ]]
then
chattr +C "${UPLOAD_DIR}"
fi
}
configure()
{
set -e -o pipefail
shopt -s dotglob # includes dot files
## CHECKS
local SRCDIR BASEDIR ENCDIR
SRCDIR=$( get_nc_config_value datadirectory ) || {
echo -e "Error reading data directory. Is NextCloud running and configured?";
return 1;
}
[ -d "${SRCDIR?}" ] || { echo -e "data directory $SRCDIR not found"; return 1; }
[[ "$SRCDIR" == "${DATADIR?}" ]] && { echo -e "INFO: data already there"; return 0; }
[[ "$SRCDIR" == "${DATADIR}"/data ]] && { echo -e "INFO: data already there"; return 0; }
BASEDIR="${DATADIR}"
# If the user chooses the root of the mountpoint, force a folder
mountpoint -q "${BASEDIR?}" && {
BASEDIR="${BASEDIR}"/ncdata
}
mkdir -p "${BASEDIR}"
BASEDIR="$(cd "${BASEDIR}" && pwd -P)" # resolve symlinks and use the real path
DATADIR="${BASEDIR}"/data
ENCDIR="${BASEDIR}"/ncdata_enc
# checks
[[ "$DISABLE_FS_CHECK" == 1 ]] || [[ "$(stat -fc%T "${BASEDIR}")" =~ ext|btrfs|zfs ]] || {
echo -e "Only ext/btrfs/zfs filesystems can hold the data directory (found '$(stat -fc%T "${BASEDIR}")')"
return 1
}
sudo -u www-data test -x "${BASEDIR}" || {
echo -e "ERROR: the user www-data does not have access permissions over ${BASEDIR}"
return 1
}
# backup possibly existing datadir
[ -d "${BASEDIR}" ] && {
rmdir "${BASEDIR}" &>/dev/null || {
local BKP="${BASEDIR}-$(date "+%m-%d-%y.%s")"
echo "INFO: ${BASEDIR} is not empty. Creating backup ${BKP?}"
mv "${BASEDIR}" "${BKP}"
}
mkdir -p "${BASEDIR}"
}
## COPY
cd /var/www/nextcloud
[[ "$BUILD_MODE" == 1 ]] || save_maintenance_mode
echo "moving data directory from ${SRCDIR} to ${DATADIR}..."
# use subvolumes, if BTRFS
[[ "$(stat -fc%T "${BASEDIR}")" == "btrfs" ]] && ! is_docker && {
echo "BTRFS filesystem detected"
rmdir "${BASEDIR}"
btrfs subvolume create "${BASEDIR}"
}
# use encryption, if selected
if is_active_app nc-encrypt; then
# if we have encryption AND BTRFS, then store ncdata_enc in the subvolume
mv "$(dirname "${SRCDIR}")"/ncdata_enc "${ENCDIR?}"
mkdir "${DATADIR}" && mount --bind "${SRCDIR}" "${DATADIR}"
mkdir "$(dirname "${SRCDIR}")"/ncdata_enc && mount --bind "${ENCDIR}" "$(dirname "${SRCDIR}")"/ncdata_enc
else
mv "${SRCDIR}" "${DATADIR}"
fi
chown www-data: "${DATADIR}"
# datadir
ncc config:system:set datadirectory --value="${DATADIR}" \
|| sed -i "s|'datadirectory' =>.*|'datadirectory' => '${DATADIR}',|" "${NCDIR?}"/config/config.php
ncc config:system:set logfile --value="${DATADIR}/nextcloud.log" \
|| sed -i "s|'logfile' =>.*|'logfile' => '${DATADIR}/nextcloud.log',|" "${NCDIR?}"/config/config.php
set_ncpcfg datadir "${DATADIR}"
# tmp upload dir
create_tmp_upload_dir
ncc config:system:set tempdirectory --value "$DATADIR/tmp" \
|| sed -i "s|'tempdirectory' =>.*|'tempdirectory' => '${DATADIR}/tmp',|" "${NCDIR?}"/config/config.php
sed -i "s|^;\?upload_tmp_dir =.*$|upload_tmp_dir = ${DATADIR}/tmp|" /etc/php/"${PHPVER?}"/cli/php.ini
sed -i "s|^;\?upload_tmp_dir =.*$|upload_tmp_dir = ${DATADIR}/tmp|" /etc/php/"${PHPVER}"/fpm/php.ini
sed -i "s|^;\?sys_temp_dir =.*$|sys_temp_dir = ${DATADIR}/tmp|" /etc/php/"${PHPVER}"/fpm/php.ini
# opcache dir
create_opcache_dir
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER}/mods-available/opcache.ini"
# update fail2ban logpath
[[ -f /etc/fail2ban/jail.local ]] && \
sed -i "s|logpath =.*nextcloud.log|logpath = ${DATADIR}/nextcloud.log|" /etc/fail2ban/jail.local
[[ "$BUILD_MODE" == 1 ]] || restore_maintenance_mode
(
. "${BINDIR?}/SYSTEM/metrics.sh"
reload_metrics_config || {
echo 'WARN: There was an issue reloading ncp metrics. This might not affect your installation,
but keep it in mind if there is an issue with metrics.'
true
}
)
echo "The NC data directory has been moved successfully."
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -1,32 +1,28 @@
#!/bin/bash
# HTTPS rewrite configuration script for NextCloudPi
# Tested with 2017-03-02-raspbian-jessie-lite.img
# 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!
#
# Usage:
#
# ./installer.sh nc-httpsonly.sh <IP> (<img>)
#
# See installer.sh instructions for details
#
# More at https://ownyourbits.com/2017/03/13/nextcloudpi-gets-nextcloudpi-config/
#
ACTIVE_=yes
DESCRIPTION="Force HTTPS"
configure()
{
[[ $ACTIVE_ == "no" ]] && local OPT=Off || local OPT=On
sed -i "s|RewriteEngine .*|RewriteEngine $OPT|" /etc/apache2/sites-available/000-default.conf
service apache2 reload
[[ -f /.ncp-image ]] && return 0
if [[ $ACTIVE == "no" ]]; then
local opt=Off
else
local opt=On
fi
sed -i "s|RewriteEngine .*|RewriteEngine $opt|" /etc/apache2/sites-available/000-default.conf
apachectl -k graceful
echo "Forcing HTTPS $opt"
}
install() { :; }
cleanup() { :; }
# License
#

248
bin/ncp/CONFIG/nc-init.sh Normal file
View File

@ -0,0 +1,248 @@
#!/bin/bash
# Init NextCloud database and perform initial 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!
#
# More at https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/
#
DBADMIN=ncadmin
configure()
{
echo "Setting up a clean Nextcloud instance... wait until message 'NC init done'"
# checks
local REDISPASS=$( grep "^requirepass" /etc/redis/redis.conf | cut -d' ' -f2 )
[[ "$REDISPASS" == "" ]] && { echo "redis server without a password. Abort"; return 1; }
## RE-CREATE DATABASE TABLE
echo "Setting up database..."
# launch mariadb if not already running
if ! [[ -f /run/mysqld/mysqld.pid ]]; then
echo "Starting mariaDB"
mysqld &
local db_pid=$!
fi
# wait for mariadb
while :; do
[[ -S /run/mysqld/mysqld.sock ]] && break
sleep 0.5
done
sleep 1
# workaround to emulate DROP USER IF EXISTS ..;)
local DBPASSWD=$( grep password /root/.my.cnf | sed 's|password=||' )
mysql <<EOF
DROP DATABASE IF EXISTS nextcloud;
CREATE DATABASE nextcloud
CHARACTER SET utf8mb4
COLLATE utf8mb4_general_ci;
GRANT USAGE ON *.* TO '$DBADMIN'@'localhost' IDENTIFIED BY '$DBPASSWD';
DROP USER '$DBADMIN'@'localhost';
CREATE USER '$DBADMIN'@'localhost' IDENTIFIED BY '$DBPASSWD';
GRANT ALL PRIVILEGES ON nextcloud.* TO $DBADMIN@localhost;
EXIT
EOF
## INITIALIZE NEXTCLOUD
# make sure redis is running first
REDISPASS="$( grep "^requirepass" /etc/redis/redis.conf | cut -f2 -d' ' )"
if ! pgrep -c redis-server &>/dev/null; then
mkdir -p /var/run/redis
mkdir -p /var/log/
chown redis /var/run/redis
sudo -u redis redis-server /etc/redis/redis.conf > /var/log/redis.log 2>&1 &
redis_pid=$!
for i in {1..5}
do
if redis-cli -s //var/run/redis/redis.sock -a "$REDISPASS" ping | grep PONG
then
break
else
if [[ $i -ge 5 ]]
then
echo "FAILED TO START REDIS"
cat /var/log/redis.log /var/log/redis/redis-server.log
return 1
fi
fi
sleep 3
done
fi
while :; do
[[ -S /run/redis/redis.sock ]] && break
sleep 0.5
done
echo "Setting up Nextcloud..."
cd /var/www/nextcloud/
rm -f config/config.php
ncc maintenance:install --database \
"mysql" --database-name "nextcloud" --database-user "$DBADMIN" --database-pass \
"$DBPASSWD" --admin-user "$ADMINUSER" --admin-pass "$ADMINPASS"
# cron jobs
ncc background:cron
# redis cache
sed -i '$d' config/config.php
cat >> config/config.php <<EOF
'memcache.local' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => '/var/run/redis/redis.sock',
'port' => 0,
'timeout' => 0.0,
'password' => '$REDISPASS',
),
);
EOF
# tmp upload dir
local UPLOADTMPDIR=/var/www/nextcloud/data/tmp
mkdir -p "$UPLOADTMPDIR"
chown www-data:www-data "$UPLOADTMPDIR"
ncc config:system:set tempdirectory --value "$UPLOADTMPDIR"
sed -i "s|^;\?upload_tmp_dir =.*$|upload_tmp_dir = $UPLOADTMPDIR|" /etc/php/${PHPVER}/cli/php.ini
sed -i "s|^;\?upload_tmp_dir =.*$|upload_tmp_dir = $UPLOADTMPDIR|" /etc/php/${PHPVER}/fpm/php.ini
sed -i "s|^;\?sys_temp_dir =.*$|sys_temp_dir = $UPLOADTMPDIR|" /etc/php/${PHPVER}/fpm/php.ini
# 4 Byte UTF8 support
ncc config:system:set mysql.utf8mb4 --type boolean --value="true"
ncc config:system:set trusted_domains 7 --value="nextcloudpi"
ncc config:system:set trusted_domains 5 --value="nextcloudpi.local"
ncc config:system:set trusted_domains 8 --value="nextcloudpi.lan"
ncc config:system:set trusted_domains 3 --value="nextcloudpi.lan"
# email
ncc config:system:set mail_smtpmode --value="sendmail"
ncc config:system:set mail_smtpauthtype --value="LOGIN"
ncc config:system:set mail_from_address --value="noreply"
ncc config:system:set mail_domain --value="nextcloudpi.com"
# Fix NCP theme
[[ -e /usr/local/etc/logo ]] && {
local ID=$( grep instanceid config/config.php | awk -F "=> " '{ print $2 }' | sed "s|[,']||g" )
[[ "$ID" == "" ]] && { echo "failed to get ID"; return 1; }
local theming_base_path="data/appdata_${ID}/theming/global/images"
mkdir -p "${theming_base_path}"
cp /usr/local/etc/background "${theming_base_path}/"
cp /usr/local/etc/logo "${theming_base_path}/logo"
cp /usr/local/etc/logo "${theming_base_path}/logoheader"
chown -R www-data:www-data "data/appdata_${ID}"
}
mysql nextcloud <<EOF
replace into ${DB_PREFIX}appconfig values ( 'theming', 'name' , "NextCloudPi" , 2, 0);
replace into ${DB_PREFIX}appconfig values ( 'theming', 'slogan' , "keep your data close" , 2, 0);
replace into ${DB_PREFIX}appconfig values ( 'theming', 'url' , "https://nextcloudpi.com" , 2, 0);
replace into ${DB_PREFIX}appconfig values ( 'theming', 'logoMime' , "image/svg+xml" , 2, 0);
replace into ${DB_PREFIX}appconfig values ( 'theming', 'backgroundMime', "image/png" , 2, 0);
EOF
# NCP app
cp -r /var/www/ncp-app /var/www/nextcloud/apps/nextcloudpi
chown -R www-data: /var/www/nextcloud/apps/nextcloudpi
ncc app:enable nextcloudpi
# enable some apps by default
ncc app:install calendar
ncc app:enable calendar
ncc app:install contacts
ncc app:enable contacts
ncc app:install notes
ncc app:enable notes
ncc app:install tasks
ncc app:enable tasks
# we handle this ourselves
ncc app:disable updatenotification
# Not supported in Nextcloudpi without manual setup
ncc app:disable app_api
# ncp-previewgenerator
local ncver
ncver="$(ncc status 2>/dev/null | grep "version:" | awk '{ print $3 }')"
if is_more_recent_than "21.0.0" "${ncver}"; then
local ncprev=/var/www/ncp-previewgenerator/ncp-previewgenerator-nc20
else
ncc app:install notify_push
ncc app:enable notify_push
test -f /.ncp-image || start_notify_push # don't start during build
local ncprev=/var/www/ncp-previewgenerator/ncp-previewgenerator-nc21
fi
ln -snf "${ncprev}" /var/www/nextcloud/apps/previewgenerator
chown -R www-data: /var/www/nextcloud/apps/previewgenerator
ncc app:enable previewgenerator
# previews
ncc config:app:set previewgenerator squareSizes --value="32 256"
ncc config:app:set previewgenerator widthSizes --value="256 384"
ncc config:app:set previewgenerator heightSizes --value="256"
ncc config:system:set preview_max_x --value 2048
ncc config:system:set preview_max_y --value 2048
ncc config:system:set jpeg_quality --value 60
ncc config:app:set preview jpeg_quality --value="60"
# other
ncc config:system:set overwriteprotocol --value=https
ncc config:system:set overwrite.cli.url --value="https://nextcloudpi/"
# bash completion for ncc
apt_install bash-completion
ncc _completion -g --shell-type bash -p ncc | sed 's|/var/www/nextcloud/occ|ncc|g' > /usr/share/bash-completion/completions/ncp
echo ". /etc/bash_completion" >> /etc/bash.bashrc
echo ". /usr/share/bash-completion/completions/ncp" >> /etc/bash.bashrc
# TODO temporary workaround for https://github.com/nextcloud/server/pull/13358
ncc -n db:convert-filecache-bigint
ncc db:add-missing-indices
ncc maintenance:repair --include-expensive
# Default trusted domain (only from ncp-config)
test -f /usr/local/bin/nextcloud-domain.sh && {
test -f /.ncp-image || bash /usr/local/bin/nextcloud-domain.sh
}
# dettach mysql during the build
if [[ "${db_pid}" != "" ]]; then
echo "Shutting down mariaDB (${db_pid})"
mysqladmin -u root shutdown
wait "${db_pid}"
fi
echo "NC init done"
}
install(){ :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

117
bin/ncp/CONFIG/nc-limits.sh Normal file
View File

@ -0,0 +1,117 @@
#!/bin/bash
# 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!
#
# More at https://ownyourbits.com/2017/03/13/nextcloudpi-gets-nextcloudpi-config/
#
get_total_mem() {
local total_mem="$(free -b | sed -n 2p | awk '{ print $2 }')"
local MAX_32BIT=4096000000
if [[ "$ARCH" == 'armv7' ]] && [[ $MAX_32BIT -lt "$total_mem" ]]
then
echo "$MAX_32BIT"
else
echo "$total_mem"
fi
}
tmpl_innodb_buffer_pool_size() {
local TOTAL_MEM="$(get_total_mem)"
# DATABASE MEMORY (25%)
local AUTOMEM=$(( TOTAL_MEM * 25 / 100 ))
# Maximum MySQL Memory Usage = innodb_buffer_pool_size + key_buffer_size + (read_buffer_size + sort_buffer_size) X max_connections
# leave 16MiB for key_buffer_size and a bit more
AUTOMEM=$(( AUTOMEM - (16 + 32) * 1024 * 1024 ))
echo -n "$AUTOMEM"
}
tmpl_php_max_memory() {
local TOTAL_MEM="$( get_total_mem )"
local MEMORYLIMIT="$(find_app_param nc-limits MEMORYLIMIT)"
[[ "$MEMORYLIMIT" == "0" ]] && echo -n "$(( TOTAL_MEM * 75 / 100 ))" || echo -n "$MEMORYLIMIT"
}
tmpl_php_max_filesize() {
local FILESIZE="$(find_app_param nc-limits MAXFILESIZE)"
[[ "$FILESIZE" == "0" ]] && echo -n "10G" || echo -n "$FILESIZE"
}
tmpl_php_threads() {
local TOTAL_MEM="$( get_total_mem )"
local PHPTHREADS="$(find_app_param nc-limits 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()
{
# Set auto memory limit to 75% of the total memory
local TOTAL_MEM="$( get_total_mem )"
# special case of 32bit emulation (e.g. 32bit-docker on 64bit hardware)
file /bin/bash | grep 64-bit > /dev/null || TOTAL_MEM="$(( 1024 * 1024 * 1024 * 4 ))"
local AUTOMEM=$(( TOTAL_MEM * 75 / 100 ))
# MAX FILESIZE
# MAX PHP MEMORY
local require_fpm_restart=false
local CONF=/etc/php/${PHPVER}/fpm/conf.d/90-ncp.ini
local CONF_VALUE="$(cat "$CONF" 2> /dev/null || true)"
echo "Using $(tmpl_php_max_memory) for PHP max memory"
install_template "php/90-ncp.ini.sh" "$CONF"
[[ "$CONF_VALUE" == "$(cat "$CONF")" ]] || require_fpm_restart=true
# MAX PHP THREADS
local CONF=/etc/php/${PHPVER}/fpm/pool.d/www.conf
CONF_VALUE="$(cat "$CONF" 2> /dev/null || true)"
echo "Using $(tmpl_php_threads) PHP threads"
install_template "php/pool.d.www.conf.sh" "$CONF"
[[ "$CONF_VALUE" == "$(cat "$CONF")" ]] || require_fpm_restart=true
local CONF=/etc/mysql/mariadb.conf.d/91-ncp.cnf
CONF_VALUE="$(cat "$CONF" 2> /dev/null || true)"
install_template "mysql/91-ncp.cnf.sh" "$CONF"
[[ "$CONF_VALUE" == "$(cat "$CONF")" ]] || service mariadb restart
# RESTART PHP
[[ "$require_fpm_restart" != "true" ]] || {
bash -c "sleep 3; source /usr/local/etc/library.sh; clear_opcache; service php${PHPVER}-fpm restart" &>/dev/null &
}
# redis max memory
local CONF=/etc/redis/redis.conf
local CURRENT_REDIS_MEM="$( grep "^maxmemory" "$CONF" | awk '{ print $2 }' )"
[[ "$REDISMEM" == "$CURRENT_REDIS_MEM" ]] || {
sed -i "s|^maxmemory .*|maxmemory $REDISMEM|" "$CONF"
chown redis:redis "$CONF"
service redis-server restart
}
}
install() { :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,309 @@
#!/bin/bash
# Nextcloud installation on Raspbian over LAMP base
#
# 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!
#
# More at https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/
#
DBADMIN=ncadmin
REDIS_MEM=3gb
APTINSTALL="apt-get install -y --no-install-recommends"
export DEBIAN_FRONTEND=noninteractive
tmpl_max_transfer_time()
{
find_app_param nc-nextcloud MAXTRANSFERTIME
}
install()
{
# During build, this step is run before ncp.sh. Avoid executing twice
[[ -f /usr/lib/systemd/system/nc-provisioning.service ]] && return 0
# Optional packets for Nextcloud and Apps
apt-get update
$APTINSTALL lbzip2 iputils-ping jq wget
# NOTE: php-smbclient in sury but not in Debian sources, we'll use the binary version
# https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/external_storage/smb.html
$APTINSTALL -t $RELEASE smbclient exfat-fuse exfatprogs # for external storage
$APTINSTALL -t $RELEASE exfat-fuse exfatprogs # for external storage
$APTINSTALL -t $RELEASE php${PHPVER}-exif # for gallery
$APTINSTALL -t $RELEASE php${PHPVER}-bcmath # for LDAP
$APTINSTALL -t $RELEASE php${PHPVER}-gmp # for bookmarks
#$APTINSTALL -t imagemagick php${PHPVER}-imagick ghostscript # for gallery
# POSTFIX
$APTINSTALL postfix || {
# [armbian] workaround for bug - https://bugs.launchpad.net/ubuntu/+source/postfix/+bug/1531299
echo "[NCP] Please, ignore the previous postfix installation error ..."
mv /usr/bin/newaliases /
ln -s /bin/true /usr/bin/newaliases
$APTINSTALL postfix
rm /usr/bin/newaliases
mv /newaliases /usr/bin/newaliases
}
$APTINSTALL redis-server
$APTINSTALL -t $RELEASE php${PHPVER}-redis
local REDIS_CONF=/etc/redis/redis.conf
local REDISPASS="default"
sed -i "s|# unixsocket .*|unixsocket /var/run/redis/redis.sock|" $REDIS_CONF
sed -i "s|# unixsocketperm .*|unixsocketperm 770|" $REDIS_CONF
sed -i "s|# requirepass .*|requirepass $REDISPASS|" $REDIS_CONF
sed -i 's|# maxmemory-policy .*|maxmemory-policy allkeys-lru|' $REDIS_CONF
sed -i 's|# rename-command CONFIG ""|rename-command CONFIG ""|' $REDIS_CONF
sed -i "s|^port.*|port 0|" $REDIS_CONF
echo "maxmemory $REDIS_MEM" >> $REDIS_CONF
if [[ "$ARMBIAN_BUILD" == "yes" ]]
then
echo "ignore-warnings ARM64-COW-BUG" >> $REDIS_CONF
fi
echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf
if is_lxc; then
# Otherwise it fails to start in Buster LXC container
mkdir -p /etc/systemd/system/redis-server.service.d
cat > /etc/systemd/system/redis-server.service.d/lxc_fix.conf <<'EOF'
[Service]
ReadOnlyDirectories=
EOF
systemctl daemon-reload
fi
chown redis: "$REDIS_CONF"
usermod -a -G redis www-data
service redis-server restart
update-rc.d redis-server enable
clear_opcache
# NC service workers
cat > /etc/systemd/system/nextcloud-ai-worker@.service <<'EOF'
[Unit]
Description=Nextcloud AI worker %i
After=network.target
[Service]
ExecStart=php occ background-job:worker -t 60 'OC\\TaskProcessing\\SynchronousBackgroundJob'
Restart=always
StartLimitInterval=60
StartLimitBurst=10
WorkingDirectory=/var/www/nextcloud
User=www-data
[Install]
WantedBy=multi-user.target
EOF
# service to randomize passwords on first boot
mkdir -p /usr/lib/systemd/system
cat > /usr/lib/systemd/system/nc-provisioning.service <<'EOF'
[Unit]
Description=Randomize passwords on first boot
Requires=network.target
After=mysql.service redis.service
[Service]
ExecStart=/bin/bash /usr/local/bin/ncp-provisioning.sh
[Install]
WantedBy=multi-user.target
EOF
[[ "$DOCKERBUILD" != 1 ]] && systemctl enable nc-provisioning
return 0
}
configure()
{
## DOWNLOAD AND (OVER)WRITE NEXTCLOUD
cd /var/www/
local URL="https://download.nextcloud.com/server/${PREFIX}releases/nextcloud-$VER.tar.bz2"
echo "Downloading Nextcloud $VER..."
wget -q "$URL" -O nextcloud.tar.bz2 || {
echo "couldn't download $URL"
return 1
}
rm -rf nextcloud
echo "Installing Nextcloud $VER..."
tar -xf nextcloud.tar.bz2
rm nextcloud.tar.bz2
## CONFIGURE FILE PERMISSIONS
local ocpath='/var/www/nextcloud'
local htuser='www-data'
local htgroup='www-data'
local rootuser='root'
printf "Creating possible missing Directories\n"
mkdir -p $ocpath/data
mkdir -p $ocpath/updater
printf "chmod Files and Directories\n"
find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750
printf "chown Directories\n"
chown -R ${htuser}:${htgroup} ${ocpath}/
chown -R ${htuser}:${htgroup} ${ocpath}/apps/
chown -R ${htuser}:${htgroup} ${ocpath}/config/
chown -R ${htuser}:${htgroup} ${ocpath}/data/
chown -R ${htuser}:${htgroup} ${ocpath}/themes/
chown -R ${htuser}:${htgroup} ${ocpath}/updater/
chmod +x ${ocpath}/occ
printf "chmod/chown .htaccess\n"
if [ -f ${ocpath}/.htaccess ]; then
chmod 0644 ${ocpath}/.htaccess
chown ${htuser}:${htgroup} ${ocpath}/.htaccess
fi
if [ -f ${ocpath}/data/.htaccess ]; then
chmod 0644 ${ocpath}/data/.htaccess
chown ${htuser}:${htgroup} ${ocpath}/data/.htaccess
fi
# create and configure opcache dir
local OPCACHEDIR="$(
# shellcheck disable=SC2015
[ -f "${BINDIR}/CONFIG/nc-datadir.sh" ] && { source "${BINDIR}/CONFIG/nc-datadir.sh"; tmpl_opcache_dir; } || true
)"
if [[ -z "${OPCACHEDIR}" ]]
then
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER}/mods-available/opcache.ini" --defaults
else
mkdir -p "$OPCACHEDIR"
chown -R www-data:www-data "$OPCACHEDIR"
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER}/mods-available/opcache.ini"
fi
## RE-CREATE DATABASE TABLE
# launch mariadb if not already running (for docker build)
if ! [[ -f /run/mysqld/mysqld.pid ]]; then
echo "Starting mariaDB"
mysqld &
local db_pid=$!
fi
while :; do
[[ -S /var/run/mysqld/mysqld.sock ]] && break
sleep 0.5
done
echo "Setting up database..."
# workaround to emulate DROP USER IF EXISTS ..;)
local DBPASSWD=$( grep password /root/.my.cnf | sed 's|password=||' )
mysql <<EOF
DROP DATABASE IF EXISTS nextcloud;
CREATE DATABASE nextcloud
CHARACTER SET utf8mb4
COLLATE utf8mb4_general_ci;
GRANT USAGE ON *.* TO '$DBADMIN'@'localhost' IDENTIFIED BY '$DBPASSWD';
DROP USER '$DBADMIN'@'localhost';
CREATE USER '$DBADMIN'@'localhost' IDENTIFIED BY '$DBPASSWD';
GRANT ALL PRIVILEGES ON nextcloud.* TO $DBADMIN@localhost;
EXIT
EOF
## SET APACHE VHOST
echo "Setting up Apache..."
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 001-nextcloud
cat > /etc/apache2/sites-available/000-default.conf <<'EOF'
<VirtualHost _default_:80>
DocumentRoot /var/www/nextcloud
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^.well-known/acme-challenge/ - [L]
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
</IfModule>
<Directory /var/www/nextcloud/>
Options +FollowSymlinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
LimitRequestBody 0
</Directory>
</VirtualHost>
EOF
# for notify_push app in NC21
a2enmod proxy proxy_http proxy_wstunnel
arch="$(uname -m)"
[[ "${arch}" =~ "armv7" ]] && arch="armv7"
install_template systemd/notify_push.service.sh /etc/systemd/system/notify_push.service
[[ -f /.docker-image ]] || systemctl enable notify_push
# some added security
sed -i 's|^ServerSignature .*|ServerSignature Off|' /etc/apache2/conf-enabled/security.conf
sed -i 's|^ServerTokens .*|ServerTokens Prod|' /etc/apache2/conf-enabled/security.conf
echo "Setting up system..."
## SET LIMITS
cat > /etc/php/${PHPVER}/fpm/conf.d/90-ncp.ini <<EOF
; disable .user.ini files for performance and workaround NC update bugs
user_ini.filename =
; from Nextcloud .user.ini
upload_max_filesize=$MAXFILESIZE
post_max_size=$MAXFILESIZE
memory_limit=$MEMORYLIMIT
mbstring.func_overload=0
always_populate_raw_post_data=-1
default_charset='UTF-8'
output_buffering=0
; slow transfers will be killed after this time
max_execution_time=$MAXTRANSFERTIME
max_input_time=$MAXTRANSFERTIME
EOF
## SET CRON
echo "*/5 * * * * php -f /var/www/nextcloud/cron.php" > /tmp/crontab_http
crontab -u www-data /tmp/crontab_http
rm /tmp/crontab_http
# dettach mysql during the build
if [[ "${db_pid}" != "" ]]; then
echo "Shutting down mariaDB (${db_pid})"
mysqladmin -u root shutdown
wait "${db_pid}"
fi
echo "Don't forget to run nc-init"
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,56 @@
#!/bin/bash
# Change password for the ncp-web user
#
# 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!
#
# More at: https://ownyourbits.com
#
configure()
{
# update password
echo -e "$PASSWORD\n$CONFIRM" | passwd ncp &>/dev/null && \
echo "password updated successfully" || \
{ echo "passwords do not match"; return 1; }
# persist ncp-web password in docker container
[[ -f /.docker-image ]] && {
mv /etc/shadow /data/etc/shadow
ln -s /data/etc/shadow /etc/shadow
}
# activate NCP
if ! is_ncp_activated; then
# Run cron.php once now to get all checks right in CI.
sudo -u www-data php /var/www/nextcloud/cron.php
a2dissite ncp-activation
a2ensite ncp 001-nextcloud
apachectl -k graceful
sed -i -e 's/^NCP is not activated yet.*$//' /etc/issue
# Trusted Domain (local/public IP), also configures notify_push
bash /usr/local/bin/nextcloud-domain.sh
fi
}
install() { :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,63 @@
#!/bin/bash
#
# Activate/deactivate a pretty URL without index.php
#
#
# Copyleft 2018 by Timo Stiefel and xxx
# GPL licensed (see end of file) * Use at your own risk!
install() { :; }
isactive()
{
local REWRITEBASE
REWRITEBASE="$( grep RewriteBase /var/www/nextcloud/.htaccess )" || return 1
[[ $REWRITEBASE != 1 ]]
}
configure()
{
# make sure overwrite.cli.url end with a '/'
local URL
URL="$(ncc config:system:get overwrite.cli.url)"
[[ "${URL: -1}" != "/" ]] && ncc config:system:set overwrite.cli.url --value="${URL}/"
if [[ $ACTIVE != "yes" ]]; then
ncc config:system:set htaccess.RewriteBase --value=""
ncc maintenance:update:htaccess
[[ $? -ne 0 ]] && {
echo "There has been an error."
return 1
}
echo "Your cloud does no longer have a pretty domain name."
else
ncc config:system:set htaccess.RewriteBase --value="/"
ncc maintenance:update:htaccess
[[ $? -ne 0 ]] && {
echo "There has been an error."
return 1
}
echo "Your cloud now has a pretty domain name."
fi
apachectl -k graceful
return 0
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,74 @@
#!/bin/bash
# Periodically generate previews for the gallery
#
# Copyleft 2019 by Timo Stiefel and Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
# GPL licensed (see end of file) * Use at your own risk!
#
isactive()
{
[[ -f "/etc/cron.d/nc-previews-auto" ]]
}
configure()
{
[[ "$ACTIVE" != "yes" ]] && {
rm -f /etc/cron.d/nc-previews-auto
service cron restart
echo "Automatic preview generation disabled"
return 0
}
grep -qP "^\d+$" <<<"$RUNTIME" || { echo "Invalid RUNTIME value $RUNTIME"; return 1; }
RUNTIME=$((RUNTIME*60))
echo "0 2 * * * root /usr/local/bin/nc-previews" > /etc/cron.d/nc-previews-auto
chmod 644 /etc/cron.d/nc-previews-auto
cat > /usr/local/bin/nc-previews <<EOF
#!/bin/bash
echo -e "\n[ nc-previews-auto ]" >> /var/log/ncp.log
(
for i in \$(seq 1 \$(nproc)); do
ionice -c3 nice -n20 /usr/local/bin/ncc preview:pre-generate -n -vvv &
done
wait
) 2>&1 >>/var/log/ncp.log &
PID=\$!
[[ "$RUNTIME" != 0 ]] && {
for i in \$(seq 1 1 $RUNTIME); do
sleep 1
kill -0 "\$PID" &>/dev/null || break
done
pkill -f preview:pre-generate
pkill -f preview:generate-all
}
wait "\$PID"
EOF
chmod +x /usr/local/bin/nc-previews
service cron restart
echo "Automatic preview generation enabled"
return 0
}
install() { :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,79 @@
#!/bin/bash
# Periodically synchronize NextCloud for externally modified files
#
# 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!
#
# More at: https://ownyourbits.com
#
configure()
{
[[ $ACTIVE != "yes" ]] && {
rm -f /etc/cron.d/ncp-scan-auto
service cron restart
echo "automatic scans disabled"
return 0
}
# set crontab
local days hour mins
days=$(( SCANINTERVAL / 1440 ))
if [[ "$days" != "0" ]]; then
days="*/$days" hour="1" mins="15"
else
days="*"
hour=$(( SCANINTERVAL / 60 ))
mins=$(( SCANINTERVAL % 60 ))
mins="*/$mins"
[[ $hour == 0 ]] && hour="*" || { hour="*/$hour" mins="15"; }
fi
[[ "$RECURSIVE" == no ]] && local recursive=--shallow
[[ "$NONEXTERNAL" == yes ]] && local non_external=--home-only
cat > /usr/local/bin/ncp-scan-auto <<EOF
#!/bin/bash
(
echo -e "\n[ nc-scan-auto ]"
[[ "$PATH1" != "" ]] && /usr/local/bin/ncc files:scan $recursive $non_external -n -p "$PATH1"
[[ "$PATH2" != "" ]] && /usr/local/bin/ncc files:scan $recursive $non_external -n -p "$PATH2"
[[ "$PATH3" != "" ]] && /usr/local/bin/ncc files:scan $recursive $non_external -n -p "$PATH3"
[[ "${PATH1}${PATH2}${PATH3}" == "" ]] && /usr/local/bin/ncc files:scan $recursive $non_external -n --all
) 2>&1 >>/var/log/ncp.log
EOF
chmod +x /usr/local/bin/ncp-scan-auto
echo "${mins} ${hour} ${days} * * root /usr/local/bin/ncp-scan-auto" > /etc/cron.d/ncp-scan-auto
chmod 644 /etc/cron.d/ncp-scan-auto
service cron restart
echo "automatic scans enabled"
}
install() { :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,37 @@
#!/bin/bash
# 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!
#
# More at https://ownyourbits.com/
#
configure()
{
[[ "$DOMAIN1" != "" ]] && ncc config:system:set trusted_domains 20 --value="$DOMAIN1"
[[ "$DOMAIN2" != "" ]] && ncc config:system:set trusted_domains 21 --value="$DOMAIN2"
[[ "$DOMAIN3" != "" ]] && ncc config:system:set trusted_domains 22 --value="$DOMAIN3"
return 0
}
install(){ :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,49 @@
#!/bin/bash
# Periodically synchronize NextCloud for externally modified files
#
# 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!
#
# More at: https://ownyourbits.com
#
is_active()
{
a2query -s ncp &>/dev/null
}
configure()
{
if [[ $ACTIVE != "yes" ]]; then
a2dissite ncp
echo "ncp-web disabled"
else
a2ensite ncp
echo "ncp-web enabled"
fi
# delayed in bg so it does not kill the connection, and we get AJAX response
bash -c "sleep 2 && service apache2 reload" &>/dev/null &
}
install() { :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,7 @@
#!/bin/bash
# Configure various settings for community participation
install() { :; }
configure() { :; }

64
bin/ncp/NETWORKING/NFS.sh Normal file
View File

@ -0,0 +1,64 @@
#!/bin/bash
# NFS server for Raspbian
#
# 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!
#
# More at: https://ownyourbits.com
#
install()
{
apt-get update
apt-get install --no-install-recommends -y nfs-kernel-server
systemctl disable nfs-kernel-server
systemctl mask nfs-blkmap
}
configure()
{
[[ $ACTIVE != "yes" ]] && {
service nfs-kernel-server stop
systemctl disable nfs-kernel-server
echo -e "NFS disabled"
return
}
# CHECKS
################################
id "$USER" &>/dev/null || { echo "user $USER does not exist" ; return 1; }
id -g "$GROUP" &>/dev/null || { echo "group $GROUP does not exist"; return 1; }
[ -d "$DIR" ] || { echo -e "INFO: directory $DIR does not exist. Creating"; mkdir -p "$DIR"; }
[[ $( stat -fc%d / ) == $( stat -fc%d $DIR ) ]] && \
echo -e "INFO: mounting a in the SD card\nIf you want to use an external mount, make sure it is properly set up"
# CONFIG
################################
cat > /etc/exports <<EOF
$DIR $SUBNET(rw,sync,all_squash,anonuid=$(id -u $USER),anongid=$(id -g $GROUP),no_subtree_check)
EOF
systemctl enable rpcbind
systemctl enable nfs-kernel-server
service nfs-kernel-server restart
echo -e "NFS enabled"
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

118
bin/ncp/NETWORKING/SSH.sh Normal file
View File

@ -0,0 +1,118 @@
#!/bin/bash
# Activate/deactivate SSH
#
#
# Copyleft 2017 by Courtney Hicks and Ignacio Nunez Hernanz
# GPL licensed (see end of file) * Use at your own risk!
#
install() {
apt-get update
apt-get install -y --no-install-recommends openssh-server
if grep '^PermitRootLogin' /etc/ssh/sshd_config
then
sed -i -e 's/^PermitRootLogin.*$/PermitRootLogin prohibit-password/' /etc/ssh/sshd_config
else
echo 'PermitRootLogin prohibit-password' >> /etc/ssh/sshd_config
fi
systemctl reload ssh
}
is_active()
{
systemctl -q is-enabled ssh &>/dev/null
}
configure()
{
[[ "$ACTIVE" != "yes" ]] && {
systemctl stop ssh
systemctl disable ssh
echo "SSH disabled"
return 0
}
# Check for bad ideas
[[ "${USER,,}" == "pi" ]] && [[ "${PASS,,}" == "raspberry" ]] && {
echo "Refusing to use the default Raspbian user and password. It's insecure"
return 1
}
[[ "${USER,,}" == "root" ]] && {
echo "Refusing to use the root user for SSH. It's insecure"
return 1
}
# Disallow the webadmin to be used for SSH
[[ "${USER,,}" == "ncp" ]] && {
echo "The webadmin is not allowed to be used, pick another username"
return 1
}
# --force: exit successfully if the group already exists
groupadd --force ncp-ssh
# Change or create credentials
if id "$USER" &>/dev/null
then
usermod --append --groups ncp-ssh "$USER"
echo "$USER exists, changing password"
echo -e "$PASS\n$CONFIRM" | passwd "$USER" || return 1
# Unlocks the user if previously locked
# This one needs to be after passwd becuase it will fail
# if the user didn't have a password set when the account was locked
usermod --unlock --expiredate -1 "$USER"
else
echo "Creating $USER & setting password"
useradd --create-home --home-dir /home/"$USER" --shell /bin/bash --groups ncp-ssh "$USER" || return 1
echo -e "$PASS\n$CONFIRM" | passwd "$USER" || return 1
fi
# Get the current users of the group to an array
mapfile -d ',' -t GROUP_USERS < <(awk -F':' '/ncp-ssh/{printf $4}' /etc/group)
if [[ "${#GROUP_USERS[@]}" -gt 0 ]]
then
# Loop through each user in the group
for U in "${GROUP_USERS[@]}"
do
# Test if extra users exists in the group
if [[ "$U" != "$USER" ]]
then
echo "Disabling user '$U'..."
# Locks any extra accounts
usermod --lock --expiredate 1 "$U"
fi
done
fi
# Unsets the group array variable (cleanup)
unset GROUP_USERS
[[ "$SUDO" == "yes" ]] && {
usermod --append --groups sudo "$USER"
echo "Enabled sudo for $USER"
}
# Enable
systemctl enable ssh
systemctl start ssh
echo "SSH enabled"
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,111 @@
#!/bin/bash
# dnsmasq DNS server with cache installation on Raspbian
#
# 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!
#
# More at: https://ownyourbits.com/2017/03/09/dnsmasq-as-dns-cache-server-for-nextcloudpi-and-raspbian/
#
install()
{
set -x
apt-get update
apt-get install --no-install-recommends -y dnsmasq
sleep 10
rc=0
service dnsmasq status > /dev/null 2>&1 || rc=$?
if [[ $rc -eq 3 ]] && ! [[ "$INIT_SYSTEM" =~ ^("chroot"|"unknown")$ ]]
then
echo "Applying workaround for dnsmasq bug (compare issue #1446)"
mkdir -p /etc/systemd/resolved.conf.d
if systemctl status systemd-resolved
then
cat <<EOF > /etc/systemd/resolved.conf.d/nostublistener.conf
[Resolve]
DNSStubListener=no
EOF
[[ "$INIT_SYSTEM" != "systemd" ]] || systemctl restart systemd-resolved
elif systemctl status resolvconf
then
systemctl stop resolvconf
systemctl start dnsmasq
systemctl status dnsmasq
else
echo "dnsmasq failed to start and no workaround could be found. This means, the installer failed."
false
fi
# service systemd-resolved stop || true
systemctl start dnsmasq
systemctl status dnsmasq
fi
service dnsmasq stop
if [[ "$INIT_SYSTEM" == "systemd" ]] && systemctl list-unit-files resolvconf.service
then
systemctl start resolvconf
fi
update-rc.d dnsmasq disable || rm /etc/systemd/system/multi-user.target.wants/dnsmasq.service
return 0
}
configure()
{
[[ $ACTIVE != "yes" ]] && {
service dnsmasq stop
update-rc.d dnsmasq disable
echo "dnmasq disabled"
return
}
local IFACE IP
IFACE=$( ip r | grep "default via" | awk '{ print $5 }' | head -1 )
IP=$( ncc config:system:get trusted_domains 6 | grep -oP '\d{1,3}(.\d{1,3}){3}' )
[[ "$IP" == "" ]] && IP="$(get_ip)"
[[ "$IP" == "" ]] && { echo "could not detect IP"; return 1; }
cat > /etc/dnsmasq.conf <<EOF
interface=$IFACE
domain-needed # Never forward plain names (without a dot or domain part)
bogus-priv # Never forward addresses in the non-routed address spaces.
no-poll # Don't poll for changes in /etc/resolv.conf
no-resolv # Don't use /etc/resolv.conf or any other file
cache-size=$CACHESIZE
server=$DNSSERVER
address=/$DOMAIN/$IP # This is optional if we add it to /etc/hosts
EOF
# required to run in container
test -d /data && echo "user=root" >> /etc/dnsmasq.conf
sed -i 's|#\?IGNORE_RESOLVCONF=.*|IGNORE_RESOLVCONF=yes|' /etc/default/dnsmasq
update-rc.d dnsmasq defaults
update-rc.d dnsmasq enable
service dnsmasq restart
ncc config:system:set trusted_domains 2 --value="$DOMAIN"
set-nc-domain "$DOMAIN" --no-trusted-domain
echo "dnsmasq enabled"
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,71 @@
#!/bin/bash
# DuckDNS installation on Raspbian for NextcloudPi
#
#
# Copyleft 2017 by Courtney Hicks
# GPL licensed (see end of file) * Use at your own risk!
#
INSTALLDIR=duckdns
INSTALLPATH=/usr/local/etc/$INSTALLDIR
CRONFILE=/etc/cron.d/duckdns
configure()
{
local DOMAIN="$( sed 's|.duckdns.org||' <<<"$DOMAIN" )"
if [[ $ACTIVE == "yes" ]]; then
mkdir -p "$INSTALLPATH"
# Creates duck.sh script that checks for updates to DNS records
touch "$INSTALLPATH"/duck.sh
touch "$INSTALLPATH"/duck.log
echo -e "echo url=\"https://www.duckdns.org/update?domains=$DOMAIN&token=$TOKEN&ip=\" | curl -k -o "$INSTALLPATH"/duck.log -K -" > "$INSTALLPATH"/duck.sh
# Adds file to cron to run script for DNS record updates and change permissions
touch $CRONFILE
echo "*/5 * * * * root $INSTALLPATH/duck.sh >/dev/null 2>&1" > "$CRONFILE"
chmod 700 "$INSTALLPATH"/duck.sh
chmod 644 "$CRONFILE"
# First-time execution of duck script
"$INSTALLPATH"/duck.sh > /dev/null 2>&1
SUCCESS="$( cat $INSTALLPATH/duck.log )"
# Checks for successful run of duck.sh
if [[ $SUCCESS == "OK" ]]; then
echo "DuckDNS is enabled"
elif [[ $SUCCESS == "KO" ]]; then
echo "DuckDNS install failed, is your information correct?"
fi
# Removes config files and cron job if ACTIVE_ is set to no
elif [[ $ACTIVE == "no" ]]; then
rm -f "$CRONFILE"
rm -f "$INSTALLPATH"/duck.sh
rm -f "$INSTALLPATH"/duck.log
rmdir "$INSTALLPATH"
echo "DuckDNS is now disabled"
fi
}
install() { :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,65 @@
#!/bin/bash
# FreeDNS updater client installation on Raspbian
#
# Copyleft 2017 by Panteleimon Sarantos <pantelis.fedora _a_t_ gmail _d_o_t_ com>
# GPL licensed (see end of file) * Use at your own risk!
#
install()
{
apt-get update
apt-get install --no-install-recommends -y dnsutils
}
configure()
{
local updateurl=https://freedns.afraid.org/dynamic/update.php
local url="${updateurl}?${UPDATEHASH}"
[[ $ACTIVE != "yes" ]] && {
rm -f /etc/cron.d/freeDNS
service cron restart
echo "FreeDNS client is disabled"
return 0
}
cat > /usr/local/bin/freedns.sh <<EOF
#!/bin/bash
echo "FreeDNS client started"
echo "${url}"
registeredIP=\$(dig +short "$DOMAIN"|tail -n1)
currentIP=\$(wget -q -O - http://checkip.dyndns.org|sed s/[^0-9.]//g)
[ "\$currentIP" != "\$registeredIP" ] && {
wget -q -O /dev/null ${url}
}
echo "Registered IP: \$registeredIP | Current IP: \$currentIP"
EOF
chmod +744 /usr/local/bin/freedns.sh
echo "*/${UPDATEINTERVAL} * * * * root /bin/bash /usr/local/bin/freedns.sh" > /etc/cron.d/freeDNS
chmod 644 /etc/cron.d/freeDNS
service cron restart
set-nc-domain "$DOMAIN"
echo "FreeDNS client is enabled"
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,179 @@
#!/bin/bash
# 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!
#
# More at https://ownyourbits.com/2017/03/17/lets-encrypt-installer-for-apache/
ncdir=/var/www/nextcloud
nc_vhostcfg=/etc/apache2/sites-available/001-nextcloud.conf
ncp_vhostcfg=/etc/apache2/sites-available/ncp.conf
letsencrypt=/usr/bin/letsencrypt
is_active()
{
[[ "${ACTIVE}" == "yes" ]] && [[ $( find /etc/letsencrypt/live/ -maxdepth 0 -empty | wc -l ) == 0 ]]
}
tmpl_letsencrypt_domain() {
(
. /usr/local/etc/library.sh
if is_active_app letsencrypt; then
find_app_param letsencrypt DOMAIN
fi
)
}
install()
{
cd /etc || return 1
apt-get update
apt-get install --no-install-recommends -y letsencrypt
rm -f /etc/cron.d/certbot
mkdir -p /etc/letsencrypt/live
is_docker && {
# execute before lamp stack
cat > /etc/services-available.d/009letsencrypt <<EOF
#!/bin/bash
source /usr/local/etc/library.sh
persistent_cfg /etc/letsencrypt
exit 0
EOF
chmod +x /etc/services-available.d/009letsencrypt
}
return 0
}
configure()
{
[[ "${ACTIVE}" != "yes" ]] && {
rm -rf /etc/letsencrypt/live/*
rm -f /etc/cron.weekly/letsencrypt-ncp
rm -f /etc/letsencrypt/renewal-hooks/deploy/ncp
[[ "$DOCKERBUILD" == 1 ]] && update-rc.d letsencrypt disable
install_template nextcloud.conf.sh "${nc_vhostcfg}"
local cert_path="$(grep SSLCertificateFile "${nc_vhostcfg}" | awk '{ print $2 }')"
local key_path="$(grep SSLCertificateKeyFile "${nc_vhostcfg}" | awk '{ print $2 }')"
sed -i "s|SSLCertificateFile.*|SSLCertificateFile ${cert_path}|" "${ncp_vhostcfg}"
sed -i "s|SSLCertificateKeyFile.*|SSLCertificateKeyFile ${key_path}|" "${ncp_vhostcfg}"
apachectl -k graceful
echo "letsencrypt certificates disabled. Using self-signed certificates instead."
exit 0
}
local DOMAIN_LOWERCASE="${DOMAIN,,}"
[[ "$DOMAIN" == "" ]] && { echo "empty domain"; return 1; }
local IFS_BK="$IFS"
# Do it
local domain_string=""
for domain in "${DOMAIN}" "${OTHER_DOMAIN}"; do
[[ "$domain" != "" ]] && {
[[ $domain_string == "" ]] && \
domain_string+="${domain}" || \
domain_string+=",${domain}"
}
done
"${letsencrypt}" certonly -n --cert-name "${DOMAIN}" --force-renew --no-self-upgrade --webroot -w "${ncdir}" \
--hsts --agree-tos -m "${EMAIL}" -d "${domain_string}" && {
# Set up auto-renewal
cat > /etc/cron.weekly/letsencrypt-ncp <<EOF
#!/bin/bash
source /usr/local/etc/library.sh
# renew and notify
$letsencrypt renew --quiet
# notify if fails
[[ \$? -ne 0 ]] && notify_admin \
"SSL renewal error" \
"SSL certificate renewal failed. See /var/log/letsencrypt/letsencrypt.log"
# cleanup
rm -rf $ncdir/.well-known
EOF
chmod 755 /etc/cron.weekly/letsencrypt-ncp
mkdir -p /etc/letsencrypt/renewal-hooks/deploy
cat > /etc/letsencrypt/renewal-hooks/deploy/ncp <<EOF
#!/bin/bash
source /usr/local/etc/library.sh
notify_admin \
"SSL renewal" \
"Your SSL certificate(s) \$RENEWED_DOMAINS has been renewed for another 90 days"
exit 0
EOF
chmod +x /etc/letsencrypt/renewal-hooks/deploy/ncp
# Configure Apache
install_template nextcloud.conf.sh "${nc_vhostcfg}"
local cert_path="$(grep SSLCertificateFile "${nc_vhostcfg}" | awk '{ print $2 }')"
local key_path="$(grep SSLCertificateKeyFile "${nc_vhostcfg}" | awk '{ print $2 }')"
sed -i "s|SSLCertificateFile.*|SSLCertificateFile ${cert_path}|" "${ncp_vhostcfg}"
sed -i "s|SSLCertificateKeyFile.*|SSLCertificateKeyFile ${key_path}|" "${ncp_vhostcfg}"
# Configure Nextcloud
local domain_index=11
for dom in $DOMAIN "${OTHER_DOMAINS_ARRAY[@]}"; do
[[ "$dom" != "" ]] && {
[[ $domain_index -lt 20 ]] || {
echo "WARN: $dom will not be included in trusted domains for Nextcloud (maximum reached)." \
"It will still be included in the SSL certificate"
continue
}
ncc config:system:set trusted_domains "$domain_index" --value="$dom"
((domain_index++))
}
done
set-nc-domain "$DOMAIN"
apachectl -k graceful
rm -rf $ncdir/.well-known
# Update configuration
is_docker && update-rc.d letsencrypt enable
return 0
}
rm -rf $ncdir/.well-known
return 1
}
cleanup()
{
apt-get purge -y \
augeas-lenses \
libpython-dev \
libpython2.7-dev \
libssl-dev \
python-dev \
python2.7-dev \
python-pip-whl
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,73 @@
#!/bin/bash
# Namecheap DNS updater client installation on Raspbian
#
# Copyleft 2020 by ndunks and Huizerd
# GPL licensed (see end of file) * Use at your own risk!
#
# Based on:
# - https://gist.github.com/ndunks/c756030c0757b667c9a478c97ca5a9b7
# - https://www.namecheap.com/support/knowledgebase/article.aspx/29/11/how-do-i-use-a-browser-to-dynamically-update-the-hosts-ip
#
# Further steps to be taken:
# - Buying a Namecheap domain
# - https://www.namecheap.com/support/knowledgebase/article.aspx/595/11/how-do-i-enable-dynamic-dns-for-a-domain/
# - https://www.namecheap.com/support/knowledgebase/article.aspx/43/11/how-do-i-set-up-a-host-for-dynamic-dns
install()
{
apt-get update
apt-get install --no-install-recommends -y dnsutils
}
configure()
{
local updateurl=https://dynamicdns.park-your-domain.com/update
local url="${updateurl}?host=${HOST}&domain=${DOMAIN}&password=${PASSWORD}"
[[ $ACTIVE != "yes" ]] && {
rm -f /etc/cron.d/namecheapDNS
service cron restart
echo "Namecheap DNS client is disabled"
return 0
}
cat > /usr/local/bin/namecheapdns.sh <<EOF
#!/bin/bash
echo "Namecheap DNS client started"
registeredIP=\$(dig +short "$FULLDOMAIN"|tail -n1)
currentIP=\$(wget -q -O - http://checkip.dyndns.org|sed s/[^0-9.]//g)
echo "${url}&ip=${currentIP}"
[ "\$currentIP" != "\$registeredIP" ] && {
wget -q -O /dev/null "${url}&ip=${currentIP}"
}
echo "Registered IP: \$registeredIP | Current IP: \$currentIP"
EOF
chmod +744 /usr/local/bin/namecheapdns.sh
echo "*/${UPDATEINTERVAL} * * * * root /bin/bash /usr/local/bin/namecheapdns.sh" > /etc/cron.d/namecheapDNS
chmod 644 /etc/cron.d/namecheapDNS
service cron restart
set-nc-domain "$FULLDOMAIN"
echo "Namecheap DNS client is enabled"
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,46 @@
#!/bin/bash
# Use uPnP to forward router ports 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!
#
# More at: https://ownyourbits.com
#
install()
{
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends miniupnpc
}
configure()
{
local ip
ip="$(get_ip)"
upnpc -d "$HTTPSPORT" TCP
upnpc -d "$HTTPPORT" TCP
upnpc -a "$ip" 443 "$HTTPSPORT" TCP | tee >(cat - >&2) | grep -q "is redirected to internal" || \
{ echo -e "\nCould not forward ports automatically.\nDo it manually, or activate UPnP in your router and try again"; return 1; }
upnpc -a "$ip" 80 "$HTTPPORT" TCP | tee >(cat - >&2) | grep -q "is redirected to internal" || \
{ echo -e "\nCould not forward ports automatically.\nDo it manually, or activate UPnP in your router and try again"; return 1; }
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,113 @@
#!/bin/bash
# Enable static IP or DHCP for Raspbian
#
# 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!
#
# More at: https://ownyourbits.com
#
configure()
{
local GW="$( ip r | grep "default via" | awk '{ print $3 }' | head -1 )"
local DNS="$( grep nameserver /etc/resolv.conf | head -1 | awk '{ print $2 }' )"
[[ "$DNS" == "" ]] && DNS="$GW"
local IFACE="$( ip r | grep "default via" | awk '{ print $5 }' | head -1 )"
[[ "$IFACE" == "" ]] && { echo "Couldn't find default interface"; exit 1; }
## DHCPCD
[[ -f /etc/dhcpcd.conf ]] && {
# delete NCP config
grep -q "^# NextCloudPi autogenerated" /etc/dhcpcd.conf && \
sed -i '/^# NextCloudPi autogenerated/,+6d' /etc/dhcpcd.conf
[[ $ACTIVE != "yes" ]] && {
systemctl restart dhcpcd
echo "DHCP enabled"
return
}
cat >> /etc/dhcpcd.conf <<EOF
# NextCloudPi autogenerated
# don't modify! better use ncp-config
interface $IFACE
static ip_address=$IP/24
static routers=$GW
static domain_name_servers=$DNS
# Local loopback
auto lo
iface lo inet loopback
EOF
systemctl restart dhcpcd
} || {
## NETWORK MANAGER
cp -n /etc/network/interfaces /etc/network/interfaces-ncp-backup-orig
[[ $ACTIVE != "yes" ]] && {
cat > /etc/network/interfaces <<EOF
# Wired adapter #1
allow-hotplug $IFACE
no-auto-down $IFACE
auto $IFACE
iface $IFACE inet dhcp
# Local loopback
auto lo
iface lo inet loopback
EOF
ifdown "${IFACE}"
ifup "${IFACE}"
echo "DHCP enabled"
return
}
cat > /etc/network/interfaces <<EOF
# ncp-config generated
source /etc/network/interfaces.d/*
# Local loopback
auto lo
iface lo inet loopback
# Interface $IFACE
auto $IFACE
allow-hotplug $IFACE
iface $IFACE inet static
address $IP
netmask 255.255.255.0
gateway $GW
dns-nameservers $DNS 8.8.8.8
EOF
pkill dhclient
ifdown "${IFACE}"
ifup "${IFACE}"
}
ncc config:system:set trusted_domains 1 --value="$IP"
set-nc-domain "${IP}"
echo "Static IP set to $IP"
}
install() { :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,37 @@
#!/bin/bash
# Manually add trusted proxies in NextcloudPi
#
# Copyleft 2019 by Pascal Haefliger <45995338+paschaef_a_t_users_d_o_t_noreply_d_o_tgithub_d_o_t_com>
# GPL licensed (see end of file) * Use at your own risk!
#
#
configure()
{
[[ "$PROXY1" != "" ]] && ncc config:system:set trusted_proxies 0 --value="$PROXY1"
[[ "$PROXY2" != "" ]] && ncc config:system:set trusted_proxies 1 --value="$PROXY2"
[[ "$PROXY3" != "" ]] && ncc config:system:set trusted_proxies 2 --value="$PROXY3"
exit 0
}
install(){ :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -1,32 +1,25 @@
#!/bin/bash
# no-ip.org installation on Raspbian
# Tested with 2017-03-02-raspbian-jessie-lite.img
# no-ip.org 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!
#
# Usage:
#
# ./installer.sh no-ip.sh <IP> (<img>)
#
# See installer.sh instructions for details
#
# More at https://ownyourbits.com/2017/03/05/dynamic-dns-for-raspbian-with-no-ip-org-installer/
#
ACTIVE_=yes
USER_=my-noip-user@email.com
PASS_=noip-pass
TIME_=30
DESCRIPTION="Free Dynamic DNS provider (need account)"
install()
{
mkdir /tmp/noip && cd /tmp/noip
wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz
tar vzxf noip-duc-linux.tar.gz
cd -; cd $OLDPWD/noip-*
apt-get update
apt-get install --no-install-recommends -y make gcc libc-dev
local TEMPDIR="$( mktemp -d /tmp/noip.XXXXXX )"
cd "$TEMPDIR"
wget -O- --content-disposition https://github.com/nachoparker/noip-DDNS/archive/master/latest.tar.gz \
| tar -xz \
|| return 1
cd -; cd "$OLDPWD"/noip-DDNS-master/
make
cp noip2 /usr/local/bin/
@ -44,26 +37,62 @@ install()
### END INIT INFO
EOF
cat debian.noip2.sh >> /etc/init.d/noip2
cat debian.noip2.sh >> /etc/init.d/noip2
chmod +x /etc/init.d/noip2
cd -
rm -r /tmp/noip
rm -r "$TEMPDIR"
update-rc.d noip2 defaults
update-rc.d noip2 disable
mkdir -p /usr/local/etc/noip2
[[ "$DOCKERBUILD" == 1 ]] && {
cat > /etc/services-available.d/100noip <<EOF
#!/bin/bash
source /usr/local/etc/library.sh
[[ "\$1" == "stop" ]] && {
echo "stopping noip..."
service noip2 stop
exit 0
}
configure()
{
[[ $ACTIVE_ == "no" ]] && { service noip2 stop; update-rc.d noip2 disable; return; }
persistent_cfg /usr/local/etc/noip2 /data/etc/noip2
/usr/local/bin/noip2 -C -c /usr/local/etc/no-ip2.conf -U $TIME_ -u $USER_ -p $PASS_
update-rc.d noip2 defaults
echo "Starting noip..."
service noip2 start
exit 0
EOF
chmod +x /etc/services-available.d/100noip
}
return 0
}
configure()
{
service noip2 stop
[[ $ACTIVE != "yes" ]] && { update-rc.d noip2 disable; return 0; }
local IF=$( ip -br l | awk '{ if ( $2 == "UP" ) print $1 }' | head -1 )
[[ "$IF" != "" ]] && IF="-I $IF"
/usr/local/bin/noip2 -C -c /usr/local/etc/no-ip2.conf $IF -U "$TIME" -u "$USER" -p "$PASS" 2>&1 | tee >(cat - >&2) \
| grep -q "New configuration file .* created" || return 1
update-rc.d noip2 enable
service noip2 restart
set-nc-domain "$DOMAIN"
echo "noip DDNS enabled"
}
cleanup()
{
rm -f /home/pi/.bash_history
systemctl disable ssh
apt-get purge -y make gcc libc-dev
}
# License

132
bin/ncp/NETWORKING/samba.sh Normal file
View File

@ -0,0 +1,132 @@
#!/bin/bash
# SAMBA server for Raspbian
#
# 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!
#
# More at: https://ownyourbits.com
#
install()
{
apt-get update
apt-get install --no-install-recommends -y samba
update-rc.d smbd disable
update-rc.d nmbd disable
# the directory needs to be recreated if we are using nc-ramlogs
grep -q mkdir /etc/init.d/smbd || sed -i "/\<start)/amkdir -p /var/log/samba" /etc/init.d/smbd
# disable SMB1 and SMB2
grep -q SMB3 /etc/samba/smb.conf || sed -i '/\[global\]/aprotocol = SMB3' /etc/samba/smb.conf
# disable the [homes] share by default
sed -i /\[homes\]/s/homes/homes_disabled_ncp/ /etc/samba/smb.conf
cat >> /etc/samba/smb.conf <<EOF
# NextCloudPi automatically generated from here. Do not remove this comment
EOF
}
configure()
{
[[ $ACTIVE != "yes" ]] && {
service smbd stop
update-rc.d smbd disable
update-rc.d nmbd disable
echo "SMB disabled"
return
}
# CHECKS
################################
local DATADIR
DATADIR=$( get_nc_config_value datadirectory ) || {
echo -e "Error reading data directory. Is NextCloud running and configured?";
return 1;
}
[ -d "$DATADIR" ] || { echo -e "data directory $DATADIR not found" ; return 1; }
# CONFIG
################################
# remove files from this line to the end
sed -i '/# NextCloudPi automatically/,/\$/d' /etc/samba/smb.conf
# restore this line
cat >> /etc/samba/smb.conf <<EOF
# NextCloudPi automatically generated from here. Do not remove this comment
EOF
# create a share per Nextcloud user
local USERS=()
while read -r path; do
USERS+=( "$( basename "$(dirname "$path")" )" )
done < <( ls -d "$DATADIR"/*/files )
for user in "${USERS[@]}"; do
# Exclude users not matching group filter (if enabled)
if [[ -n "$FILTER_BY_GROUP" ]] \
&& [[ -z "$(ncc user:info "$user" --output=json | jq ".groups[] | select( . == \"${FILTER_BY_GROUP}\" )")" ]]
then
echo "Omitting user $user (not in group ${FILTER_BY_GROUP})...";
continue;
fi
echo "adding SAMBA share for user $user"
local DIR="$DATADIR/$user/files"
[ -d "$DIR" ] || { echo -e "INFO: directory $DIR does not exist."; return 1; }
cat >> /etc/samba/smb.conf <<EOF
[ncp-$user]
path = $DIR
writeable = yes
; browseable = yes
valid users = $user
force user = www-data
force group = www-data
create mask = 0770
directory mask = 0771
force create mode = 0660
force directory mode = 0770
EOF
## create user with no login if it doesn't exist
id "$user" &>/dev/null || adduser --disabled-password --force-badname --gecos "" "$user" || return 1
echo -e "$PWD\n$PWD" | smbpasswd -s -a "${user}"
usermod -aG www-data "${user}"
sudo chmod g+w "${DIR}"
done
update-rc.d smbd defaults
update-rc.d smbd enable
service smbd restart
update-rc.d nmbd enable
service nmbd restart
echo "SMB enabled"
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

130
bin/ncp/NETWORKING/spDYN.sh Normal file
View File

@ -0,0 +1,130 @@
#!/bin/bash
# spDYN setup for NextcloudPi
#
#
# Copyleft 2017/2018 by Timm Goldenstein and Timo Stiefel
# https://github.com/TimmThaler/spdnsUpdater
#
# GPL licensed (see end of file) * Use at your own risk!
#
INSTALLDIR=spdnsupdater
INSTALLPATH=/usr/local/etc/$INSTALLDIR
CRONFILE=/etc/cron.d/spdnsupdater
install()
{
# Create the spdnsUpdater.sh
mkdir -p "$INSTALLPATH"
# Write the script to file
cat > "$INSTALLPATH"/spdnsUpdater.sh <<'EOF'
#!/bin/bash
### Usage
#
# Recommended usage: ./spdnsUpdater.sh <hostname> <token>
# Alternative usage: ./spdnsUpdater.sh <hostname> <user> <passwd> (not implemented)
#
### Configuration
HOST=$1
TOKEN=$2
# Get current IP address from
get_ip_url="http://checkip.spdyn.de"
update_url="https://update.spdyn.de/nic/update"
### Update procedure
function spdnsUpdater {
# Send the current IP address to spdyn.de
# and show the response
params=$1
updater=$(wget -qO- --post-data $params $update_url)
updater=$(echo $updater | grep -o '^[a-z]*')
case "$updater" in
abuse) echo "[$updater] Der Host kann nicht aktualisiert werden, da er aufgrund vorheriger fehlerhafter Updateversuche gesperrt ist."
;;
badauth) echo "[$updater] Ein ungültiger Benutzername und / oder ein ungültiges Kennwort wurde eingegeben."
;;
good) echo "[$updater] Die Hostname wurde erfolgreich auf die neue IP aktualisiert."
;;
yours) echo "[$updater] Der angegebene Host kann nicht unter diesem Benutzer-Account verwendet werden."
;;
notfqdn) echo "[$updater] Der angegebene Host ist kein FQDN."
;;
numhost) echo "[$updater] Es wurde versucht, mehr als 20 Hosts in einer Anfrage zu aktualisieren."
;;
nochg) echo "[$updater] Die IP hat sich zum letzten Update nicht geändert."
;;
nohost) echo "[$updater] Der angegebene Host existiert nicht oder wurde gelöscht."
;;
fatal) echo "[$updater] Der angegebene Host wurde manuell deaktiviert."
;;
*) echo "[$updater]"
;;
esac
}
# Get registered IP address
registered_ip=$(dig +short "$HOST"|tail -n1)
# Get current IP address
current_ip=$(wget -qO- "$get_ip_url");
# Update only when IP address has changed.
[ "\$current_ip" == "\$registered_ip" ] && {
return 0
}
params="hostname=$HOST&myip=$current_ip&user=$HOST&pass=$TOKEN"
spdnsUpdater "$params"
EOF
chmod 700 "$INSTALLPATH"/spdnsUpdater.sh
chmod a+x "$INSTALLPATH"/spdnsUpdater.sh
}
configure()
{
if [[ $ACTIVE == "yes" ]]; then
# Adds file to cron to run script for DNS record updates and change permissions
touch $CRONFILE
echo "10 * * * * root $INSTALLPATH/spdnsUpdater.sh $DOMAIN $TOKEN >/dev/null 2>&1" > "$CRONFILE"
chmod 644 "$CRONFILE"
# First-time execution of update script and print response from spdns.de server
"$INSTALLPATH"/spdnsUpdater.sh "$DOMAIN" "$TOKEN"
echo -e "\nspdnsUpdater is now enabled"
# Removes config files and cron job if ACTIVE_ is set to no
elif [[ $ACTIVE == "no" ]]; then
echo "... removing cronfile: $CRONFILE"
rm -f "$CRONFILE"
echo -e "\nspdnsUpdater is now disabled"
fi
service cron restart
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

77
bin/ncp/SECURITY/UFW.sh Normal file
View File

@ -0,0 +1,77 @@
#!/bin/bash
# Uncomplicated Firewall
#
# 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!
#
# More at https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/
#
install()
{
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ufw
systemctl disable ufw
# Disable logging to kernel
grep -q maxsize /etc/logrotate.d/ufw || sed -i '/weekly/amaxsize 2M' /etc/logrotate.d/ufw
return 0
}
configure()
{
[[ "$ACTIVE" != yes ]] && {
ufw --force reset
systemctl disable ufw
systemctl stop ufw
echo "UFW disabled"
return 0
}
ufw --force enable
systemctl enable ufw
systemctl start ufw
echo -e "\n# web server rules"
ufw allow $HTTP/tcp
ufw allow $HTTPS/tcp
ufw allow 4443/tcp
echo -e "\n# SSH rules"
ufw allow $SSH
echo -e "\n# DNS rules"
ufw allow dns
echo -e "\n# SAMBA rules"
ufw allow samba
echo -e "\n# NFS rules"
ufw allow nfs
echo -e "\n# UPnP rules"
ufw allow proto udp from 192.168.0.0/16
echo "UFW enabled"
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,179 @@
#!/bin/bash
# Fail2ban 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!
#
# More at: https://ownyourbits.com/2017/02/24/nextcloudpi-fail2ban-installer/
#
# time to ban an IP that exceeded attempts
# cooldown time for incorrect passwords
# bad attempts before banning an IP
# Option to activate email notifications
# email to send notifications to
install()
{
apt-get update
apt-get install --no-install-recommends -y python3-systemd
apt-get install --no-install-recommends -y fail2ban whois
update-rc.d fail2ban disable
rm -f /etc/fail2ban/jail.d/defaults-debian.conf
# tweak fail2ban email
local F=/etc/fail2ban/action.d/sendmail-common.conf
sed -i 's|Fail2Ban|NextCloudPi|' /etc/fail2ban/action.d/sendmail-whois-lines.conf
grep -q actionstart_ "$F" || sed -i 's|actionstart|actionstart_|' "$F"
grep -q actionstop_ "$F" || sed -i 's|actionstop|actionstop_|' "$F"
}
configure()
{
[[ $ACTIVE != "yes" ]] && {
service fail2ban stop
update-rc.d fail2ban disable
echo "fail2ban disabled"
return
}
local NCLOG="/var/www/nextcloud/data/nextcloud.log"
local NCLOG1="$(ncc config:system:get logfile)"
[[ "$NCLOG1" != "" ]] && NCLOG="$NCLOG1"
local BASEDIR=$( dirname "$NCLOG" )
[ -d "$BASEDIR" ] || { echo -e "directory $BASEDIR not found"; return 1; }
sudo -u www-data touch "$NCLOG" || { echo -e "ERROR: user www-data does not have write permissions on $NCLOG"; return 1; }
ncc config:system:set loglevel --value=2
ncc config:system:set log_type --value=file
# Filters
cat > /etc/fail2ban/filter.d/nextcloud.conf <<'EOF'
[INCLUDES]
before = common.conf
[Definition]
_groupsre = (?:(?:,?\s*"\w+":(?:"[^"]+"|\w+))*)
failregex = ^\{%(_groupsre)s,?\s*"remoteAddr":"<HOST>"%(_groupsre)s,?\s*"message":"Login failed:
datepattern = ,?\s*"time"\s*:\s*"%%Y-%%m-%%d[T ]%%H:%%M:%%S(%%z)?"
ignoreregex =
EOF
cat > /etc/fail2ban/filter.d/ufwban.conf <<'EOF'
[INCLUDES]
before = common.conf
[Definition]
failregex = UFW BLOCK.* SRC=<HOST>
ignoreregex =
EOF
mkdir -p /etc/systemd/system/fail2ban.service.d
cat > /etc/systemd/system/fail2ban.service.d/touch-ufw-log.conf <<'EOF'
[Service]
ExecStartPre=/bin/touch /var/log/ufw.log
EOF
[[ "$MAILALERTS" == "yes" ]] && local ACTION=action_mwl || local ACTION=action_
# Jails
cat > /etc/fail2ban/jail.conf <<EOF
# The DEFAULT allows a global definition of the options. They can be overridden
# in each jail afterwards.
[DEFAULT]
# "ignoreip" can be an IP address, a CIDR mask or a DNS host. Fail2ban will not
# ban a host which matches an address in this list. Several addresses can be
# defined using space separator.
ignoreip = 127.0.0.1/8
# "bantime" is the number of seconds that a host is banned.
bantime = $BANTIME
# A host is banned if it has generated "maxretry" during the last "findtime"
# seconds.
findtime = $FINDTIME
maxretry = $MAXRETRY
#
# ACTIONS
#
banaction = iptables-multiport
protocol = tcp
chain = INPUT
action_ = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
action_mwl = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
sendmail-whois-lines[name=%(__name__)s, dest=$EMAIL, sender=ncp-fail2ban@nextcloudpi.com]
action = %($ACTION)s
#
# SSH
#
[ssh]
enabled = true
port = ssh
filter = sshd
backend = systemd
logpath = /var/log/auth.log
maxretry = $MAXRETRY
#
# HTTP servers
#
[nextcloud]
enabled = true
port = http,https
filter = nextcloud
logpath = $NCLOG
maxretry = $MAXRETRY
backend = auto
#
# UFW
#
[ufwban]
enabled = true
port = ssh, http, https
filter = ufwban
logpath = /var/log/ufw.log
action = ufw
backend = auto
EOF
cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
touch /var/log/ufw.log
update-rc.d fail2ban defaults
update-rc.d fail2ban enable
systemctl daemon-reload
service fail2ban restart
echo "fail2ban enabled"
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -1,73 +1,60 @@
#!/bin/bash
# modsecurity WAF installation on Raspbian
# Tested with 2017-03-02-raspbian-jessie-lite.img
#
# 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!
#
# Usage:
#
# ./installer.sh modsecurity.sh <IP> (<img>)
#
# See installer.sh instructions for details
#
# More at ownyourbits.com
#
ACTIVE_=no
NCDIR_=/var/www/nextcloud/
DESCRIPTION="Web Application Firewall for extra security (experimental)"
install()
{
apt-get update
apt-get install -y --no-install-recommends libapache2-mod-security2 modsecurity-crs
a2dismod security2
# COPY RULES
cd /usr/share/modsecurity-crs/base_rules/
for ruleFile in * ; do sudo ln -s /usr/share/modsecurity-crs/base_rules/$ruleFile /etc/modsecurity/$ruleFile ; done
cd /usr/share/modsecurity-crs/optional_rules/
for ruleFile in * ; do sudo ln -s /usr/share/modsecurity-crs/optional_rules/$ruleFile /etc/modsecurity/$ruleFile ; done
rm /etc/modsecurity/modsecurity_crs_16_session_hijacking.conf # https://github.com/SpiderLabs/owasp-modsecurity-crs/commit/e2fbef4ce89fed0c4dd338002b9a090dd2f6491d
cat >> /etc/modsecurity/crs/crs-setup.conf <<'EOF'
# NextCloudPi: allow PROPFIND for webDAV
SecAction "id:900200, phase:1, nolog, pass, t:none, setvar:'tx.allowed_methods=GET HEAD POST OPTIONS PROPFIND'"
EOF
# CONFIGURE
cp /etc/modsecurity/modsecurity.conf-recommended /etc/modsecurity/modsecurity.conf
sed -i "s|SecRuleEngine .*|SecRuleEngine Off|" /etc/modsecurity/modsecurity.conf
sed -i 's|SecTmpDir .*|SecTmpDir /var/cache/modsecurity/|' /etc/modsecurity/modsecurity.conf
sed -i 's|SecDataDir .*|SecDataDir /var/cache/modsecurity/|' /etc/modsecurity/modsecurity.conf
sed -i 's|^SecRequestBodyLimit .*|#SecRequestBodyLimit 13107200|' /etc/modsecurity/modsecurity.conf
cp /usr/share/modsecurity-crs/modsecurity_crs_10_setup.conf /etc/modsecurity/modsecurity_crs_10_setup.conf
patch /etc/modsecurity/modsecurity_crs_10_setup.conf <<<'66,67c66
< SecDefaultAction "phase:1,deny,log"
< SecDefaultAction "phase:2,deny,log"
---
> SecDefaultAction "phase:2,pass,log"
152c151
< #SecAction \
---
> SecAction \
278c277
< setvar:'\''tx.allowed_methods=GET HEAD POST OPTIONS'\'', \
---
> setvar:'\''tx.allowed_methods=GET HEAD POST OPTIONS PROPFIND'\'', \
280c279
< setvar:'\''tx.allowed_http_versions=HTTP/0.9 HTTP/1.0 HTTP/1.1'\'', \
---
> setvar:'\''tx.allowed_http_versions=HTTP/1.1 HTTP/2.0'\'', \'
# turn modsecurity logs off, too spammy
sed -i 's|SecAuditEngine .*|SecAuditEngine Off|' /etc/modsecurity/modsecurity.conf
cat >> /etc/modsecurity/modsecurity_crs_99_whitelist.conf <<EOF
<Directory $NCDIR_>
cat >> /etc/apache2/apache2.conf <<EOF
<IfModule mod_security2.c>
SecServerSignature " "
</IfModule>
EOF
}
configure()
{
local NCDIR=/var/www/nextcloud/
local NCPWB=/var/www/ncp-web/
cat > /etc/modsecurity/modsecurity_crs_99_whitelist.conf <<EOF
<Directory $NCDIR>
# VIDEOS
SecRuleRemoveById 958291 # Range Header Checks
SecRuleRemoveById 981203 # Correlated Attack Attempt
SecRuleRemoveById 980120 # Correlated Attack Attempt
# PDF
SecRuleRemoveById 950109 # Check URL encodings
SecRuleRemoveById 920230 # Check URL encodings
# ADMIN (webdav)
SecRuleRemoveById 960024 # Repeatative Non-Word Chars (heuristic)
SecRuleRemoveById 981173 # SQL Injection Character Anomaly Usage
SecRuleRemoveById 981204 # Correlated Attack Attempt
SecRuleRemoveById 980130 # Correlated Attack Attempt
SecRuleRemoveById 981243 # PHPIDS - Converted SQLI Filters
SecRuleRemoveById 981245 # PHPIDS - Converted SQLI Filters
SecRuleRemoveById 981246 # PHPIDS - Converted SQLI Filters
@ -78,29 +65,34 @@ cat >> /etc/modsecurity/modsecurity_crs_99_whitelist.conf <<EOF
# COMING BACK FROM OLD SESSION
SecRuleRemoveById 970903 # Microsoft Office document properties leakage
# NOTES APP
SecRuleRemoveById 981401 # Content-Type Response Header is Missing and X-Content-Type-Options is either missing or not set to 'nosniff'
SecRuleRemoveById 200002 # Failed to parse request body
# UPLOADS ( https://github.com/nextcloud/nextcloudpi/issues/959#issuecomment-529150562 )
SecRequestBodyNoFilesLimit 536870912
# GENERAL
SecRuleRemoveById 920350 # Host header is a numeric IP address
# REGISTERED WARNINGS, BUT DID NOT HAVE TO DISABLE THEM
#SecRuleRemoveById 981220 900046 981407
#SecRuleRemoveById 981222 981405 981185 949160
</Directory>
<Directory $NCPWB>
# GENERAL
SecRuleRemoveById 920350 # Host header is a numeric IP address
</Directory>
EOF
cat >> /etc/apache2/apache2.conf <<EOF
<IfModule mod_security2.c>
SecServerSignature " "
</IfModule>
EOF
}
configure()
{
[[ $ACTIVE_ == "yes" ]] && local STATE=On || local STATE=Off
[[ $ACTIVE == "yes" ]] && local STATE=On || local STATE=Off
sed -i "s|SecRuleEngine .*|SecRuleEngine $STATE|" /etc/modsecurity/modsecurity.conf
service apache2 restart
}
[[ $ACTIVE == "yes" ]] && echo "Enabling module security2" || echo "Disabling module security2"
[[ $ACTIVE == "yes" ]] && a2enmod security2 &>/dev/null || a2dismod security2 &>/dev/null
cleanup()
{
apt-get autoremove -y
apt-get clean
rm /var/lib/apt/lists/* -r
rm -f /home/pi/.bash_history
systemctl disable ssh
apachectl -k graceful
}
# License

View File

@ -0,0 +1,86 @@
#!/bin/bash
# Launch security audit reports 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!
#
# More at https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/
#
install()
{
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
lynis debsecan debian-goodies debsums
cp /etc/lynis/default.prf /etc/lynis/ncp.prf
cat >> /etc/lynis/ncp.prf <<EOF
# Won't install apt-listbugs and all its ruby dependencies
skip-test=CUST-0810
# Won't install puppet or similar
skip-test=TOOL-5002
# Raspbian doesn't have security sources ( https://www.raspberrypi.org/forums/viewtopic.php?t=98006&p=680175 )
skip-test=PKGS-7388
# We have a preset partition scheme in the SD card
skip-test=FILE-6310
# We don't use firewire
skip-test=STRG-1846
# We use USB in NCP
skip-test=STRG-1840
# Won't recompile kernel to support auditd
skip-test=ACCT-9628
# Won't be protected against DDOS in self-hosting, will save the resources
skip-test=HTTP-6640
skip-test=HTTP-6641
# False positive about mysql root password ( https://github.com/CISOfy/lynis/issues/288 )
skip-test=DBS-1816
# vmlinuz missing at least in Raspbian
skip-test=KRNL-5788
# won't recompile kernels for PAE NX
skip-test=KRNL-5677
# false positive with DNS settings. We use mDNS and dnsmasq (and they work)
skip-test=NAME-4028
# false positive due to fail2ban
skip-test=FIRE-4513
EOF
}
configure()
{
echo "General security audit"
lynis audit system --profile /etc/lynis/ncp.prf --no-colors
echo "Known vulnerabilities in this system"
debsecan
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,130 @@
#!/bin/bash
# Data at rest encryption for NextcloudPi
#
# Copyleft 2021 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
# GPL licensed (see end of file) * Use at your own risk!
#
# More at: nextcloudpi.com
#
is_active()
{
mount | grep ncdata_enc | grep -q gocryptfs
}
install()
{
apt_install gocryptfs
}
configure()
{
set -e -o pipefail
local datadir parentdir encdir tmpdir
datadir="$(get_ncpcfg datadir)"
[[ "${datadir?}" == "null" ]] && datadir=/var/www/nextcloud/data
parentdir="$(dirname "${datadir}")"
encdir="${parentdir?}/ncdata_enc"
tmpdir="$(mktemp -u -p "${parentdir}" -t nc-data-crypt.XXXXXX)"
[[ "${ACTIVE?}" != "yes" ]] && {
if ! is_active; then
echo "Data not currently encrypted"
return 0
fi
save_maintenance_mode
trap restore_maintenance_mode EXIT
echo "Decrypting data..."
mkdir "${tmpdir?}"
chown www-data: "${tmpdir}"
pkill tail # prevents from umounting in docker
mv "${datadir?}"/* "${datadir}"/.[!.]* "${tmpdir}"
fusermount -u "${datadir}"
rmdir "${datadir}"
mv "${tmpdir}" "${datadir}"
rm "${encdir?}"/gocryptfs.*
rmdir "${encdir}"
echo "Data no longer encrypted"
return
}
if is_active; then
echo "Encrypted data already in use"
return
fi
export PASSWORD
# Just mount already encrypted data
if [[ -f "${encdir?}"/gocryptfs.conf ]]; then
systemctl reset-failed ncp-encrypt 2>/dev/null ||:
systemd-run -u ncp-encrypt -E PASSWORD bash -c "gocryptfs -fg -allow_other -q '${encdir}' '${datadir}' <<<\"\${PASSWORD}\" 2>&1 | sed /^Switch/d |& tee /var/log/ncp-encrypt.log"
# switch to the regular virtual hosts after we decrypt, so we can access NC and ncp-web
a2ensite ncp 001-nextcloud
a2dissite ncp-activation
apache2ctl -k graceful
echo "Encrypted data now accessible"
return
fi
mkdir -p "${encdir?}"
echo "${PASSWORD?}" | gocryptfs -init -q "${encdir}"
save_maintenance_mode
cleanup() {
umount "${datadir}" ||:
[[ -f "${tmpdir}" ]] && {
rm -rf "${datadir?}" ||:
mv "${tmpdir}" "${datadir}"
chown -R www-data:www-data "${datadir}"
}
}
trap cleanup 1
trap restore_maintenance_mode EXIT
mv "${datadir?}" "${tmpdir?}"
mkdir "${datadir}"
systemctl reset-failed ncp-encrypt 2>/dev/null ||:
systemd-run -u ncp-encrypt -E PASSWORD bash -c "gocryptfs -fg -allow_other -q '${encdir}' '${datadir}' <<<\"\${PASSWORD}\" 2>&1 | sed /^Switch/d |& tee /var/log/ncp-encrypt.log"
maxtries=5
while [[ "$(systemctl is-active ncp-encrypt)" != "active" ]] || ! mount | grep -1 "${datadir}"
do
echo "Wating for encryption process to start... (${maxtries})"
sleep 3
maxtries=$((maxtries - 1))
[[ $maxtries -gt 0 ]] || return 1
done
echo "Encrypting data..."
mv "${tmpdir}"/* "${tmpdir}"/.[!.]* "${datadir}"
chown -R www-data: "${datadir}"
rmdir "${tmpdir}"
set_ncpcfg datadir "${datadir}"
echo "Data is now encrypted"
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

262
bin/ncp/SYSTEM/metrics.sh Normal file
View File

@ -0,0 +1,262 @@
#!/bin/bash
is_supported() {
[[ "${DOCKERBUILD:-0}" == 1 ]] && [[ "$(lsb_release -r)" =~ .*10 ]] && return 1
return 0
}
is_active() {
is_supported || return 1
metrics_services status > /dev/null 2>&1 || return 1
# systemctl is-active -q prometheus-node-exporter || return 1
return 0
}
tmpl_metrics_enabled() {
(
. /usr/local/etc/library.sh
local param_active="$(find_app_param metrics.sh ACTIVE)"
[[ "$param_active" == yes ]] || exit 1
)
}
reload_metrics_config() {
is_supported || return 0
install_template ncp-metrics.cfg.sh "/usr/local/etc/ncp-metrics.cfg" || {
echo -e "ERROR while generating ncp-metrics.conf!"
return 1
}
service ncp-metrics-exporter status > /dev/null && {
service ncp-metrics-exporter restart
service ncp-metrics-exporter status > /dev/null 2>&1 || {
rc=$?
echo -e "WARNING: ncp-metrics-exporter failed to start (exit-code $rc)!"
return $rc
}
} || return 0
}
metrics_services() {
cmd="${1?}"
if [[ "$cmd" =~ (start|stop|restart|reload|status) ]]
then
if ! is_docker && [[ "$INIT_SYSTEM" != "systemd" ]]
then
echo "Probably running in chroot. Ignoring 'metrics_services $cmd'..."
return 0
fi
rc1=0
rc2=0
service prometheus-node-exporter "$cmd" || rc1=$?
service ncp-metrics-exporter "$cmd" || rc2=$?
[[ $rc1 > $rc2 ]] && return $rc1
return $rc2
fi
if ! [[ "$cmd" =~ (en|dis)able ]]
then
echo -e "ERROR: Invalid command: metrics_services ${cmd}!"
exit 1
fi
if is_docker
then
rc1=0
rc2=0
update-rc.d ncp-metrics-exporter "$cmd" || rc1=$?
update-rc.d prometheus-node-exporter "$cmd" || rc2=$?
[[ $rc1 > $rc2 ]] && return $rc1
return $rc2
else
systemctl "$cmd" prometheus-node-exporter ncp-metrics-exporter
return $?
fi
}
install() {
# Subshell to return on failure instead of exiting (due to set -e)
(
set -e
set +u
is_supported || {
echo -e "Metrics app is not supported in debian 10 docker containers. Installation will be skipped."
return 0
}
cat > /etc/default/prometheus-node-exporter <<'EOF'
ARGS="--collector.filesystem.ignored-mount-points=\"^/(dev|proc|run|sys|mnt|var/log|var/lib/docker)($|/)\""
EOF
arch="$(uname -m)"
[[ "${arch}" =~ ^"arm" ]] && arch="armv7"
mkdir -p /usr/local/lib/ncp-metrics
wget -qO "/usr/local/lib/ncp-metrics/ncp-metrics-exporter" \
"https://github.com/theCalcaholic/ncp-metrics-exporter/releases/download/v1.1.0/ncp-metrics-exporter-${arch}"
chmod +x /usr/local/lib/ncp-metrics/ncp-metrics-exporter
# Apply fix to init-d-script (https://salsa.debian.org/debian/sysvinit/-/commit/aa40516c)
# Otherwise the init.d scripts of prometheus-node-exporter won't work
# shellcheck disable=SC2016
sed -i 's|status_of_proc "$DAEMON" "$NAME" ${PIDFILE:="-p ${PIDFILE}"}|status_of_proc ${PIDFILE:+-p "$PIDFILE"} "$DAEMON" "$NAME"|' /lib/init/init-d-script
apt-get update --allow-releaseinfo-change
install_with_shadow_workaround -o Dpkg::Options::=--force-confdef -o Dpkg::Options::="--force-confold" prometheus-node-exporter
if is_docker
then
cat > /etc/init.d/ncp-metrics-exporter <<'EOF'
#!/bin/sh
# Generated by sysd2v v0.3 -- http://www.trek.eu.org/devel/sysd2v
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi
### BEGIN INIT INFO
# Provides: ncp-metrics-exporter
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: NCP Metrics Exporter
### END INIT INFO
set -a
NCP_CONFIG_DIR=/usr/local/etc
set +a
NAME=ncp-exporter
DAEMON=/usr/local/lib/ncp-metrics/ncp-metrics-exporter
PIDFILE=/var/run/ncp-metrics-exporter.pid
LOGFILE=/var/log/ncp-metrics.log
START_ARGS="--background --make-pidfile"
EOF
chmod +x /etc/init.d/ncp-metrics-exporter
update-rc.d ncp-metrics-exporter defaults
cat > /etc/services-available.d/101ncp-metrics <<EOF
#!/bin/bash
source /usr/local/etc/library.sh
[[ "\$1" == "stop" ]] && {
echo "stopping prometheus-node-exporter..."
service prometheus-node-exporter stop
echo "done."
echo "stopping ncp-metrics-exporter"
service ncp-metrics-exporter stop
echo "done."
exit 0
}
persistent_cfg /etc/default/prometheus-node-exporter
echo "starting prometheus-node-exporter..."
service prometheus-node-exporter start
[[ -n "\$(pgrep prometheus)" ]] || echo -e "ERROR: prometheus-node-exporter failed to start!"
echo "starting ncp-metrics-exporter
service ncp-metrics-exporter start
EOF
chmod +x /etc/services-available.d/101ncp-metrics
else #=> if not is_docker
cat <<EOF > /etc/systemd/system/ncp-metrics-exporter.service
[Unit]
Description=NCP Metrics Exporter
[Service]
Environment=NCP_CONFIG_DIR=/usr/local/etc
ExecStart=/usr/local/lib/ncp-metrics/ncp-metrics-exporter
SyslogIdentifier=ncp-metrics
Restart=on-failure
RestartSec=30
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
fi
metrics_services stop
metrics_services disable
)
}
configure() {
set +u
if [[ "$ACTIVE" != yes ]]
then
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
}
echo "Disabling and stopping services..."
metrics_services disable
metrics_services stop
echo "done."
else
is_supported || {
echo -e "Metrics app is not supported in debian 10 docker containers. Terminating..."
return 0
}
[[ -n "$USER" ]] || {
echo -e "ERROR: User can not be empty!" >&2
return 1
}
if [[ "$METRICS_SKIP_PASSWORD_CONFIG" != "true" ]]
then
[[ -n "$PASSWORD" ]] || {
echo -e "ERROR: Password can not be empty!" >&2
return 1
}
[[ ${#PASSWORD} -ge 10 ]] || {
echo -e "ERROR: Password must be at least 10 characters long!" >&2
return 1
}
local htpasswd_file="/usr/local/etc/metrics.htpasswd"
rm -f "${htpasswd_file}"
echo "$PASSWORD" | htpasswd -ciB "${htpasswd_file}" "$USER"
fi
echo "Generate config..."
reload_metrics_config
echo "done."
echo "Enabling and starting services..."
metrics_services enable
metrics_services start
metrics_services status || {
echo -e "ERROR: Metrics services not running!"
return 1
}
echo "done."
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
}
echo "Metrics endpoint enabled. You can test it at https://nextcloudpi.local/metrics/system and https://nextcloudpi.local/metrics/ncp (or under your NC domain under the same paths)"
fi
bash -c "sleep 2 && service apache2 reload" &>/dev/null &
}

View File

@ -0,0 +1,145 @@
#!/bin/bash
# Automount 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!
#
# More at https://ownyourbits.com/
#
install()
{
apt-get update
apt-get install -y --no-install-recommends udiskie inotify-tools
cat > /etc/udev/rules.d/99-udisks2.rules <<'EOF'
ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{UDISKS_FILESYSTEM_SHARED}="1"
EOF
cat > /usr/lib/systemd/system/nc-automount.service <<'EOF'
[Unit]
Description=Automount USB drives
Before=mysqld.service dphys-swapfile.service fail2ban.service smbd.service nfs-server.service
[Service]
Restart=always
ExecStartPre=/bin/bash -c "rmdir /media/* || true"
ExecStart=/usr/bin/udiskie -NTFv
[Install]
WantedBy=multi-user.target
EOF
cat > /usr/lib/systemd/system/nc-automount-links.service <<'EOF'
[Unit]
Description=Monitor /media for mountpoints and create USBdrive* symlinks
Before=nc-automount.service
[Service]
Restart=always
ExecStart=/usr/local/etc/nc-automount-links-mon
[Install]
WantedBy=multi-user.target
EOF
cat > /usr/local/etc/nc-automount-links <<'EOF'
#!/bin/bash
ls -d /media/* &>/dev/null && {
# remove old links
for l in $( ls /media/ ); do
test -L /media/"$l" && rm /media/"$l"
done
# create links
i=0
for d in $( ls -d /media/* 2>/dev/null ); do
if [ $i -eq 0 ]; then
test -e /media/USBdrive || test -d "$d" && ln -sT "$d" /media/USBdrive
else
test -e /media/USBdrive$i || test -d "$d" && ln -sT "$d" /media/USBdrive$i
fi
i=$(( i + 1 ))
done
}
EOF
chmod +x /usr/local/etc/nc-automount-links
cat > /usr/local/etc/nc-automount-links-mon <<'EOF'
#!/bin/bash
inotifywait --monitor --event create --event delete --format '%f %e' /media/ | \
grep --line-buffered ISDIR | while read f; do
echo $f
sleep 0.5
/usr/local/etc/nc-automount-links
done
EOF
chmod +x /usr/local/etc/nc-automount-links-mon
}
configure()
{
[[ $ACTIVE != "yes" ]] && {
systemctl disable --now nc-automount
systemctl disable --now nc-automount-links
rm -rf /etc/systemd/system/{mariadb,nfs-server,dphys-swapfile,fail2ban}.service.d
systemctl daemon-reload
echo "automount disabled"
return 0
}
systemctl enable --now nc-automount
systemctl enable --now nc-automount-links
# create delays in some units
mkdir -p /etc/systemd/system/mariadb.service.d
cat > /etc/systemd/system/mariadb.service.d/ncp-delay-automount.conf <<'EOF'
[Service]
ExecStartPre=/bin/sleep 20
Restart=on-failure
EOF
mkdir -p /etc/systemd/system/nfs-server.service.d
cat > /etc/systemd/system/nfs-server.service.d/ncp-delay-automount.conf <<'EOF'
[Service]
ExecStartPre=
ExecStartPre=/bin/bash -c "/bin/sleep 30; /usr/sbin/exportfs -r"
EOF
mkdir -p /etc/systemd/system/dphys-swapfile.service.d
cat > /etc/systemd/system/dphys-swapfile.service.d/ncp-delay-automount.conf <<'EOF'
[Service]
ExecStartPre=/bin/sleep 30
EOF
mkdir -p /etc/systemd/system/fail2ban.service.d
cat > /etc/systemd/system/fail2ban.service.d/ncp-delay-automount.conf <<'EOF'
[Service]
ExecStartPre=/bin/sleep 10
EOF
systemctl daemon-reload
echo "automount enabled"
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,93 @@
#!/bin/bash
# Monitor HDD health automatically
#
# 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!
#
# More at https://ownyourbits.com
#
is_active()
{
systemctl -q is-enabled smartmontools &>/dev/null
}
configure()
{
local DRIVES=($(lsblk -ln | grep "^sd[[:alpha:]].*disk" | awk '{ print $1 }'))
[[ ${#DRIVES[@]} == 0 ]] && {
echo "no drives detected. Disabling.."
}
[[ "$ACTIVE" != yes ]] && {
systemctl disable --now smartmontools
echo "HDD monitor disabled"
return 0
}
cat > /usr/local/etc/ncp-hdd-notif.sh <<EOF
#!/bin/bash
EOF
[[ "$EMAIL" != "" ]] && {
cat >> /usr/local/etc/ncp-hdd-notif.sh <<EOF
sendmail "$EMAIL" <<EOFMAIL
Subject: Hard drive problems found
"\$SMARTD_MESSAGE"
EOFMAIL
EOF
}
cat >> /usr/local/etc/ncp-hdd-notif.sh <<EOF
source /usr/local/etc/library.sh
wall "\$SMARTD_MESSAGE"
notify_admin \
"NextCloudPi HDD health \$SMARTD_FAILTYPE" \
"\$SMARTD_MESSAGE"
EOF
chmod +x /usr/local/etc/ncp-hdd-notif.sh
cat > /etc/smartd.conf <<EOF
# short scan every day at 1am, long one on sundays at 2am
EOF
for dr in "${DRIVES[@]}"; do
local type=""
smartctl -d test /dev/${dr} &>/dev/null || {
smartctl -d sat -i /dev/${dr} &>/dev/null && type="-d sat"
}
smartctl ${type} --smart=on /dev/${dr} | sed 1,2d;
cat >> /etc/smartd.conf <<EOF
/dev/${dr} -a ${type} -m ${EMAIL} -M exec /usr/local/etc/ncp-hdd-notif.sh -s (S/../.././01|L/../../7/02)
EOF
done
systemctl enable --now smartmontools
echo "HDD monitor enabled"
}
install() { :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,68 @@
#!/bin/bash
# Check HDD health
#
# 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!
#
# More at https://ownyourbits.com
#
install()
{
apt_install smartmontools
systemctl disable smartd
return
}
configure()
{
local DRIVES=($(lsblk -ln | grep "^sd[[:alpha:]].*disk" | awk '{ print $1 }'))
[[ ${#DRIVES[@]} == 0 ]] && {
echo "no drives detected. Abort"
return 0
}
for dr in "${DRIVES[@]}"; do
local type=""
smartctl -d test /dev/${dr} &>/dev/null || {
smartctl -d sat -i /dev/${dr} &>/dev/null || { echo "couldnt detect device type"; return 1; }
type="-d sat"
}
smartctl --smart=on /dev/${dr} | sed 1,2d
if [[ "$SHORTTEST" == yes ]]; then
echo "* Starting test on $dr. Check results later"
smartctl $type -X "/dev/$dr" &>/dev/null
smartctl $type -t short "/dev/$dr" | sed 1,2d
elif [[ "$LONGTEST" == yes ]]; then
echo "* Starting test on $dr. Check results later"
smartctl $type -X "/dev/$dr" &>/dev/null
smartctl $type -t long "/dev/$dr" | sed 1,2d
else
echo "* Stats for $dr"
smartctl $type -a "/dev/$dr" | sed 1,2d
fi
done
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

48
bin/ncp/SYSTEM/nc-info.sh Normal file
View File

@ -0,0 +1,48 @@
#!/bin/bash
# Print NCP sytem info
#
# 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!
#
# More at: https://ownyourbits.com
#
install()
{
apt-get update
apt-get install -y --no-install-recommends bsdmainutils
}
configure()
{
echo "Gathering information..."
local OUT="$( bash /usr/local/bin/ncp-diag )"
# info
echo "$OUT" | column -t -s'|'
# suggestions
echo
bash /usr/local/bin/ncp-suggestions "$OUT"
return 0
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,66 @@
#!/bin/bash
# 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!
#
# More at https://ownyourbits.com/
#
is_active()
{
systemctl -q is-active log2ram &>/dev/null || systemctl -q is-active armbian-ramlog &>/dev/null
}
install()
{
VERSION=1.5.2
[[ -d /var/log.hdd ]] || [[ -d /var/hdd.log ]] && { echo "log2ram detected, not installing"; return; }
cd /tmp
curl -Lo log2ram.tar.gz https://github.com/azlux/log2ram/archive/${VERSION}.tar.gz
tar xf log2ram.tar.gz
cd log2ram-${VERSION}
sed -i '/systemctl -q is-active log2ram/d' install.sh
sed -i '/systemctl enable log2ram/d' install.sh
chmod +x install.sh && sudo ./install.sh
cd ..
rm -r log2ram-${VERSION} log2ram.tar.gz
rm /etc/cron.daily/log2ram /usr/local/bin/uninstall-log2ram.sh
}
configure()
{
[[ -f /lib/systemd/system/armbian-ramlog.service ]] && local ramlog=armbian-ramlog || local ramlog=log2ram
[[ $ACTIVE != "yes" ]] && {
systemctl disable "$ramlog"
systemctl stop "$ramlog"
echo "Logs in SD. Reboot to take effect"
return
}
systemctl enable "$ramlog"
systemctl start "$ramlog"
echo "Logs in RAM. Reboot to take effect"
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,72 @@
#!/bin/bash
# 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!
#
# More at https://ownyourbits.com/
#
is_active()
{
local DIR=$( swapon -s | sed -n 2p | awk '{ print $1 }' )
[[ "$DIR" != "" ]] && [[ "$DIR" != "/var/swap" ]]
}
configure()
{
local ORIG="$( swapon | tail -1 | awk '{ print $1 }' )"
local DSTDIR="$(dirname "$SWAPFILE")"
[[ "$ORIG" == "$SWAPFILE" ]] && { echo "nothing to do"; return 0; }
[[ -d "$SWAPFILE" ]] && { echo "$SWAPFILE is a directory. Abort"; return 1; }
[[ -d "$DSTDIR" ]] || { echo "$DSTDIR Doesn't exist. Abort"; return 1; }
[[ "$( stat -fc%T "$DSTDIR" )" == "btrfs" ]] && {
echo "BTRFS doesn't support swapfiles. You can still use nc-zram"
return 1
}
[[ $( stat -fc%d / ) == $( stat -fc%d "$DSTDIR" ) ]] && \
echo -e "INFO: moving swapfile to another place in the same SD card\nIf you want to use an external mount, make sure it is properly set up"
sed -i "s|#\?CONF_SWAPFILE=.*|CONF_SWAPFILE=$SWAPFILE|" /etc/dphys-swapfile
sed -i "s|#\?CONF_SWAPSIZE=.*|CONF_SWAPSIZE=$SWAPSIZE|" /etc/dphys-swapfile
grep -q vm.swappiness /etc/sysctl.conf || echo "vm.swappiness = 10" >> /etc/sysctl.conf && sysctl --load &>/dev/null
dphys-swapfile setup && dphys-swapfile swapon && {
[[ -f "$ORIG" ]] && swapoff "$ORIG" && rm -f "$ORIG"
echo "swapfile moved successfully"
return 0
}
echo "moving swapfile failed"
return 1
}
install()
{
if [[ "$(stat -fc%T /var)" != "btrfs" ]]; then
apt_install dphys-swapfile
fi
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

93
bin/ncp/SYSTEM/nc-zram.sh Normal file
View File

@ -0,0 +1,93 @@
#!/bin/bash
# NextcloudPi ZRAM settings
#
# 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!
#
# More at https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/
#
install()
{
cat > /etc/systemd/system/zram.service <<EOF
[Unit]
Description=Set up ZRAM
[Service]
Type=oneshot
ExecStart=/usr/local/bin/ncp-zram start
ExecStop=/usr/local/bin/ncp-zram stop
RemainAfterExit=yes
[Install]
WantedBy=sysinit.target
EOF
cat > /usr/local/bin/ncp-zram <<'EOF'
#!/bin/bash
# inspired by https://github.com/novaspirit/rpi_zram/blob/master/zram.sh
case "$1" in
start)
CORES=$(nproc --all)
modprobe zram num_devices=$CORES || exit 1
swapoff -a
TOTALMEM=`free | grep -e "^Mem:" | awk '{print $2}'`
MEM=$(( ($TOTALMEM / $CORES)* 1024 ))
core=0
while [ $core -lt $CORES ]; do
echo $MEM > /sys/block/zram$core/disksize
mkswap /dev/zram$core
swapon -p 5 /dev/zram$core
let core=core+1
done
;;
stop)
swapoff -a
rmmod zram
;;
*)
echo "Usage: $0 {start|stop}" >&2
exit 1
;;
esac
EOF
chmod +x /usr/local/bin/ncp-zram
}
configure()
{
[[ $ACTIVE != "yes" ]] && {
systemctl stop zram
systemctl disable zram
echo "ZRAM disabled"
return 0
}
systemctl start zram
systemctl enable zram
echo "ZRAM enabled"
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,36 @@
#!/bin/bash
# Fix permissions of the data files, in case they were copied externally
#
# 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!
#
# More at: https://ownyourbits.com
#
configure()
{
echo "Clearing opcache..."
bash -c "sleep 5; source /usr/local/etc/library.sh; clear_opcache;" &>/dev/null &
echo "Done."
}
install() { :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,42 @@
#!/bin/bash
# Fix permissions of the data files, in case they were copied externally
#
# 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!
#
# More at: https://ownyourbits.com
#
configure()
{
local DATADIR
DATADIR=$( get_nc_config_value datadirectory ) || {
echo "data directory not found";
return 1;
}
echo -ne "fixing permissions in $DATADIR... "
chown -R www-data:www-data "$DATADIR"/*/files
chmod -R u+rw "$DATADIR"/*/files
echo "done"
}
install() { :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,109 @@
#!/bin/bash
# Format a USB external drive as a unique BTRFS partition
#
# 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!
#
# More at: https://ownyourbits.com
#
configure()
{
# count all disk devices except mmcblk0
local mounts
local found=false
local root_disk
while read -r line
do
if [[ "$found" != "true" ]]
then
mounts="$(rev <<<"$line" | cut -d" " -f1 | rev)"
[[ "$mounts" =~ (^|'\x0a')/($|'\x0a') ]] && {
echo "$line"
found=true
}
fi
if [[ "$found" == "true" ]]
then
if [[ "$(cut -d" " -f6 <<<"$line")" == "disk" ]]
then
root_disk="$(cut -d" " -f1 <<<"$line")"
break
fi
fi
done < <( lsblk -nr | tac )
[[ -n "$root_disk" ]] || {
echo "ERROR: Could not determine root disk!"
return 1
}
local NUM=$( lsblk -ln | grep "^sd[[:alpha:]].*disk" | grep -v "^$root_disk" | awk '{ print $1 }' | wc -l )
# only one plugged in
[[ $NUM != 1 ]] && {
echo "ERROR: counted $NUM devices. Please, only plug in the USB drive you want to format";
return 1;
}
DATADIR="$(get_nc_config_value datadirectory || true)"
if [[ $( stat -fc%d / ) != $( stat -fc%d "$DATADIR" ) ]] || [[ -z "$DATADIR" ]] && [[ "$ALLOW_DATADIR_REMOVAL" != "yes" ]]
then
echo "ERROR: Data directory is on USB drive (or can't be determined) and removal of data directory was not explicitly allowed." \
"Please move the data directory to SD before formatting the USB drive." \
"If you are certain that the data directory is not on this USB drive, check 'Allow data directory removal'." \
"Exiting..."
return 1
fi
# disable nc-automount if enabled
killall -STOP udiskie 2>/dev/null
# umount if mounted
umount /media/USBdrive* &> /dev/null
# check still not mounted
for dir in $( ls -d /media/* 2>/dev/null ); do
mountpoint -q $dir && { echo "$dir is still mounted"; return 1; }
done
# do it
local NAME=( $( lsblk -ln | grep "^sd[[:alpha:]].*disk" | awk '{ print $1 }' ) )
[[ ${#NAME[@]} != 1 ]] && { echo "unexpected error"; return 1; }
wipefs -a -f /dev/"$NAME" || return 1
parted /dev/"$NAME" --script -- mklabel gpt || return 2
parted /dev/"$NAME" --script -- mkpart primary 0% 100% || return 3
sleep 0.5
mkfs.btrfs -q /dev/"${NAME}1" -f -L "$LABEL"
local RET=$?
# enable nc-automount if enabled
killall -CONT udiskie 2>/dev/null
[ $RET -eq 0 ] && echo "Drive $NAME formatted successfuly and labeled $LABEL"
return $RET
}
install() { :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,43 @@
#!/bin/bash
# Turn maintenance mode on or off
#
# Copyleft 2019 by Yi Chi 齊一 <chiyi4869 _a_t_ gmail _d_o_t_ com>
# GPL licensed (see end of file) * Use at your own risk!
#
# More at: https://www.cotpear.com
# Made in Taiwan (Republic of China)
#
is_active()
{
grep -q enabled <(ncc maintenance:mode)
}
configure()
{
[[ "$ACTIVE" != "yes" ]] && {
ncc maintenance:mode --off
return $?
}
ncc maintenance:mode --on
}
install(){ :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,64 @@
#!/bin/bash
# Generate previews for the gallery
#
# 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!
#
# More at nextcloudpi.com
#
configure()
{
pgrep -af preview:pre-generate &>/dev/null || pgrep -af preview:generate-all &>/dev/null && {
echo "nc-previews is already running"
return 1
}
[[ "$CLEAN" == "yes" ]] && {
local datadir
datadir=$( get_nc_config_value datadirectory ) || {
echo "data directory not found";
return 1;
}
rm -r "$datadir"/appdata_*/preview/* &>/dev/null
mysql nextcloud <<<"delete from ${DB_PREFIX?}filecache where path like \"appdata_%/preview/%\""
ncc files:scan-app-data -n
}
[[ "$INCREMENTAL" == "yes" ]] && {
for i in $(seq 1 $(nproc)); do
ncc preview:pre-generate -n -vvv &
done
wait
return
}
for i in $(seq 1 $(nproc)); do
[[ "$PATH1" != "" ]] && PATH_ARG=(-p "$PATH1")
ncc preview:generate-all -n -v ${PATH_ARG[@]} &
done
wait
}
install() { :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

68
bin/ncp/TOOLS/nc-scan.sh Normal file
View File

@ -0,0 +1,68 @@
#!/bin/bash
# Synchronize NextCloud for externally modified files
#
# 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!
#
# More at: https://ownyourbits.com
#
install()
{
cat > /usr/local/bin/ncp-scan <<'EOF'
#!/bin/bash
ncc files:scan -n -v --all
EOF
chmod +x /usr/local/bin/ncp-scan
}
configure()
{
grep -q enabled <(ncc maintenance:mode) && { echo "Cannot run ncp-scan while in maintenance mode"; exit 1; }
local ret=0
[[ "$RECURSIVE" == no ]] && local recursive=--shallow
[[ "$NONEXTERNAL" == yes ]] && local non_external=--home-only
[[ "$PATH1" != "" ]] && {
ncc files:scan -n -v $recursive $non_external -p "$PATH1"
[[ $? -ne 0 ]] && ret=1
}
[[ "$PATH2" != "" ]] && {
ncc files:scan -n -v $recursive $non_external -p "$PATH2"
[[ $? -ne 0 ]] && ret=1
}
[[ "$PATH3" != "" ]] && {
ncc files:scan -n -v $recursive $non_external -p "$PATH3"
[[ $? -ne 0 ]] && ret=1
}
[[ "${PATH1}${PATH2}${PATH3}" == "" ]] && {
ncc files:scan -n -v $recursive $non_external --all
[[ $? -ne 0 ]] && ret=1
}
return ${ret}
}
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,58 @@
#!/bin/bash
# Automatically apply Nextcloud updates
#
# 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!
#
# More at: https://ownyourbits.com
#
# just change NCLATESTVER and re-activate in update.sh to upgrade users
configure()
{
[[ "$ACTIVE" != "yes" ]] && {
rm -f /etc/cron.daily/ncp-autoupdate-nc
echo "automatic Nextcloud updates disabled"
return 0
}
cat > /etc/cron.daily/ncp-autoupdate-nc <<EOF
#!/bin/bash
source /usr/local/etc/library.sh
echo -e "[ncp-update-nc]" >> /var/log/ncp.log
/usr/local/bin/ncp-update-nc "latest" 2>&1 | tee -a /var/log/ncp.log
if [[ \${PIPESTATUS[0]} -eq 0 ]]; then
VER="\$(nc_version)"
notify_admin "NextCloudPi" "Nextcloud was updated to \$VER"
fi
echo "" >> /var/log/ncp.log
EOF
chmod 755 /etc/cron.daily/ncp-autoupdate-nc
echo "automatic Nextcloud updates enabled"
}
install() { :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

View File

@ -0,0 +1,53 @@
#!/bin/bash
# Automatically apply NextcloudPi updates
#
# 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!
#
# More at: https://ownyourbits.com
#
configure()
{
[[ $ACTIVE != "yes" ]] && {
rm -f /etc/cron.daily/ncp-autoupdate
echo "automatic NextCloudPi updates disabled"
return 0
}
cat > /etc/cron.daily/ncp-autoupdate <<EOF
#!/bin/bash
source /usr/local/etc/library.sh
# Forward all output to the ncp log
exec >> /var/log/ncp.log 2>&1
echo "\$(date) - Running \$0..."
if /usr/local/bin/ncp-test-updates; then
/usr/local/bin/ncp-update || exit 1
notify_admin "NextCloudPi" "NextCloudPi was updated to \$(cat /usr/local/etc/ncp-version)"
fi
EOF
chmod 755 /etc/cron.daily/ncp-autoupdate
echo "automatic NextCloudPi updates enabled"
}
install() { :; }
# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

Some files were not shown because too many files have changed in this diff Show More