From 8aba98c01204aa553b798f70bd3ceb55ff7fcc30 Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Fri, 3 Sep 2021 19:06:42 +0200 Subject: [PATCH 1/3] use forked version of package targz --- cmd/backup/main.go | 2 +- go.mod | 3 ++- go.sum | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cmd/backup/main.go b/cmd/backup/main.go index dd0c067..21bf028 100644 --- a/cmd/backup/main.go +++ b/cmd/backup/main.go @@ -21,10 +21,10 @@ import ( "github.com/gofrs/flock" "github.com/kelseyhightower/envconfig" "github.com/leekchan/timeutil" + "github.com/m90/targz" "github.com/minio/minio-go/v7" "github.com/minio/minio-go/v7/pkg/credentials" "github.com/sirupsen/logrus" - "github.com/walle/targz" "golang.org/x/crypto/openpgp" ) diff --git a/go.mod b/go.mod index d348f6f..ea4c684 100644 --- a/go.mod +++ b/go.mod @@ -7,9 +7,9 @@ require ( github.com/gofrs/flock v0.8.1 github.com/kelseyhightower/envconfig v1.4.0 github.com/leekchan/timeutil v0.0.0-20150802142658-28917288c48d + github.com/m90/targz v0.0.0-20210904080153-f3929d2235bc github.com/minio/minio-go/v7 v7.0.12 github.com/sirupsen/logrus v1.8.1 - github.com/walle/targz v0.0.0-20140417120357-57fe4206da5a golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 ) @@ -35,6 +35,7 @@ require ( github.com/opencontainers/image-spec v1.0.1 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/rs/xid v1.2.1 // indirect + github.com/walle/targz v0.0.0-20140417120357-57fe4206da5a // indirect golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect golang.org/x/text v0.3.4 // indirect diff --git a/go.sum b/go.sum index 11d7ff4..e633c89 100644 --- a/go.sum +++ b/go.sum @@ -407,6 +407,12 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/leekchan/timeutil v0.0.0-20150802142658-28917288c48d h1:2puqoOQwi3Ai1oznMOsFIbifm6kIfJaLLyYzWD4IzTs= github.com/leekchan/timeutil v0.0.0-20150802142658-28917288c48d/go.mod h1:hO90vCP2x3exaSH58BIAowSKvV+0OsY21TtzuFGHON4= +github.com/m90/targz v0.0.0-20140417120357-57fe4206da5a h1:ML3GxKU275DDCbdDvqoA2yy5kF/xOzOOmUdY4uQryUM= +github.com/m90/targz v0.0.0-20140417120357-57fe4206da5a/go.mod h1:bWDufAy+5ZjKRbxe8gh/oKrGC+Ryww8AKPsFiwPuAGY= +github.com/m90/targz v0.0.0-20210903165208-2619a50ded33 h1:YFpJF7QUAb2z/pviBm58vIl5VS+qD3ibzvlhqeL9TTo= +github.com/m90/targz v0.0.0-20210903165208-2619a50ded33/go.mod h1:YZK3bSO/oVlk9G+v00BxgzxW2Us4p/R4ysHOBjk0fJI= +github.com/m90/targz v0.0.0-20210904080153-f3929d2235bc h1:cNfcJUU7pra4Kz6XN1GbF6bHg7KWDitCxn1z4rJIqc8= +github.com/m90/targz v0.0.0-20210904080153-f3929d2235bc/go.mod h1:YZK3bSO/oVlk9G+v00BxgzxW2Us4p/R4ysHOBjk0fJI= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= From 5922820adadd292b21da27278ab83a2c543f6bee Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Sat, 4 Sep 2021 10:09:51 +0200 Subject: [PATCH 2/3] add test for checking behavior on symlinks --- go.mod | 2 +- go.sum | 2 ++ test/compose/run.sh | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index ea4c684..a751f64 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/gofrs/flock v0.8.1 github.com/kelseyhightower/envconfig v1.4.0 github.com/leekchan/timeutil v0.0.0-20150802142658-28917288c48d - github.com/m90/targz v0.0.0-20210904080153-f3929d2235bc + github.com/m90/targz v0.0.0-20210904082215-2e9a4529a615 github.com/minio/minio-go/v7 v7.0.12 github.com/sirupsen/logrus v1.8.1 golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 diff --git a/go.sum b/go.sum index e633c89..aef254d 100644 --- a/go.sum +++ b/go.sum @@ -413,6 +413,8 @@ github.com/m90/targz v0.0.0-20210903165208-2619a50ded33 h1:YFpJF7QUAb2z/pviBm58v github.com/m90/targz v0.0.0-20210903165208-2619a50ded33/go.mod h1:YZK3bSO/oVlk9G+v00BxgzxW2Us4p/R4ysHOBjk0fJI= github.com/m90/targz v0.0.0-20210904080153-f3929d2235bc h1:cNfcJUU7pra4Kz6XN1GbF6bHg7KWDitCxn1z4rJIqc8= github.com/m90/targz v0.0.0-20210904080153-f3929d2235bc/go.mod h1:YZK3bSO/oVlk9G+v00BxgzxW2Us4p/R4ysHOBjk0fJI= +github.com/m90/targz v0.0.0-20210904082215-2e9a4529a615 h1:rn0LO2tQEgCDOct8qnbcslTUpAIWdVlWcGkjoumhf2U= +github.com/m90/targz v0.0.0-20210904082215-2e9a4529a615/go.mod h1:YZK3bSO/oVlk9G+v00BxgzxW2Us4p/R4ysHOBjk0fJI= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= diff --git a/test/compose/run.sh b/test/compose/run.sh index d8b830f..a00142f 100755 --- a/test/compose/run.sh +++ b/test/compose/run.sh @@ -9,6 +9,7 @@ mkdir -p local docker-compose up -d sleep 5 +docker-compose exec offen ln -s /var/opt/offen/offen.db /var/opt/offen/db.link docker-compose exec backup backup docker run --rm -it \ @@ -20,6 +21,7 @@ echo "[TEST:PASS] Found relevant files in untared remote backup." echo 1234secret | gpg -d --yes --passphrase-fd 0 ./local/test.tar.gz.gpg > ./local/decrypted.tar.gz tar -xf ./local/decrypted.tar.gz -C /tmp && test -f /tmp/backup/app_data/offen.db rm ./local/decrypted.tar.gz +test -L /tmp/backup/app_data/db.link echo "[TEST:PASS] Found relevant files in untared local backup." From fefc34c6aaf7ec5c7135a57e955df9b1731f2f06 Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Sat, 4 Sep 2021 15:54:09 +0200 Subject: [PATCH 3/3] tidy go mod file --- go.mod | 1 - go.sum | 8 -------- 2 files changed, 9 deletions(-) diff --git a/go.mod b/go.mod index a751f64..30b1578 100644 --- a/go.mod +++ b/go.mod @@ -35,7 +35,6 @@ require ( github.com/opencontainers/image-spec v1.0.1 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/rs/xid v1.2.1 // indirect - github.com/walle/targz v0.0.0-20140417120357-57fe4206da5a // indirect golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect golang.org/x/text v0.3.4 // indirect diff --git a/go.sum b/go.sum index aef254d..ceca83c 100644 --- a/go.sum +++ b/go.sum @@ -407,12 +407,6 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/leekchan/timeutil v0.0.0-20150802142658-28917288c48d h1:2puqoOQwi3Ai1oznMOsFIbifm6kIfJaLLyYzWD4IzTs= github.com/leekchan/timeutil v0.0.0-20150802142658-28917288c48d/go.mod h1:hO90vCP2x3exaSH58BIAowSKvV+0OsY21TtzuFGHON4= -github.com/m90/targz v0.0.0-20140417120357-57fe4206da5a h1:ML3GxKU275DDCbdDvqoA2yy5kF/xOzOOmUdY4uQryUM= -github.com/m90/targz v0.0.0-20140417120357-57fe4206da5a/go.mod h1:bWDufAy+5ZjKRbxe8gh/oKrGC+Ryww8AKPsFiwPuAGY= -github.com/m90/targz v0.0.0-20210903165208-2619a50ded33 h1:YFpJF7QUAb2z/pviBm58vIl5VS+qD3ibzvlhqeL9TTo= -github.com/m90/targz v0.0.0-20210903165208-2619a50ded33/go.mod h1:YZK3bSO/oVlk9G+v00BxgzxW2Us4p/R4ysHOBjk0fJI= -github.com/m90/targz v0.0.0-20210904080153-f3929d2235bc h1:cNfcJUU7pra4Kz6XN1GbF6bHg7KWDitCxn1z4rJIqc8= -github.com/m90/targz v0.0.0-20210904080153-f3929d2235bc/go.mod h1:YZK3bSO/oVlk9G+v00BxgzxW2Us4p/R4ysHOBjk0fJI= github.com/m90/targz v0.0.0-20210904082215-2e9a4529a615 h1:rn0LO2tQEgCDOct8qnbcslTUpAIWdVlWcGkjoumhf2U= github.com/m90/targz v0.0.0-20210904082215-2e9a4529a615/go.mod h1:YZK3bSO/oVlk9G+v00BxgzxW2Us4p/R4ysHOBjk0fJI= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -604,8 +598,6 @@ github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:tw github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmFBXmLKZu9Nxj3WKYEafiSqer2rnvPr0en9UNpI= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/walle/targz v0.0.0-20140417120357-57fe4206da5a h1:6cKSHLRphD9Fo1LJlISiulvgYCIafJ3QfKLimPYcAGc= -github.com/walle/targz v0.0.0-20140417120357-57fe4206da5a/go.mod h1:nccQrXCnc5SjsThFLmL7hYbtT/mHJcuolPifzY5vJqE= github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=