Files
sp-config/sp-modules/vikunja/load-client-secret-from-env.patch
nhnn b605d07b52 feat: Vikunja to-do app (#128)
Vikunja is fast self-hostable to-do app.

Reviewed-on: https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-config/pulls/128
Reviewed-by: Inex Code <inex.code@selfprivacy.org>
Co-authored-by: nhnn <nhnn@nhnn.dev>
Co-committed-by: nhnn <nhnn@nhnn.dev>
2025-04-14 14:32:42 +03:00

34 lines
933 B
Diff

diff --git a/pkg/modules/auth/openid/providers.go b/pkg/modules/auth/openid/providers.go
index 5e14c1b31..769dc96e8 100644
--- a/pkg/modules/auth/openid/providers.go
+++ b/pkg/modules/auth/openid/providers.go
@@ -17,6 +17,7 @@
package openid
import (
+ "os"
"regexp"
"strconv"
"strings"
@@ -129,12 +130,19 @@ func getProviderFromMap(pi map[string]interface{}) (provider *Provider, err erro
if scope == "" {
scope = "openid profile email"
}
+
+ clientsecret, err := os.ReadFile(os.Getenv("SP_VIKUNJA_CLIENT_SECRET_PATH"))
+
+ if err != nil {
+ panic(err)
+ }
+
provider = &Provider{
Name: pi["name"].(string),
Key: k,
AuthURL: pi["authurl"].(string),
OriginalAuthURL: pi["authurl"].(string),
- ClientSecret: pi["clientsecret"].(string),
+ ClientSecret: strings.TrimSuffix(string(clientsecret), "\n"),
LogoutURL: logoutURL,
Scope: scope,
}