Commit Graph

436 Commits

Author SHA1 Message Date
1db896f7cf Tweak README, improve client naming, tidy go.mod file 2022-01-22 13:35:13 +01:00
Kaerbr
6ded00aa06
Support Nextcloud / WebDav (#48)
* add studio-b12/gowebdav to be able to upload to webdav server

* make sure all env variables are present for webdav upload

* implement file upload to WebDav server

directory defaults to the base directory

* docs: add the new feature to the documentation

* if no WebDav env variable are given throw no error

* docs: use more elegant english :D

Co-authored-by: Frederik Ring <frederik.ring@gmail.com>

* docs: use official spelling of "WebDAV"

* perf: golang likes to return early instead of having an else block

* use WEBDAV_PATH instead of WEBDAV_DIRECTORY

* use split_words for more convenience

like shown here: https://github.com/kelseyhightower/envconfig#struct-tag-support

* simplify

* feat: add pruning of files in WebDAV remote

Based on / Inspired by the minio/S3 implementation of pruning remote files.

* remove logging from the development

* test: first try implementing tests

Sandly I have to use the remote pipeline -- local wont work for me.

* test: adapt used volume names

* test: specify image only once!

* test: minio AND webdav data should be present

* test: backups on WebDAV remote are laying in the root directory

* test: the webdav server stores date in /var/lib/dav

* trying with data subfolder

* test: 1 container was added so the number raised from 3 to 4

* webdav  subfolder is "data" not "backup"

* fix: password AND username must be defined

not password OR username

* improve logging

* feat: if the given path on the server isnt preset it will be created

* test: add creation of new folder for webdav to tests

Co-authored-by: Frederik Ring <frederik.ring@gmail.com>
2022-01-22 13:29:21 +01:00
6b79f1914b
Update README.md 2022-01-06 16:09:33 +01:00
40ff2e00c9
Update README.md 2022-01-06 16:07:00 +01:00
760cc9cebc Add issue template 2021-12-29 13:10:43 +01:00
1f9582df51
Fix handling of empty directories (#44)
* Add test checking whether empty directories are included in backups

* Update targz library to include fix
2021-12-29 10:10:12 +01:00
32575c831e Also expand env vars in pruning prefix if configured 2021-12-23 09:22:56 +01:00
c062710ce8
Allow for env substitution in backup filename (#39) 2021-12-22 14:39:46 +01:00
3a7dfe8e60 Add note about double quoting issue in older compose versions 2021-12-18 13:24:14 +01:00
9ec33510e7 Extend docs on notifications 2021-12-18 10:31:12 +01:00
4207146fb6 Refactor calling of hooks on exit 2021-12-18 10:31:12 +01:00
1f727f698f Run hooks in order of severity 2021-12-18 10:31:12 +01:00
88c90a206c Use int comparison for checking hooks 2021-12-18 10:31:12 +01:00
8bad0656b3 Enable notifications on multiple levels 2021-12-18 10:31:12 +01:00
08d78a0bd6 allow sending notifications to multiple channels 2021-12-18 10:31:12 +01:00
5a6ce81b58 update github.com/otai/copy, use PreserveOwner option 2021-11-29 08:40:55 +01:00
dfd0d617e4 install bugfix releases where available 2021-11-28 20:12:23 +01:00
7bc5b2ccef fix minor error scoping mistakes 2021-11-28 20:06:24 +01:00
b6ad624115 leverage docker cache for downloading go deps 2021-11-23 08:04:48 +01:00
210c7d4540
Reuse hook mechanism for scheduling clean up tasks (#33)
* reuse hook mechanism for scheduling clean up tasks

* register hooks before creating files or dirs

* fix logging order

* use typed hook levels
2021-11-08 19:10:10 +01:00
3c06bf8102 run cli test using BACKUP_FROM_SNAPSHOT 2021-11-08 08:44:59 +01:00
schwannden
411c39ee72
create a snapshot before creating tar archive (#32)
* create a snapshot before creating tar archive

* safeguard snapshot removal and make snapshot optional

* fix typo, make sure remove snapshot failure triggers failure hook

Co-authored-by: Schwannden Kuo <schwannden@mobagel.com>
2021-11-08 08:39:18 +01:00
0c666d0c88 use lstat when checking whether file is a symlink 2021-11-03 18:07:55 +01:00
a0402b407d fix fileinfo mode comparison when checking for symlinks 2021-11-03 18:03:44 +01:00
3193e88fc0 os.FileInfo cannot be used for deleting files as it does not contain a full path 2021-11-02 06:40:37 +01:00
c391230be6
Merge pull request #31 from offen/exclude-symlink-candidates
Exclude symlinks from candidates when pruning local files
2021-10-31 20:07:51 +01:00
f946f36fb0 exclude symlinks from candidates when pruning local files
Previously, symlinks would be included in the set of candidates, but would
be skipped when pruning. This could lead to a wrong number of candidates
being printed in the log messages.
2021-10-29 09:00:37 +02:00
5245b5882f update README, save some indentation 2021-10-28 19:55:39 +02:00
schwannden
7f0f173115
adding option to skip tls verification error (#30)
* adding option to skip tls verification error

* merge options

* removed merged option from README

Co-authored-by: Schwannden Kuo <schwannden@mobagel.com>
2021-10-28 19:51:35 +02:00
ad7ec58322 add syntax highlighting 2021-10-23 17:45:57 +02:00
b7ab2fbacc add section about container timezones to the README 2021-10-23 17:44:30 +02:00
789fc656e8
Merge pull request #27 from offen/latest-symlink
Automatically create symlink to latest local backup if configured
2021-10-01 18:47:16 +02:00
c59b40f2df automatically create symlink to latest local backup if configured 2021-10-01 18:19:24 +02:00
cff418e735 fix README grammar 2021-10-01 08:48:20 +02:00
d7ccdd79fc
Merge pull request #26 from offen/instance-profile
Allow s3 authentication via IAM role
2021-09-30 19:32:54 +02:00
bd73a2b5e4 allow s3 authentication via IAM role 2021-09-30 19:24:43 +02:00
6cf5cf47e7
Merge pull request #25 from offen/delete-on-failure
Ensure script always tries to remove local artifacts even when backup failed
2021-09-13 09:33:12 +02:00
53c257065e ensure script always tries to remove local artifacts even when backup failed 2021-09-12 10:48:19 +02:00
184b7a1e18 add docs on one off backups using docker cli 2021-09-11 11:21:48 +02:00
69a94f226b tweak configuration reference for email settings 2021-09-10 11:58:33 +02:00
160a47e90b allow registering hooks at different levels 2021-09-09 16:55:49 +02:00
59660ec5c7 include exit log message in notification 2021-09-09 11:08:05 +02:00
af3e69b7a8 fix typo in README 2021-09-09 09:19:37 +02:00
5d400cb943
Merge pull request #24 from offen/failure-email
Enable sending out email notifications on failed backups
2021-09-09 09:10:20 +02:00
88368197c1 implement email notifications on failed backup runs 2021-09-09 09:00:23 +02:00
e46968ed79 call error hooks on script failure 2021-09-09 08:12:07 +02:00
2c06f81503 collect all log output in buffer so it could be used in notifications 2021-09-09 07:24:18 +02:00
55d030a06a
Merge pull request #22 from offen/targz-fork
Fix handling of symlinks in backup targets
2021-09-06 18:15:34 +02:00
fefc34c6aa tidy go mod file 2021-09-04 15:54:09 +02:00
5922820ada add test for checking behavior on symlinks 2021-09-04 10:30:34 +02:00