64 lines
2.5 KiB
Diff
64 lines
2.5 KiB
Diff
From e231fe4739b06e2cb4a4973d77ea7ca1c64b51db Mon Sep 17 00:00:00 2001
|
|
From: nyyu <mail@nyyu.dev>
|
|
Date: Sat, 25 Nov 2023 10:51:33 +0100
|
|
Subject: [PATCH] fix: encryption
|
|
|
|
---
|
|
cmd/server/server.go | 18 +++++++++---------
|
|
server/plugins/encryption/encryption.go | 2 ++
|
|
2 files changed, 11 insertions(+), 9 deletions(-)
|
|
|
|
diff --git a/cmd/server/server.go b/cmd/server/server.go
|
|
index fae4f9b21..541544907 100644
|
|
--- a/cmd/server/server.go
|
|
+++ b/cmd/server/server.go
|
|
@@ -51,8 +51,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 {
|
|
@@ -279,13 +279,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)
|
|
diff --git a/server/plugins/encryption/encryption.go b/server/plugins/encryption/encryption.go
|
|
index f0e30db5c..8d9a1462c 100644
|
|
--- a/server/plugins/encryption/encryption.go
|
|
+++ b/server/plugins/encryption/encryption.go
|
|
@@ -56,7 +56,9 @@ func (b builder) Build() error {
|
|
if err != nil {
|
|
return fmt.Errorf(errTemplateFailedInitializingUnencrypted, err)
|
|
}
|
|
+ return nil
|
|
}
|
|
+
|
|
svc, err := b.getService(keyType)
|
|
if err != nil {
|
|
return fmt.Errorf(errTemplateFailedInitializing, err)
|
|
--
|
|
2.43.0
|
|
|