From 5b81278c8fcd14f0cc35861d717bd40698a9704f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 11:52:25 +0000 Subject: [PATCH 01/34] Bump docker/build-push-action from 5 to 6 Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5 to 6. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v5...v6) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/docker-push.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-push.yml b/.github/workflows/docker-push.yml index 592cba8..35b5b96 100644 --- a/.github/workflows/docker-push.yml +++ b/.github/workflows/docker-push.yml @@ -136,7 +136,7 @@ jobs: - name: Build and push Docker images (Docker) if: ${{ steps.build_check.outputs.build == 'true' }} - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: push: true context: . @@ -149,7 +149,7 @@ jobs: - name: Build and push Docker images (GHCR) if: ${{ steps.build_check.outputs.build == 'true' }} - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: push: true context: . From 09d898ef15f8a120d5101ad53cf93efc08021077 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 02:23:47 +0000 Subject: [PATCH 02/34] Bump the all group with 3 updates Bumps the all group with 3 updates: [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2), [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2) and [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2). Updates `github.com/aws/aws-sdk-go-v2` from 1.27.2 to 1.28.0 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.27.2...v1.28.0) Updates `github.com/aws/aws-sdk-go-v2/credentials` from 1.17.18 to 1.17.19 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.18...credentials/v1.17.19) Updates `github.com/aws/aws-sdk-go-v2/service/s3` from 1.55.1 to 1.55.2 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.55.1...service/s3/v1.55.2) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all - dependency-name: github.com/aws/aws-sdk-go-v2/credentials dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all - dependency-name: github.com/aws/aws-sdk-go-v2/service/s3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all ... Signed-off-by: dependabot[bot] --- go.mod | 18 +++++++++--------- go.sum | 36 ++++++++++++++++++------------------ 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/go.mod b/go.mod index 6624f11..7fa104c 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,9 @@ module github.com/essentialkaos/atlassian-cloud-backuper go 1.19 require ( - github.com/aws/aws-sdk-go-v2 v1.27.2 - github.com/aws/aws-sdk-go-v2/credentials v1.17.18 - github.com/aws/aws-sdk-go-v2/service/s3 v1.55.1 + github.com/aws/aws-sdk-go-v2 v1.28.0 + github.com/aws/aws-sdk-go-v2/credentials v1.17.19 + github.com/aws/aws-sdk-go-v2/service/s3 v1.55.2 github.com/essentialkaos/ek/v12 v12.126.1 github.com/pkg/sftp v1.13.6 golang.org/x/crypto v0.24.0 @@ -13,13 +13,13 @@ require ( require ( github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.9 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.9 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.9 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.10 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.10 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.10 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.11 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.11 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.9 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.12 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.12 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.10 // indirect github.com/aws/smithy-go v1.20.2 // indirect github.com/essentialkaos/depsy v1.3.0 // indirect github.com/kr/fs v0.1.0 // indirect diff --git a/go.sum b/go.sum index 993a585..d4d2c45 100644 --- a/go.sum +++ b/go.sum @@ -1,25 +1,25 @@ -github.com/aws/aws-sdk-go-v2 v1.27.2 h1:pLsTXqX93rimAOZG2FIYraDQstZaaGVVN4tNw65v0h8= -github.com/aws/aws-sdk-go-v2 v1.27.2/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= +github.com/aws/aws-sdk-go-v2 v1.28.0 h1:ne6ftNhY0lUvlazMUQF15FF6NH80wKmPRFG7g2q6TCw= +github.com/aws/aws-sdk-go-v2 v1.28.0/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 h1:x6xsQXGSmW6frevwDA+vi/wqhp1ct18mVXYN08/93to= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2/go.mod h1:lPprDr1e6cJdyYeGXnRaJoP4Md+cDBvi2eOj00BlGmg= -github.com/aws/aws-sdk-go-v2/credentials v1.17.18 h1:D/ALDWqK4JdY3OFgA2thcPO1c9aYTT5STS/CvnkqY1c= -github.com/aws/aws-sdk-go-v2/credentials v1.17.18/go.mod h1:JuitCWq+F5QGUrmMPsk945rop6bB57jdscu+Glozdnc= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.9 h1:cy8ahBJuhtM8GTTSyOkfy6WVPV1IE+SS5/wfXUYuulw= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.9/go.mod h1:CZBXGLaJnEZI6EVNcPd7a6B5IC5cA/GkRWtu9fp3S6Y= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.9 h1:A4SYk07ef04+vxZToz9LWvAXl9LW0NClpPpMsi31cz0= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.9/go.mod h1:5jJcHuwDagxN+ErjQ3PU3ocf6Ylc/p9x+BLO/+X4iXw= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.9 h1:vHyZxoLVOgrI8GqX7OMHLXp4YYoxeEsrjweXKpye+ds= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.9/go.mod h1:z9VXZsWA2BvZNH1dT0ToUYwMu/CR9Skkj/TBX+mceZw= +github.com/aws/aws-sdk-go-v2/credentials v1.17.19 h1:R18G7nBBGLby51CFEqUBFF2IVl7LUdCtYj6iosUwh/0= +github.com/aws/aws-sdk-go-v2/credentials v1.17.19/go.mod h1:xr9kUMnaLTB866HItT6pg58JgiBP77fSQLBwIa//zk8= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.10 h1:LZIUb8sQG2cb89QaVFtMSnER10gyKkqU1k3hP3g9das= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.10/go.mod h1:BRIqay//vnIOCZjoXWSLffL2uzbtxEmnSlfbvVh7Z/4= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.10 h1:HY7CXLA0GiQUo3WYxOP7WYkLcwvRX4cLPf5joUcrQGk= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.10/go.mod h1:kfRBSxRa+I+VyON7el3wLZdrO91oxUxEwdAaWgFqN90= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.10 h1:KPPEosyvs2q6sGbRj/LIGMpqPStDZKtEy/CEbBl+tps= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.10/go.mod h1:6pZBDPNlCwrpj79TpGfjgaliXrC3lvoFGMCg7Rtc7p8= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1xUsUr3I8cHps0G+XM3WWU16lP6yG8qu1GAZAs= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.11 h1:4vt9Sspk59EZyHCAEMaktHKiq0C09noRTQorXD/qV+s= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.11/go.mod h1:5jHR79Tv+Ccq6rwYh+W7Nptmw++WiFafMfR42XhwNl8= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.11 h1:o4T+fKxA3gTMcluBNZZXE9DNaMkJuUL1O3mffCUjoJo= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.11/go.mod h1:84oZdJ+VjuJKs9v1UTC9NaodRZRseOXCTgku+vQJWR8= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.9 h1:TE2i0A9ErH1YfRSvXfCr2SQwfnqsoJT9nPQ9kj0lkxM= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.9/go.mod h1:9TzXX3MehQNGPwCZ3ka4CpwQsoAMWSF48/b+De9rfVM= -github.com/aws/aws-sdk-go-v2/service/s3 v1.55.1 h1:UAxBuh0/8sFJk1qOkvOKewP5sWeWaTPDknbQz0ZkDm0= -github.com/aws/aws-sdk-go-v2/service/s3 v1.55.1/go.mod h1:hWjsYGjVuqCgfoveVcVFPXIWgz0aByzwaxKlN1StKcM= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.12 h1:77ORAasgQRiNRi1du4UVmttQg2Wf41WSe7TvpmpmDg0= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.12/go.mod h1:PsApornkaurUc1DIGUdiBzC19GfF1fy2ZH93O2JWigc= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.12 h1:kO2J7WMroF/OTHN9WTcUtMjPhJ7ZoNxx0dwv6UCXQgY= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.12/go.mod h1:mrNxrjYvXaSjZe5fkKaWgDnOQ6BExLn/7Ru9OpRsMPY= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.10 h1:1Hmy47QP13NjScoCMOr9kJo/hqKqf+tskyGpxVgNBxU= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.10/go.mod h1:8jZvhEt+MemeoHm9P4WFk/AVfIa9sCWL80OAKNDNTCM= +github.com/aws/aws-sdk-go-v2/service/s3 v1.55.2 h1:9UkFXpS7uU7ipUlj2sSkLtIo3Sa+LtbnObBJdx8yjd0= +github.com/aws/aws-sdk-go-v2/service/s3 v1.55.2/go.mod h1:Cijxa/K9vFQ9RPd16rq3cE+0Sg5hvmpEkTo+LThg43E= github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q= github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= From c343e2936916f556827f1b43dfee7870d37f3c46 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 02:38:16 +0000 Subject: [PATCH 03/34] Bump the all group with 3 updates Bumps the all group with 3 updates: [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2), [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2) and [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2). Updates `github.com/aws/aws-sdk-go-v2` from 1.28.0 to 1.29.0 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.28.0...v1.29.0) Updates `github.com/aws/aws-sdk-go-v2/credentials` from 1.17.19 to 1.17.20 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.19...credentials/v1.17.20) Updates `github.com/aws/aws-sdk-go-v2/service/s3` from 1.55.2 to 1.56.0 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.55.2...service/s3/v1.56.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all - dependency-name: github.com/aws/aws-sdk-go-v2/credentials dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all - dependency-name: github.com/aws/aws-sdk-go-v2/service/s3 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all ... Signed-off-by: dependabot[bot] --- go.mod | 18 +++++++++--------- go.sum | 36 ++++++++++++++++++------------------ 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/go.mod b/go.mod index 7fa104c..a6617de 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,9 @@ module github.com/essentialkaos/atlassian-cloud-backuper go 1.19 require ( - github.com/aws/aws-sdk-go-v2 v1.28.0 - github.com/aws/aws-sdk-go-v2/credentials v1.17.19 - github.com/aws/aws-sdk-go-v2/service/s3 v1.55.2 + github.com/aws/aws-sdk-go-v2 v1.29.0 + github.com/aws/aws-sdk-go-v2/credentials v1.17.20 + github.com/aws/aws-sdk-go-v2/service/s3 v1.56.0 github.com/essentialkaos/ek/v12 v12.126.1 github.com/pkg/sftp v1.13.6 golang.org/x/crypto v0.24.0 @@ -13,13 +13,13 @@ require ( require ( github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.10 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.10 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.10 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.11 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.11 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.11 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.12 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.12 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.10 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.13 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.13 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.11 // indirect github.com/aws/smithy-go v1.20.2 // indirect github.com/essentialkaos/depsy v1.3.0 // indirect github.com/kr/fs v0.1.0 // indirect diff --git a/go.sum b/go.sum index d4d2c45..b070d62 100644 --- a/go.sum +++ b/go.sum @@ -1,25 +1,25 @@ -github.com/aws/aws-sdk-go-v2 v1.28.0 h1:ne6ftNhY0lUvlazMUQF15FF6NH80wKmPRFG7g2q6TCw= -github.com/aws/aws-sdk-go-v2 v1.28.0/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= +github.com/aws/aws-sdk-go-v2 v1.29.0 h1:uMlEecEwgp2gs6CsM6ugquNHr6mg0LHylPBR8u5Ojac= +github.com/aws/aws-sdk-go-v2 v1.29.0/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 h1:x6xsQXGSmW6frevwDA+vi/wqhp1ct18mVXYN08/93to= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2/go.mod h1:lPprDr1e6cJdyYeGXnRaJoP4Md+cDBvi2eOj00BlGmg= -github.com/aws/aws-sdk-go-v2/credentials v1.17.19 h1:R18G7nBBGLby51CFEqUBFF2IVl7LUdCtYj6iosUwh/0= -github.com/aws/aws-sdk-go-v2/credentials v1.17.19/go.mod h1:xr9kUMnaLTB866HItT6pg58JgiBP77fSQLBwIa//zk8= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.10 h1:LZIUb8sQG2cb89QaVFtMSnER10gyKkqU1k3hP3g9das= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.10/go.mod h1:BRIqay//vnIOCZjoXWSLffL2uzbtxEmnSlfbvVh7Z/4= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.10 h1:HY7CXLA0GiQUo3WYxOP7WYkLcwvRX4cLPf5joUcrQGk= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.10/go.mod h1:kfRBSxRa+I+VyON7el3wLZdrO91oxUxEwdAaWgFqN90= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.10 h1:KPPEosyvs2q6sGbRj/LIGMpqPStDZKtEy/CEbBl+tps= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.10/go.mod h1:6pZBDPNlCwrpj79TpGfjgaliXrC3lvoFGMCg7Rtc7p8= +github.com/aws/aws-sdk-go-v2/credentials v1.17.20 h1:VYTCplAeOeBv5InTtrmF61OIwD4aHKryg3KZ6hf7dsI= +github.com/aws/aws-sdk-go-v2/credentials v1.17.20/go.mod h1:ktubcFYvbN8++72jVM9IJoQH6Q2TP+Z7r2VbV1AaESU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.11 h1:ltkhl3I9ddcRR3Dsy+7bOFFq546O8OYsfNEXVIyuOSE= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.11/go.mod h1:H4D8JoCFNJwnT7U5U8iwgG24n71Fx2I/ZP/18eYFr9g= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.11 h1:+BgX2AY7yV4ggSwa80z/yZIJX+e0jnNxjMLVyfpSXM0= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.11/go.mod h1:DlBATBSDCz30BCdRFldmyLsAzJwi2pdQ+YSdJTHhTUI= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.11 h1:jJ2dythFP5oNunvwc3gBsINl3ZPt/InVm4a5OAr3tag= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.11/go.mod h1:SNkot0zeLtgjP54/6BGuyG12pBcXi77jV5nbEsPgPzg= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1xUsUr3I8cHps0G+XM3WWU16lP6yG8qu1GAZAs= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.12 h1:77ORAasgQRiNRi1du4UVmttQg2Wf41WSe7TvpmpmDg0= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.12/go.mod h1:PsApornkaurUc1DIGUdiBzC19GfF1fy2ZH93O2JWigc= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.12 h1:kO2J7WMroF/OTHN9WTcUtMjPhJ7ZoNxx0dwv6UCXQgY= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.12/go.mod h1:mrNxrjYvXaSjZe5fkKaWgDnOQ6BExLn/7Ru9OpRsMPY= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.10 h1:1Hmy47QP13NjScoCMOr9kJo/hqKqf+tskyGpxVgNBxU= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.10/go.mod h1:8jZvhEt+MemeoHm9P4WFk/AVfIa9sCWL80OAKNDNTCM= -github.com/aws/aws-sdk-go-v2/service/s3 v1.55.2 h1:9UkFXpS7uU7ipUlj2sSkLtIo3Sa+LtbnObBJdx8yjd0= -github.com/aws/aws-sdk-go-v2/service/s3 v1.55.2/go.mod h1:Cijxa/K9vFQ9RPd16rq3cE+0Sg5hvmpEkTo+LThg43E= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.13 h1:zmKtGN1dMQDVBsfCePykMQmTfWY+jlaUTv55RF5b31w= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.13/go.mod h1:1UzMv5n56AjbPR9834o5YLw5dH6baIsY60Ib84s1NCc= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.13 h1:3A8vxp65nZy6aMlSCBvpIyxIbAN0DOSxaPDZuzasxuU= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.13/go.mod h1:IxJ/pMQ/Y+MDFGo6pQRyqzKKwtGMHb5IWp5PXSQr8dM= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.11 h1:QNkz5KqOUdeq1D0AP9r7Af6hNKyb0fnFa/L4DEKTp+Q= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.11/go.mod h1:c7R1eDLOU5hQ4f66TYzyAT2AeLLtw5khZJpbGCo1cYU= +github.com/aws/aws-sdk-go-v2/service/s3 v1.56.0 h1:NZIFz15bhrWwewGU0tdUGsisKPQxvzy3O4dL5jgBDKw= +github.com/aws/aws-sdk-go-v2/service/s3 v1.56.0/go.mod h1:ha/DkVoeDtS0XwRKyOiXP2J4Vzo3zpiE0yGi7Ej0X3o= github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q= github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= From b5be3d04b2d8b9179cd06de353609a78a107b637 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Jun 2024 02:32:01 +0000 Subject: [PATCH 04/34] Bump the all group with 3 updates Bumps the all group with 3 updates: [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2), [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2) and [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2). Updates `github.com/aws/aws-sdk-go-v2` from 1.29.0 to 1.30.0 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.29.0...v1.30.0) Updates `github.com/aws/aws-sdk-go-v2/credentials` from 1.17.20 to 1.17.21 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.20...credentials/v1.17.21) Updates `github.com/aws/aws-sdk-go-v2/service/s3` from 1.56.0 to 1.56.1 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.56.0...service/s3/v1.56.1) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all - dependency-name: github.com/aws/aws-sdk-go-v2/credentials dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all - dependency-name: github.com/aws/aws-sdk-go-v2/service/s3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all ... Signed-off-by: dependabot[bot] --- go.mod | 18 +++++++++--------- go.sum | 36 ++++++++++++++++++------------------ 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/go.mod b/go.mod index a6617de..aef1a05 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,9 @@ module github.com/essentialkaos/atlassian-cloud-backuper go 1.19 require ( - github.com/aws/aws-sdk-go-v2 v1.29.0 - github.com/aws/aws-sdk-go-v2/credentials v1.17.20 - github.com/aws/aws-sdk-go-v2/service/s3 v1.56.0 + github.com/aws/aws-sdk-go-v2 v1.30.0 + github.com/aws/aws-sdk-go-v2/credentials v1.17.21 + github.com/aws/aws-sdk-go-v2/service/s3 v1.56.1 github.com/essentialkaos/ek/v12 v12.126.1 github.com/pkg/sftp v1.13.6 golang.org/x/crypto v0.24.0 @@ -13,13 +13,13 @@ require ( require ( github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.11 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.11 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.11 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.12 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.12 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.12 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.13 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.13 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.11 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.14 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.14 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.12 // indirect github.com/aws/smithy-go v1.20.2 // indirect github.com/essentialkaos/depsy v1.3.0 // indirect github.com/kr/fs v0.1.0 // indirect diff --git a/go.sum b/go.sum index b070d62..cfc610f 100644 --- a/go.sum +++ b/go.sum @@ -1,25 +1,25 @@ -github.com/aws/aws-sdk-go-v2 v1.29.0 h1:uMlEecEwgp2gs6CsM6ugquNHr6mg0LHylPBR8u5Ojac= -github.com/aws/aws-sdk-go-v2 v1.29.0/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= +github.com/aws/aws-sdk-go-v2 v1.30.0 h1:6qAwtzlfcTtcL8NHtbDQAqgM5s6NDipQTkPxyH/6kAA= +github.com/aws/aws-sdk-go-v2 v1.30.0/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 h1:x6xsQXGSmW6frevwDA+vi/wqhp1ct18mVXYN08/93to= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2/go.mod h1:lPprDr1e6cJdyYeGXnRaJoP4Md+cDBvi2eOj00BlGmg= -github.com/aws/aws-sdk-go-v2/credentials v1.17.20 h1:VYTCplAeOeBv5InTtrmF61OIwD4aHKryg3KZ6hf7dsI= -github.com/aws/aws-sdk-go-v2/credentials v1.17.20/go.mod h1:ktubcFYvbN8++72jVM9IJoQH6Q2TP+Z7r2VbV1AaESU= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.11 h1:ltkhl3I9ddcRR3Dsy+7bOFFq546O8OYsfNEXVIyuOSE= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.11/go.mod h1:H4D8JoCFNJwnT7U5U8iwgG24n71Fx2I/ZP/18eYFr9g= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.11 h1:+BgX2AY7yV4ggSwa80z/yZIJX+e0jnNxjMLVyfpSXM0= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.11/go.mod h1:DlBATBSDCz30BCdRFldmyLsAzJwi2pdQ+YSdJTHhTUI= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.11 h1:jJ2dythFP5oNunvwc3gBsINl3ZPt/InVm4a5OAr3tag= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.11/go.mod h1:SNkot0zeLtgjP54/6BGuyG12pBcXi77jV5nbEsPgPzg= +github.com/aws/aws-sdk-go-v2/credentials v1.17.21 h1:pjAqgzfgFhTv5grc7xPHtXCAaMapzmwA7aU+c/SZQGw= +github.com/aws/aws-sdk-go-v2/credentials v1.17.21/go.mod h1:nhK6PtBlfHTUDVmBLr1dg+WHCOCK+1Fu/WQyVHPsgNQ= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.12 h1:SJ04WXGTwnHlWIODtC5kJzKbeuHt+OUNOgKg7nfnUGw= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.12/go.mod h1:FkpvXhA92gb3GE9LD6Og0pHHycTxW7xGpnEh5E7Opwo= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.12 h1:hb5KgeYfObi5MHkSSZMEudnIvX30iB+E21evI4r6BnQ= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.12/go.mod h1:CroKe/eWJdyfy9Vx4rljP5wTUjNJfb+fPz1uMYUhEGM= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.12 h1:DXFWyt7ymx/l1ygdyTTS0X923e+Q2wXIxConJzrgwc0= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.12/go.mod h1:mVOr/LbvaNySK1/BTy4cBOCjhCNY2raWBwK4v+WR5J4= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1xUsUr3I8cHps0G+XM3WWU16lP6yG8qu1GAZAs= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.13 h1:zmKtGN1dMQDVBsfCePykMQmTfWY+jlaUTv55RF5b31w= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.13/go.mod h1:1UzMv5n56AjbPR9834o5YLw5dH6baIsY60Ib84s1NCc= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.13 h1:3A8vxp65nZy6aMlSCBvpIyxIbAN0DOSxaPDZuzasxuU= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.13/go.mod h1:IxJ/pMQ/Y+MDFGo6pQRyqzKKwtGMHb5IWp5PXSQr8dM= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.11 h1:QNkz5KqOUdeq1D0AP9r7Af6hNKyb0fnFa/L4DEKTp+Q= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.11/go.mod h1:c7R1eDLOU5hQ4f66TYzyAT2AeLLtw5khZJpbGCo1cYU= -github.com/aws/aws-sdk-go-v2/service/s3 v1.56.0 h1:NZIFz15bhrWwewGU0tdUGsisKPQxvzy3O4dL5jgBDKw= -github.com/aws/aws-sdk-go-v2/service/s3 v1.56.0/go.mod h1:ha/DkVoeDtS0XwRKyOiXP2J4Vzo3zpiE0yGi7Ej0X3o= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.14 h1:oWccitSnByVU74rQRHac4gLfDqjB6Z1YQGOY/dXKedI= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.14/go.mod h1:8SaZBlQdCLrc/2U3CEO48rYj9uR8qRsPRkmzwNM52pM= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.14 h1:zSDPny/pVnkqABXYRicYuPf9z2bTqfH13HT3v6UheIk= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.14/go.mod h1:3TTcI5JSzda1nw/pkVC9dhgLre0SNBFj2lYS4GctXKI= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.12 h1:tzha+v1SCEBpXWEuw6B/+jm4h5z8hZbTpXz0zRZqTnw= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.12/go.mod h1:n+nt2qjHGoseWeLHt1vEr6ZRCCxIN2KcNpJxBcYQSwI= +github.com/aws/aws-sdk-go-v2/service/s3 v1.56.1 h1:wsg9Z/vNnCmxWikfGIoOlnExtEU459cR+2d+iDJ8elo= +github.com/aws/aws-sdk-go-v2/service/s3 v1.56.1/go.mod h1:8rDw3mVwmvIWWX/+LWY3PPIMZuwnQdJMCt0iVFVT3qw= github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q= github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= From 83a2cf3d77e89cd2e2533633a8c05577c78e428e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 02:52:51 +0000 Subject: [PATCH 05/34] Bump github.com/essentialkaos/ek/v12 in the all group Bumps the all group with 1 update: [github.com/essentialkaos/ek/v12](https://github.com/essentialkaos/ek). Updates `github.com/essentialkaos/ek/v12` from 12.126.1 to 12.127.0 - [Release notes](https://github.com/essentialkaos/ek/releases) - [Changelog](https://github.com/essentialkaos/ek/blob/master/CHANGELOG.md) - [Commits](https://github.com/essentialkaos/ek/compare/v12.126.1...v12.127.0) --- updated-dependencies: - dependency-name: github.com/essentialkaos/ek/v12 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index aef1a05..6879319 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/aws/aws-sdk-go-v2 v1.30.0 github.com/aws/aws-sdk-go-v2/credentials v1.17.21 github.com/aws/aws-sdk-go-v2/service/s3 v1.56.1 - github.com/essentialkaos/ek/v12 v12.126.1 + github.com/essentialkaos/ek/v12 v12.127.0 github.com/pkg/sftp v1.13.6 golang.org/x/crypto v0.24.0 ) diff --git a/go.sum b/go.sum index cfc610f..4166431 100644 --- a/go.sum +++ b/go.sum @@ -28,8 +28,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk= github.com/essentialkaos/depsy v1.3.0 h1:CN7bRgBU2jGTHSkg/Sh38eDUn7cvmaTp2sxFt2HpFeU= github.com/essentialkaos/depsy v1.3.0/go.mod h1:kpiTAV17dyByVnrbNaMcZt2jRwvuXClUYOzpyJQwtG8= -github.com/essentialkaos/ek/v12 v12.126.1 h1:K4tCpu9T3k5Bv6hJ1lmW7Ou0GxjgjBIKRsoZgAGdEhE= -github.com/essentialkaos/ek/v12 v12.126.1/go.mod h1:71IJ7m82hgjrvWnhL+z0vIhguxz47/rfVma5/CeI5Fw= +github.com/essentialkaos/ek/v12 v12.127.0 h1:fU5A+QbIZ7NTq1K5jGVwAWwuLtBUhsIKuRWYT78hE+Q= +github.com/essentialkaos/ek/v12 v12.127.0/go.mod h1:71IJ7m82hgjrvWnhL+z0vIhguxz47/rfVma5/CeI5Fw= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= From 82adfef513f9ea25d26f60614451a46fbf1482e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Jun 2024 02:43:28 +0000 Subject: [PATCH 06/34] Bump github.com/essentialkaos/ek/v12 in the all group Bumps the all group with 1 update: [github.com/essentialkaos/ek/v12](https://github.com/essentialkaos/ek). Updates `github.com/essentialkaos/ek/v12` from 12.127.0 to 12.128.0 - [Release notes](https://github.com/essentialkaos/ek/releases) - [Changelog](https://github.com/essentialkaos/ek/blob/master/CHANGELOG.md) - [Commits](https://github.com/essentialkaos/ek/compare/v12.127.0...v12.128.0) --- updated-dependencies: - dependency-name: github.com/essentialkaos/ek/v12 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6879319..b1e8b5c 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/aws/aws-sdk-go-v2 v1.30.0 github.com/aws/aws-sdk-go-v2/credentials v1.17.21 github.com/aws/aws-sdk-go-v2/service/s3 v1.56.1 - github.com/essentialkaos/ek/v12 v12.127.0 + github.com/essentialkaos/ek/v12 v12.128.0 github.com/pkg/sftp v1.13.6 golang.org/x/crypto v0.24.0 ) diff --git a/go.sum b/go.sum index 4166431..25cd293 100644 --- a/go.sum +++ b/go.sum @@ -28,8 +28,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk= github.com/essentialkaos/depsy v1.3.0 h1:CN7bRgBU2jGTHSkg/Sh38eDUn7cvmaTp2sxFt2HpFeU= github.com/essentialkaos/depsy v1.3.0/go.mod h1:kpiTAV17dyByVnrbNaMcZt2jRwvuXClUYOzpyJQwtG8= -github.com/essentialkaos/ek/v12 v12.127.0 h1:fU5A+QbIZ7NTq1K5jGVwAWwuLtBUhsIKuRWYT78hE+Q= -github.com/essentialkaos/ek/v12 v12.127.0/go.mod h1:71IJ7m82hgjrvWnhL+z0vIhguxz47/rfVma5/CeI5Fw= +github.com/essentialkaos/ek/v12 v12.128.0 h1:vaBvqvYZtkBxmiYSMllYA6MRbNbiOXcxwKEVbZqxxLE= +github.com/essentialkaos/ek/v12 v12.128.0/go.mod h1:71IJ7m82hgjrvWnhL+z0vIhguxz47/rfVma5/CeI5Fw= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= From 71ca80a870d93575cd083374a8c3bfbc0322eb2f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 27 Jun 2024 02:55:22 +0000 Subject: [PATCH 07/34] Bump the all group with 3 updates Bumps the all group with 3 updates: [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2), [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2) and [github.com/essentialkaos/ek/v12](https://github.com/essentialkaos/ek). Updates `github.com/aws/aws-sdk-go-v2/credentials` from 1.17.21 to 1.17.22 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.21...credentials/v1.17.22) Updates `github.com/aws/aws-sdk-go-v2/service/s3` from 1.56.1 to 1.57.0 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.56.1...service/s3/v1.57.0) Updates `github.com/essentialkaos/ek/v12` from 12.128.0 to 12.129.0 - [Release notes](https://github.com/essentialkaos/ek/releases) - [Changelog](https://github.com/essentialkaos/ek/blob/master/CHANGELOG.md) - [Commits](https://github.com/essentialkaos/ek/compare/v12.128.0...v12.129.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/credentials dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all - dependency-name: github.com/aws/aws-sdk-go-v2/service/s3 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all - dependency-name: github.com/essentialkaos/ek/v12 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all ... Signed-off-by: dependabot[bot] --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index b1e8b5c..fc02aa7 100644 --- a/go.mod +++ b/go.mod @@ -4,9 +4,9 @@ go 1.19 require ( github.com/aws/aws-sdk-go-v2 v1.30.0 - github.com/aws/aws-sdk-go-v2/credentials v1.17.21 - github.com/aws/aws-sdk-go-v2/service/s3 v1.56.1 - github.com/essentialkaos/ek/v12 v12.128.0 + github.com/aws/aws-sdk-go-v2/credentials v1.17.22 + github.com/aws/aws-sdk-go-v2/service/s3 v1.57.0 + github.com/essentialkaos/ek/v12 v12.129.0 github.com/pkg/sftp v1.13.6 golang.org/x/crypto v0.24.0 ) diff --git a/go.sum b/go.sum index 25cd293..87f2f56 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/aws/aws-sdk-go-v2 v1.30.0 h1:6qAwtzlfcTtcL8NHtbDQAqgM5s6NDipQTkPxyH/6 github.com/aws/aws-sdk-go-v2 v1.30.0/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 h1:x6xsQXGSmW6frevwDA+vi/wqhp1ct18mVXYN08/93to= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2/go.mod h1:lPprDr1e6cJdyYeGXnRaJoP4Md+cDBvi2eOj00BlGmg= -github.com/aws/aws-sdk-go-v2/credentials v1.17.21 h1:pjAqgzfgFhTv5grc7xPHtXCAaMapzmwA7aU+c/SZQGw= -github.com/aws/aws-sdk-go-v2/credentials v1.17.21/go.mod h1:nhK6PtBlfHTUDVmBLr1dg+WHCOCK+1Fu/WQyVHPsgNQ= +github.com/aws/aws-sdk-go-v2/credentials v1.17.22 h1:wu9kXQbbt64ul09v3ye4HYleAr4WiGV/uv69EXKDEr0= +github.com/aws/aws-sdk-go-v2/credentials v1.17.22/go.mod h1:pcvMtPcxJn3r2k6mZD9I0EcumLqPLA7V/0iCgOIlY+o= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.12 h1:SJ04WXGTwnHlWIODtC5kJzKbeuHt+OUNOgKg7nfnUGw= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.12/go.mod h1:FkpvXhA92gb3GE9LD6Og0pHHycTxW7xGpnEh5E7Opwo= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.12 h1:hb5KgeYfObi5MHkSSZMEudnIvX30iB+E21evI4r6BnQ= @@ -18,8 +18,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.14 h1:zSDPny/p github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.14/go.mod h1:3TTcI5JSzda1nw/pkVC9dhgLre0SNBFj2lYS4GctXKI= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.12 h1:tzha+v1SCEBpXWEuw6B/+jm4h5z8hZbTpXz0zRZqTnw= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.12/go.mod h1:n+nt2qjHGoseWeLHt1vEr6ZRCCxIN2KcNpJxBcYQSwI= -github.com/aws/aws-sdk-go-v2/service/s3 v1.56.1 h1:wsg9Z/vNnCmxWikfGIoOlnExtEU459cR+2d+iDJ8elo= -github.com/aws/aws-sdk-go-v2/service/s3 v1.56.1/go.mod h1:8rDw3mVwmvIWWX/+LWY3PPIMZuwnQdJMCt0iVFVT3qw= +github.com/aws/aws-sdk-go-v2/service/s3 v1.57.0 h1:v2DWNY6ll3JK62Bx1khUu9fJ4f3TwXllIEJxI7dDv/o= +github.com/aws/aws-sdk-go-v2/service/s3 v1.57.0/go.mod h1:8rDw3mVwmvIWWX/+LWY3PPIMZuwnQdJMCt0iVFVT3qw= github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q= github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -28,8 +28,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk= github.com/essentialkaos/depsy v1.3.0 h1:CN7bRgBU2jGTHSkg/Sh38eDUn7cvmaTp2sxFt2HpFeU= github.com/essentialkaos/depsy v1.3.0/go.mod h1:kpiTAV17dyByVnrbNaMcZt2jRwvuXClUYOzpyJQwtG8= -github.com/essentialkaos/ek/v12 v12.128.0 h1:vaBvqvYZtkBxmiYSMllYA6MRbNbiOXcxwKEVbZqxxLE= -github.com/essentialkaos/ek/v12 v12.128.0/go.mod h1:71IJ7m82hgjrvWnhL+z0vIhguxz47/rfVma5/CeI5Fw= +github.com/essentialkaos/ek/v12 v12.129.0 h1:ILbIifoOe3nZIP2ilRBZ/N/UyZUNCSGFGRnwb0Vb5WQ= +github.com/essentialkaos/ek/v12 v12.129.0/go.mod h1:71IJ7m82hgjrvWnhL+z0vIhguxz47/rfVma5/CeI5Fw= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= From a5b70fe36c1c1eb95c77cb3b949b206576b83d30 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 02:57:41 +0000 Subject: [PATCH 08/34] Bump the all group with 3 updates Bumps the all group with 3 updates: [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2), [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2) and [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2). Updates `github.com/aws/aws-sdk-go-v2` from 1.30.0 to 1.30.1 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.30.0...v1.30.1) Updates `github.com/aws/aws-sdk-go-v2/credentials` from 1.17.22 to 1.17.23 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.22...credentials/v1.17.23) Updates `github.com/aws/aws-sdk-go-v2/service/s3` from 1.57.0 to 1.57.1 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.57.0...service/s3/v1.57.1) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all - dependency-name: github.com/aws/aws-sdk-go-v2/credentials dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all - dependency-name: github.com/aws/aws-sdk-go-v2/service/s3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all ... Signed-off-by: dependabot[bot] --- go.mod | 24 ++++++++++++------------ go.sum | 48 ++++++++++++++++++++++++------------------------ 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/go.mod b/go.mod index fc02aa7..d7e5b2c 100644 --- a/go.mod +++ b/go.mod @@ -3,24 +3,24 @@ module github.com/essentialkaos/atlassian-cloud-backuper go 1.19 require ( - github.com/aws/aws-sdk-go-v2 v1.30.0 - github.com/aws/aws-sdk-go-v2/credentials v1.17.22 - github.com/aws/aws-sdk-go-v2/service/s3 v1.57.0 + github.com/aws/aws-sdk-go-v2 v1.30.1 + github.com/aws/aws-sdk-go-v2/credentials v1.17.23 + github.com/aws/aws-sdk-go-v2/service/s3 v1.57.1 github.com/essentialkaos/ek/v12 v12.129.0 github.com/pkg/sftp v1.13.6 golang.org/x/crypto v0.24.0 ) require ( - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.12 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.12 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.12 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.14 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.14 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.12 // indirect - github.com/aws/smithy-go v1.20.2 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.13 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.13 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.13 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.15 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.15 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.13 // indirect + github.com/aws/smithy-go v1.20.3 // indirect github.com/essentialkaos/depsy v1.3.0 // indirect github.com/kr/fs v0.1.0 // indirect golang.org/x/sys v0.21.0 // indirect diff --git a/go.sum b/go.sum index 87f2f56..aff2d61 100644 --- a/go.sum +++ b/go.sum @@ -1,27 +1,27 @@ -github.com/aws/aws-sdk-go-v2 v1.30.0 h1:6qAwtzlfcTtcL8NHtbDQAqgM5s6NDipQTkPxyH/6kAA= -github.com/aws/aws-sdk-go-v2 v1.30.0/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 h1:x6xsQXGSmW6frevwDA+vi/wqhp1ct18mVXYN08/93to= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2/go.mod h1:lPprDr1e6cJdyYeGXnRaJoP4Md+cDBvi2eOj00BlGmg= -github.com/aws/aws-sdk-go-v2/credentials v1.17.22 h1:wu9kXQbbt64ul09v3ye4HYleAr4WiGV/uv69EXKDEr0= -github.com/aws/aws-sdk-go-v2/credentials v1.17.22/go.mod h1:pcvMtPcxJn3r2k6mZD9I0EcumLqPLA7V/0iCgOIlY+o= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.12 h1:SJ04WXGTwnHlWIODtC5kJzKbeuHt+OUNOgKg7nfnUGw= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.12/go.mod h1:FkpvXhA92gb3GE9LD6Og0pHHycTxW7xGpnEh5E7Opwo= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.12 h1:hb5KgeYfObi5MHkSSZMEudnIvX30iB+E21evI4r6BnQ= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.12/go.mod h1:CroKe/eWJdyfy9Vx4rljP5wTUjNJfb+fPz1uMYUhEGM= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.12 h1:DXFWyt7ymx/l1ygdyTTS0X923e+Q2wXIxConJzrgwc0= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.12/go.mod h1:mVOr/LbvaNySK1/BTy4cBOCjhCNY2raWBwK4v+WR5J4= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1xUsUr3I8cHps0G+XM3WWU16lP6yG8qu1GAZAs= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.14 h1:oWccitSnByVU74rQRHac4gLfDqjB6Z1YQGOY/dXKedI= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.14/go.mod h1:8SaZBlQdCLrc/2U3CEO48rYj9uR8qRsPRkmzwNM52pM= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.14 h1:zSDPny/pVnkqABXYRicYuPf9z2bTqfH13HT3v6UheIk= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.14/go.mod h1:3TTcI5JSzda1nw/pkVC9dhgLre0SNBFj2lYS4GctXKI= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.12 h1:tzha+v1SCEBpXWEuw6B/+jm4h5z8hZbTpXz0zRZqTnw= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.12/go.mod h1:n+nt2qjHGoseWeLHt1vEr6ZRCCxIN2KcNpJxBcYQSwI= -github.com/aws/aws-sdk-go-v2/service/s3 v1.57.0 h1:v2DWNY6ll3JK62Bx1khUu9fJ4f3TwXllIEJxI7dDv/o= -github.com/aws/aws-sdk-go-v2/service/s3 v1.57.0/go.mod h1:8rDw3mVwmvIWWX/+LWY3PPIMZuwnQdJMCt0iVFVT3qw= -github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q= -github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= +github.com/aws/aws-sdk-go-v2 v1.30.1 h1:4y/5Dvfrhd1MxRDD77SrfsDaj8kUkkljU7XE83NPV+o= +github.com/aws/aws-sdk-go-v2 v1.30.1/go.mod h1:nIQjQVp5sfpQcTc9mPSr1B0PaWK5ByX9MOoDadSN4lc= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3 h1:tW1/Rkad38LA15X4UQtjXZXNKsCgkshC3EbmcUmghTg= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3/go.mod h1:UbnqO+zjqk3uIt9yCACHJ9IVNhyhOCnYk8yA19SAWrM= +github.com/aws/aws-sdk-go-v2/credentials v1.17.23 h1:G1CfmLVoO2TdQ8z9dW+JBc/r8+MqyPQhXCafNZcXVZo= +github.com/aws/aws-sdk-go-v2/credentials v1.17.23/go.mod h1:V/DvSURn6kKgcuKEk4qwSwb/fZ2d++FFARtWSbXnLqY= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.13 h1:5SAoZ4jYpGH4721ZNoS1znQrhOfZinOhc4XuTXx/nVc= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.13/go.mod h1:+rdA6ZLpaSeM7tSg/B0IEDinCIBJGmW8rKDFkYpP04g= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.13 h1:WIijqeaAO7TYFLbhsZmi2rgLEAtWOC1LhxCAVTJlSKw= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.13/go.mod h1:i+kbfa76PQbWw/ULoWnp51EYVWH4ENln76fLQE3lXT8= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.13 h1:THZJJ6TU/FOiM7DZFnisYV9d49oxXWUzsVIMTuf3VNU= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.13/go.mod h1:VISUTg6n+uBaYIWPBaIG0jk7mbBxm7DUqBtU2cUDDWI= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 h1:dT3MqvGhSoaIhRseqw2I0yH81l7wiR2vjs57O51EAm8= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3/go.mod h1:GlAeCkHwugxdHaueRr4nhPuY+WW+gR8UjlcqzPr1SPI= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.15 h1:2jyRZ9rVIMisyQRnhSS/SqlckveoxXneIumECVFP91Y= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.15/go.mod h1:bDRG3m382v1KJBk1cKz7wIajg87/61EiiymEyfLvAe0= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.15 h1:I9zMeF107l0rJrpnHpjEiiTSCKYAIw8mALiXcPsGBiA= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.15/go.mod h1:9xWJ3Q/S6Ojusz1UIkfycgD1mGirJfLLKqq3LPT7WN8= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.13 h1:Eq2THzHt6P41mpjS2sUzz/3dJYFRqdWZ+vQaEMm98EM= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.13/go.mod h1:FgwTca6puegxgCInYwGjmd4tB9195Dd6LCuA+8MjpWw= +github.com/aws/aws-sdk-go-v2/service/s3 v1.57.1 h1:aHPtNY87GZ214N4rShgIo+5JQz7ICrJ50i17JbueUTw= +github.com/aws/aws-sdk-go-v2/service/s3 v1.57.1/go.mod h1:hdV0NTYd0RwV4FvNKhKUNbPLZoq9CTr/lke+3I7aCAI= +github.com/aws/smithy-go v1.20.3 h1:ryHwveWzPV5BIof6fyDvor6V3iUL7nTfiTKXHiW05nE= +github.com/aws/smithy-go v1.20.3/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= From 5a7091a912b3aac013b26a819fce8bab8c771c47 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Jul 2024 03:04:07 +0000 Subject: [PATCH 09/34] Bump github.com/aws/aws-sdk-go-v2/service/s3 in the all group Bumps the all group with 1 update: [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2). Updates `github.com/aws/aws-sdk-go-v2/service/s3` from 1.57.1 to 1.58.0 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.57.1...service/s3/v1.58.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/s3 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d7e5b2c..4039ff8 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/aws/aws-sdk-go-v2 v1.30.1 github.com/aws/aws-sdk-go-v2/credentials v1.17.23 - github.com/aws/aws-sdk-go-v2/service/s3 v1.57.1 + github.com/aws/aws-sdk-go-v2/service/s3 v1.58.0 github.com/essentialkaos/ek/v12 v12.129.0 github.com/pkg/sftp v1.13.6 golang.org/x/crypto v0.24.0 diff --git a/go.sum b/go.sum index aff2d61..2aca386 100644 --- a/go.sum +++ b/go.sum @@ -18,8 +18,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.15 h1:I9zMeF10 github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.15/go.mod h1:9xWJ3Q/S6Ojusz1UIkfycgD1mGirJfLLKqq3LPT7WN8= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.13 h1:Eq2THzHt6P41mpjS2sUzz/3dJYFRqdWZ+vQaEMm98EM= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.13/go.mod h1:FgwTca6puegxgCInYwGjmd4tB9195Dd6LCuA+8MjpWw= -github.com/aws/aws-sdk-go-v2/service/s3 v1.57.1 h1:aHPtNY87GZ214N4rShgIo+5JQz7ICrJ50i17JbueUTw= -github.com/aws/aws-sdk-go-v2/service/s3 v1.57.1/go.mod h1:hdV0NTYd0RwV4FvNKhKUNbPLZoq9CTr/lke+3I7aCAI= +github.com/aws/aws-sdk-go-v2/service/s3 v1.58.0 h1:4rhV0Hn+bf8IAIUphRX1moBcEvKJipCPmswMCl6Q5mw= +github.com/aws/aws-sdk-go-v2/service/s3 v1.58.0/go.mod h1:hdV0NTYd0RwV4FvNKhKUNbPLZoq9CTr/lke+3I7aCAI= github.com/aws/smithy-go v1.20.3 h1:ryHwveWzPV5BIof6fyDvor6V3iUL7nTfiTKXHiW05nE= github.com/aws/smithy-go v1.20.3/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= From 5e4fb96d501c411cd78165cfc4f0c46168a7b186 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Jul 2024 02:16:20 +0000 Subject: [PATCH 10/34] Bump github.com/aws/aws-sdk-go-v2/credentials in the all group Bumps the all group with 1 update: [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2). Updates `github.com/aws/aws-sdk-go-v2/credentials` from 1.17.23 to 1.17.24 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.23...credentials/v1.17.24) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/credentials dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4039ff8..d26914b 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/aws/aws-sdk-go-v2 v1.30.1 - github.com/aws/aws-sdk-go-v2/credentials v1.17.23 + github.com/aws/aws-sdk-go-v2/credentials v1.17.24 github.com/aws/aws-sdk-go-v2/service/s3 v1.58.0 github.com/essentialkaos/ek/v12 v12.129.0 github.com/pkg/sftp v1.13.6 diff --git a/go.sum b/go.sum index 2aca386..97356b5 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/aws/aws-sdk-go-v2 v1.30.1 h1:4y/5Dvfrhd1MxRDD77SrfsDaj8kUkkljU7XE83NP github.com/aws/aws-sdk-go-v2 v1.30.1/go.mod h1:nIQjQVp5sfpQcTc9mPSr1B0PaWK5ByX9MOoDadSN4lc= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3 h1:tW1/Rkad38LA15X4UQtjXZXNKsCgkshC3EbmcUmghTg= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3/go.mod h1:UbnqO+zjqk3uIt9yCACHJ9IVNhyhOCnYk8yA19SAWrM= -github.com/aws/aws-sdk-go-v2/credentials v1.17.23 h1:G1CfmLVoO2TdQ8z9dW+JBc/r8+MqyPQhXCafNZcXVZo= -github.com/aws/aws-sdk-go-v2/credentials v1.17.23/go.mod h1:V/DvSURn6kKgcuKEk4qwSwb/fZ2d++FFARtWSbXnLqY= +github.com/aws/aws-sdk-go-v2/credentials v1.17.24 h1:YclAsrnb1/GTQNt2nzv+756Iw4mF8AOzcDfweWwwm/M= +github.com/aws/aws-sdk-go-v2/credentials v1.17.24/go.mod h1:Hld7tmnAkoBQdTMNYZGzztzKRdA4fCdn9L83LOoigac= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.13 h1:5SAoZ4jYpGH4721ZNoS1znQrhOfZinOhc4XuTXx/nVc= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.13/go.mod h1:+rdA6ZLpaSeM7tSg/B0IEDinCIBJGmW8rKDFkYpP04g= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.13 h1:WIijqeaAO7TYFLbhsZmi2rgLEAtWOC1LhxCAVTJlSKw= From 0b9d5e81f277cd11954d52b6b4b8fed87e4906fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 03:08:53 +0000 Subject: [PATCH 11/34] Bump the all group across 1 directory with 5 updates Bumps the all group with 5 updates in the / directory: | Package | From | To | | --- | --- | --- | | [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2) | `1.30.1` | `1.30.3` | | [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2) | `1.17.24` | `1.17.26` | | [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2) | `1.58.0` | `1.58.2` | | [github.com/essentialkaos/ek/v12](https://github.com/essentialkaos/ek) | `12.129.0` | `12.130.0` | | [golang.org/x/crypto](https://github.com/golang/crypto) | `0.24.0` | `0.25.0` | Updates `github.com/aws/aws-sdk-go-v2` from 1.30.1 to 1.30.3 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.30.1...v1.30.3) Updates `github.com/aws/aws-sdk-go-v2/credentials` from 1.17.24 to 1.17.26 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.24...credentials/v1.17.26) Updates `github.com/aws/aws-sdk-go-v2/service/s3` from 1.58.0 to 1.58.2 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.58.0...service/s3/v1.58.2) Updates `github.com/essentialkaos/ek/v12` from 12.129.0 to 12.130.0 - [Release notes](https://github.com/essentialkaos/ek/releases) - [Changelog](https://github.com/essentialkaos/ek/blob/master/CHANGELOG.md) - [Commits](https://github.com/essentialkaos/ek/compare/v12.129.0...v12.130.0) Updates `golang.org/x/crypto` from 0.24.0 to 0.25.0 - [Commits](https://github.com/golang/crypto/compare/v0.24.0...v0.25.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all - dependency-name: github.com/aws/aws-sdk-go-v2/credentials dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all - dependency-name: github.com/aws/aws-sdk-go-v2/service/s3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all - dependency-name: github.com/essentialkaos/ek/v12 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all - dependency-name: golang.org/x/crypto dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all ... Signed-off-by: dependabot[bot] --- go.mod | 24 ++++++++++++------------ go.sum | 50 +++++++++++++++++++++++++------------------------- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/go.mod b/go.mod index d26914b..c5958a3 100644 --- a/go.mod +++ b/go.mod @@ -3,25 +3,25 @@ module github.com/essentialkaos/atlassian-cloud-backuper go 1.19 require ( - github.com/aws/aws-sdk-go-v2 v1.30.1 - github.com/aws/aws-sdk-go-v2/credentials v1.17.24 - github.com/aws/aws-sdk-go-v2/service/s3 v1.58.0 - github.com/essentialkaos/ek/v12 v12.129.0 + github.com/aws/aws-sdk-go-v2 v1.30.3 + github.com/aws/aws-sdk-go-v2/credentials v1.17.26 + github.com/aws/aws-sdk-go-v2/service/s3 v1.58.2 + github.com/essentialkaos/ek/v12 v12.130.0 github.com/pkg/sftp v1.13.6 - golang.org/x/crypto v0.24.0 + golang.org/x/crypto v0.25.0 ) require ( github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.13 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.13 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.13 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.15 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.15 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.15 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.13 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.17 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.15 // indirect github.com/aws/smithy-go v1.20.3 // indirect github.com/essentialkaos/depsy v1.3.0 // indirect github.com/kr/fs v0.1.0 // indirect - golang.org/x/sys v0.21.0 // indirect + golang.org/x/sys v0.22.0 // indirect ) diff --git a/go.sum b/go.sum index 97356b5..d6f8375 100644 --- a/go.sum +++ b/go.sum @@ -1,25 +1,25 @@ -github.com/aws/aws-sdk-go-v2 v1.30.1 h1:4y/5Dvfrhd1MxRDD77SrfsDaj8kUkkljU7XE83NPV+o= -github.com/aws/aws-sdk-go-v2 v1.30.1/go.mod h1:nIQjQVp5sfpQcTc9mPSr1B0PaWK5ByX9MOoDadSN4lc= +github.com/aws/aws-sdk-go-v2 v1.30.3 h1:jUeBtG0Ih+ZIFH0F4UkmL9w3cSpaMv9tYYDbzILP8dY= +github.com/aws/aws-sdk-go-v2 v1.30.3/go.mod h1:nIQjQVp5sfpQcTc9mPSr1B0PaWK5ByX9MOoDadSN4lc= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3 h1:tW1/Rkad38LA15X4UQtjXZXNKsCgkshC3EbmcUmghTg= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3/go.mod h1:UbnqO+zjqk3uIt9yCACHJ9IVNhyhOCnYk8yA19SAWrM= -github.com/aws/aws-sdk-go-v2/credentials v1.17.24 h1:YclAsrnb1/GTQNt2nzv+756Iw4mF8AOzcDfweWwwm/M= -github.com/aws/aws-sdk-go-v2/credentials v1.17.24/go.mod h1:Hld7tmnAkoBQdTMNYZGzztzKRdA4fCdn9L83LOoigac= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.13 h1:5SAoZ4jYpGH4721ZNoS1znQrhOfZinOhc4XuTXx/nVc= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.13/go.mod h1:+rdA6ZLpaSeM7tSg/B0IEDinCIBJGmW8rKDFkYpP04g= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.13 h1:WIijqeaAO7TYFLbhsZmi2rgLEAtWOC1LhxCAVTJlSKw= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.13/go.mod h1:i+kbfa76PQbWw/ULoWnp51EYVWH4ENln76fLQE3lXT8= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.13 h1:THZJJ6TU/FOiM7DZFnisYV9d49oxXWUzsVIMTuf3VNU= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.13/go.mod h1:VISUTg6n+uBaYIWPBaIG0jk7mbBxm7DUqBtU2cUDDWI= +github.com/aws/aws-sdk-go-v2/credentials v1.17.26 h1:tsm8g/nJxi8+/7XyJJcP2dLrnK/5rkFp6+i2nhmz5fk= +github.com/aws/aws-sdk-go-v2/credentials v1.17.26/go.mod h1:3vAM49zkIa3q8WT6o9Ve5Z0vdByDMwmdScO0zvThTgI= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 h1:SoNJ4RlFEQEbtDcCEt+QG56MY4fm4W8rYirAmq+/DdU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15/go.mod h1:U9ke74k1n2bf+RIgoX1SXFed1HLs51OgUSs+Ph0KJP8= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 h1:C6WHdGnTDIYETAm5iErQUiVNsclNx9qbJVPIt03B6bI= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15/go.mod h1:ZQLZqhcu+JhSrA9/NXRm8SkDvsycE+JkV3WGY41e+IM= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.15 h1:Z5r7SycxmSllHYmaAZPpmN8GviDrSGhMS6bldqtXZPw= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.15/go.mod h1:CetW7bDE00QoGEmPUoZuRog07SGVAUVW6LFpNP0YfIg= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 h1:dT3MqvGhSoaIhRseqw2I0yH81l7wiR2vjs57O51EAm8= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3/go.mod h1:GlAeCkHwugxdHaueRr4nhPuY+WW+gR8UjlcqzPr1SPI= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.15 h1:2jyRZ9rVIMisyQRnhSS/SqlckveoxXneIumECVFP91Y= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.15/go.mod h1:bDRG3m382v1KJBk1cKz7wIajg87/61EiiymEyfLvAe0= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.15 h1:I9zMeF107l0rJrpnHpjEiiTSCKYAIw8mALiXcPsGBiA= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.15/go.mod h1:9xWJ3Q/S6Ojusz1UIkfycgD1mGirJfLLKqq3LPT7WN8= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.13 h1:Eq2THzHt6P41mpjS2sUzz/3dJYFRqdWZ+vQaEMm98EM= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.13/go.mod h1:FgwTca6puegxgCInYwGjmd4tB9195Dd6LCuA+8MjpWw= -github.com/aws/aws-sdk-go-v2/service/s3 v1.58.0 h1:4rhV0Hn+bf8IAIUphRX1moBcEvKJipCPmswMCl6Q5mw= -github.com/aws/aws-sdk-go-v2/service/s3 v1.58.0/go.mod h1:hdV0NTYd0RwV4FvNKhKUNbPLZoq9CTr/lke+3I7aCAI= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.17 h1:YPYe6ZmvUfDDDELqEKtAd6bo8zxhkm+XEFEzQisqUIE= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.17/go.mod h1:oBtcnYua/CgzCWYN7NZ5j7PotFDaFSUjCYVTtfyn7vw= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 h1:HGErhhrxZlQ044RiM+WdoZxp0p+EGM62y3L6pwA4olE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17/go.mod h1:RkZEx4l0EHYDJpWppMJ3nD9wZJAa8/0lq9aVC+r2UII= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.15 h1:246A4lSTXWJw/rmlQI+TT2OcqeDMKBdyjEQrafMaQdA= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.15/go.mod h1:haVfg3761/WF7YPuJOER2MP0k4UAXyHaLclKXB6usDg= +github.com/aws/aws-sdk-go-v2/service/s3 v1.58.2 h1:sZXIzO38GZOU+O0C+INqbH7C2yALwfMWpd64tONS/NE= +github.com/aws/aws-sdk-go-v2/service/s3 v1.58.2/go.mod h1:Lcxzg5rojyVPU/0eFwLtcyTaek/6Mtic5B1gJo7e/zE= github.com/aws/smithy-go v1.20.3 h1:ryHwveWzPV5BIof6fyDvor6V3iUL7nTfiTKXHiW05nE= github.com/aws/smithy-go v1.20.3/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -28,8 +28,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk= github.com/essentialkaos/depsy v1.3.0 h1:CN7bRgBU2jGTHSkg/Sh38eDUn7cvmaTp2sxFt2HpFeU= github.com/essentialkaos/depsy v1.3.0/go.mod h1:kpiTAV17dyByVnrbNaMcZt2jRwvuXClUYOzpyJQwtG8= -github.com/essentialkaos/ek/v12 v12.129.0 h1:ILbIifoOe3nZIP2ilRBZ/N/UyZUNCSGFGRnwb0Vb5WQ= -github.com/essentialkaos/ek/v12 v12.129.0/go.mod h1:71IJ7m82hgjrvWnhL+z0vIhguxz47/rfVma5/CeI5Fw= +github.com/essentialkaos/ek/v12 v12.130.0 h1:JhcjGZaBIEFfyNReHAHeTgldNv65ruHa9LR7YIVgmn0= +github.com/essentialkaos/ek/v12 v12.130.0/go.mod h1:yGof+LJIkWvQtGINs+2AGv/yeqcfj/brpQ9eYnzMzKs= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -48,8 +48,8 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -63,12 +63,12 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= +golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= From 064982b8d86a1be700d35eebdf54c75859c7c83f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Jul 2024 02:28:11 +0000 Subject: [PATCH 12/34] Bump github.com/aws/aws-sdk-go-v2/credentials in the all group Bumps the all group with 1 update: [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2). Updates `github.com/aws/aws-sdk-go-v2/credentials` from 1.17.26 to 1.17.27 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.26...credentials/v1.17.27) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/credentials dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c5958a3..aa87b7a 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/aws/aws-sdk-go-v2 v1.30.3 - github.com/aws/aws-sdk-go-v2/credentials v1.17.26 + github.com/aws/aws-sdk-go-v2/credentials v1.17.27 github.com/aws/aws-sdk-go-v2/service/s3 v1.58.2 github.com/essentialkaos/ek/v12 v12.130.0 github.com/pkg/sftp v1.13.6 diff --git a/go.sum b/go.sum index d6f8375..6f0266d 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/aws/aws-sdk-go-v2 v1.30.3 h1:jUeBtG0Ih+ZIFH0F4UkmL9w3cSpaMv9tYYDbzILP github.com/aws/aws-sdk-go-v2 v1.30.3/go.mod h1:nIQjQVp5sfpQcTc9mPSr1B0PaWK5ByX9MOoDadSN4lc= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3 h1:tW1/Rkad38LA15X4UQtjXZXNKsCgkshC3EbmcUmghTg= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3/go.mod h1:UbnqO+zjqk3uIt9yCACHJ9IVNhyhOCnYk8yA19SAWrM= -github.com/aws/aws-sdk-go-v2/credentials v1.17.26 h1:tsm8g/nJxi8+/7XyJJcP2dLrnK/5rkFp6+i2nhmz5fk= -github.com/aws/aws-sdk-go-v2/credentials v1.17.26/go.mod h1:3vAM49zkIa3q8WT6o9Ve5Z0vdByDMwmdScO0zvThTgI= +github.com/aws/aws-sdk-go-v2/credentials v1.17.27 h1:2raNba6gr2IfA0eqqiP2XiQ0UVOpGPgDSi0I9iAP+UI= +github.com/aws/aws-sdk-go-v2/credentials v1.17.27/go.mod h1:gniiwbGahQByxan6YjQUMcW4Aov6bLC3m+evgcoN4r4= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 h1:SoNJ4RlFEQEbtDcCEt+QG56MY4fm4W8rYirAmq+/DdU= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15/go.mod h1:U9ke74k1n2bf+RIgoX1SXFed1HLs51OgUSs+Ph0KJP8= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 h1:C6WHdGnTDIYETAm5iErQUiVNsclNx9qbJVPIt03B6bI= From 2eec761ea7c2f78fac0a2d24284a9843a13096af Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Fri, 19 Jul 2024 16:05:04 +0300 Subject: [PATCH 13/34] Package ek updated to v13 --- app/app.go | 94 +++++++++++----------- backuper/backuper.go | 2 +- backuper/confluence/confluence-backuper.go | 10 +-- backuper/jira/jira-backuper.go | 10 +-- cloudfunc/ycfunc.go | 10 +-- go.mod | 2 +- go.sum | 4 +- uploader/fs/fs.go | 8 +- uploader/s3/s3.go | 10 +-- uploader/sftp/sftp.go | 10 +-- uploader/uploader.go | 2 +- 11 files changed, 81 insertions(+), 81 deletions(-) diff --git a/app/app.go b/app/app.go index e2c2ef0..4637ecd 100644 --- a/app/app.go +++ b/app/app.go @@ -14,34 +14,34 @@ import ( "strings" "time" - "github.com/essentialkaos/ek/v12/errutil" - "github.com/essentialkaos/ek/v12/events" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/fmtutil" - "github.com/essentialkaos/ek/v12/fsutil" - "github.com/essentialkaos/ek/v12/knf" - "github.com/essentialkaos/ek/v12/log" - "github.com/essentialkaos/ek/v12/options" - "github.com/essentialkaos/ek/v12/path" - "github.com/essentialkaos/ek/v12/req" - "github.com/essentialkaos/ek/v12/spinner" - "github.com/essentialkaos/ek/v12/support" - "github.com/essentialkaos/ek/v12/support/deps" - "github.com/essentialkaos/ek/v12/system/container" - "github.com/essentialkaos/ek/v12/terminal/tty" - "github.com/essentialkaos/ek/v12/timeutil" - "github.com/essentialkaos/ek/v12/tmp" - "github.com/essentialkaos/ek/v12/usage" - "github.com/essentialkaos/ek/v12/usage/completion/bash" - "github.com/essentialkaos/ek/v12/usage/completion/fish" - "github.com/essentialkaos/ek/v12/usage/completion/zsh" - "github.com/essentialkaos/ek/v12/usage/man" - "github.com/essentialkaos/ek/v12/usage/update" - - knfu "github.com/essentialkaos/ek/v12/knf/united" - knfv "github.com/essentialkaos/ek/v12/knf/validators" - knff "github.com/essentialkaos/ek/v12/knf/validators/fs" - knfn "github.com/essentialkaos/ek/v12/knf/validators/network" + "github.com/essentialkaos/ek/v13/errutil" + "github.com/essentialkaos/ek/v13/events" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/fmtutil" + "github.com/essentialkaos/ek/v13/fsutil" + "github.com/essentialkaos/ek/v13/knf" + "github.com/essentialkaos/ek/v13/log" + "github.com/essentialkaos/ek/v13/options" + "github.com/essentialkaos/ek/v13/path" + "github.com/essentialkaos/ek/v13/req" + "github.com/essentialkaos/ek/v13/spinner" + "github.com/essentialkaos/ek/v13/support" + "github.com/essentialkaos/ek/v13/support/deps" + "github.com/essentialkaos/ek/v13/system/container" + "github.com/essentialkaos/ek/v13/terminal/tty" + "github.com/essentialkaos/ek/v13/timeutil" + "github.com/essentialkaos/ek/v13/tmp" + "github.com/essentialkaos/ek/v13/usage" + "github.com/essentialkaos/ek/v13/usage/completion/bash" + "github.com/essentialkaos/ek/v13/usage/completion/fish" + "github.com/essentialkaos/ek/v13/usage/completion/zsh" + "github.com/essentialkaos/ek/v13/usage/man" + "github.com/essentialkaos/ek/v13/usage/update" + + knfu "github.com/essentialkaos/ek/v13/knf/united" + knfv "github.com/essentialkaos/ek/v13/knf/validators" + knff "github.com/essentialkaos/ek/v13/knf/validators/fs" + knfn "github.com/essentialkaos/ek/v13/knf/validators/network" "github.com/essentialkaos/atlassian-cloud-backuper/backuper" "github.com/essentialkaos/atlassian-cloud-backuper/backuper/confluence" @@ -199,7 +199,7 @@ func Run(gitRev string, gomod []byte) { // preConfigureUI preconfigures UI based on information about user terminal func preConfigureUI() { - if !tty.IsTTY() { + if !tty.IsTTY() || tty.IsSystemd() || container.GetEngine() == container.YANDEX { fmtc.DisableColors = true } @@ -277,23 +277,23 @@ func loadConfig() error { // validateConfig validates configuration file values func validateConfig() error { validators := []*knf.Validator{ - {ACCESS_ACCOUNT, knfv.Empty, nil}, - {ACCESS_EMAIL, knfv.Empty, nil}, - {ACCESS_API_KEY, knfv.Empty, nil}, + {ACCESS_ACCOUNT, knfv.Set, nil}, + {ACCESS_EMAIL, knfv.Set, nil}, + {ACCESS_API_KEY, knfv.Set, nil}, {ACCESS_EMAIL, knfn.Mail, nil}, - {STORAGE_TYPE, knfv.NotContains, []string{ + {STORAGE_TYPE, knfv.SetToAnyIgnoreCase, []string{ "fs", "sftp", "s3", }}, - {LOG_FORMAT, knfv.NotContains, []string{ + {LOG_FORMAT, knfv.SetToAnyIgnoreCase, []string{ "", "text", "json", }}, - {LOG_LEVEL, knfv.NotContains, []string{ + {LOG_LEVEL, knfv.SetToAnyIgnoreCase, []string{ "", "debug", "info", "warn", "error", "crit", }}, {TEMP_DIR, knff.Perms, "DW"}, } - switch knfu.GetS(STORAGE_TYPE) { + switch strings.ToLower(knfu.GetS(STORAGE_TYPE)) { case "fs": validators = append(validators, &knf.Validator{STORAGE_FS_PATH, knff.Perms, "DRW"}, @@ -301,19 +301,19 @@ func validateConfig() error { case "sftp": validators = append(validators, - &knf.Validator{STORAGE_SFTP_HOST, knfv.Empty, nil}, - &knf.Validator{STORAGE_SFTP_USER, knfv.Empty, nil}, - &knf.Validator{STORAGE_SFTP_KEY, knfv.Empty, nil}, - &knf.Validator{STORAGE_SFTP_PATH, knfv.Empty, nil}, + &knf.Validator{STORAGE_SFTP_HOST, knfv.Set, nil}, + &knf.Validator{STORAGE_SFTP_USER, knfv.Set, nil}, + &knf.Validator{STORAGE_SFTP_KEY, knfv.Set, nil}, + &knf.Validator{STORAGE_SFTP_PATH, knfv.Set, nil}, ) case "s3": validators = append(validators, - &knf.Validator{STORAGE_S3_HOST, knfv.Empty, nil}, - &knf.Validator{STORAGE_S3_ACCESS_KEY, knfv.Empty, nil}, - &knf.Validator{STORAGE_S3_SECRET_KEY, knfv.Empty, nil}, - &knf.Validator{STORAGE_S3_BUCKET, knfv.Empty, nil}, - &knf.Validator{STORAGE_S3_PATH, knfv.Empty, nil}, + &knf.Validator{STORAGE_S3_HOST, knfv.Set, nil}, + &knf.Validator{STORAGE_S3_ACCESS_KEY, knfv.Set, nil}, + &knf.Validator{STORAGE_S3_SECRET_KEY, knfv.Set, nil}, + &knf.Validator{STORAGE_S3_BUCKET, knfv.Set, nil}, + &knf.Validator{STORAGE_S3_PATH, knfv.Set, nil}, ) } @@ -331,7 +331,7 @@ func setupLogger() error { var err error if knfu.GetS(LOG_FILE) != "" { - err = log.Set(knfu.GetS(LOG_FILE), knfu.GetM(LOG_MODE, 640)) + err = log.Set(knfu.GetS(LOG_FILE), knfu.GetM(LOG_MODE, 0640)) if err != nil { return err @@ -347,7 +347,7 @@ func setupLogger() error { if knfu.GetS(LOG_FORMAT) == "" && container.IsContainer() { log.Global.UseJSON = true } else { - switch knfu.GetS(LOG_FORMAT) { + switch strings.ToLower(knfu.GetS(LOG_FORMAT)) { case "json": log.Global.UseJSON = true case "text", "": diff --git a/backuper/backuper.go b/backuper/backuper.go index 5b00eaa..a7f8821 100644 --- a/backuper/backuper.go +++ b/backuper/backuper.go @@ -11,7 +11,7 @@ import ( "fmt" "io" - "github.com/essentialkaos/ek/v12/events" + "github.com/essentialkaos/ek/v13/events" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/backuper/confluence/confluence-backuper.go b/backuper/confluence/confluence-backuper.go index 6f05568..b549f1e 100644 --- a/backuper/confluence/confluence-backuper.go +++ b/backuper/confluence/confluence-backuper.go @@ -16,11 +16,11 @@ import ( "strings" "time" - "github.com/essentialkaos/ek/v12/events" - "github.com/essentialkaos/ek/v12/fmtutil" - "github.com/essentialkaos/ek/v12/fsutil" - "github.com/essentialkaos/ek/v12/log" - "github.com/essentialkaos/ek/v12/req" + "github.com/essentialkaos/ek/v13/events" + "github.com/essentialkaos/ek/v13/fmtutil" + "github.com/essentialkaos/ek/v13/fsutil" + "github.com/essentialkaos/ek/v13/log" + "github.com/essentialkaos/ek/v13/req" "github.com/essentialkaos/atlassian-cloud-backuper/backuper" ) diff --git a/backuper/jira/jira-backuper.go b/backuper/jira/jira-backuper.go index 5bebb9f..c5afc0f 100644 --- a/backuper/jira/jira-backuper.go +++ b/backuper/jira/jira-backuper.go @@ -14,11 +14,11 @@ import ( "os" "time" - "github.com/essentialkaos/ek/v12/events" - "github.com/essentialkaos/ek/v12/fmtutil" - "github.com/essentialkaos/ek/v12/fsutil" - "github.com/essentialkaos/ek/v12/log" - "github.com/essentialkaos/ek/v12/req" + "github.com/essentialkaos/ek/v13/events" + "github.com/essentialkaos/ek/v13/fmtutil" + "github.com/essentialkaos/ek/v13/fsutil" + "github.com/essentialkaos/ek/v13/log" + "github.com/essentialkaos/ek/v13/req" "github.com/essentialkaos/atlassian-cloud-backuper/backuper" ) diff --git a/cloudfunc/ycfunc.go b/cloudfunc/ycfunc.go index b3f4acd..4f0f9ac 100644 --- a/cloudfunc/ycfunc.go +++ b/cloudfunc/ycfunc.go @@ -18,12 +18,12 @@ import ( "strings" "time" - "github.com/essentialkaos/ek/v12/log" - "github.com/essentialkaos/ek/v12/req" - "github.com/essentialkaos/ek/v12/strutil" - "github.com/essentialkaos/ek/v12/timeutil" + "github.com/essentialkaos/ek/v13/log" + "github.com/essentialkaos/ek/v13/req" + "github.com/essentialkaos/ek/v13/strutil" + "github.com/essentialkaos/ek/v13/timeutil" - knfu "github.com/essentialkaos/ek/v12/knf/united" + knfu "github.com/essentialkaos/ek/v13/knf/united" "github.com/essentialkaos/atlassian-cloud-backuper/app" diff --git a/go.mod b/go.mod index aa87b7a..3abd02a 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/aws/aws-sdk-go-v2 v1.30.3 github.com/aws/aws-sdk-go-v2/credentials v1.17.27 github.com/aws/aws-sdk-go-v2/service/s3 v1.58.2 - github.com/essentialkaos/ek/v12 v12.130.0 + github.com/essentialkaos/ek/v13 v13.1.0 github.com/pkg/sftp v1.13.6 golang.org/x/crypto v0.25.0 ) diff --git a/go.sum b/go.sum index 6f0266d..6890c11 100644 --- a/go.sum +++ b/go.sum @@ -28,8 +28,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk= github.com/essentialkaos/depsy v1.3.0 h1:CN7bRgBU2jGTHSkg/Sh38eDUn7cvmaTp2sxFt2HpFeU= github.com/essentialkaos/depsy v1.3.0/go.mod h1:kpiTAV17dyByVnrbNaMcZt2jRwvuXClUYOzpyJQwtG8= -github.com/essentialkaos/ek/v12 v12.130.0 h1:JhcjGZaBIEFfyNReHAHeTgldNv65ruHa9LR7YIVgmn0= -github.com/essentialkaos/ek/v12 v12.130.0/go.mod h1:yGof+LJIkWvQtGINs+2AGv/yeqcfj/brpQ9eYnzMzKs= +github.com/essentialkaos/ek/v13 v13.1.0 h1:k0X7805R2z5QVBCYzGgApWosnpmBdb+00B4rc2tEGVA= +github.com/essentialkaos/ek/v13 v13.1.0/go.mod h1:RVf1NpNyK04xkBJ3NTUD1wNLWemY9/naVD4iEVjU2fA= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= diff --git a/uploader/fs/fs.go b/uploader/fs/fs.go index 9e7e810..12bab41 100644 --- a/uploader/fs/fs.go +++ b/uploader/fs/fs.go @@ -13,10 +13,10 @@ import ( "io" "os" - "github.com/essentialkaos/ek/v12/events" - "github.com/essentialkaos/ek/v12/fsutil" - "github.com/essentialkaos/ek/v12/log" - "github.com/essentialkaos/ek/v12/path" + "github.com/essentialkaos/ek/v13/events" + "github.com/essentialkaos/ek/v13/fsutil" + "github.com/essentialkaos/ek/v13/log" + "github.com/essentialkaos/ek/v13/path" "github.com/essentialkaos/atlassian-cloud-backuper/uploader" ) diff --git a/uploader/s3/s3.go b/uploader/s3/s3.go index 8a363b9..527349e 100644 --- a/uploader/s3/s3.go +++ b/uploader/s3/s3.go @@ -15,11 +15,11 @@ import ( "strings" "time" - "github.com/essentialkaos/ek/v12/events" - "github.com/essentialkaos/ek/v12/fsutil" - "github.com/essentialkaos/ek/v12/log" - "github.com/essentialkaos/ek/v12/passthru" - "github.com/essentialkaos/ek/v12/path" + "github.com/essentialkaos/ek/v13/events" + "github.com/essentialkaos/ek/v13/fsutil" + "github.com/essentialkaos/ek/v13/log" + "github.com/essentialkaos/ek/v13/passthru" + "github.com/essentialkaos/ek/v13/path" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/credentials" diff --git a/uploader/sftp/sftp.go b/uploader/sftp/sftp.go index ea2541a..2e19dbb 100644 --- a/uploader/sftp/sftp.go +++ b/uploader/sftp/sftp.go @@ -17,11 +17,11 @@ import ( "github.com/pkg/sftp" "golang.org/x/crypto/ssh" - "github.com/essentialkaos/ek/v12/events" - "github.com/essentialkaos/ek/v12/fsutil" - "github.com/essentialkaos/ek/v12/log" - "github.com/essentialkaos/ek/v12/passthru" - "github.com/essentialkaos/ek/v12/path" + "github.com/essentialkaos/ek/v13/events" + "github.com/essentialkaos/ek/v13/fsutil" + "github.com/essentialkaos/ek/v13/log" + "github.com/essentialkaos/ek/v13/passthru" + "github.com/essentialkaos/ek/v13/path" "github.com/essentialkaos/atlassian-cloud-backuper/uploader" ) diff --git a/uploader/uploader.go b/uploader/uploader.go index 0cfe9f4..76da9cf 100644 --- a/uploader/uploader.go +++ b/uploader/uploader.go @@ -10,7 +10,7 @@ package uploader import ( "io" - "github.com/essentialkaos/ek/v12/events" + "github.com/essentialkaos/ek/v13/events" ) // ////////////////////////////////////////////////////////////////////////////////// // From 466482debc3a7eca457009fb37a4cb304d2f20f2 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Fri, 19 Jul 2024 16:07:12 +0300 Subject: [PATCH 14/34] Version bump --- app/app.go | 2 +- common/atlassian-cloud-backuper.spec | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/app.go b/app/app.go index 4637ecd..86e1e70 100644 --- a/app/app.go +++ b/app/app.go @@ -58,7 +58,7 @@ import ( // Basic utility info const ( APP = "Atlassian Cloud Backuper" - VER = "0.0.3" + VER = "0.0.4" DESC = "Tool for backuping Atlassian cloud services (Jira and Confluence)" ) diff --git a/common/atlassian-cloud-backuper.spec b/common/atlassian-cloud-backuper.spec index 827e07c..020c48b 100644 --- a/common/atlassian-cloud-backuper.spec +++ b/common/atlassian-cloud-backuper.spec @@ -10,7 +10,7 @@ Summary: Tool for backuping Atlassian cloud services Name: atlassian-cloud-backuper -Version: 0.0.3 +Version: 0.0.4 Release: 0%{?dist} Group: Applications/System License: Apache License, Version 2.0 @@ -22,7 +22,7 @@ Source100: checksum.sha512 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: golang >= 1.21 +BuildRequires: golang >= 1.22 Provides: %{name} = %{version}-%{release} @@ -40,7 +40,10 @@ Tool for backuping Atlassian cloud services (Jira and Confluence). %build if [[ ! -d "%{name}/vendor" ]] ; then - echo "This package requires vendored dependencies" + echo -e "----\nThis package requires vendored dependencies\n----" + exit 1 +elif [[ -f "%{name}/%{name}" ]] ; then + echo -e "----\nSources must not contain precompiled binaries\n----" exit 1 fi @@ -110,6 +113,9 @@ rm -rf %{buildroot} ################################################################################ %changelog +* Fri Jul 19 2024 Anton Novojilov - 0.0.4-0 +- Dependencies update + * Wed Jun 12 2024 Anton Novojilov - 0.0.3-0 - Dependencies update From 7a9ee5c23af258669311fa604356033fa2edbd32 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Fri, 19 Jul 2024 17:08:53 +0300 Subject: [PATCH 15/34] Fix function packing --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 598a86b..d4fdfe8 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ all: atlassian-cloud-backuper ## Build all binaries pack: clean ## Create zip file with YC function @echo "Packing YC function to zip…" @go build cloudfunc/ycfunc.go && rm -f ycfunc - @zip atlassian-cloud-backuper -r "app" "backuper" "cloudfunc" "uploader" + @zip atlassian-cloud-backuper -r "app" "backuper" "cloudfunc" "uploader" go.* atlassian-cloud-backuper: @echo "Building atlassian-cloud-backuper…" From 590ccf2187bc912f6e442f6439db48acc3ee5c5d Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Mon, 22 Jul 2024 00:12:10 +0300 Subject: [PATCH 16/34] Add server mode --- app/app.go | 298 ++++-------------- common/atlassian-cloud-backuper-container.knf | 8 + common/atlassian-cloud-backuper.knf | 11 + 3 files changed, 74 insertions(+), 243 deletions(-) diff --git a/app/app.go b/app/app.go index 86e1e70..74fd096 100644 --- a/app/app.go +++ b/app/app.go @@ -8,28 +8,21 @@ package app // ////////////////////////////////////////////////////////////////////////////////// // import ( - "encoding/base64" "fmt" "os" "strings" - "time" "github.com/essentialkaos/ek/v13/errutil" - "github.com/essentialkaos/ek/v13/events" "github.com/essentialkaos/ek/v13/fmtc" - "github.com/essentialkaos/ek/v13/fmtutil" - "github.com/essentialkaos/ek/v13/fsutil" "github.com/essentialkaos/ek/v13/knf" "github.com/essentialkaos/ek/v13/log" "github.com/essentialkaos/ek/v13/options" - "github.com/essentialkaos/ek/v13/path" "github.com/essentialkaos/ek/v13/req" - "github.com/essentialkaos/ek/v13/spinner" "github.com/essentialkaos/ek/v13/support" "github.com/essentialkaos/ek/v13/support/deps" "github.com/essentialkaos/ek/v13/system/container" + "github.com/essentialkaos/ek/v13/terminal" "github.com/essentialkaos/ek/v13/terminal/tty" - "github.com/essentialkaos/ek/v13/timeutil" "github.com/essentialkaos/ek/v13/tmp" "github.com/essentialkaos/ek/v13/usage" "github.com/essentialkaos/ek/v13/usage/completion/bash" @@ -42,15 +35,6 @@ import ( knfv "github.com/essentialkaos/ek/v13/knf/validators" knff "github.com/essentialkaos/ek/v13/knf/validators/fs" knfn "github.com/essentialkaos/ek/v13/knf/validators/network" - - "github.com/essentialkaos/atlassian-cloud-backuper/backuper" - "github.com/essentialkaos/atlassian-cloud-backuper/backuper/confluence" - "github.com/essentialkaos/atlassian-cloud-backuper/backuper/jira" - - "github.com/essentialkaos/atlassian-cloud-backuper/uploader" - "github.com/essentialkaos/atlassian-cloud-backuper/uploader/fs" - "github.com/essentialkaos/atlassian-cloud-backuper/uploader/s3" - "github.com/essentialkaos/atlassian-cloud-backuper/uploader/sftp" ) // ////////////////////////////////////////////////////////////////////////////////// // @@ -58,7 +42,7 @@ import ( // Basic utility info const ( APP = "Atlassian Cloud Backuper" - VER = "0.0.4" + VER = "0.1.0" DESC = "Tool for backuping Atlassian cloud services (Jira and Confluence)" ) @@ -68,6 +52,7 @@ const ( const ( OPT_CONFIG = "c:config" OPT_INTERACTIVE = "I:interactive" + OPT_SERVER = "S:server" OPT_NO_COLOR = "nc:no-color" OPT_HELP = "h:help" OPT_VER = "v:version" @@ -81,6 +66,9 @@ const ( ACCESS_ACCOUNT = "access:account" ACCESS_EMAIL = "access:email" ACCESS_API_KEY = "access:api-key" + SERVER_IP = "server:ip" + SERVER_PORT = "server:port" + SERVER_ACCESS_TOKEN = "server:access-token" STORAGE_TYPE = "storage:type" STORAGE_FS_PATH = "storage-fs:path" STORAGE_FS_MODE = "storage-fs:mode" @@ -114,6 +102,12 @@ const ( TARGET_CONFLUENCE = "confluence" ) +const ( + STORAGE_FS = "fs" + STORAGE_SFTP = "sftp" + STORAGE_S3 = "s3" +) + // ////////////////////////////////////////////////////////////////////////////////// // // optMap contains information about all supported options @@ -144,8 +138,9 @@ func Run(gitRev string, gomod []byte) { args, errs := options.Parse(optMap) - if len(errs) != 0 { - printError(errs[0].Error()) + if !errs.IsEmpty() { + terminal.Error("Options parsing errors:") + terminal.Error(errs.String()) os.Exit(1) } @@ -170,7 +165,8 @@ func Run(gitRev string, gomod []byte) { WithChecks(getServiceStatus("Confluence")). Print() os.Exit(0) - case options.GetB(OPT_HELP) || len(args) == 0: + case options.GetB(OPT_HELP) || + (!options.Has(OPT_SERVER) && len(args) == 0): genUsage(options.GetS(OPT_HELP)).Print() os.Exit(0) } @@ -179,18 +175,34 @@ func Run(gitRev string, gomod []byte) { loadConfig, validateConfig, setupLogger, - setupTemp, ) if err != nil { - printError(err.Error()) + terminal.Error(err) os.Exit(1) } log.Divider() log.Aux("%s %s starting…", APP, VER) - if !process(args.Get(0).String()) { + err = errutil.Chain( + setupTemp, + setupReq, + ) + + if err != nil { + log.Crit(err.Error()) + os.Exit(1) + } + + if options.GetB(OPT_SERVER) { + err = startServer() + } else { + err = startApp(args) + } + + if err != nil { + log.Crit(err.Error()) os.Exit(1) } } @@ -222,6 +234,7 @@ func addExtraOptions(m options.Map) { knfu.AddOptions(m, ACCESS_ACCOUNT, ACCESS_EMAIL, ACCESS_API_KEY, + SERVER_IP, SERVER_PORT, STORAGE_TYPE, STORAGE_FS_PATH, STORAGE_FS_MODE, STORAGE_SFTP_HOST, STORAGE_SFTP_USER, STORAGE_SFTP_KEY, @@ -240,8 +253,6 @@ func configureUI() { if options.GetB(OPT_NO_COLOR) { fmtc.DisableColors = true } - - req.SetUserAgent("AtlassianCloudBackuper", VER) } // loadConfig loads configuration file @@ -258,6 +269,7 @@ func loadConfig() error { knfu.CombineSimple( config, ACCESS_ACCOUNT, ACCESS_EMAIL, ACCESS_API_KEY, + SERVER_IP, SERVER_PORT, STORAGE_TYPE, STORAGE_FS_PATH, STORAGE_FS_MODE, STORAGE_SFTP_HOST, STORAGE_SFTP_USER, STORAGE_SFTP_KEY, @@ -282,7 +294,7 @@ func validateConfig() error { {ACCESS_API_KEY, knfv.Set, nil}, {ACCESS_EMAIL, knfn.Mail, nil}, {STORAGE_TYPE, knfv.SetToAnyIgnoreCase, []string{ - "fs", "sftp", "s3", + STORAGE_FS, STORAGE_SFTP, STORAGE_S3, }}, {LOG_FORMAT, knfv.SetToAnyIgnoreCase, []string{ "", "text", "json", @@ -290,16 +302,16 @@ func validateConfig() error { {LOG_LEVEL, knfv.SetToAnyIgnoreCase, []string{ "", "debug", "info", "warn", "error", "crit", }}, - {TEMP_DIR, knff.Perms, "DW"}, + {TEMP_DIR, knff.Perms, "DWX"}, } switch strings.ToLower(knfu.GetS(STORAGE_TYPE)) { - case "fs": + case STORAGE_FS: validators = append(validators, &knf.Validator{STORAGE_FS_PATH, knff.Perms, "DRW"}, ) - case "sftp": + case STORAGE_SFTP: validators = append(validators, &knf.Validator{STORAGE_SFTP_HOST, knfv.Set, nil}, &knf.Validator{STORAGE_SFTP_USER, knfv.Set, nil}, @@ -307,7 +319,7 @@ func validateConfig() error { &knf.Validator{STORAGE_SFTP_PATH, knfv.Set, nil}, ) - case "s3": + case STORAGE_S3: validators = append(validators, &knf.Validator{STORAGE_S3_HOST, knfv.Set, nil}, &knf.Validator{STORAGE_S3_ACCESS_KEY, knfv.Set, nil}, @@ -317,6 +329,13 @@ func validateConfig() error { ) } + if options.GetB(OPT_SERVER) { + validators = append(validators, + &knf.Validator{SERVER_PORT, knfn.IP, nil}, + &knf.Validator{SERVER_IP, knfn.Port, nil}, + ) + } + errs := knfu.Validate(validators) if len(errs) > 0 { @@ -369,218 +388,10 @@ func setupTemp() error { return err } -// process starts backup creation -func process(target string) bool { - var dispatcher *events.Dispatcher - - if options.GetB(OPT_INTERACTIVE) { - dispatcher = events.NewDispatcher() - addEventsHandlers(dispatcher) - } - - defer temp.Clean() - - bkpr, err := getBackuper(target) - - if err != nil { - log.Crit("Can't start backuping process: %v", err) - return false - } - - bkpr.SetDispatcher(dispatcher) - - outputFileName := getOutputFileName(target) - tmpFile := path.Join(temp.MkName(".zip"), outputFileName) - - err = bkpr.Backup(tmpFile) - - if err != nil { - spinner.Done(false) - log.Crit("Error while backuping process: %v", err) - return false - } - - log.Info("Backup process successfully finished!") - - updr, err := getUploader(target) - - if err != nil { - log.Crit("Can't start uploading process: %v", err) - return false - } - - updr.SetDispatcher(dispatcher) - - err = updr.Upload(tmpFile, outputFileName) - - if err != nil { - spinner.Done(false) - log.Crit("Error while uploading process: %v", err) - return false - } - - return true -} - -// getBackuper returns backuper instances -func getBackuper(target string) (backuper.Backuper, error) { - var err error - var bkpr backuper.Backuper - - bkpConfig, err := getBackuperConfig(target) - - if err != nil { - return nil, err - } - - switch target { - case TARGET_JIRA: - bkpr, err = jira.NewBackuper(bkpConfig) - case TARGET_CONFLUENCE: - bkpr, err = confluence.NewBackuper(bkpConfig) - } - - return bkpr, nil -} - -// getOutputFileName returns name for backup output file -func getOutputFileName(target string) string { - var template string - - switch target { - case TARGET_JIRA: - template = knfu.GetS(JIRA_OUTPUT_FILE, `jira-backup-%Y-%m-%d`) + ".zip" - case TARGET_CONFLUENCE: - template = knfu.GetS(JIRA_OUTPUT_FILE, `confluence-backup-%Y-%m-%d`) + ".zip" - } - - return timeutil.Format(time.Now(), template) -} - -// getBackuperConfig returns configuration for backuper -func getBackuperConfig(target string) (*backuper.Config, error) { - switch target { - case TARGET_JIRA: - return &backuper.Config{ - Account: knfu.GetS(ACCESS_ACCOUNT), - Email: knfu.GetS(ACCESS_EMAIL), - APIKey: knfu.GetS(ACCESS_API_KEY), - WithAttachments: knfu.GetB(JIRA_INCLUDE_ATTACHMENTS), - ForCloud: knfu.GetB(JIRA_CLOUD_FORMAT), - }, nil - - case TARGET_CONFLUENCE: - return &backuper.Config{ - Account: knfu.GetS(ACCESS_ACCOUNT), - Email: knfu.GetS(ACCESS_EMAIL), - APIKey: knfu.GetS(ACCESS_API_KEY), - WithAttachments: knfu.GetB(CONFLUENCE_INCLUDE_ATTACHMENTS), - ForCloud: knfu.GetB(CONFLUENCE_CLOUD_FORMAT), - }, nil - } - - return nil, fmt.Errorf("Unknown target %q", target) -} - -// getUploader returns uploader instance -func getUploader(target string) (uploader.Uploader, error) { - var err error - var updr uploader.Uploader - - switch knfu.GetS(STORAGE_TYPE) { - case "fs": - updr, err = fs.NewUploader(&fs.Config{ - Path: path.Join(knfu.GetS(STORAGE_FS_PATH), target), - Mode: knfu.GetM(STORAGE_FS_MODE, 0600), - }) - - case "sftp": - keyData, err := readPrivateKeyData() - - if err != nil { - return nil, err - } - - updr, err = sftp.NewUploader(&sftp.Config{ - Host: knfu.GetS(STORAGE_SFTP_HOST), - User: knfu.GetS(STORAGE_SFTP_USER), - Key: keyData, - Path: path.Join(knfu.GetS(STORAGE_SFTP_PATH), target), - Mode: knfu.GetM(STORAGE_SFTP_MODE, 0600), - }) - - case "s3": - updr, err = s3.NewUploader(&s3.Config{ - Host: knfu.GetS(STORAGE_S3_HOST), - Region: knfu.GetS(STORAGE_S3_REGION), - AccessKeyID: knfu.GetS(STORAGE_S3_ACCESS_KEY), - SecretKey: knfu.GetS(STORAGE_S3_SECRET_KEY), - Bucket: knfu.GetS(STORAGE_S3_BUCKET), - Path: path.Join(knfu.GetS(STORAGE_S3_PATH), target), - }) - } - - return updr, err -} - -// readPrivateKeyData reads private key data -func readPrivateKeyData() ([]byte, error) { - if fsutil.IsExist(knfu.GetS(STORAGE_SFTP_KEY)) { - return os.ReadFile(knfu.GetS(STORAGE_SFTP_KEY)) - } - - return base64.StdEncoding.DecodeString(knfu.GetS(STORAGE_SFTP_KEY)) -} - -// addEventsHandlers registers events handlers -func addEventsHandlers(dispatcher *events.Dispatcher) { - dispatcher.AddHandler(backuper.EVENT_BACKUP_STARTED, func(payload any) { - fmtc.NewLine() - spinner.Show("Starting downloading process") - }) - - dispatcher.AddHandler(backuper.EVENT_BACKUP_PROGRESS, func(payload any) { - p := payload.(*backuper.ProgressInfo) - spinner.Update("[%d%%] %s", p.Progress, p.Message) - }) - - dispatcher.AddHandler(backuper.EVENT_BACKUP_SAVING, func(payload any) { - spinner.Done(true) - spinner.Show("Fetching backup file") - }) - - dispatcher.AddHandler(backuper.EVENT_BACKUP_DONE, func(payload any) { - spinner.Done(true) - }) - - dispatcher.AddHandler(uploader.EVENT_UPLOAD_STARTED, func(payload any) { - spinner.Show("Uploading backup file to %s storage", payload) - }) - - dispatcher.AddHandler(uploader.EVENT_UPLOAD_PROGRESS, func(payload any) { - p := payload.(*uploader.ProgressInfo) - spinner.Update( - "[%s] Uploading file (%s/%s)", - fmtutil.PrettyPerc(p.Progress), - fmtutil.PrettySize(p.Current), - fmtutil.PrettySize(p.Total), - ) - }) - - dispatcher.AddHandler(uploader.EVENT_UPLOAD_DONE, func(payload any) { - spinner.Update("Uploading file") - spinner.Done(true) - fmtc.NewLine() - }) -} - -// printError prints error message to console -func printError(f string, a ...interface{}) { - if len(a) == 0 { - fmtc.Fprintln(os.Stderr, "{r}"+f+"{!}") - } else { - fmtc.Fprintf(os.Stderr, "{r}"+f+"{!}\n", a...) - } +// setupReq configures HTTP request engine +func setupReq() error { + req.SetUserAgent("AtlassianCloudBackuper", VER) + return nil } // ////////////////////////////////////////////////////////////////////////////////// // @@ -671,6 +482,7 @@ func genUsage(section string) *usage.Info { info.AddOption(OPT_CONFIG, "Path to configuration file", "file") info.AddOption(OPT_INTERACTIVE, "Interactive mode") + info.AddOption(OPT_SERVER, "Server mode") info.AddOption(OPT_NO_COLOR, "Disable colors in output") info.AddOption(OPT_HELP, "Show this help message") info.AddOption(OPT_VER, "Show version") diff --git a/common/atlassian-cloud-backuper-container.knf b/common/atlassian-cloud-backuper-container.knf index 384dd85..650aec7 100644 --- a/common/atlassian-cloud-backuper-container.knf +++ b/common/atlassian-cloud-backuper-container.knf @@ -9,6 +9,14 @@ # API key api-key: +[server] + + # HTTP server IP + ip: + + # HTTP server port + port: 8080 + [storage] # Storage type (fs/sftp/s3) diff --git a/common/atlassian-cloud-backuper.knf b/common/atlassian-cloud-backuper.knf index 87bcd2a..4cf38fd 100644 --- a/common/atlassian-cloud-backuper.knf +++ b/common/atlassian-cloud-backuper.knf @@ -9,6 +9,17 @@ # API key api-key: +[server] + + # HTTP server IP + ip: + + # HTTP server port + port: 8080 + + # Unique token for requests + access-token: + [storage] # Storage type (fs/sftp/s3) From 883633d9fc04281e693eaed2f01d1636c7a9cefc Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Mon, 22 Jul 2024 00:12:21 +0300 Subject: [PATCH 17/34] Add server mode --- app/basic.go | 239 ++++++++++++++++++++++++++++++++++++++++++++++++++ app/server.go | 224 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 463 insertions(+) create mode 100644 app/basic.go create mode 100644 app/server.go diff --git a/app/basic.go b/app/basic.go new file mode 100644 index 0000000..26762a4 --- /dev/null +++ b/app/basic.go @@ -0,0 +1,239 @@ +package app + +// ////////////////////////////////////////////////////////////////////////////////// // +// // +// Copyright (c) 2024 ESSENTIAL KAOS // +// Apache License, Version 2.0 // +// // +// ////////////////////////////////////////////////////////////////////////////////// // + +import ( + "encoding/base64" + "fmt" + "os" + "time" + + "github.com/essentialkaos/ek/v13/events" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/fmtutil" + "github.com/essentialkaos/ek/v13/fsutil" + "github.com/essentialkaos/ek/v13/log" + "github.com/essentialkaos/ek/v13/options" + "github.com/essentialkaos/ek/v13/path" + "github.com/essentialkaos/ek/v13/spinner" + "github.com/essentialkaos/ek/v13/timeutil" + + knfu "github.com/essentialkaos/ek/v13/knf/united" + + "github.com/essentialkaos/atlassian-cloud-backuper/backuper" + "github.com/essentialkaos/atlassian-cloud-backuper/backuper/confluence" + "github.com/essentialkaos/atlassian-cloud-backuper/backuper/jira" + "github.com/essentialkaos/atlassian-cloud-backuper/uploader" + "github.com/essentialkaos/atlassian-cloud-backuper/uploader/fs" + "github.com/essentialkaos/atlassian-cloud-backuper/uploader/s3" + "github.com/essentialkaos/atlassian-cloud-backuper/uploader/sftp" +) + +// ////////////////////////////////////////////////////////////////////////////////// // + +// startApp starts app in basic mode +func startApp(args options.Arguments) error { + var dispatcher *events.Dispatcher + + if options.GetB(OPT_INTERACTIVE) { + dispatcher = events.NewDispatcher() + addEventsHandlers(dispatcher) + } + + defer temp.Clean() + + target := args.Get(0).String() + bkpr, err := getBackuper(target) + + if err != nil { + return fmt.Errorf("Can't start backuping process: %v", err) + } + + bkpr.SetDispatcher(dispatcher) + + outputFileName := getOutputFileName(target) + tmpFile := path.Join(temp.MkName(".zip"), outputFileName) + + err = bkpr.Backup(tmpFile) + + if err != nil { + spinner.Done(false) + return fmt.Errorf("Error while backuping process: %v", err) + } + + log.Info("Backup process successfully finished!") + + updr, err := getUploader(target) + + if err != nil { + return fmt.Errorf("Can't start uploading process: %v", err) + } + + updr.SetDispatcher(dispatcher) + + err = updr.Upload(tmpFile, outputFileName) + + if err != nil { + spinner.Done(false) + return fmt.Errorf("Error while uploading process: %v", err) + } + + return nil +} + +// getBackuper returns backuper instances +func getBackuper(target string) (backuper.Backuper, error) { + var err error + var bkpr backuper.Backuper + + bkpConfig, err := getBackuperConfig(target) + + if err != nil { + return nil, err + } + + switch target { + case TARGET_JIRA: + bkpr, err = jira.NewBackuper(bkpConfig) + case TARGET_CONFLUENCE: + bkpr, err = confluence.NewBackuper(bkpConfig) + } + + return bkpr, nil +} + +// getOutputFileName returns name for backup output file +func getOutputFileName(target string) string { + var template string + + switch target { + case TARGET_JIRA: + template = knfu.GetS(JIRA_OUTPUT_FILE, `jira-backup-%Y-%m-%d`) + ".zip" + case TARGET_CONFLUENCE: + template = knfu.GetS(JIRA_OUTPUT_FILE, `confluence-backup-%Y-%m-%d`) + ".zip" + } + + return timeutil.Format(time.Now(), template) +} + +// getBackuperConfig returns configuration for backuper +func getBackuperConfig(target string) (*backuper.Config, error) { + switch target { + case TARGET_JIRA: + return &backuper.Config{ + Account: knfu.GetS(ACCESS_ACCOUNT), + Email: knfu.GetS(ACCESS_EMAIL), + APIKey: knfu.GetS(ACCESS_API_KEY), + WithAttachments: knfu.GetB(JIRA_INCLUDE_ATTACHMENTS), + ForCloud: knfu.GetB(JIRA_CLOUD_FORMAT), + }, nil + + case TARGET_CONFLUENCE: + return &backuper.Config{ + Account: knfu.GetS(ACCESS_ACCOUNT), + Email: knfu.GetS(ACCESS_EMAIL), + APIKey: knfu.GetS(ACCESS_API_KEY), + WithAttachments: knfu.GetB(CONFLUENCE_INCLUDE_ATTACHMENTS), + ForCloud: knfu.GetB(CONFLUENCE_CLOUD_FORMAT), + }, nil + } + + return nil, fmt.Errorf("Unknown target %q", target) +} + +// getUploader returns uploader instance +func getUploader(target string) (uploader.Uploader, error) { + var err error + var updr uploader.Uploader + + switch knfu.GetS(STORAGE_TYPE) { + case STORAGE_FS: + updr, err = fs.NewUploader(&fs.Config{ + Path: path.Join(knfu.GetS(STORAGE_FS_PATH), target), + Mode: knfu.GetM(STORAGE_FS_MODE, 0600), + }) + + case STORAGE_SFTP: + keyData, err := readPrivateKeyData() + + if err != nil { + return nil, err + } + + updr, err = sftp.NewUploader(&sftp.Config{ + Host: knfu.GetS(STORAGE_SFTP_HOST), + User: knfu.GetS(STORAGE_SFTP_USER), + Key: keyData, + Path: path.Join(knfu.GetS(STORAGE_SFTP_PATH), target), + Mode: knfu.GetM(STORAGE_SFTP_MODE, 0600), + }) + + case STORAGE_S3: + updr, err = s3.NewUploader(&s3.Config{ + Host: knfu.GetS(STORAGE_S3_HOST), + Region: knfu.GetS(STORAGE_S3_REGION), + AccessKeyID: knfu.GetS(STORAGE_S3_ACCESS_KEY), + SecretKey: knfu.GetS(STORAGE_S3_SECRET_KEY), + Bucket: knfu.GetS(STORAGE_S3_BUCKET), + Path: path.Join(knfu.GetS(STORAGE_S3_PATH), target), + }) + } + + return updr, err +} + +// readPrivateKeyData reads private key data +func readPrivateKeyData() ([]byte, error) { + if fsutil.IsExist(knfu.GetS(STORAGE_SFTP_KEY)) { + return os.ReadFile(knfu.GetS(STORAGE_SFTP_KEY)) + } + + return base64.StdEncoding.DecodeString(knfu.GetS(STORAGE_SFTP_KEY)) +} + +// addEventsHandlers registers events handlers +func addEventsHandlers(dispatcher *events.Dispatcher) { + dispatcher.AddHandler(backuper.EVENT_BACKUP_STARTED, func(payload any) { + fmtc.NewLine() + spinner.Show("Starting downloading process") + }) + + dispatcher.AddHandler(backuper.EVENT_BACKUP_PROGRESS, func(payload any) { + p := payload.(*backuper.ProgressInfo) + spinner.Update("[%d%%] %s", p.Progress, p.Message) + }) + + dispatcher.AddHandler(backuper.EVENT_BACKUP_SAVING, func(payload any) { + spinner.Done(true) + spinner.Show("Fetching backup file") + }) + + dispatcher.AddHandler(backuper.EVENT_BACKUP_DONE, func(payload any) { + spinner.Done(true) + }) + + dispatcher.AddHandler(uploader.EVENT_UPLOAD_STARTED, func(payload any) { + spinner.Show("Uploading backup file to %s storage", payload) + }) + + dispatcher.AddHandler(uploader.EVENT_UPLOAD_PROGRESS, func(payload any) { + p := payload.(*uploader.ProgressInfo) + spinner.Update( + "[%s] Uploading file (%s/%s)", + fmtutil.PrettyPerc(p.Progress), + fmtutil.PrettySize(p.Current), + fmtutil.PrettySize(p.Total), + ) + }) + + dispatcher.AddHandler(uploader.EVENT_UPLOAD_DONE, func(payload any) { + spinner.Update("Uploading file") + spinner.Done(true) + fmtc.NewLine() + }) +} diff --git a/app/server.go b/app/server.go new file mode 100644 index 0000000..6ba5670 --- /dev/null +++ b/app/server.go @@ -0,0 +1,224 @@ +package app + +// ////////////////////////////////////////////////////////////////////////////////// // +// // +// Copyright (c) 2024 ESSENTIAL KAOS // +// Apache License, Version 2.0 // +// // +// ////////////////////////////////////////////////////////////////////////////////// // + +import ( + "fmt" + "net/http" + "os" + "strings" + "time" + + "github.com/essentialkaos/ek/v13/log" + "github.com/essentialkaos/ek/v13/strutil" + + knfu "github.com/essentialkaos/ek/v13/knf/united" +) + +// ////////////////////////////////////////////////////////////////////////////////// // + +// startServer starts app in server mode +func startServer() error { + port := strutil.Q(os.Getenv("PORT"), knfu.GetS(SERVER_PORT)) + ip := knfu.GetS(SERVER_IP) + + log.Info( + "Starting HTTP server", + log.F{"server-ip", strutil.Q(ip, "localhost")}, + log.F{"server-port", port}, + ) + + mux := http.NewServeMux() + + server := &http.Server{ + Addr: ip + ":" + port, + Handler: mux, + ReadTimeout: 3 * time.Second, + WriteTimeout: 3 * time.Second, + } + + mux.HandleFunc("/create", createBackupHandler) + mux.HandleFunc("/download", downloadBackupHandler) + + return server.ListenAndServe() +} + +// ////////////////////////////////////////////////////////////////////////////////// // + +// createHandler is handler for caching booking data +func createBackupHandler(rw http.ResponseWriter, r *http.Request) { + updateResponseHeaders(rw) + + log.Info("Got create request", getConfigurationFields()) + + target := strings.ToLower(r.URL.Query().Get("target")) + token := r.URL.Query().Get("token") + + err := validateRequestQuery(target, token) + + if err != nil { + log.Error("Invalid request query: %v", err.Error()) + rw.WriteHeader(http.StatusBadRequest) + return + } + + bkpr, err := getBackuper(target) + + if err != nil { + log.Error("Can't create backuper instance: %v", err) + rw.WriteHeader(http.StatusInternalServerError) + return + } + + taskID, err := bkpr.Start() + + if err != nil { + log.Error("Can't create backup: %v", err) + rw.WriteHeader(http.StatusBadGateway) + return + } + + log.Info("Backup request successfully created", log.F{"task-id", taskID}) + + rw.WriteHeader(http.StatusOK) +} + +// createHandler is handler for caching booking data +func downloadBackupHandler(rw http.ResponseWriter, r *http.Request) { + var lf log.Fields + + updateResponseHeaders(rw) + + log.Info("Got download request", getConfigurationFields()) + + target := strings.ToLower(r.URL.Query().Get("target")) + token := r.URL.Query().Get("token") + + err := validateRequestQuery(target, token) + + if err != nil { + log.Error("Invalid request query: %v", err.Error()) + rw.WriteHeader(http.StatusBadRequest) + return + } + + bkpr, err := getBackuper(target) + + if err != nil { + log.Error("Can't create backuper instance: %v", err) + rw.WriteHeader(http.StatusInternalServerError) + return + } + + backupFile, err := bkpr.GetBackupFile() + + if err != nil { + log.Error("Can't find backup file: %v", err) + rw.WriteHeader(http.StatusBadGateway) + return + } + + log.Info("Starting downloading of backup", log.F{"backup-file", backupFile}) + + br, err := bkpr.GetReader(backupFile) + + if err != nil { + log.Error("Can't get reader for backup file: %v", err) + rw.WriteHeader(http.StatusInternalServerError) + return + } + + updr, err := getUploader(target) + + if err != nil { + log.Error("Can't create uploader instance: %v", err) + rw.WriteHeader(http.StatusInternalServerError) + return + } + + outputFile := getOutputFileName(target) + + lf.Add( + log.F{"backup-file", backupFile}, + log.F{"output-file", outputFile}, + ) + + log.Info("Uploading backup to storage", lf) + + err = updr.Write(br, outputFile) + + if err != nil { + log.Error("Can't upload backup file: %v", err, lf) + rw.WriteHeader(http.StatusInternalServerError) + return + } + + log.Info("Backup successfully uploaded", lf) + + rw.WriteHeader(http.StatusOK) +} + +// ////////////////////////////////////////////////////////////////////////////////// // + +// validateRequestQuery validates request query arguments +func validateRequestQuery(target, token string) error { + switch { + case target == "": + return fmt.Errorf("target is empty") + case knfu.GetS(SERVER_ACCESS_TOKEN) != "" && token == "": + return fmt.Errorf("token is empty") + case target != TARGET_JIRA && target != TARGET_CONFLUENCE: + return fmt.Errorf("Unknown target %q", target) + case knfu.GetS(SERVER_ACCESS_TOKEN) != "" && token == knfu.GetS(SERVER_ACCESS_TOKEN): + return fmt.Errorf("Invalid access token") + } + + return nil +} + +// getConfigurationFields returns log fields +func getConfigurationFields() *log.Fields { + lf := &log.Fields{} + + lf.Add( + log.Field{"access-account", knfu.GetS(ACCESS_ACCOUNT)}, + log.Field{"access-email", knfu.GetS(ACCESS_EMAIL)}, + log.Field{"access-key", knfu.GetS(ACCESS_API_KEY) != ""}, + log.Field{"storage-type", knfu.GetS(STORAGE_TYPE)}, + ) + + switch strings.ToLower(knfu.GetS(STORAGE_TYPE)) { + case STORAGE_FS: + lf.Add( + log.Field{"storage-fs-path", knfu.GetS(STORAGE_FS_PATH)}, + ) + + case STORAGE_SFTP: + lf.Add( + log.Field{"storage-sftp-host", knfu.GetS(STORAGE_SFTP_HOST)}, + log.Field{"storage-sftp-user", knfu.GetS(STORAGE_SFTP_USER)}, + log.Field{"storage-sftp-path", knfu.GetS(STORAGE_SFTP_PATH)}, + ) + + case STORAGE_S3: + lf.Add( + log.Field{"storage-s3-host", knfu.GetS(STORAGE_S3_HOST)}, + log.Field{"storage-s3-bucket", knfu.GetS(STORAGE_S3_BUCKET)}, + log.Field{"storage-s3-path", knfu.GetS(STORAGE_S3_PATH)}, + log.Field{"storage-s3-key-id", knfu.GetS(STORAGE_S3_ACCESS_KEY)}, + ) + } + + return lf +} + +// updateResponseHeaders updates response headers +func updateResponseHeaders(rw http.ResponseWriter) { + rw.Header().Set("X-Powered-By", "EK|"+APP) + rw.Header().Set("X-App-Version", VER) +} From 12e52b9cff752fb7a4647285635fcac9378397ab Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Mon, 22 Jul 2024 00:22:51 +0300 Subject: [PATCH 18/34] Improve dockerfile --- .docker/alpine.docker | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.docker/alpine.docker b/.docker/alpine.docker index 77be9ff..d132146 100644 --- a/.docker/alpine.docker +++ b/.docker/alpine.docker @@ -4,18 +4,17 @@ ARG REGISTRY="docker.io" ## BUILDER ##################################################################### -FROM golang:alpine3.17 as builder +FROM ${REGISTRY}/essentialkaos/golang:alpine3.18 as builder -WORKDIR /go/src/github.com/essentialkaos/atlassian-cloud-backuper +WORKDIR /go/src/github.com/essentialkaos/{{SHORT_NAME}} COPY . . -# hadolint ignore=DL3018 -RUN apk add --no-cache git make && make deps && make all +RUN make deps && make all ## FINAL IMAGE ################################################################# -FROM ${REGISTRY}/essentialkaos/alpine:3.17 +FROM ${REGISTRY}/essentialkaos/alpine:3.18 LABEL org.opencontainers.image.title="atlassian-cloud-backuper" \ org.opencontainers.image.description="Atlassian Cloud Backuper" \ From 79f492b0f6ca790f16b5cfc49dbcdcd8e1d31325 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Mon, 22 Jul 2024 00:25:52 +0300 Subject: [PATCH 19/34] Workflows refactoring --- .../{docker-push.yml => cd-release.yml} | 17 ++--- .github/workflows/ci-pr.yml | 69 +++++++++++++++++ .github/workflows/ci-push.yml | 27 +++++++ .github/workflows/ci.yml | 74 +------------------ 4 files changed, 107 insertions(+), 80 deletions(-) rename .github/workflows/{docker-push.yml => cd-release.yml} (94%) create mode 100644 .github/workflows/ci-pr.yml create mode 100644 .github/workflows/ci-push.yml diff --git a/.github/workflows/docker-push.yml b/.github/workflows/cd-release.yml similarity index 94% rename from .github/workflows/docker-push.yml rename to .github/workflows/cd-release.yml index 35b5b96..43539a0 100644 --- a/.github/workflows/docker-push.yml +++ b/.github/workflows/cd-release.yml @@ -1,4 +1,4 @@ -name: "Docker Push" +name: CD (Release) on: release: @@ -19,15 +19,13 @@ permissions: env: IMAGE_NAME: ${{ github.repository }} + DOCKER_FILE: alpine jobs: - Docker: - name: Docker Build & Publish + BuildImage: + name: Image Build & Publish runs-on: ubuntu-latest - env: - DOCKER_FILE: alpine - steps: - name: Checkout uses: actions/checkout@v4 @@ -92,7 +90,7 @@ jobs: - name: Check if build/rebuild is required id: build_check run: | - if [[ "${{github.event_name}}" == "release" ]] ; then + if [[ "$GITHUB_EVENT_NAME" == "release" ]] ; then echo "build=true" >> $GITHUB_OUTPUT exit 0 fi @@ -106,9 +104,8 @@ jobs: echo -e "::group::\033[34mDownloading built image…\033[0m" if ! docker pull ghcr.io/${{env.IMAGE_NAME}}:latest ; then - echo "::warning::Rebuild is required (reason: new image)" - echo "build=true" >> $GITHUB_OUTPUT - exit 0 + echo "::error::Can't download image ghcr.io/${{env.IMAGE_NAME}}:latest" + exit 1 fi echo "::endgroup::" diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml new file mode 100644 index 0000000..0624c2f --- /dev/null +++ b/.github/workflows/ci-pr.yml @@ -0,0 +1,69 @@ +name: CI (PR) + +on: + pull_request: + branches: [master] + workflow_dispatch: + inputs: + force_run: + description: 'Force workflow run' + required: true + type: choice + options: [yes, no] + +permissions: + actions: read + contents: read + statuses: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + CI: + uses: ./.github/workflows/ci.yml + secrets: inherit + + ImageBuild: + name: Container Image Build Check + runs-on: ubuntu-latest + + needs: CI + + env: + REGISTRY: ghcr.io + + strategy: + matrix: + image: [ 'alpine' ] + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Login to DockerHub + uses: docker/login-action@v3 + env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + if: ${{ env.DOCKERHUB_USERNAME != '' }} + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build Docker image + run: | + docker build --build-arg REGISTRY=${REGISTRY} -f .docker/${{matrix.image}}.docker -t ${{matrix.image}} . + + - name: Show info about built Docker image + uses: essentialkaos/docker-info-action@v1 + with: + image: ${{matrix.image}} + show-labels: true diff --git a/.github/workflows/ci-push.yml b/.github/workflows/ci-push.yml new file mode 100644 index 0000000..65449f4 --- /dev/null +++ b/.github/workflows/ci-push.yml @@ -0,0 +1,27 @@ +name: CI (Push) + +on: + push: + branches: [master, develop] + workflow_call: + workflow_dispatch: + inputs: + force_run: + description: 'Force workflow run' + required: true + type: choice + options: [yes, no] + +permissions: + actions: read + contents: read + statuses: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + CI: + uses: ./.github/workflows/ci.yml + secrets: inherit diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c2eb6e3..7364831 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,27 +1,16 @@ name: CI on: - push: - branches: [master, develop] - pull_request: - branches: [master] - workflow_dispatch: - inputs: - force_run: - description: 'Force workflow run' + workflow_call: + secrets: + CODACY_PROJECT_TOKEN: required: true - type: choice - options: [yes, no] permissions: actions: read contents: read statuses: write -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - jobs: Go: name: Go @@ -94,60 +83,5 @@ jobs: uses: actions/checkout@v4 - name: Check spelling + continue-on-error: true uses: crate-ci/typos@master - - DockerBuild: - name: Docker Build Check - runs-on: ubuntu-latest - - needs: [Hadolint, Perfecto] - - env: - REGISTRY: ghcr.io - - strategy: - matrix: - image: [ 'alpine' ] - - steps: - - name: Check event type - run: | - if [[ "${{github.event_name}}" != "pull_request" ]] ; then - echo "::notice::Event type is not 'pull_request', all job actions will be skipped" - fi - - # This step is a hack for needs+if issue with actions - # More info about issue: https://github.com/actions/runner/issues/491 - - - name: Checkout - uses: actions/checkout@v4 - if: ${{ github.event_name == 'pull_request' }} - - - name: Login to DockerHub - uses: docker/login-action@v3 - env: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - if: ${{ github.event_name == 'pull_request' && env.DOCKERHUB_USERNAME != '' }} - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - if: ${{ github.event_name == 'pull_request' }} - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build Docker image - if: ${{ github.event_name == 'pull_request' }} - run: | - docker build --build-arg REGISTRY=${REGISTRY} -f .docker/${{matrix.image}}.docker -t ${{matrix.image}} . - - - name: Show info about built Docker image - uses: essentialkaos/docker-info-action@v1 - if: ${{ github.event_name == 'pull_request' }} - with: - image: ${{matrix.image}} - show-labels: true From b39bc613cc2359af1a659ae40f244ca87f5f570b Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Mon, 22 Jul 2024 00:28:03 +0300 Subject: [PATCH 20/34] Workflows refactoring --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7364831..3d1f55c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,6 @@ name: CI on: workflow_call: - secrets: - CODACY_PROJECT_TOKEN: - required: true permissions: actions: read From ed0f59fc51e6f0e685fdb86123838887b5579ca9 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Mon, 22 Jul 2024 00:32:03 +0300 Subject: [PATCH 21/34] New issue templates --- .github/ISSUE_TEMPLATE.md | 51 --------------------- .github/ISSUE_TEMPLATE/bug.yml | 64 +++++++++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 1 + .github/ISSUE_TEMPLATE/question.yml | 26 +++++++++++ .github/ISSUE_TEMPLATE/suggestion.yml | 43 ++++++++++++++++++ 5 files changed, 134 insertions(+), 51 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/ISSUE_TEMPLATE/bug.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/question.yml create mode 100644 .github/ISSUE_TEMPLATE/suggestion.yml diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 2eb6195..0000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,51 +0,0 @@ -_Before opening an issue, search for similar bug reports or feature requests on GitHub Issues. If yes, please add a_ 👍 _reaction to the existing issue. If no similar issue can be found, fill out either the "Bug Report" or the "Feature Request" section below. Erase the other section and everything on and above this line._ - -### Bug report - -**System info:** - -* **Verbose version info (`atlassian-cloud-backuper -vv`):** -* **Install tools:** - -**Steps to reproduce:** - -1. [First Step] -2. [Second Step] -3. [and so on...] - -**Expected behavior:** - -[What you expected to happen] - -**Actual behavior:** - -[What actually happened] - -**Additional info:** - -[Include gist of relevant config, logs, etc.] - -Please run those if possible and link them from a [gist](http://gist.github.com). - ---- - -### Feature Request - -Opening a feature request kicks off a discussion. Requests may be closed if we're not actively planning to work on them. - -**Proposal:** - -[Description of the feature] - -**Current behavior:** - -[What currently happens] - -**Desired behavior:** - -[What you would like to happen] - -**Use case:** - -[Why is this important (helps with prioritizing requests)] - diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml new file mode 100644 index 0000000..1f96f54 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -0,0 +1,64 @@ +name: ❗ Bug Report +description: File a bug report +title: "[Bug]: " +labels: ["issue • bug"] +assignees: + - andyone + +body: + - type: markdown + attributes: + value: | + > [!IMPORTANT] + > Before you open an issue, search GitHub Issues for a similar bug reports. If so, please add a 👍 reaction to the existing issue. + + - type: textarea + attributes: + label: Verbose application info + description: Output of `atlassian-cloud-backuper -vv` command + render: shell + validations: + required: true + + - type: dropdown + id: version + attributes: + label: Install tools + description: How did you install this application + options: + - From Sources + - RPM Package + - Prebuilt Binary + default: 0 + validations: + required: true + + - type: textarea + attributes: + label: Steps to reproduce + description: Short guide on how to reproduce this problem on our site + placeholder: | + 1. [First Step] + 2. [Second Step] + 3. [and so on...] + validations: + required: true + + - type: textarea + attributes: + label: Expected behavior + description: What you expected to happen + validations: + required: true + + - type: textarea + attributes: + label: Actual behavior + description: What actually happened + validations: + required: true + + - type: textarea + attributes: + label: Additional info + description: Include gist of relevant config, logs, etc. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..3ba13e0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml new file mode 100644 index 0000000..55bfc41 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -0,0 +1,26 @@ +name: ❓ Question +description: Question about application, configuration or code +title: "[Question]: " +labels: ["issue • question"] +assignees: + - andyone + +body: + - type: markdown + attributes: + value: | + > [!IMPORTANT] + > Before you open an issue, search GitHub Issues for a similar question. If so, please add a 👍 reaction to the existing issue. + + - type: textarea + attributes: + label: Question + description: Detailed question + validations: + required: true + + - type: textarea + attributes: + label: Related version application info + description: Output of `atlassian-cloud-backuper -vv` command + render: shell diff --git a/.github/ISSUE_TEMPLATE/suggestion.yml b/.github/ISSUE_TEMPLATE/suggestion.yml new file mode 100644 index 0000000..39c69e0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/suggestion.yml @@ -0,0 +1,43 @@ +name: ➕ Suggestion +description: Suggest new feature or improvement +title: "[Suggestion]: " +labels: ["issue • suggestion"] +assignees: + - andyone + +body: + - type: markdown + attributes: + value: | + > [!IMPORTANT] + > Before you open an issue, search GitHub Issues for a similar feature requests. If so, please add a 👍 reaction to the existing issue. + > + > Opening a feature request kicks off a discussion. Requests may be closed if we're not actively planning to work on them. + + - type: textarea + attributes: + label: Proposal + description: Description of the feature + validations: + required: true + + - type: textarea + attributes: + label: Current behavior + description: What currently happens + validations: + required: true + + - type: textarea + attributes: + label: Desired behavior + description: What you would like to happen + validations: + required: true + + - type: textarea + attributes: + label: Use case + description: Why is this important (helps with prioritizing requests) + validations: + required: true From f098cc4b8ebee91fb1f8b753ff07c8444cba37f8 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Mon, 22 Jul 2024 00:33:55 +0300 Subject: [PATCH 22/34] Improve dockerfile --- .docker/alpine.docker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/alpine.docker b/.docker/alpine.docker index d132146..db5bb8f 100644 --- a/.docker/alpine.docker +++ b/.docker/alpine.docker @@ -6,7 +6,7 @@ ARG REGISTRY="docker.io" FROM ${REGISTRY}/essentialkaos/golang:alpine3.18 as builder -WORKDIR /go/src/github.com/essentialkaos/{{SHORT_NAME}} +WORKDIR /go/src/github.com/essentialkaos/atlassian-cloud-backuper COPY . . From 4f2eefe12fecfb7a023c60081004533900661032 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Mon, 22 Jul 2024 00:37:22 +0300 Subject: [PATCH 23/34] Regenerate usage svgs --- .github/images/usage-container.svg | 102 +++++++++++++++-------------- .github/images/usage.svg | 40 +++++------ 2 files changed, 73 insertions(+), 69 deletions(-) diff --git a/.github/images/usage-container.svg b/.github/images/usage-container.svg index af4f579..090c505 100644 --- a/.github/images/usage-container.svg +++ b/.github/images/usage-container.svg @@ -1,5 +1,5 @@ - - + + Atlassian Cloud Backuper Usage @@ -14,12 +14,13 @@ text { font-family: ui-monospace, 'JetBrains Mono', 'Fira Code', 'Iosevka', SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 14px; font-display: swap; white-space: pre; } tspan { white-space: pre; } - .bold { font-weight: bold; } - .italic { font-style: italic; } - .underline { text-decoration-line: underline; } - .dim { opacity: 0.75; } .terminal { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-weight: 500; font-size: 15px; } + tspan.BB { font-weight: bold; } + tspan.II { font-style: italic; } + tspan.UU { text-decoration-line: underline; } + tspan.DD { opacity: 0.75; } + text { fill: #333; } .terminal { fill: #333; } .bg { fill: #F0F0F0; stop-color: #F0F0F0; } @@ -30,8 +31,8 @@ tspan.b { fill: #0060BA; } tspan.m { fill: #BA00AD; } tspan.c { fill: #00B7BA; } - tspan.LG { fill: #696969; } - tspan.DG { fill: #AAA; } + tspan.s { fill: #696969; } + tspan.d { fill: #AAA; } tspan.R { fill: #EA4B4B; } tspan.G { fill: #88DB43; } tspan.Y { fill: #D3BA3B; } @@ -53,8 +54,8 @@ tspan.b { fill: #5C9AD8; } tspan.m { fill: #B6419E; } tspan.c { fill: #38AFC5; } - tspan.LG { fill: #AAA; } - tspan.DG { fill: #696969; } + tspan.s { fill: #AAA; } + tspan.d { fill: #696969; } tspan.R { fill: #EF5A56; } tspan.G { fill: #49E471; } tspan.Y { fill: #E3E342; } @@ -67,7 +68,7 @@ } - + @@ -77,44 +78,45 @@ Terminal - Usage: atlassian-cloud-backuper {options} target - Options - --config, -c file ........................ Path to configuration file - --interactive, -I ........................ Interactive mode - --no-color, -nc .......................... Disable colors in output - --help, -h ............................... Show this help message - --version, -v ............................ Show version - --access-account name .................... Account name (ACCESS_ACCOUNT) - --access-email email ..................... User email with access to API (ACCESS_EMAIL) - --access-api-key key ..................... API key (ACCESS_API_KEY) - --storage-type fs/sftp/s3 ................ Storage type (STORAGE_TYPE) - --storage-fs-path path ................... Path on system for backups (STORAGE_FS_PATH) - --storage-fs-mode mode ................... File mode on system (STORAGE_FS_MODE) - --storage-sftp-host host ................. SFTP host (STORAGE_SFTP_HOST) - --storage-sftp-user name ................. SFTP user name (STORAGE_SFTP_USER) - --storage-sftp-key key ................... Base64-encoded private key (STORAGE_SFTP_KEY) - --storage-sftp-path path ................. Path on SFTP (STORAGE_SFTP_PATH) - --storage-sftp-mode mode ................. File mode on SFTP (STORAGE_SFTP_MODE) - --storage-s3-host host ................... S3 host (STORAGE_S3_HOST) - --storage-s3-region region ............... S3 region (STORAGE_S3_REGION) - --storage-s3-access-key id ............... S3 access key ID (STORAGE_S3_ACCESS_KEY) - --storage-s3-secret-key key .............. S3 access secret key (STORAGE_S3_SECRET_KEY) - --storage-s3-bucket name ................. S3 bucket (STORAGE_S3_BUCKET) - --storage-s3-path path ................... Path for backups (STORAGE_S3_PATH) - --jira-output-file template .............. Jira backup output file name template - (JIRA_OUTPUT_FILE) - --jira-include-attachments yes/no ........ Include attachments to Jira backup - (JIRA_INCLUDE_ATTACHMENTS) - --jira-cloud-format yes/no ............... Create Jira backup for Cloud (JIRA_CLOUD_FORMAT) - --confluence-output-file template ........ Confluence backup output file name template - (CONFLUENCE_OUTPUT_FILE) - --confluence-include-attachments yes/no .. Include attachments to Confluence backup - (CONFLUENCE_INCLUDE_ATTACHMENTS) - --confluence-cloud-format yes/no ......... Create Confluence backup for Cloud - (CONFLUENCE_CLOUD_FORMAT) - --temp-dir path .......................... Path to directory for temporary data (TEMP_DIR) - --log-format text/json ................... Log format (LOG_FORMAT) - --log-level level ........................ Log level (LOG_LEVEL) + Usage: atlassian-cloud-backuper {options} target + Options + --config, -c file ........................ Path to configuration file + --interactive, -I ........................ Interactive mode + --server, -S ............................. Server mode + --no-color, -nc .......................... Disable colors in output + --help, -h ............................... Show this help message + --version, -v ............................ Show version + --access-account name .................... Account name (ACCESS_ACCOUNT) + --access-email email ..................... User email with access to API (ACCESS_EMAIL) + --access-api-key key ..................... API key (ACCESS_API_KEY) + --storage-type fs/sftp/s3 ................ Storage type (STORAGE_TYPE) + --storage-fs-path path ................... Path on system for backups (STORAGE_FS_PATH) + --storage-fs-mode mode ................... File mode on system (STORAGE_FS_MODE) + --storage-sftp-host host ................. SFTP host (STORAGE_SFTP_HOST) + --storage-sftp-user name ................. SFTP user name (STORAGE_SFTP_USER) + --storage-sftp-key key ................... Base64-encoded private key (STORAGE_SFTP_KEY) + --storage-sftp-path path ................. Path on SFTP (STORAGE_SFTP_PATH) + --storage-sftp-mode mode ................. File mode on SFTP (STORAGE_SFTP_MODE) + --storage-s3-host host ................... S3 host (STORAGE_S3_HOST) + --storage-s3-region region ............... S3 region (STORAGE_S3_REGION) + --storage-s3-access-key id ............... S3 access key ID (STORAGE_S3_ACCESS_KEY) + --storage-s3-secret-key key .............. S3 access secret key (STORAGE_S3_SECRET_KEY) + --storage-s3-bucket name ................. S3 bucket (STORAGE_S3_BUCKET) + --storage-s3-path path ................... Path for backups (STORAGE_S3_PATH) + --jira-output-file template .............. Jira backup output file name template + (JIRA_OUTPUT_FILE) + --jira-include-attachments yes/no ........ Include attachments to Jira backup + (JIRA_INCLUDE_ATTACHMENTS) + --jira-cloud-format yes/no ............... Create Jira backup for Cloud (JIRA_CLOUD_FORMAT) + --confluence-output-file template ........ Confluence backup output file name template + (CONFLUENCE_OUTPUT_FILE) + --confluence-include-attachments yes/no .. Include attachments to Confluence backup + (CONFLUENCE_INCLUDE_ATTACHMENTS) + --confluence-cloud-format yes/no ......... Create Confluence backup for Cloud + (CONFLUENCE_CLOUD_FORMAT) + --temp-dir path .......................... Path to directory for temporary data (TEMP_DIR) + --log-format text/json ................... Log format (LOG_FORMAT) + --log-level level ........................ Log level (LOG_LEVEL) - + diff --git a/.github/images/usage.svg b/.github/images/usage.svg index 3f12b95..6512674 100644 --- a/.github/images/usage.svg +++ b/.github/images/usage.svg @@ -1,5 +1,5 @@ - - + + Atlassian Cloud Backuper Usage @@ -14,12 +14,13 @@ text { font-family: ui-monospace, 'JetBrains Mono', 'Fira Code', 'Iosevka', SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 14px; font-display: swap; white-space: pre; } tspan { white-space: pre; } - .bold { font-weight: bold; } - .italic { font-style: italic; } - .underline { text-decoration-line: underline; } - .dim { opacity: 0.75; } .terminal { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-weight: 500; font-size: 15px; } + tspan.BB { font-weight: bold; } + tspan.II { font-style: italic; } + tspan.UU { text-decoration-line: underline; } + tspan.DD { opacity: 0.75; } + text { fill: #333; } .terminal { fill: #333; } .bg { fill: #F0F0F0; stop-color: #F0F0F0; } @@ -30,8 +31,8 @@ tspan.b { fill: #0060BA; } tspan.m { fill: #BA00AD; } tspan.c { fill: #00B7BA; } - tspan.LG { fill: #696969; } - tspan.DG { fill: #AAA; } + tspan.s { fill: #696969; } + tspan.d { fill: #AAA; } tspan.R { fill: #EA4B4B; } tspan.G { fill: #88DB43; } tspan.Y { fill: #D3BA3B; } @@ -53,8 +54,8 @@ tspan.b { fill: #5C9AD8; } tspan.m { fill: #B6419E; } tspan.c { fill: #38AFC5; } - tspan.LG { fill: #AAA; } - tspan.DG { fill: #696969; } + tspan.s { fill: #AAA; } + tspan.d { fill: #696969; } tspan.R { fill: #EF5A56; } tspan.G { fill: #49E471; } tspan.Y { fill: #E3E342; } @@ -67,7 +68,7 @@ } - + @@ -77,13 +78,14 @@ Terminal - Usage: atlassian-cloud-backuper {options} target - Options - --config, -c file .. Path to configuration file - --interactive, -I .. Interactive mode - --no-color, -nc .... Disable colors in output - --help, -h ......... Show this help message - --version, -v ...... Show version + Usage: atlassian-cloud-backuper {options} target + Options + --config, -c file .. Path to configuration file + --interactive, -I .. Interactive mode + --server, -S ....... Server mode + --no-color, -nc .... Disable colors in output + --help, -h ......... Show this help message + --version, -v ...... Show version - + From aa1f344dc493996b124dab4afd68e63428ff17cf Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Mon, 22 Jul 2024 00:52:55 +0300 Subject: [PATCH 24/34] Fixes --- app/app.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/app.go b/app/app.go index 74fd096..33bb07b 100644 --- a/app/app.go +++ b/app/app.go @@ -97,6 +97,8 @@ const ( LOG_LEVEL = "log:level" ) +// ////////////////////////////////////////////////////////////////////////////////// // + const ( TARGET_JIRA = "jira" TARGET_CONFLUENCE = "confluence" @@ -114,6 +116,7 @@ const ( var optMap = options.Map{ OPT_CONFIG: {Value: "/etc/atlassian-cloud-backuper.knf"}, OPT_INTERACTIVE: {Type: options.BOOL}, + OPT_SERVER: {Type: options.BOOL}, OPT_NO_COLOR: {Type: options.BOOL}, OPT_HELP: {Type: options.MIXED}, OPT_VER: {Type: options.MIXED}, @@ -491,6 +494,9 @@ func genUsage(section string) *usage.Info { addUnitedOption(info, ACCESS_ACCOUNT, "Account name", "name") addUnitedOption(info, ACCESS_EMAIL, "User email with access to API", "email") addUnitedOption(info, ACCESS_API_KEY, "API key", "key") + addUnitedOption(info, SERVER_IP, "HTTP server IP", "ip") + addUnitedOption(info, SERVER_PORT, "HTTP server port", "port") + addUnitedOption(info, SERVER_ACCESS_TOKEN, "HTTP access token", "token") addUnitedOption(info, STORAGE_TYPE, "Storage type", "fs/sftp/s3") addUnitedOption(info, STORAGE_FS_PATH, "Path on system for backups", "path") addUnitedOption(info, STORAGE_FS_MODE, "File mode on system", "mode") From fe56f3e57cd0ba4845f365306a8f4e5061a1aa47 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Mon, 22 Jul 2024 00:59:00 +0300 Subject: [PATCH 25/34] Fixes --- app/app.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/app.go b/app/app.go index 33bb07b..28b5fc2 100644 --- a/app/app.go +++ b/app/app.go @@ -334,8 +334,8 @@ func validateConfig() error { if options.GetB(OPT_SERVER) { validators = append(validators, - &knf.Validator{SERVER_PORT, knfn.IP, nil}, - &knf.Validator{SERVER_IP, knfn.Port, nil}, + &knf.Validator{SERVER_IP, knfn.IP, nil}, + &knf.Validator{SERVER_PORT, knfn.Port, nil}, ) } From 63cfb405980f5b4bb8b881a5852edcb86d1b63f7 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Mon, 22 Jul 2024 01:33:15 +0300 Subject: [PATCH 26/34] Improvements --- app/basic.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/basic.go b/app/basic.go index 26762a4..60c42ce 100644 --- a/app/basic.go +++ b/app/basic.go @@ -57,7 +57,14 @@ func startApp(args options.Arguments) error { bkpr.SetDispatcher(dispatcher) outputFileName := getOutputFileName(target) - tmpFile := path.Join(temp.MkName(".zip"), outputFileName) + tmpDir, err := temp.MkDir() + + if err != nil { + spinner.Done(false) + return fmt.Errorf("Can't create temporary directory: %v", err) + } + + tmpFile := path.Join(tmpDir, outputFileName) err = bkpr.Backup(tmpFile) From aec3a09b5b2ecb17048dc23c52441f8509316f5b Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Mon, 22 Jul 2024 11:39:44 +0300 Subject: [PATCH 27/34] Improvements --- app/app.go | 1 - uploader/s3/s3.go | 31 ++++++++++++++++++++++++------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/app/app.go b/app/app.go index 28b5fc2..33f4620 100644 --- a/app/app.go +++ b/app/app.go @@ -328,7 +328,6 @@ func validateConfig() error { &knf.Validator{STORAGE_S3_ACCESS_KEY, knfv.Set, nil}, &knf.Validator{STORAGE_S3_SECRET_KEY, knfv.Set, nil}, &knf.Validator{STORAGE_S3_BUCKET, knfv.Set, nil}, - &knf.Validator{STORAGE_S3_PATH, knfv.Set, nil}, ) } diff --git a/uploader/s3/s3.go b/uploader/s3/s3.go index 527349e..c00b112 100644 --- a/uploader/s3/s3.go +++ b/uploader/s3/s3.go @@ -75,11 +75,18 @@ func (u *S3Uploader) SetDispatcher(d *events.Dispatcher) { // Upload uploads given file to S3 storage func (u *S3Uploader) Upload(file, fileName string) error { + var outputFile string + u.dispatcher.DispatchAndWait(uploader.EVENT_UPLOAD_STARTED, "S3") lastUpdate := time.Now() fileSize := fsutil.GetSize(file) - outputFile := path.Join(u.config.Path, fileName) + + if u.config.Path == "" { + outputFile = fileName + } else { + outputFile = path.Join(u.config.Path, fileName) + } log.Info( "Uploading backup file to %s:%s (%s/%s)", @@ -87,8 +94,8 @@ func (u *S3Uploader) Upload(file, fileName string) error { ) client := s3.New(s3.Options{ - Region: "ru-central1", - BaseEndpoint: aws.String("https://storage.yandexcloud.net"), + Region: u.config.Region, + BaseEndpoint: aws.String("https://" + u.config.Host), Credentials: aws.NewCredentialsCache(credentials.NewStaticCredentialsProvider( u.config.AccessKeyID, u.config.SecretKey, "", )), @@ -111,7 +118,11 @@ func (u *S3Uploader) Upload(file, fileName string) error { u.dispatcher.Dispatch( uploader.EVENT_UPLOAD_PROGRESS, - &uploader.ProgressInfo{Progress: r.Progress(), Current: r.Current(), Total: r.Total()}, + &uploader.ProgressInfo{ + Progress: r.Progress(), + Current: r.Current(), + Total: r.Total(), + }, ) lastUpdate = time.Now() @@ -135,9 +146,15 @@ func (u *S3Uploader) Upload(file, fileName string) error { // Write writes data from given reader to given file func (u *S3Uploader) Write(r io.ReadCloser, fileName string) error { + var outputFile string + u.dispatcher.DispatchAndWait(uploader.EVENT_UPLOAD_STARTED, "S3") - outputFile := path.Join(u.config.Path, fileName) + if u.config.Path == "" { + outputFile = fileName + } else { + outputFile = path.Join(u.config.Path, fileName) + } log.Info( "Uploading backup file to %s:%s (%s/%s)", @@ -145,8 +162,8 @@ func (u *S3Uploader) Write(r io.ReadCloser, fileName string) error { ) client := s3.New(s3.Options{ - Region: "ru-central1", - BaseEndpoint: aws.String("https://storage.yandexcloud.net"), + Region: u.config.Region, + BaseEndpoint: aws.String("https://" + u.config.Host), Credentials: aws.NewCredentialsCache(credentials.NewStaticCredentialsProvider( u.config.AccessKeyID, u.config.SecretKey, "", )), From 44e45cc2140de2296175c172ca8808673482ca17 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Mon, 22 Jul 2024 12:03:12 +0300 Subject: [PATCH 28/34] Remove cloud function --- README.md | 4 - cloudfunc/README.md | 93 -------- cloudfunc/ycfunc.go | 535 -------------------------------------------- 3 files changed, 632 deletions(-) delete mode 100644 cloudfunc/README.md delete mode 100644 cloudfunc/ycfunc.go diff --git a/README.md b/README.md index 91f98cc..b5668ed 100644 --- a/README.md +++ b/README.md @@ -33,10 +33,6 @@ bash <(curl -fsSL https://apps.kaos.st/get) atlassian-cloud-backuper The latest version of `atlassian-cloud-backuper` also available as container image on [GitHub Container Registry](https://kaos.sh/p/atlassian-cloud-backuper) and [Docker Hub](https://kaos.sh/d/atlassian-cloud-backuper). -#### Cloud/serverless function - -You can use `atlassian-cloud-backuper` as a serverless function on Yandex.Cloud. More information about function configuration can be found in [this documentation](cloudfunc/README.md). - ### Usage #### Standalone diff --git a/cloudfunc/README.md b/cloudfunc/README.md deleted file mode 100644 index bb4d796..0000000 --- a/cloudfunc/README.md +++ /dev/null @@ -1,93 +0,0 @@ -## Cloud function - -> [!IMPORTANT] -> Currently we support only [Yandex.Cloud serverless/cloud functions](https://yandex.cloud/en/docs/functions/lang/golang/). AWS Lambda is not supported yet. - -### Targets - -- `jira` — Create backup of Jira instance; -- `confluence` — Create backup of Confluence instance. - -### Stages - -- `create` — generate backup file for given target; -- `download` — download backup file for given target. - -### Recommended roles for service account (Yandex.Cloud) - -- `storage.uploader` — for uploading data to S3; -- `lockbox.payloadViewer` — for viewing secrets in Lockbox; -- `functions.functionInvoker` — for working with triggers. - -### Handlers - -- `cloudfunc/ycfunc.Request` — handler for HTTP requests; -- `cloudfunc/ycfunc.Trigger` — handler for events from timer trigger. - -#### `Request` configuration - -You must pass `target` and `stage` using query string. - -Example: - -```bash -# Create Jira backup (asynchronously) -curl 'https://functions.yandexcloud.net/abcdeabcdeabcdeabcde?target=jira&stage=create' - -# Download Jira backup -curl 'https://functions.yandexcloud.net/abcdeabcdeabcdeabcde?target=jira&stage=download' - -# Create Confluence backup (asynchronously) -curl 'https://functions.yandexcloud.net/abcdeabcdeabcdeabcde?target=confluence&stage=create' - -# Download Confluence backup -curl 'https://functions.yandexcloud.net/abcdeabcdeabcdeabcde?target=confluence&stage=download' -``` - -HTTP status codes: - -- `200` — request successfully processed; -- `400` — query validation error; -- `500` — configuration validation error. - -#### `Trigger` configuration - -You must pass `target` and `stage` using event payload using ';' as a separator. - -Supported payload values: - -``` -jira;create -jira;download -confluence;create -confluence;download -``` - -### Environment variables - -| Env | Type | Required | Description | -|-----|------|----------|-------------| -| `ACCESS_ACCOUNT` | sᴛʀɪɴɢ | Yes | _Account name_ | -| `ACCESS_EMAIL` | sᴛʀɪɴɢ | Yes | _User email with access to API_ | -| `ACCESS_API_KEY` | sᴛʀɪɴɢ | Yes | _API key_ | -| `STORAGE_TYPE` | sᴛʀɪɴɢ | Yes | _Storage type (fs/sftp/s3)_ | -| `STORAGE_FS_PATH` | sᴛʀɪɴɢ | No | _Path on system for backups_ | -| `STORAGE_FS_MODE` | sᴛʀɪɴɢ | No | _File mode on system_ | -| `STORAGE_SFTP_HOST` | sᴛʀɪɴɢ | No | _SFTP host_ | -| `STORAGE_SFTP_USER` | sᴛʀɪɴɢ | No | _SFTP user name_ | -| `STORAGE_SFTP_KEY` | sᴛʀɪɴɢ | No | _Base64-encoded private key_ | -| `STORAGE_SFTP_PATH` | sᴛʀɪɴɢ | No | _Path on SFTP_ | -| `STORAGE_SFTP_MODE` | sᴛʀɪɴɢ | No | _File mode on SFTP_ | -| `STORAGE_S3_HOST` | sᴛʀɪɴɢ | No | _S3 host_ | -| `STORAGE_S3_REGION` | sᴛʀɪɴɢ | No | _S3 region_ | -| `STORAGE_S3_ACCESS_KEY` | sᴛʀɪɴɢ | No | _S3 access key ID_ | -| `STORAGE_S3_SECRET_KEY` | sᴛʀɪɴɢ | No | _S3 access secret key_ | -| `STORAGE_S3_BUCKET` | sᴛʀɪɴɢ | No | _S3 bucket_ | -| `STORAGE_S3_PATH` | sᴛʀɪɴɢ | No | _Path for backups_ | -| `JIRA_OUTPUT_FILE` | sᴛʀɪɴɢ | No | _Jira backup output file name template_ | -| `JIRA_INCLUDE_ATTACHMENTS` | ʙᴏᴏʟᴇᴀɴ | No | _Include attachments to Jira backup_ | -| `JIRA_CLOUD_FORMAT` | ʙᴏᴏʟᴇᴀɴ | No | _Create Jira backup for Cloud_ | -| `CONFLUENCE_OUTPUT_FILE` | sᴛʀɪɴɢ | No | _Confluence backup output file name template_ | -| `CONFLUENCE_INCLUDE_ATTACHMENTS` | ʙᴏᴏʟᴇᴀɴ | No | _Include attachments to Confluence backup_ | -| `CONFLUENCE_CLOUD_FORMAT` | ʙᴏᴏʟᴇᴀɴ | No | _Create Confluence backup for Cloud_ | -| `LOG_LEVEL` | sᴛʀɪɴɢ | No | _Log level (debug,info,warn,error)_ | diff --git a/cloudfunc/ycfunc.go b/cloudfunc/ycfunc.go deleted file mode 100644 index 4f0f9ac..0000000 --- a/cloudfunc/ycfunc.go +++ /dev/null @@ -1,535 +0,0 @@ -package main - -// ////////////////////////////////////////////////////////////////////////////////// // -// // -// Copyright (c) 2024 ESSENTIAL KAOS // -// Apache License, Version 2.0 // -// // -// ////////////////////////////////////////////////////////////////////////////////// // - -import ( - "context" - "encoding/base64" - "fmt" - "net/http" - "os" - "path" - "strconv" - "strings" - "time" - - "github.com/essentialkaos/ek/v13/log" - "github.com/essentialkaos/ek/v13/req" - "github.com/essentialkaos/ek/v13/strutil" - "github.com/essentialkaos/ek/v13/timeutil" - - knfu "github.com/essentialkaos/ek/v13/knf/united" - - "github.com/essentialkaos/atlassian-cloud-backuper/app" - - "github.com/essentialkaos/atlassian-cloud-backuper/backuper" - "github.com/essentialkaos/atlassian-cloud-backuper/backuper/confluence" - "github.com/essentialkaos/atlassian-cloud-backuper/backuper/jira" - - "github.com/essentialkaos/atlassian-cloud-backuper/uploader" - "github.com/essentialkaos/atlassian-cloud-backuper/uploader/fs" - "github.com/essentialkaos/atlassian-cloud-backuper/uploader/s3" - "github.com/essentialkaos/atlassian-cloud-backuper/uploader/sftp" -) - -// ////////////////////////////////////////////////////////////////////////////////// // - -const ( - STAGE_CREATE = "create" - STAGE_DOWNLOAD = "download" -) - -// ////////////////////////////////////////////////////////////////////////////////// // - -type Data struct { - Messages []*Message `json:"messages"` -} - -type Message struct { - Metadata *Metadata `json:"event_metadata"` - Details *Details `json:"details"` -} - -type Metadata struct { - EventType string `json:"event_type"` -} - -type Details struct { - TriggerID string `json:"trigger_id"` - Payload string `json:"payload"` -} - -// ////////////////////////////////////////////////////////////////////////////////// // - -// main is used for compilation errors -func main() { - return -} - -// ////////////////////////////////////////////////////////////////////////////////// // - -// Request is handler for HTTP requests -func Request(rw http.ResponseWriter, r *http.Request) { - req.SetUserAgent("AtlassianCloudBackuper|YCFunction", app.VER) - rw.Header().Set("X-Version", app.VER) - - log.Global.UseJSON = true - log.Global.WithCaller = true - - defer log.Flush() - - if !validateConfiguration() { - rw.WriteHeader(500) - return - } - - if !validateRequest(r) { - rw.WriteHeader(400) - return - } - - target := strings.ToLower(r.URL.Query().Get("target")) - stage := strings.ToLower(r.URL.Query().Get("stage")) - - log.Info("Got backup request", log.F{"target", target}, log.F{"stage", stage}) - - var ok bool - - switch stage { - case STAGE_CREATE: - ok = createBackupRequest(target) - case STAGE_DOWNLOAD: - ok = downloadBackupData(target) - } - - if ok { - rw.WriteHeader(200) - } else { - rw.WriteHeader(500) - } -} - -// Trigger is handler for timer trigger -func Trigger(ctx context.Context, data *Data) error { - log.Global.UseJSON = true - log.Global.WithCaller = true - - defer log.Flush() - - if !validatePayload(data) { - return fmt.Errorf("Error while trigger event validation") - } - - target, stage, _ := data.GetPayload() - - log.Info("Got trigger event", log.F{"target", target}, log.F{"stage", stage}) - - var ok bool - - switch stage { - case STAGE_CREATE: - ok = createBackupRequest(target) - case STAGE_DOWNLOAD: - ok = downloadBackupData(target) - } - - if !ok { - return fmt.Errorf("Can't handle event") - } - - return nil -} - -// ////////////////////////////////////////////////////////////////////////////////// // - -// GetPayload extracts target and stage from trigger payload -func (d *Data) GetPayload() (string, string, bool) { - payload := d.Messages[0].Details.Payload - return strings.Cut(payload, ";") -} - -// ////////////////////////////////////////////////////////////////////////////////// // - -// validateRequest validates request data -func validateRequest(r *http.Request) bool { - if r.Method != req.GET { - log.Error("Invalid request: Unsupported method") - return false - } - - target := strings.ToLower(r.URL.Query().Get("target")) - stage := strings.ToLower(r.URL.Query().Get("stage")) - - switch target { - case app.TARGET_JIRA, app.TARGET_CONFLUENCE: - // ok - - case "": - log.Error("Invalid request: Target is empty") - return false - - default: - log.Error("Invalid request: Unsupported target", log.F{"target", target}) - return false - } - - switch stage { - case STAGE_CREATE, STAGE_DOWNLOAD: - // ok - - case "": - log.Error("Invalid request: Stage is empty") - return false - - default: - log.Error("Invalid request: Unsupported stage", log.F{"stage", stage}) - return false - } - - return true -} - -// validatePayload validates trigger payload -func validatePayload(data *Data) bool { - switch { - case data == nil: - log.Error("Trigger data is nil") - return false - - case len(data.Messages) == 0: - log.Error("No messages in trigger event") - return false - - case data.Messages[0].Metadata == nil: - log.Error("No metadata in message #0") - return false - - case data.Messages[0].Metadata.EventType != "yandex.cloud.events.serverless.triggers.TimerMessage": - log.Error("Unsupported event type", log.F{"event-type", data.Messages[0].Metadata.EventType}) - return false - - case data.Messages[0].Details == nil: - log.Error("No details in message #0") - return false - - case data.Messages[0].Details.Payload == "": - log.Error("Payload is empty") - return false - - case !strings.Contains(data.Messages[0].Details.Payload, ";"): - log.Error("Payload doesn't have ';' separator", log.F{"payload", data.Messages[0].Details.Payload}) - return false - } - - target, stage, _ := data.GetPayload() - - switch target { - case app.TARGET_JIRA, app.TARGET_CONFLUENCE: - // ok - - case "": - log.Error("Invalid trigger payload: Target is empty") - return false - - default: - log.Error("Invalid trigger payload: Unsupported target", log.F{"target", target}) - return false - } - - switch stage { - case STAGE_CREATE, STAGE_DOWNLOAD: - // ok - - case "": - log.Error("Invalid trigger payload: Stage is empty") - return false - - default: - log.Error("Invalid trigger payload: Unsupported stage", log.F{"stage", stage}) - return false - } - - return true -} - -// validateConfiguration validates configuration -func validateConfiguration() bool { - switch { - case getEnvVar(app.ACCESS_ACCOUNT) == "": - log.Error("Invalid configuration: ACCESS_ACCOUNT is empty") - return false - - case getEnvVar(app.ACCESS_EMAIL) == "": - log.Error("Invalid configuration: ACCESS_EMAIL is empty") - return false - - case getEnvVar(app.ACCESS_API_KEY) == "": - log.Error("Invalid configuration: ACCESS_API_KEY is empty") - return false - - case getEnvVar(app.STORAGE_TYPE) == "": - log.Error("Invalid configuration: STORAGE_TYPE is empty") - return false - } - - switch getEnvVar(app.STORAGE_TYPE) { - case "fs", "sftp", "s3": - // ok - default: - log.Error("Invalid configuration: invalid STORAGE_TYPE value %q", getEnvVar(app.STORAGE_TYPE)) - return false - } - - if getEnvVar(app.STORAGE_TYPE) == "s3" { - switch { - case getEnvVar(app.STORAGE_S3_ACCESS_KEY) == "": - log.Error("Invalid configuration: STORAGE_S3_ACCESS_KEY is empty") - return false - case getEnvVar(app.STORAGE_S3_SECRET_KEY) == "": - log.Error("Invalid configuration: STORAGE_S3_SECRET_KEY is empty") - return false - case getEnvVar(app.STORAGE_S3_BUCKET) == "": - log.Error("Invalid configuration: STORAGE_S3_BUCKET is empty") - return false - } - } else if getEnvVar(app.STORAGE_TYPE) == "sftp" { - switch { - case getEnvVar(app.STORAGE_SFTP_HOST) == "": - log.Error("Invalid configuration: STORAGE_SFTP_HOST is empty") - return false - case getEnvVar(app.STORAGE_SFTP_USER) == "": - log.Error("Invalid configuration: STORAGE_SFTP_USER is empty") - return false - case getEnvVar(app.STORAGE_SFTP_KEY) == "": - log.Error("Invalid configuration: STORAGE_SFTP_KEY is empty") - return false - case getEnvVar(app.STORAGE_SFTP_PATH) == "": - log.Error("Invalid configuration: STORAGE_SFTP_PATH is empty") - return false - } - } else { - if getEnvVar(app.STORAGE_FS_PATH) == "" { - log.Error("Invalid configuration: STORAGE_FS_PATH is empty") - return false - } - } - - return true -} - -// createBackupRequest sends request for creating backup -func createBackupRequest(target string) bool { - bkpr, err := getBackuper(target) - - if err != nil { - log.Error("Can't create backuper instance: %v", err) - return false - } - - taskID, err := bkpr.Start() - - if err != nil { - log.Error("Can't create backup: %v", err) - return false - } - - log.Info("Backup request successfully created", log.F{"task-id", taskID}) - - return true -} - -// downloadBackupData downloads backup data and upload it to storage -func downloadBackupData(target string) bool { - bkpr, err := getBackuper(target) - - if err != nil { - log.Error("Can't create backuper instance: %v", err) - return false - } - - backupFile, err := bkpr.GetBackupFile() - - if err != nil { - log.Error("Can't find backup file: %v", err) - return false - } - - log.Info("Start downloading of backup", log.F{"backup-file", backupFile}) - - r, err := bkpr.GetReader(backupFile) - - if err != nil { - log.Error("Can't get reader for backup file: %v", err) - return false - } - - updr, err := getUploader(target) - - if err != nil { - log.Error("Can't create uploader instance: %v", err) - return false - } - - outputFile := getOutputFile(target) - - log.Info( - "Uploading backup to storage", - log.F{"backup-file", backupFile}, - log.F{"output-file", outputFile}, - ) - - err = updr.Write(r, outputFile) - - if err != nil { - log.Error( - "Can't upload backup file: %v", err, - log.F{"backup-file", backupFile}, - log.F{"output-file", outputFile}, - ) - return false - } - - return true -} - -// getBackuper returns backuper instance -func getBackuper(target string) (backuper.Backuper, error) { - var err error - var bkpr backuper.Backuper - - config, err := getBackuperConfig(target) - - if err != nil { - return nil, err - } - - switch target { - case app.TARGET_JIRA: - bkpr, err = jira.NewBackuper(config) - case app.TARGET_CONFLUENCE: - bkpr, err = confluence.NewBackuper(config) - default: - return nil, fmt.Errorf("Unknown or unsupported target %q", target) - } - - return bkpr, err -} - -// getBackuperConfig returns configuration for backuper -func getBackuperConfig(target string) (*backuper.Config, error) { - switch target { - case app.TARGET_JIRA: - return &backuper.Config{ - Account: getEnvVar(app.ACCESS_ACCOUNT), - Email: getEnvVar(app.ACCESS_EMAIL), - APIKey: getEnvVar(app.ACCESS_API_KEY), - WithAttachments: getEnvVarFlag(app.JIRA_INCLUDE_ATTACHMENTS, true), - ForCloud: getEnvVarFlag(app.JIRA_CLOUD_FORMAT, true), - }, nil - - case app.TARGET_CONFLUENCE: - return &backuper.Config{ - Account: getEnvVar(app.ACCESS_ACCOUNT), - Email: getEnvVar(app.ACCESS_EMAIL), - APIKey: getEnvVar(app.ACCESS_API_KEY), - WithAttachments: getEnvVarFlag(app.CONFLUENCE_INCLUDE_ATTACHMENTS, true), - ForCloud: getEnvVarFlag(app.CONFLUENCE_CLOUD_FORMAT, true), - }, nil - } - - return nil, fmt.Errorf("Unknown or unsupported target %q", target) -} - -// getUploader returns uploader instance -func getUploader(target string) (uploader.Uploader, error) { - var err error - var updr uploader.Uploader - - switch getEnvVar(app.STORAGE_TYPE) { - case "fs": - updr, err = fs.NewUploader(&fs.Config{ - Path: path.Join(getEnvVar(app.STORAGE_FS_PATH), target), - Mode: parseMode(getEnvVar(app.STORAGE_FS_MODE, "0640")), - }) - - case "sftp": - key, err := base64.StdEncoding.DecodeString(getEnvVar(app.STORAGE_SFTP_KEY)) - - if err != nil { - return nil, err - } - - updr, err = sftp.NewUploader(&sftp.Config{ - Host: getEnvVar(app.STORAGE_SFTP_HOST), - User: getEnvVar(app.STORAGE_SFTP_USER), - Key: key, - Path: path.Join(getEnvVar(app.STORAGE_SFTP_PATH), target), - Mode: parseMode(getEnvVar(app.STORAGE_SFTP_MODE, "0640")), - }) - - case "s3": - updr, err = s3.NewUploader(&s3.Config{ - Host: getEnvVar(app.STORAGE_S3_HOST, "storage.yandexcloud.net"), - Region: getEnvVar(app.STORAGE_S3_REGION, "ru-central1"), - AccessKeyID: getEnvVar(app.STORAGE_S3_ACCESS_KEY), - SecretKey: getEnvVar(app.STORAGE_S3_SECRET_KEY), - Bucket: getEnvVar(app.STORAGE_S3_BUCKET), - Path: path.Join(getEnvVar(app.STORAGE_S3_PATH), target), - }) - } - - return updr, err -} - -// getOutputFile returns name of output file -func getOutputFile(target string) string { - var template string - - switch target { - case app.TARGET_JIRA: - template = strutil.Q(getEnvVar(app.JIRA_OUTPUT_FILE), `jira-backup-%Y-%m-%d`) + ".zip" - case app.TARGET_CONFLUENCE: - template = strutil.Q(getEnvVar(app.CONFLUENCE_OUTPUT_FILE), `confluence-backup-%Y-%m-%d`) + ".zip" - } - - return timeutil.Format(time.Now(), template) -} - -// getEnvVar reads environment variable -func getEnvVar(name string, defs ...string) string { - value := os.Getenv(knfu.ToEnvVar(name)) - - if value == "" && len(defs) > 0 { - return defs[0] - } - - return value -} - -// getEnvVarFlag reads environment variable with flag -func getEnvVarFlag(name string, def bool) bool { - switch strings.ToLower(getEnvVar(name)) { - case "n", "no", "false", "0": - return false - case "y", "yes", "true", "1": - return true - } - - return def -} - -// parseMode parses file mode -func parseMode(v string) os.FileMode { - m, err := strconv.ParseUint(v, 8, 32) - - if err != nil { - return 0600 - } - - return os.FileMode(m) -} From 533584e8113e9c42e90d72bcced678be06d7d307 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Mon, 22 Jul 2024 12:03:38 +0300 Subject: [PATCH 29/34] Regenerate Makefile with the latest version of gomakegen --- Makefile | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index d4fdfe8..02c3bad 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ ################################################################################ -# This Makefile generated by GoMakeGen 3.0.2 using next command: +# This Makefile generated by GoMakeGen 3.0.5 using next command: # gomakegen --mod . # # More info: https://kaos.sh/gomakegen @@ -24,11 +24,6 @@ GITREV ?= $(shell test -s $(MAKEDIR)/.git && git rev-parse --short HEAD) all: atlassian-cloud-backuper ## Build all binaries -pack: clean ## Create zip file with YC function - @echo "Packing YC function to zip…" - @go build cloudfunc/ycfunc.go && rm -f ycfunc - @zip atlassian-cloud-backuper -r "app" "backuper" "cloudfunc" "uploader" go.* - atlassian-cloud-backuper: @echo "Building atlassian-cloud-backuper…" @go build $(VERBOSE_FLAG) -ldflags="-X main.gitrev=$(GITREV)" atlassian-cloud-backuper.go @@ -114,6 +109,6 @@ help: ## Show this info | sed 's/ifdef //' \ | awk 'BEGIN {FS = " .*?## "}; {printf " \033[32m%-11s\033[0m %s\n", $$1, $$2}' @echo -e '' - @echo -e '\033[90mGenerated by GoMakeGen 3.0.2\033[0m\n' + @echo -e '\033[90mGenerated by GoMakeGen 3.0.5\033[0m\n' ################################################################################ From 4644752d0d69f646140cc013541ea63eac68ddf4 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Tue, 23 Jul 2024 14:20:28 +0300 Subject: [PATCH 30/34] Add data encryption feature --- app/app.go | 8 ++ app/basic.go | 131 ++---------------- app/common.go | 151 +++++++++++++++++++++ app/server.go | 2 +- backuper/confluence/confluence-backuper.go | 15 +- backuper/jira/jira-backuper.go | 2 +- common/atlassian-cloud-backuper.knf | 3 + go.mod | 4 +- go.sum | 8 +- uploader/fs/fs.go | 85 +++++++++--- uploader/s3/s3.go | 114 +++++++--------- uploader/sftp/sftp.go | 135 ++++++++---------- uploader/uploader.go | 10 +- 13 files changed, 373 insertions(+), 295 deletions(-) create mode 100644 app/common.go diff --git a/app/app.go b/app/app.go index 33f4620..592330f 100644 --- a/app/app.go +++ b/app/app.go @@ -70,6 +70,7 @@ const ( SERVER_PORT = "server:port" SERVER_ACCESS_TOKEN = "server:access-token" STORAGE_TYPE = "storage:type" + STORAGE_ENCRYPTION_KEY = "storage:encryption-key" STORAGE_FS_PATH = "storage-fs:path" STORAGE_FS_MODE = "storage-fs:mode" STORAGE_SFTP_HOST = "storage-sftp:host" @@ -338,6 +339,13 @@ func validateConfig() error { ) } + if knfu.GetS(STORAGE_ENCRYPTION_KEY) != "" { + validators = append(validators, + &knf.Validator{STORAGE_ENCRYPTION_KEY, knfv.LenGreater, 16}, + &knf.Validator{STORAGE_ENCRYPTION_KEY, knfv.LenLess, 96}, + ) + } + errs := knfu.Validate(validators) if len(errs) > 0 { diff --git a/app/basic.go b/app/basic.go index 60c42ce..f4b84d3 100644 --- a/app/basic.go +++ b/app/basic.go @@ -8,30 +8,21 @@ package app // ////////////////////////////////////////////////////////////////////////////////// // import ( - "encoding/base64" "fmt" - "os" - "time" "github.com/essentialkaos/ek/v13/events" "github.com/essentialkaos/ek/v13/fmtc" "github.com/essentialkaos/ek/v13/fmtutil" - "github.com/essentialkaos/ek/v13/fsutil" "github.com/essentialkaos/ek/v13/log" "github.com/essentialkaos/ek/v13/options" "github.com/essentialkaos/ek/v13/path" "github.com/essentialkaos/ek/v13/spinner" - "github.com/essentialkaos/ek/v13/timeutil" + "github.com/essentialkaos/ek/v13/terminal" knfu "github.com/essentialkaos/ek/v13/knf/united" "github.com/essentialkaos/atlassian-cloud-backuper/backuper" - "github.com/essentialkaos/atlassian-cloud-backuper/backuper/confluence" - "github.com/essentialkaos/atlassian-cloud-backuper/backuper/jira" "github.com/essentialkaos/atlassian-cloud-backuper/uploader" - "github.com/essentialkaos/atlassian-cloud-backuper/uploader/fs" - "github.com/essentialkaos/atlassian-cloud-backuper/uploader/s3" - "github.com/essentialkaos/atlassian-cloud-backuper/uploader/sftp" ) // ////////////////////////////////////////////////////////////////////////////////// // @@ -45,6 +36,12 @@ func startApp(args options.Arguments) error { addEventsHandlers(dispatcher) } + if knfu.GetS(STORAGE_ENCRYPTION_KEY) != "" { + fmtc.NewLine() + terminal.Warn("▲ Backup will be encrypted while uploading. You will not be able to use the") + terminal.Warn(" backup if you lose the encryption key. Keep it in a safe place.") + } + defer temp.Clean() target := args.Get(0).String() @@ -93,116 +90,6 @@ func startApp(args options.Arguments) error { return nil } -// getBackuper returns backuper instances -func getBackuper(target string) (backuper.Backuper, error) { - var err error - var bkpr backuper.Backuper - - bkpConfig, err := getBackuperConfig(target) - - if err != nil { - return nil, err - } - - switch target { - case TARGET_JIRA: - bkpr, err = jira.NewBackuper(bkpConfig) - case TARGET_CONFLUENCE: - bkpr, err = confluence.NewBackuper(bkpConfig) - } - - return bkpr, nil -} - -// getOutputFileName returns name for backup output file -func getOutputFileName(target string) string { - var template string - - switch target { - case TARGET_JIRA: - template = knfu.GetS(JIRA_OUTPUT_FILE, `jira-backup-%Y-%m-%d`) + ".zip" - case TARGET_CONFLUENCE: - template = knfu.GetS(JIRA_OUTPUT_FILE, `confluence-backup-%Y-%m-%d`) + ".zip" - } - - return timeutil.Format(time.Now(), template) -} - -// getBackuperConfig returns configuration for backuper -func getBackuperConfig(target string) (*backuper.Config, error) { - switch target { - case TARGET_JIRA: - return &backuper.Config{ - Account: knfu.GetS(ACCESS_ACCOUNT), - Email: knfu.GetS(ACCESS_EMAIL), - APIKey: knfu.GetS(ACCESS_API_KEY), - WithAttachments: knfu.GetB(JIRA_INCLUDE_ATTACHMENTS), - ForCloud: knfu.GetB(JIRA_CLOUD_FORMAT), - }, nil - - case TARGET_CONFLUENCE: - return &backuper.Config{ - Account: knfu.GetS(ACCESS_ACCOUNT), - Email: knfu.GetS(ACCESS_EMAIL), - APIKey: knfu.GetS(ACCESS_API_KEY), - WithAttachments: knfu.GetB(CONFLUENCE_INCLUDE_ATTACHMENTS), - ForCloud: knfu.GetB(CONFLUENCE_CLOUD_FORMAT), - }, nil - } - - return nil, fmt.Errorf("Unknown target %q", target) -} - -// getUploader returns uploader instance -func getUploader(target string) (uploader.Uploader, error) { - var err error - var updr uploader.Uploader - - switch knfu.GetS(STORAGE_TYPE) { - case STORAGE_FS: - updr, err = fs.NewUploader(&fs.Config{ - Path: path.Join(knfu.GetS(STORAGE_FS_PATH), target), - Mode: knfu.GetM(STORAGE_FS_MODE, 0600), - }) - - case STORAGE_SFTP: - keyData, err := readPrivateKeyData() - - if err != nil { - return nil, err - } - - updr, err = sftp.NewUploader(&sftp.Config{ - Host: knfu.GetS(STORAGE_SFTP_HOST), - User: knfu.GetS(STORAGE_SFTP_USER), - Key: keyData, - Path: path.Join(knfu.GetS(STORAGE_SFTP_PATH), target), - Mode: knfu.GetM(STORAGE_SFTP_MODE, 0600), - }) - - case STORAGE_S3: - updr, err = s3.NewUploader(&s3.Config{ - Host: knfu.GetS(STORAGE_S3_HOST), - Region: knfu.GetS(STORAGE_S3_REGION), - AccessKeyID: knfu.GetS(STORAGE_S3_ACCESS_KEY), - SecretKey: knfu.GetS(STORAGE_S3_SECRET_KEY), - Bucket: knfu.GetS(STORAGE_S3_BUCKET), - Path: path.Join(knfu.GetS(STORAGE_S3_PATH), target), - }) - } - - return updr, err -} - -// readPrivateKeyData reads private key data -func readPrivateKeyData() ([]byte, error) { - if fsutil.IsExist(knfu.GetS(STORAGE_SFTP_KEY)) { - return os.ReadFile(knfu.GetS(STORAGE_SFTP_KEY)) - } - - return base64.StdEncoding.DecodeString(knfu.GetS(STORAGE_SFTP_KEY)) -} - // addEventsHandlers registers events handlers func addEventsHandlers(dispatcher *events.Dispatcher) { dispatcher.AddHandler(backuper.EVENT_BACKUP_STARTED, func(payload any) { @@ -212,7 +99,7 @@ func addEventsHandlers(dispatcher *events.Dispatcher) { dispatcher.AddHandler(backuper.EVENT_BACKUP_PROGRESS, func(payload any) { p := payload.(*backuper.ProgressInfo) - spinner.Update("[%d%%] %s", p.Progress, p.Message) + spinner.Update("{s}(%d%%){!} %s", p.Progress, p.Message) }) dispatcher.AddHandler(backuper.EVENT_BACKUP_SAVING, func(payload any) { @@ -231,7 +118,7 @@ func addEventsHandlers(dispatcher *events.Dispatcher) { dispatcher.AddHandler(uploader.EVENT_UPLOAD_PROGRESS, func(payload any) { p := payload.(*uploader.ProgressInfo) spinner.Update( - "[%s] Uploading file (%s/%s)", + "{s}(%5s){!} Uploading file {s-}(%7s | %7s){!}", fmtutil.PrettyPerc(p.Progress), fmtutil.PrettySize(p.Current), fmtutil.PrettySize(p.Total), diff --git a/app/common.go b/app/common.go new file mode 100644 index 0000000..2aec48c --- /dev/null +++ b/app/common.go @@ -0,0 +1,151 @@ +package app + +// ////////////////////////////////////////////////////////////////////////////////// // +// // +// Copyright (c) 2024 ESSENTIAL KAOS // +// Apache License, Version 2.0 // +// // +// ////////////////////////////////////////////////////////////////////////////////// // + +import ( + "encoding/base64" + "fmt" + "os" + "time" + + "github.com/essentialkaos/ek/v13/fsutil" + "github.com/essentialkaos/ek/v13/path" + "github.com/essentialkaos/ek/v13/timeutil" + + "github.com/essentialkaos/katana" + + knfu "github.com/essentialkaos/ek/v13/knf/united" + + "github.com/essentialkaos/atlassian-cloud-backuper/backuper" + "github.com/essentialkaos/atlassian-cloud-backuper/backuper/confluence" + "github.com/essentialkaos/atlassian-cloud-backuper/backuper/jira" + "github.com/essentialkaos/atlassian-cloud-backuper/uploader" + "github.com/essentialkaos/atlassian-cloud-backuper/uploader/fs" + "github.com/essentialkaos/atlassian-cloud-backuper/uploader/s3" + "github.com/essentialkaos/atlassian-cloud-backuper/uploader/sftp" +) + +// ////////////////////////////////////////////////////////////////////////////////// // + +// getBackuper returns backuper instances +func getBackuper(target string) (backuper.Backuper, error) { + var err error + var bkpr backuper.Backuper + + bkpConfig, err := getBackuperConfig(target) + + if err != nil { + return nil, err + } + + switch target { + case TARGET_JIRA: + bkpr, err = jira.NewBackuper(bkpConfig) + case TARGET_CONFLUENCE: + bkpr, err = confluence.NewBackuper(bkpConfig) + } + + return bkpr, nil +} + +// getOutputFileName returns name for backup output file +func getOutputFileName(target string) string { + var template string + + switch target { + case TARGET_JIRA: + template = knfu.GetS(JIRA_OUTPUT_FILE, `jira-backup-%Y-%m-%d`) + ".zip" + case TARGET_CONFLUENCE: + template = knfu.GetS(JIRA_OUTPUT_FILE, `confluence-backup-%Y-%m-%d`) + ".zip" + } + + return timeutil.Format(time.Now(), template) +} + +// getBackuperConfig returns configuration for backuper +func getBackuperConfig(target string) (*backuper.Config, error) { + switch target { + case TARGET_JIRA: + return &backuper.Config{ + Account: knfu.GetS(ACCESS_ACCOUNT), + Email: knfu.GetS(ACCESS_EMAIL), + APIKey: knfu.GetS(ACCESS_API_KEY), + WithAttachments: knfu.GetB(JIRA_INCLUDE_ATTACHMENTS), + ForCloud: knfu.GetB(JIRA_CLOUD_FORMAT), + }, nil + + case TARGET_CONFLUENCE: + return &backuper.Config{ + Account: knfu.GetS(ACCESS_ACCOUNT), + Email: knfu.GetS(ACCESS_EMAIL), + APIKey: knfu.GetS(ACCESS_API_KEY), + WithAttachments: knfu.GetB(CONFLUENCE_INCLUDE_ATTACHMENTS), + ForCloud: knfu.GetB(CONFLUENCE_CLOUD_FORMAT), + }, nil + } + + return nil, fmt.Errorf("Unknown target %q", target) +} + +// getUploader returns uploader instance +func getUploader(target string) (uploader.Uploader, error) { + var err error + var updr uploader.Uploader + var secret *katana.Secret + + if knfu.GetS(STORAGE_ENCRYPTION_KEY) != "" { + secret = katana.NewSecret(knfu.GetS(STORAGE_ENCRYPTION_KEY)) + } + + switch knfu.GetS(STORAGE_TYPE) { + case STORAGE_FS: + updr, err = fs.NewUploader(&fs.Config{ + Path: path.Join(knfu.GetS(STORAGE_FS_PATH), target), + Mode: knfu.GetM(STORAGE_FS_MODE, 0600), + Secret: secret, + }) + + case STORAGE_SFTP: + keyData, err := readPrivateKeyData() + + if err != nil { + return nil, err + } + + updr, err = sftp.NewUploader(&sftp.Config{ + Host: knfu.GetS(STORAGE_SFTP_HOST), + User: knfu.GetS(STORAGE_SFTP_USER), + Key: keyData, + Path: path.Join(knfu.GetS(STORAGE_SFTP_PATH), target), + Mode: knfu.GetM(STORAGE_SFTP_MODE, 0600), + Secret: secret, + }) + + case STORAGE_S3: + updr, err = s3.NewUploader(&s3.Config{ + Host: knfu.GetS(STORAGE_S3_HOST), + Region: knfu.GetS(STORAGE_S3_REGION), + AccessKeyID: knfu.GetS(STORAGE_S3_ACCESS_KEY), + SecretKey: knfu.GetS(STORAGE_S3_SECRET_KEY), + Bucket: knfu.GetS(STORAGE_S3_BUCKET), + Path: path.Join(knfu.GetS(STORAGE_S3_PATH), target), + Secret: secret, + }) + } + + return updr, err +} + +// readPrivateKeyData reads private key data +func readPrivateKeyData() ([]byte, error) { + if fsutil.IsExist(knfu.GetS(STORAGE_SFTP_KEY)) { + return os.ReadFile(knfu.GetS(STORAGE_SFTP_KEY)) + } + + return base64.StdEncoding.DecodeString(knfu.GetS(STORAGE_SFTP_KEY)) +} diff --git a/app/server.go b/app/server.go index 6ba5670..8d25121 100644 --- a/app/server.go +++ b/app/server.go @@ -150,7 +150,7 @@ func downloadBackupHandler(rw http.ResponseWriter, r *http.Request) { log.Info("Uploading backup to storage", lf) - err = updr.Write(br, outputFile) + err = updr.Write(br, outputFile, 0) if err != nil { log.Error("Can't upload backup file: %v", err, lf) diff --git a/backuper/confluence/confluence-backuper.go b/backuper/confluence/confluence-backuper.go index b549f1e..e445c70 100644 --- a/backuper/confluence/confluence-backuper.go +++ b/backuper/confluence/confluence-backuper.go @@ -98,8 +98,17 @@ func (b *ConfluenceBackuper) Start() (string, error) { info, _ := b.getBackupProgress() if info != nil && !info.IsOutdated { - log.Info("Found previously created backup task") + log.Info( + "Found previously created backup task", + log.F{"backup-status", info.CurrentStatus}, + log.F{"backup-perc", info.AlternativePercentage}, + log.F{"backup-size", info.Size}, + log.F{"backup-file", info.Filename}, + log.F{"backup-outdated", info.IsOutdated}, + ) } else { + log.Info("No previously created backup task or task is outdated, starting new backup…") + err := b.startBackup() if err != nil { @@ -142,14 +151,14 @@ func (b *ConfluenceBackuper) Progress(taskID string) (string, error) { if progressInfo.Size == 0 && progressInfo.AlternativePercentage >= lastProgress { log.Info( - "(%s) Backup in progress: %s", + "(%s%%) Backup in progress: %s", progressInfo.AlternativePercentage, progressInfo.CurrentStatus, ) lastProgress = progressInfo.AlternativePercentage } - if progressInfo.Size != 0 && progressInfo.Filename != "" { + if progressInfo.Filename != "" { backupFileURL = progressInfo.Filename break } diff --git a/backuper/jira/jira-backuper.go b/backuper/jira/jira-backuper.go index c5afc0f..a189d56 100644 --- a/backuper/jira/jira-backuper.go +++ b/backuper/jira/jira-backuper.go @@ -104,7 +104,7 @@ func (b *JiraBackuper) Start() (string, error) { if backupTaskID != "" { log.Info("Found previously created backup task with ID %s", backupTaskID) } else { - log.Info("No previously created task found, run backup…") + log.Info("No previously created task found, starting new backup…") backupTaskID, err = b.startBackup() diff --git a/common/atlassian-cloud-backuper.knf b/common/atlassian-cloud-backuper.knf index 4cf38fd..fa40a4a 100644 --- a/common/atlassian-cloud-backuper.knf +++ b/common/atlassian-cloud-backuper.knf @@ -25,6 +25,9 @@ # Storage type (fs/sftp/s3) type: + # Katana encryption key + encryption-key: + [storage-fs] # Path to directory with backups diff --git a/go.mod b/go.mod index 3abd02a..7043e3f 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,8 @@ require ( github.com/aws/aws-sdk-go-v2 v1.30.3 github.com/aws/aws-sdk-go-v2/credentials v1.17.27 github.com/aws/aws-sdk-go-v2/service/s3 v1.58.2 - github.com/essentialkaos/ek/v13 v13.1.0 + github.com/essentialkaos/ek/v13 v13.2.0 + github.com/essentialkaos/katana v0.2.0 github.com/pkg/sftp v1.13.6 golang.org/x/crypto v0.25.0 ) @@ -22,6 +23,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.15 // indirect github.com/aws/smithy-go v1.20.3 // indirect github.com/essentialkaos/depsy v1.3.0 // indirect + github.com/essentialkaos/sio v1.0.0 // indirect github.com/kr/fs v0.1.0 // indirect golang.org/x/sys v0.22.0 // indirect ) diff --git a/go.sum b/go.sum index 6890c11..b04bb0d 100644 --- a/go.sum +++ b/go.sum @@ -28,8 +28,12 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk= github.com/essentialkaos/depsy v1.3.0 h1:CN7bRgBU2jGTHSkg/Sh38eDUn7cvmaTp2sxFt2HpFeU= github.com/essentialkaos/depsy v1.3.0/go.mod h1:kpiTAV17dyByVnrbNaMcZt2jRwvuXClUYOzpyJQwtG8= -github.com/essentialkaos/ek/v13 v13.1.0 h1:k0X7805R2z5QVBCYzGgApWosnpmBdb+00B4rc2tEGVA= -github.com/essentialkaos/ek/v13 v13.1.0/go.mod h1:RVf1NpNyK04xkBJ3NTUD1wNLWemY9/naVD4iEVjU2fA= +github.com/essentialkaos/ek/v13 v13.2.0 h1:Ra6segoyFYjtdz5eh0mQxJMeIso7h61A7IyG9B4R6bI= +github.com/essentialkaos/ek/v13 v13.2.0/go.mod h1:RVf1NpNyK04xkBJ3NTUD1wNLWemY9/naVD4iEVjU2fA= +github.com/essentialkaos/katana v0.2.0 h1:LRnKyEHFET9P45L718DI704oUBHcOjW+/bWBstPb9qg= +github.com/essentialkaos/katana v0.2.0/go.mod h1:B0IUikFvR6Iutx93iSu3xezHfHvIuIgXJSO6Agujp+0= +github.com/essentialkaos/sio v1.0.0 h1:+VZg0Z7+Cx8F/FmlczzTJYM6rq/LhTR45Rsditmu0Ec= +github.com/essentialkaos/sio v1.0.0/go.mod h1:lKaW6IPMJ8GAEAiXe175zcEld370u3Nr546c22Kw5C8= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= diff --git a/uploader/fs/fs.go b/uploader/fs/fs.go index 12bab41..f9166b2 100644 --- a/uploader/fs/fs.go +++ b/uploader/fs/fs.go @@ -12,12 +12,16 @@ import ( "fmt" "io" "os" + "time" "github.com/essentialkaos/ek/v13/events" "github.com/essentialkaos/ek/v13/fsutil" "github.com/essentialkaos/ek/v13/log" + "github.com/essentialkaos/ek/v13/passthru" "github.com/essentialkaos/ek/v13/path" + "github.com/essentialkaos/katana" + "github.com/essentialkaos/atlassian-cloud-backuper/uploader" ) @@ -25,8 +29,9 @@ import ( // Config is configuration for FS uploader type Config struct { - Path string - Mode os.FileMode + Path string + Mode os.FileMode + Secret *katana.Secret } // FSUploader is FS uploader instance @@ -64,10 +69,6 @@ func (u *FSUploader) SetDispatcher(d *events.Dispatcher) { // Upload uploads given file to storage func (u *FSUploader) Upload(file, fileName string) error { - log.Info("Copying backup file to %s…", u.config.Path) - - u.dispatcher.DispatchAndWait(uploader.EVENT_UPLOAD_STARTED, "FS") - err := fsutil.ValidatePerms("FRS", file) if err != nil { @@ -78,43 +79,89 @@ func (u *FSUploader) Upload(file, fileName string) error { err = os.MkdirAll(u.config.Path, 0750) if err != nil { - return fmt.Errorf("Can't create directory for backup: %v", err) + return fmt.Errorf("Can't create directory for backup: %w", err) } } - err = fsutil.CopyFile(file, path.Join(u.config.Path, fileName), u.config.Mode) + fd, err := os.Open(file) - u.dispatcher.DispatchAndWait(uploader.EVENT_UPLOAD_DONE, "FS") + if err != nil { + return fmt.Errorf("Can't open backup file: %w", err) + } - log.Info("Backup successfully copied to %s", u.config.Path) + defer fd.Close() + + err = u.Write(fd, fileName, fsutil.GetSize(file)) + + if err != nil { + return fmt.Errorf("Can't save backup file: %w", err) + } return err } // Write writes data from given reader to given file -func (u *FSUploader) Write(r io.ReadCloser, fileName string) error { +func (u *FSUploader) Write(r io.ReadCloser, fileName string, fileSize int64) error { u.dispatcher.DispatchAndWait(uploader.EVENT_UPLOAD_STARTED, "FS") - fd, err := os.OpenFile( - path.Join(u.config.Path, fileName), - os.O_CREATE|os.O_TRUNC|os.O_WRONLY, u.config.Mode, - ) + var w io.Writer + + lastUpdate := time.Now() + outputFile := path.Join(u.config.Path, fileName) + + log.Info("Copying backup file to %s…", u.config.Path) + + fd, err := os.OpenFile(outputFile, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, u.config.Mode) if err != nil { return err } - defer fd.Close() - defer r.Close() + w = fd + + if u.config.Secret != nil { + sw, err := u.config.Secret.NewWriter(fd) + + if err != nil { + return fmt.Errorf("Can't create encrypted writer: %w", err) + } + + defer sw.Close() + + w = sw + } - w := bufio.NewWriter(fd) - _, err = io.Copy(w, r) + if fileSize > 0 { + pw := passthru.NewWriter(w, fileSize) + + pw.Update = func(n int) { + if time.Since(lastUpdate) < 3*time.Second { + return + } + + u.dispatcher.Dispatch( + uploader.EVENT_UPLOAD_PROGRESS, + &uploader.ProgressInfo{ + Progress: pw.Progress(), + Current: pw.Current(), + Total: pw.Total(), + }, + ) + + lastUpdate = time.Now() + } + + w = pw + } + + _, err = io.Copy(bufio.NewWriter(w), r) if err != nil { return fmt.Errorf("File writing error: %w", err) } u.dispatcher.DispatchAndWait(uploader.EVENT_UPLOAD_DONE, "FS") + log.Info("Backup successfully copied to %s", u.config.Path) return nil } diff --git a/uploader/s3/s3.go b/uploader/s3/s3.go index c00b112..669682b 100644 --- a/uploader/s3/s3.go +++ b/uploader/s3/s3.go @@ -25,6 +25,8 @@ import ( "github.com/aws/aws-sdk-go-v2/credentials" "github.com/aws/aws-sdk-go-v2/service/s3" + "github.com/essentialkaos/katana" + "github.com/essentialkaos/atlassian-cloud-backuper/uploader" ) @@ -38,6 +40,7 @@ type Config struct { SecretKey string Bucket string Path string + Secret *katana.Secret } // S3Uploader is S3 uploader instance @@ -75,84 +78,34 @@ func (u *S3Uploader) SetDispatcher(d *events.Dispatcher) { // Upload uploads given file to S3 storage func (u *S3Uploader) Upload(file, fileName string) error { - var outputFile string - - u.dispatcher.DispatchAndWait(uploader.EVENT_UPLOAD_STARTED, "S3") - - lastUpdate := time.Now() - fileSize := fsutil.GetSize(file) - - if u.config.Path == "" { - outputFile = fileName - } else { - outputFile = path.Join(u.config.Path, fileName) - } - - log.Info( - "Uploading backup file to %s:%s (%s/%s)", - u.config.Bucket, u.config.Path, u.config.Host, u.config.Region, - ) - - client := s3.New(s3.Options{ - Region: u.config.Region, - BaseEndpoint: aws.String("https://" + u.config.Host), - Credentials: aws.NewCredentialsCache(credentials.NewStaticCredentialsProvider( - u.config.AccessKeyID, u.config.SecretKey, "", - )), - }) - - inputFD, err := os.OpenFile(file, os.O_RDONLY, 0) + fd, err := os.Open(file) if err != nil { return fmt.Errorf("Can't open backup file for reading: %v", err) } - defer inputFD.Close() - - r := passthru.NewReader(inputFD, fileSize) + defer fd.Close() - r.Update = func(n int) { - if time.Since(lastUpdate) < 3*time.Second { - return - } - - u.dispatcher.Dispatch( - uploader.EVENT_UPLOAD_PROGRESS, - &uploader.ProgressInfo{ - Progress: r.Progress(), - Current: r.Current(), - Total: r.Total(), - }, - ) - - lastUpdate = time.Now() - } - - _, err = client.PutObject(context.TODO(), &s3.PutObjectInput{ - Bucket: aws.String(u.config.Bucket), - Key: aws.String(outputFile), - Body: r, - }) + err = u.Write(fd, fileName, fsutil.GetSize(file)) if err != nil { - return fmt.Errorf("Can't upload file to S3: %v", err) + return fmt.Errorf("Can't save backup: %w", err) } - log.Info("File successfully uploaded to S3!") - u.dispatcher.DispatchAndWait(uploader.EVENT_UPLOAD_DONE, "S3") - return nil } // Write writes data from given reader to given file -func (u *S3Uploader) Write(r io.ReadCloser, fileName string) error { - var outputFile string - +func (u *S3Uploader) Write(r io.ReadCloser, fileName string, fileSize int64) error { u.dispatcher.DispatchAndWait(uploader.EVENT_UPLOAD_STARTED, "S3") - if u.config.Path == "" { - outputFile = fileName - } else { + var rr io.Reader + var err error + + lastUpdate := time.Now() + outputFile := fileName + + if u.config.Path != "" { outputFile = path.Join(u.config.Path, fileName) } @@ -161,6 +114,39 @@ func (u *S3Uploader) Write(r io.ReadCloser, fileName string) error { u.config.Bucket, u.config.Path, u.config.Host, u.config.Region, ) + rr = r + + if u.config.Secret != nil { + sr, err := u.config.Secret.NewReader(r, katana.MODE_ENCRYPT) + + if err != nil { + return fmt.Errorf("Can't create encrypted reader: %w", err) + } + + rr = sr + } + + if fileSize > 0 { + pr := passthru.NewReader(rr, fileSize) + + pr.Update = func(n int) { + if time.Since(lastUpdate) < 3*time.Second { + return + } + + u.dispatcher.Dispatch( + uploader.EVENT_UPLOAD_PROGRESS, + &uploader.ProgressInfo{ + Progress: pr.Progress(), + Current: pr.Current(), + Total: pr.Total(), + }, + ) + } + + rr = pr + } + client := s3.New(s3.Options{ Region: u.config.Region, BaseEndpoint: aws.String("https://" + u.config.Host), @@ -169,10 +155,10 @@ func (u *S3Uploader) Write(r io.ReadCloser, fileName string) error { )), }) - _, err := client.PutObject(context.TODO(), &s3.PutObjectInput{ + _, err = client.PutObject(context.TODO(), &s3.PutObjectInput{ Bucket: aws.String(u.config.Bucket), Key: aws.String(outputFile), - Body: r, + Body: rr, }) if err != nil { diff --git a/uploader/sftp/sftp.go b/uploader/sftp/sftp.go index 2e19dbb..a1e30c2 100644 --- a/uploader/sftp/sftp.go +++ b/uploader/sftp/sftp.go @@ -14,15 +14,17 @@ import ( "strings" "time" - "github.com/pkg/sftp" - "golang.org/x/crypto/ssh" - "github.com/essentialkaos/ek/v13/events" "github.com/essentialkaos/ek/v13/fsutil" "github.com/essentialkaos/ek/v13/log" "github.com/essentialkaos/ek/v13/passthru" "github.com/essentialkaos/ek/v13/path" + "github.com/pkg/sftp" + "golang.org/x/crypto/ssh" + + "github.com/essentialkaos/katana" + "github.com/essentialkaos/atlassian-cloud-backuper/uploader" ) @@ -30,11 +32,12 @@ import ( // Config is configuration for SFTP uploader type Config struct { - Host string - User string - Key []byte - Path string - Mode os.FileMode + Host string + User string + Key []byte + Path string + Mode os.FileMode + Secret *katana.Secret } // SFTPUploader is SFTP uploader instance @@ -72,88 +75,30 @@ func (u *SFTPUploader) SetDispatcher(d *events.Dispatcher) { // Upload uploads given file to SFTP storage func (u *SFTPUploader) Upload(file, fileName string) error { - u.dispatcher.DispatchAndWait(uploader.EVENT_UPLOAD_STARTED, "SFTP") - - lastUpdate := time.Now() - fileSize := fsutil.GetSize(file) - outputFile := path.Join(u.config.Path, fileName) - - log.Info( - "Uploading backup file to %s@%s~%s/%s…", - u.config.User, u.config.Host, u.config.Path, fileName, - ) - - sftpClient, err := u.connectToSFTP() - - if err != nil { - return fmt.Errorf("Can't connect to SFTP: %v", err) - } - - defer sftpClient.Close() - - _, err = sftpClient.Stat(u.config.Path) - - if err != nil { - err = sftpClient.MkdirAll(u.config.Path) - - if err != nil { - return fmt.Errorf("Can't create directory for backup: %v", err) - } - } - - outputFD, err := sftpClient.OpenFile(outputFile, os.O_CREATE|os.O_TRUNC|os.O_WRONLY) - - if err != nil { - return fmt.Errorf("Can't create file of SFTP: %v", err) - } - - defer outputFD.Close() - - inputFD, err := os.OpenFile(file, os.O_RDONLY, 0) + fd, err := os.Open(file) if err != nil { return fmt.Errorf("Can't open backup file for reading: %v", err) } - defer inputFD.Close() - - w := passthru.NewWriter(outputFD, fileSize) - - w.Update = func(n int) { - if time.Since(lastUpdate) < 3*time.Second { - return - } - - u.dispatcher.Dispatch( - uploader.EVENT_UPLOAD_PROGRESS, - &uploader.ProgressInfo{Progress: w.Progress(), Current: w.Current(), Total: w.Total()}, - ) - - lastUpdate = time.Now() - } - - _, err = io.Copy(w, inputFD) + defer fd.Close() - if err != nil { - return fmt.Errorf("Can't upload file to SFTP: %v", err) - } - - err = sftpClient.Chmod(outputFile, u.config.Mode) + err = u.Write(fd, fileName, fsutil.GetSize(file)) if err != nil { - log.Error("Can't change file mode for uploaded file: %v", err) + return fmt.Errorf("Can't save backup: %w", err) } - log.Info("File successfully uploaded to SFTP!") - u.dispatcher.DispatchAndWait(uploader.EVENT_UPLOAD_DONE, "SFTP") - return nil } // Write writes data from given reader to given file -func (u *SFTPUploader) Write(r io.ReadCloser, fileName string) error { +func (u *SFTPUploader) Write(r io.ReadCloser, fileName string, fileSize int64) error { u.dispatcher.DispatchAndWait(uploader.EVENT_UPLOAD_STARTED, "SFTP") + var w io.Writer + + lastUpdate := time.Now() outputFile := path.Join(u.config.Path, fileName) log.Info( @@ -179,16 +124,50 @@ func (u *SFTPUploader) Write(r io.ReadCloser, fileName string) error { } } - outputFD, err := sftpClient.OpenFile(outputFile, os.O_CREATE|os.O_TRUNC|os.O_WRONLY) + fd, err := sftpClient.OpenFile(outputFile, os.O_CREATE|os.O_TRUNC|os.O_WRONLY) if err != nil { return fmt.Errorf("Can't create file of SFTP: %v", err) } - defer outputFD.Close() - defer r.Close() + w = fd + + if u.config.Secret != nil { + sw, err := u.config.Secret.NewWriter(fd) + + if err != nil { + return fmt.Errorf("Can't create encrypted writer: %w", err) + } + + defer sw.Close() + + w = sw + } + + if fileSize > 0 { + pw := passthru.NewWriter(w, fileSize) + + pw.Update = func(n int) { + if time.Since(lastUpdate) < 3*time.Second { + return + } + + u.dispatcher.Dispatch( + uploader.EVENT_UPLOAD_PROGRESS, + &uploader.ProgressInfo{ + Progress: pw.Progress(), + Current: pw.Current(), + Total: pw.Total(), + }, + ) + + lastUpdate = time.Now() + } + + w = pw + } - _, err = io.Copy(outputFD, r) + _, err = io.Copy(w, r) if err != nil { return fmt.Errorf("Can't upload file to SFTP: %v", err) diff --git a/uploader/uploader.go b/uploader/uploader.go index 76da9cf..92de1f6 100644 --- a/uploader/uploader.go +++ b/uploader/uploader.go @@ -33,12 +33,14 @@ type ProgressInfo struct { // Uploader is generic uploader interface type Uploader interface { - // Upload uploads given file to storage - Upload(file, fileName string) error - // SetDispatcher sets events dispatcher SetDispatcher(d *events.Dispatcher) + // Upload uploads given file to storage + Upload(file, fileName string) error + // Write writes data from given reader to given file - Write(r io.ReadCloser, fileName string) error + Write(r io.ReadCloser, fileName string, fileSize int64) error } + +// ////////////////////////////////////////////////////////////////////////////////// // From 331ea737a77083a1f006a416dfd2f9e64a62543e Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Tue, 23 Jul 2024 14:31:27 +0300 Subject: [PATCH 31/34] Improvements --- .github/images/usage-container.svg | 66 ++++++++++--------- app/app.go | 9 +-- common/atlassian-cloud-backuper-container.knf | 6 ++ common/atlassian-cloud-backuper.spec | 7 +- 4 files changed, 51 insertions(+), 37 deletions(-) diff --git a/.github/images/usage-container.svg b/.github/images/usage-container.svg index 090c505..506b518 100644 --- a/.github/images/usage-container.svg +++ b/.github/images/usage-container.svg @@ -1,5 +1,5 @@ - + Atlassian Cloud Backuper Usage @@ -68,7 +68,7 @@ } - + @@ -89,34 +89,38 @@ --access-account name .................... Account name (ACCESS_ACCOUNT) --access-email email ..................... User email with access to API (ACCESS_EMAIL) --access-api-key key ..................... API key (ACCESS_API_KEY) - --storage-type fs/sftp/s3 ................ Storage type (STORAGE_TYPE) - --storage-fs-path path ................... Path on system for backups (STORAGE_FS_PATH) - --storage-fs-mode mode ................... File mode on system (STORAGE_FS_MODE) - --storage-sftp-host host ................. SFTP host (STORAGE_SFTP_HOST) - --storage-sftp-user name ................. SFTP user name (STORAGE_SFTP_USER) - --storage-sftp-key key ................... Base64-encoded private key (STORAGE_SFTP_KEY) - --storage-sftp-path path ................. Path on SFTP (STORAGE_SFTP_PATH) - --storage-sftp-mode mode ................. File mode on SFTP (STORAGE_SFTP_MODE) - --storage-s3-host host ................... S3 host (STORAGE_S3_HOST) - --storage-s3-region region ............... S3 region (STORAGE_S3_REGION) - --storage-s3-access-key id ............... S3 access key ID (STORAGE_S3_ACCESS_KEY) - --storage-s3-secret-key key .............. S3 access secret key (STORAGE_S3_SECRET_KEY) - --storage-s3-bucket name ................. S3 bucket (STORAGE_S3_BUCKET) - --storage-s3-path path ................... Path for backups (STORAGE_S3_PATH) - --jira-output-file template .............. Jira backup output file name template - (JIRA_OUTPUT_FILE) - --jira-include-attachments yes/no ........ Include attachments to Jira backup - (JIRA_INCLUDE_ATTACHMENTS) - --jira-cloud-format yes/no ............... Create Jira backup for Cloud (JIRA_CLOUD_FORMAT) - --confluence-output-file template ........ Confluence backup output file name template - (CONFLUENCE_OUTPUT_FILE) - --confluence-include-attachments yes/no .. Include attachments to Confluence backup - (CONFLUENCE_INCLUDE_ATTACHMENTS) - --confluence-cloud-format yes/no ......... Create Confluence backup for Cloud - (CONFLUENCE_CLOUD_FORMAT) - --temp-dir path .......................... Path to directory for temporary data (TEMP_DIR) - --log-format text/json ................... Log format (LOG_FORMAT) - --log-level level ........................ Log level (LOG_LEVEL) + --server-ip ip ........................... HTTP server IP (SERVER_IP) + --server-port port ....................... HTTP server port (SERVER_PORT) + --server-access-token token .............. HTTP access token (SERVER_ACCESS_TOKEN) + --storage-type fs/sftp/s3 ................ Storage type (STORAGE_TYPE) + --storage-encryption-key key ............. Data encryption key (STORAGE_ENCRYPTION_KEY) + --storage-fs-path path ................... Path on system for backups (STORAGE_FS_PATH) + --storage-fs-mode mode ................... File mode on system (STORAGE_FS_MODE) + --storage-sftp-host host ................. SFTP host (STORAGE_SFTP_HOST) + --storage-sftp-user name ................. SFTP user name (STORAGE_SFTP_USER) + --storage-sftp-key key ................... Base64-encoded private key (STORAGE_SFTP_KEY) + --storage-sftp-path path ................. Path on SFTP (STORAGE_SFTP_PATH) + --storage-sftp-mode mode ................. File mode on SFTP (STORAGE_SFTP_MODE) + --storage-s3-host host ................... S3 host (STORAGE_S3_HOST) + --storage-s3-region region ............... S3 region (STORAGE_S3_REGION) + --storage-s3-access-key id ............... S3 access key ID (STORAGE_S3_ACCESS_KEY) + --storage-s3-secret-key key .............. S3 access secret key (STORAGE_S3_SECRET_KEY) + --storage-s3-bucket name ................. S3 bucket (STORAGE_S3_BUCKET) + --storage-s3-path path ................... Path for backups (STORAGE_S3_PATH) + --jira-output-file template .............. Jira backup output file name template + (JIRA_OUTPUT_FILE) + --jira-include-attachments yes/no ........ Include attachments to Jira backup + (JIRA_INCLUDE_ATTACHMENTS) + --jira-cloud-format yes/no ............... Create Jira backup for Cloud (JIRA_CLOUD_FORMAT) + --confluence-output-file template ........ Confluence backup output file name template + (CONFLUENCE_OUTPUT_FILE) + --confluence-include-attachments yes/no .. Include attachments to Confluence backup + (CONFLUENCE_INCLUDE_ATTACHMENTS) + --confluence-cloud-format yes/no ......... Create Confluence backup for Cloud + (CONFLUENCE_CLOUD_FORMAT) + --temp-dir path .......................... Path to directory for temporary data (TEMP_DIR) + --log-format text/json ................... Log format (LOG_FORMAT) + --log-level level ........................ Log level (LOG_LEVEL) - + diff --git a/app/app.go b/app/app.go index 592330f..a1ff012 100644 --- a/app/app.go +++ b/app/app.go @@ -238,8 +238,8 @@ func addExtraOptions(m options.Map) { knfu.AddOptions(m, ACCESS_ACCOUNT, ACCESS_EMAIL, ACCESS_API_KEY, - SERVER_IP, SERVER_PORT, - STORAGE_TYPE, + SERVER_IP, SERVER_PORT, SERVER_ACCESS_TOKEN, + STORAGE_TYPE, STORAGE_ENCRYPTION_KEY, STORAGE_FS_PATH, STORAGE_FS_MODE, STORAGE_SFTP_HOST, STORAGE_SFTP_USER, STORAGE_SFTP_KEY, STORAGE_SFTP_PATH, STORAGE_SFTP_MODE, @@ -273,8 +273,8 @@ func loadConfig() error { knfu.CombineSimple( config, ACCESS_ACCOUNT, ACCESS_EMAIL, ACCESS_API_KEY, - SERVER_IP, SERVER_PORT, - STORAGE_TYPE, + SERVER_IP, SERVER_PORT, SERVER_ACCESS_TOKEN, + STORAGE_TYPE, STORAGE_ENCRYPTION_KEY, STORAGE_FS_PATH, STORAGE_FS_MODE, STORAGE_SFTP_HOST, STORAGE_SFTP_USER, STORAGE_SFTP_KEY, STORAGE_SFTP_PATH, STORAGE_SFTP_MODE, @@ -505,6 +505,7 @@ func genUsage(section string) *usage.Info { addUnitedOption(info, SERVER_PORT, "HTTP server port", "port") addUnitedOption(info, SERVER_ACCESS_TOKEN, "HTTP access token", "token") addUnitedOption(info, STORAGE_TYPE, "Storage type", "fs/sftp/s3") + addUnitedOption(info, STORAGE_ENCRYPTION_KEY, "Data encryption key", "key") addUnitedOption(info, STORAGE_FS_PATH, "Path on system for backups", "path") addUnitedOption(info, STORAGE_FS_MODE, "File mode on system", "mode") addUnitedOption(info, STORAGE_SFTP_HOST, "SFTP host", "host") diff --git a/common/atlassian-cloud-backuper-container.knf b/common/atlassian-cloud-backuper-container.knf index 650aec7..ea8d82f 100644 --- a/common/atlassian-cloud-backuper-container.knf +++ b/common/atlassian-cloud-backuper-container.knf @@ -17,11 +17,17 @@ # HTTP server port port: 8080 + # Unique token for requests + access-token: + [storage] # Storage type (fs/sftp/s3) type: + # Katana encryption key + encryption-key: + [storage-fs] # Path to directory with backups diff --git a/common/atlassian-cloud-backuper.spec b/common/atlassian-cloud-backuper.spec index 020c48b..b2bef66 100644 --- a/common/atlassian-cloud-backuper.spec +++ b/common/atlassian-cloud-backuper.spec @@ -10,7 +10,7 @@ Summary: Tool for backuping Atlassian cloud services Name: atlassian-cloud-backuper -Version: 0.0.4 +Version: 0.1.0 Release: 0%{?dist} Group: Applications/System License: Apache License, Version 2.0 @@ -113,7 +113,10 @@ rm -rf %{buildroot} ################################################################################ %changelog -* Fri Jul 19 2024 Anton Novojilov - 0.0.4-0 +* Tue Jul 23 2024 Anton Novojilov - 0.1.0-0 +- Added data encryption feature +- Added server mode +- Code refactoring - Dependencies update * Wed Jun 12 2024 Anton Novojilov - 0.0.3-0 From c27b2fff8cea5c43084d68a75b69263f0e5d51fa Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Tue, 23 Jul 2024 14:37:37 +0300 Subject: [PATCH 32/34] README improvements --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b5668ed..b31f06d 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@

- GitHub Actions CI Status Code Climate Maintainability Codebeat badge +
+ GitHub Actions CI Status GitHub Actions CodeQL Status

@@ -17,8 +18,8 @@ #### From [ESSENTIAL KAOS Public Repository](https://kaos.sh/kaos-repo) ```bash -sudo yum install -y https://pkgs.kaos.st/kaos-repo-latest.el$(grep 'CPE_NAME' /etc/os-release | tr -d '"' | cut -d':' -f5).noarch.rpm -sudo yum install atlassian-cloud-backuper +sudo dnf install -y https://pkgs.kaos.st/kaos-repo-latest.el$(grep 'CPE_NAME' /etc/os-release | tr -d '"' | cut -d':' -f5).noarch.rpm +sudo dnf install atlassian-cloud-backuper ``` #### Prebuilt binaries From 617b239c0a47c2ce47fd2710642455082c8b9c1d Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Tue, 23 Jul 2024 14:39:06 +0300 Subject: [PATCH 33/34] README improvements --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index b31f06d..db76463 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@

Code Climate Maintainability - Codebeat badge -
GitHub Actions CI Status GitHub Actions CodeQL Status From dfff182f5532e1e8008d5c7f6b910edbd2ccf1fa Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Tue, 23 Jul 2024 15:47:22 +0300 Subject: [PATCH 34/34] Improvements --- app/app.go | 5 +++++ app/basic.go | 29 +++++++++++++++-------------- app/common.go | 13 ++++++------- uploader/sftp/sftp.go | 2 +- 4 files changed, 27 insertions(+), 22 deletions(-) diff --git a/app/app.go b/app/app.go index a1ff012..e95231c 100644 --- a/app/app.go +++ b/app/app.go @@ -206,7 +206,12 @@ func Run(gitRev string, gomod []byte) { } if err != nil { + if options.GetB(OPT_INTERACTIVE) { + terminal.Error(err) + } + log.Crit(err.Error()) + os.Exit(1) } } diff --git a/app/basic.go b/app/basic.go index f4b84d3..876078b 100644 --- a/app/basic.go +++ b/app/basic.go @@ -31,6 +31,8 @@ import ( func startApp(args options.Arguments) error { var dispatcher *events.Dispatcher + target := args.Get(0).String() + if options.GetB(OPT_INTERACTIVE) { dispatcher = events.NewDispatcher() addEventsHandlers(dispatcher) @@ -44,21 +46,29 @@ func startApp(args options.Arguments) error { defer temp.Clean() - target := args.Get(0).String() + fmtc.NewLine() + bkpr, err := getBackuper(target) if err != nil { - return fmt.Errorf("Can't start backuping process: %v", err) + return fmt.Errorf("Can't start backuping process: %w", err) + } + + updr, err := getUploader(target) + + if err != nil { + return fmt.Errorf("Can't start backuping process: %w", err) } bkpr.SetDispatcher(dispatcher) + updr.SetDispatcher(dispatcher) outputFileName := getOutputFileName(target) tmpDir, err := temp.MkDir() if err != nil { spinner.Done(false) - return fmt.Errorf("Can't create temporary directory: %v", err) + return fmt.Errorf("Can't create temporary directory: %w", err) } tmpFile := path.Join(tmpDir, outputFileName) @@ -67,24 +77,16 @@ func startApp(args options.Arguments) error { if err != nil { spinner.Done(false) - return fmt.Errorf("Error while backuping process: %v", err) + return fmt.Errorf("Error while backuping process: %w", err) } log.Info("Backup process successfully finished!") - updr, err := getUploader(target) - - if err != nil { - return fmt.Errorf("Can't start uploading process: %v", err) - } - - updr.SetDispatcher(dispatcher) - err = updr.Upload(tmpFile, outputFileName) if err != nil { spinner.Done(false) - return fmt.Errorf("Error while uploading process: %v", err) + return fmt.Errorf("Error while uploading process: %w", err) } return nil @@ -93,7 +95,6 @@ func startApp(args options.Arguments) error { // addEventsHandlers registers events handlers func addEventsHandlers(dispatcher *events.Dispatcher) { dispatcher.AddHandler(backuper.EVENT_BACKUP_STARTED, func(payload any) { - fmtc.NewLine() spinner.Show("Starting downloading process") }) diff --git a/app/common.go b/app/common.go index 2aec48c..4fe873a 100644 --- a/app/common.go +++ b/app/common.go @@ -11,6 +11,7 @@ import ( "encoding/base64" "fmt" "os" + "strings" "time" "github.com/essentialkaos/ek/v13/fsutil" @@ -94,17 +95,15 @@ func getBackuperConfig(target string) (*backuper.Config, error) { // getUploader returns uploader instance func getUploader(target string) (uploader.Uploader, error) { - var err error - var updr uploader.Uploader var secret *katana.Secret if knfu.GetS(STORAGE_ENCRYPTION_KEY) != "" { secret = katana.NewSecret(knfu.GetS(STORAGE_ENCRYPTION_KEY)) } - switch knfu.GetS(STORAGE_TYPE) { + switch strings.ToLower(knfu.GetS(STORAGE_TYPE)) { case STORAGE_FS: - updr, err = fs.NewUploader(&fs.Config{ + return fs.NewUploader(&fs.Config{ Path: path.Join(knfu.GetS(STORAGE_FS_PATH), target), Mode: knfu.GetM(STORAGE_FS_MODE, 0600), Secret: secret, @@ -117,7 +116,7 @@ func getUploader(target string) (uploader.Uploader, error) { return nil, err } - updr, err = sftp.NewUploader(&sftp.Config{ + return sftp.NewUploader(&sftp.Config{ Host: knfu.GetS(STORAGE_SFTP_HOST), User: knfu.GetS(STORAGE_SFTP_USER), Key: keyData, @@ -127,7 +126,7 @@ func getUploader(target string) (uploader.Uploader, error) { }) case STORAGE_S3: - updr, err = s3.NewUploader(&s3.Config{ + return s3.NewUploader(&s3.Config{ Host: knfu.GetS(STORAGE_S3_HOST), Region: knfu.GetS(STORAGE_S3_REGION), AccessKeyID: knfu.GetS(STORAGE_S3_ACCESS_KEY), @@ -138,7 +137,7 @@ func getUploader(target string) (uploader.Uploader, error) { }) } - return updr, err + return nil, fmt.Errorf("Unknown storage type %q", knfu.GetS(STORAGE_TYPE)) } // readPrivateKeyData reads private key data diff --git a/uploader/sftp/sftp.go b/uploader/sftp/sftp.go index a1e30c2..08e7ee1 100644 --- a/uploader/sftp/sftp.go +++ b/uploader/sftp/sftp.go @@ -61,7 +61,7 @@ func NewUploader(config *Config) (*SFTPUploader, error) { return nil, err } - return &SFTPUploader{config, nil}, nil + return &SFTPUploader{config: config}, nil } // ////////////////////////////////////////////////////////////////////////////////// //