From 49bb097d4fabc26877b7a41c1315c9d240002816 Mon Sep 17 00:00:00 2001 From: nyyu Date: Sun, 19 Nov 2023 19:52:11 +0100 Subject: [PATCH] fix(wp): build --- woodpecker/.SRCINFO | 2 ++ woodpecker/PKGBUILD | 4 ++- woodpecker/fix-encryption.patch | 48 +++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 woodpecker/fix-encryption.patch diff --git a/woodpecker/.SRCINFO b/woodpecker/.SRCINFO index 6b2f612..168a318 100644 --- a/woodpecker/.SRCINFO +++ b/woodpecker/.SRCINFO @@ -11,11 +11,13 @@ pkgbase = woodpecker makedepends = npm options = !lto source = git+https://github.com/woodpecker-ci/woodpecker.git#tag=v1.0.5 + source = fix-encryption.patch source = woodpecker-server.service source = woodpecker-agent.service source = agent.conf source = server.conf sha256sums = SKIP + sha256sums = caed32618c98fd403441ef67626d42df51c0b13852ac0e69cd274d4fb220d114 sha256sums = 6e22e6939222aaad07311e37a086935ca32dd149c3688b2809db5f55df816516 sha256sums = 7a72ba21f385b5dcf7f2d4e8fb7a643070eb2cf722187ca1ec69a9d04b003e9e sha256sums = b6bf640e6649b991451bbd006b6e267f24fc49f51cf77251c9c33e7ebdd51014 diff --git a/woodpecker/PKGBUILD b/woodpecker/PKGBUILD index 64f85cf..48b59ef 100644 --- a/woodpecker/PKGBUILD +++ b/woodpecker/PKGBUILD @@ -15,11 +15,13 @@ license=('Apache') makedepends=('go' 'git' 'nodejs-lts-hydrogen' 'npm') options=('!lto') source=(git+https://github.com/woodpecker-ci/woodpecker.git#tag=v$pkgver + 'fix-encryption.patch' 'woodpecker-server.service' 'woodpecker-agent.service' 'agent.conf' 'server.conf') sha256sums=('SKIP' + 'caed32618c98fd403441ef67626d42df51c0b13852ac0e69cd274d4fb220d114' '6e22e6939222aaad07311e37a086935ca32dd149c3688b2809db5f55df816516' '7a72ba21f385b5dcf7f2d4e8fb7a643070eb2cf722187ca1ec69a9d04b003e9e' 'b6bf640e6649b991451bbd006b6e267f24fc49f51cf77251c9c33e7ebdd51014' @@ -28,7 +30,7 @@ sha256sums=('SKIP' prepare() { cd "$pkgbase" - git revert -n a389287d808d563beffc04f08015d78010f1da8e + git am ../fix-encryption.patch find web/src/assets/locales ! -name 'en.json' -type f -exec rm -f {} + diff --git a/woodpecker/fix-encryption.patch b/woodpecker/fix-encryption.patch new file mode 100644 index 0000000..0faf7ea --- /dev/null +++ b/woodpecker/fix-encryption.patch @@ -0,0 +1,48 @@ +From e85ff99be5887dd3dc21edbe29fcec4a3c737c01 Mon Sep 17 00:00:00 2001 +From: nyyu +Date: Sun, 19 Nov 2023 19:43:25 +0100 +Subject: [PATCH] fix: encryption + +--- + cmd/server/server.go | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/cmd/server/server.go b/cmd/server/server.go +index c35e39293..495c11436 100644 +--- a/cmd/server/server.go ++++ b/cmd/server/server.go +@@ -50,8 +50,8 @@ import ( + "go.woodpecker-ci.org/woodpecker/server/web" + "go.woodpecker-ci.org/woodpecker/shared/constant" + "go.woodpecker-ci.org/woodpecker/version" +- // "go.woodpecker-ci.org/woodpecker/server/plugins/encryption" +- // encryptedStore "go.woodpecker-ci.org/woodpecker/server/plugins/encryption/wrapper/store" ++ "go.woodpecker-ci.org/woodpecker/server/plugins/encryption" ++ encryptedStore "go.woodpecker-ci.org/woodpecker/server/plugins/encryption/wrapper/store" + ) + + func run(c *cli.Context) error { +@@ -288,13 +288,13 @@ func setupEvilGlobals(c *cli.Context, v store.Store, f forge.Forge) { + + // TODO(1544): fix encrypted store + // // encryption +- // encryptedSecretStore := encryptedStore.NewSecretStore(v) +- // err := encryption.Encryption(c, v).WithClient(encryptedSecretStore).Build() +- // if err != nil { +- // log.Fatal().Err(err).Msg("could not create encryption service") +- // } +- // server.Config.Services.Secrets = setupSecretService(c, encryptedSecretStore) +- server.Config.Services.Secrets = setupSecretService(c, v) ++ encryptedSecretStore := encryptedStore.NewSecretStore(v) ++ err := encryption.Encryption(c, v).WithClient(encryptedSecretStore).Build() ++ if err != nil { ++ log.Fatal().Err(err).Msg("could not create encryption service") ++ } ++ server.Config.Services.Secrets = setupSecretService(c, encryptedSecretStore) ++ //server.Config.Services.Secrets = setupSecretService(c, v) + + server.Config.Services.Environ = setupEnvironService(c, v) + server.Config.Services.Membership = setupMembershipService(c, f) +-- +2.42.1 +