Compare commits

...

26 Commits
21.0.1 ... main

Author SHA1 Message Date
decentral1se c532f14952
Revert internal network change (see coop-cloud/organising#62)
continuous-integration/drone/push Build is passing Details
2021-07-15 16:07:11 +02:00
decentral1se 8dfad23470
Attempt to ignore mariadb upgrade
continuous-integration/drone/push Build is passing Details
WIP but basically don't try run auto-upgrades for a bit.
2021-07-12 11:26:01 +02:00
decentral1se bd6f1dc4c6
Scope internal network internally 2021-07-10 15:21:08 +02:00
Renovate Bot 83e70bb560 Version 21.0.3; sync labels
continuous-integration/drone/push Build is failing Details
2021-07-05 07:02:53 +00:00
Renovate Bot 83b7ef9bfa chore(deps): update nextcloud docker tag to v21.0.3
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2021-07-05 07:02:38 +00:00
decentral1se 53a4995378 Version 21.0.2_1; sync labels
continuous-integration/drone/push Build is passing Details
2021-06-21 10:34:21 +00:00
decentral1se 60e20e4cdc Version 21.0.2; sync labels
continuous-integration/drone/push Build is passing Details
2021-06-21 10:32:01 +00:00
decentral1se 1adb31f281
Use new image namespace
continuous-integration/drone/push Build is passing Details
2021-06-21 12:31:36 +02:00
decentral1se 6e1a8168f2
Add all volumes for cron
continuous-integration/drone/push Build was killed Details
2021-06-16 14:00:06 +02:00
decentral1se c47bd6568c
Add cron job
continuous-integration/drone/push Build is passing Details
2021-06-16 13:36:58 +02:00
Renovate Bot 89eb579618 chore(deps): update mariadb docker tag to v10.6
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
2021-06-14 07:02:46 +00:00
3wc c7df0aedea Version 21.0.2; sync labels
continuous-integration/drone/push Build is failing Details
2021-06-13 19:08:12 +00:00
3wc 4578751dd7 Drop back to Mariadb 10.5
continuous-integration/drone/push Build is passing Details
Ref #7
2021-06-13 21:07:09 +02:00
3wc 47217ecde9 Version 21.0.2; sync labels
continuous-integration/drone/push Build is failing Details
2021-06-13 18:36:23 +00:00
3wc baaf465431 Version 21.0.2; sync labels
continuous-integration/drone/push Build is passing Details
2021-06-13 20:35:27 +02:00
3wc 66fd01c8c5 Add more `occ` stuff to README 2021-06-06 19:35:50 +02:00
decentral1se 7a2e46c5ef
Remove trigger, we make the tags [ci skip] 2021-06-04 00:15:02 +02:00
decentral1se 824faeb22b
Fix bad name in batch update script [ci skip] 2021-06-03 23:06:52 +02:00
decentral1se 49a03a99b7
Add release logic to CI [ci skip] 2021-06-03 23:01:01 +02:00
Roxie Gibson d4742a49e2
Merge branch 'main' of ssh://git.autonomic.zone:2222/coop-cloud/nextcloud
continuous-integration/drone/push Build is passing Details
2021-05-31 15:44:20 +01:00
Roxie Gibson 66642ba905
feat: functional backup & semi-functional restore
Restore is limited until I can test just dumping the sql file in the db

Backup works fully and rescans files.

Patch is part of the backup initiative to solidify our backup strategy
2021-05-31 15:42:43 +01:00
decentral1se 530f8608ac Merge pull request 'Update nextcloud Docker tag to v21.0.2 (main)' (#8) from renovate/main-docker-nextcloud-21.x into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #8
2021-05-27 15:22:58 +02:00
Renovate Bot 8ba268cb9b Update nextcloud Docker tag to v21.0.2
continuous-integration/drone/pr Build is failing Details
2021-05-24 07:01:57 +00:00
decentral1se 943bff7f70
Version 21.0.1; mariadb 10.6; sync labels
continuous-integration/drone/push Build is passing Details
2021-05-06 09:40:46 +02:00
Roxie Gibson e2ade64929
dev: added chellcheck settings for vscode users 2021-05-05 09:57:05 +01:00
decentral1se 2a52aa5c81
Version 21.0.1; sync labels
continuous-integration/drone/push Build is passing Details
2021-04-16 09:20:28 +02:00
5 changed files with 132 additions and 7 deletions

5
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"shellcheck.customArgs": [
"--shell=bash"
]
}

View File

@ -29,6 +29,15 @@ Fully automated luxury Nextcloud via docker-swarm.
`abra app YOURAPPDOMAIN occ user:list`
If you need to provide additional arguments or options, you'll need to quote
them, e.g.
`abra app YOURAPPDOMAIN occ user:list --help`
## Upgrading Nextcloud apps
`abra app YOURAPPDOMAIN occ "app:update --all"`
[nextcloud-docker]: https://hub.docker.com/_/nextcloud/
[`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra
[`coop-cloud/traefik`]: https://git.autonomic.zone/coop-cloud/traefik

102
abra.sh
View File

@ -1,5 +1,101 @@
NC_APP_DIR="app:/var/www/html"
sub_occ(){
abra__service_="app"
abra___user="www-data"
sub_app_run php /var/www/html/occ "$@"
# shellcheck disable=SC2034
abra__service_="app"
# shellcheck disable=SC2034
abra___user="www-data"
sub_app_run php /var/www/html/occ "$@"
}
_backup_app() {
# Copied _abra_backup_dir to make UX better on restore and backup
{
abra__src_="$1"
abra__dst_="-"
}
# shellcheck disable=SC2154
FILENAME="$(basename "$1").tar"
debug "Copying '$1' to '$FILENAME'"
silence
mkdir -p /tmp/abra
sub_app_cp > /tmp/abra/$FILENAME
unsilence
}
next_maintenance_on() {
silence
sub_occ maintenance:mode --on > /dev/null
unsilence
debug "Nextcloud maintenance mode enabled"
}
next_maintenance_off() {
silence
sub_occ maintenance:mode --off > /dev/null
unsilence
debug "Nextcloud maintenance mode disabled"
}
abra_backup_app() {
# shellcheck disable=SC2154
ARK_FILENAME="$ABRA_BACKUP_DIR/${abra__app_}_app_$(date +%F).tar.gz"
# Cant be FILENAME as that gets changed by something
next_maintenance_on
_backup_app $NC_APP_DIR/config
_backup_app $NC_APP_DIR/data
_backup_app $NC_APP_DIR/themes
# Combine archives
tar -Af /tmp/abra/config.tar /tmp/abra/data.tar
tar -Af /tmp/abra/config.tar /tmp/abra/themes.tar
gzip /tmp/abra/config.tar -c > "$ARK_FILENAME"
rm /tmp/abra/*.tar
success "Backed up 'app' to $ARK_FILENAME"
next_maintenance_off
}
abra_backup_db() {
next_maintenance_on
_abra_backup_mysql "db" "nextcloud"
next_maintenance_off
}
abra_backup() {
abra_backup_app && abra_backup_db
}
abra_restore_app() {
next_maintenance_on
# shellcheck disable=SC2034
{
abra__src_="-"
abra__dst_=$NC_APP_DIR
}
zcat "$@" | sub_app_cp
next_maintenance_off
sub_occ files:scan --all > /dev/null # Needs to be run in normal mode
success "Restored 'app'"
}
# abra_restore_db() {
# warning "Restoring the database is on a existing app and not a new one has not been tested. Use with caution."
# next_maintenance_on
# # 3wc: unlike abra_backup_db, we can assume abra__service_ will be 'db' if we
# # got this far..
# # shellcheck disable=SC2034
# abra___no_tty="true"
# DB_PASSWORD=$(sub_app_run cat /run/secrets/db_password)
# zcat "$@" | sub_app_run mysql -u root -p"$DB_PASSWORD" wordpress
# success "Restored 'db'"
# next_maintenance_off
# }

View File

@ -1,7 +1,7 @@
version: "3.8"
services:
app:
image: nextcloud:21.0.1
image: nextcloud:21.0.3
depends_on:
- db
secrets:
@ -52,7 +52,7 @@ services:
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
- coop-cloud.${STACK_NAME}.app.version=21.0.0-7e0ea42c
- coop-cloud.${STACK_NAME}.app.version=21.0.3-87bd33d3
db:
image: "mariadb:10.5"
environment:
@ -74,8 +74,20 @@ services:
retries: 3
start_period: 30s
deploy:
labels:
- coop-cloud.${STACK_NAME}.db.version=10.5-9c681cef
labels: ["coop-cloud.${STACK_NAME}.db.version=10.5-9c681cef"]
cron:
image: nextcloud:21.0.3
volumes:
- nextcloud:/var/www/html/
- nextapps:/var/www/html/custom_apps:cached
- nextdata:/var/www/html/data:cached
- nextconfig:/var/www/html/config:cached
- ${EXTRA_VOLUME}
networks:
- internal
entrypoint: /cron.sh
deploy:
labels: ["coop-cloud.${STACK_NAME}.cron.version=21.0.3-87bd33d3"]
secrets:
db_root_password:
external: true

View File

@ -1,5 +1,8 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"ignoreDeps": [
"mariadb:10.6"
],
"extends": [
"config:base"
]