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>
This commit is contained in:
33
sp-modules/vikunja/load-client-secret-from-env.patch
Normal file
33
sp-modules/vikunja/load-client-secret-from-env.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
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,
|
||||
}
|
Reference in New Issue
Block a user