2023-11-25 11:20:02 +01:00
|
|
|
From e231fe4739b06e2cb4a4973d77ea7ca1c64b51db Mon Sep 17 00:00:00 2001
|
2023-11-19 19:52:11 +01:00
|
|
|
From: nyyu <mail@nyyu.dev>
|
2023-11-25 11:20:02 +01:00
|
|
|
Date: Sat, 25 Nov 2023 10:51:33 +0100
|
2023-11-19 19:52:11 +01:00
|
|
|
Subject: [PATCH] fix: encryption
|
|
|
|
|
|
|
|
---
|
2023-11-25 11:20:02 +01:00
|
|
|
cmd/server/server.go | 18 +++++++++---------
|
|
|
|
server/plugins/encryption/encryption.go | 2 ++
|
|
|
|
2 files changed, 11 insertions(+), 9 deletions(-)
|
2023-11-19 19:52:11 +01:00
|
|
|
|
|
|
|
diff --git a/cmd/server/server.go b/cmd/server/server.go
|
2023-11-25 11:20:02 +01:00
|
|
|
index fae4f9b21..541544907 100644
|
2023-11-19 19:52:11 +01:00
|
|
|
--- a/cmd/server/server.go
|
|
|
|
+++ b/cmd/server/server.go
|
2023-11-25 11:20:02 +01:00
|
|
|
@@ -51,8 +51,8 @@ import (
|
2023-11-19 19:52:11 +01:00
|
|
|
"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 {
|
2023-11-25 11:20:02 +01:00
|
|
|
@@ -279,13 +279,13 @@ func setupEvilGlobals(c *cli.Context, v store.Store, f forge.Forge) {
|
2023-11-19 19:52:11 +01:00
|
|
|
|
|
|
|
// 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)
|
2023-11-25 11:20:02 +01:00
|
|
|
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)
|
2023-11-19 19:52:11 +01:00
|
|
|
--
|
2023-11-25 11:20:02 +01:00
|
|
|
2.43.0
|
2023-11-19 19:52:11 +01:00
|
|
|
|