+2
-1
appview/config/config.go
+2
-1
appview/config/config.go
···
13
CookieSecret string `env:"COOKIE_SECRET, default=00000000000000000000000000000000"`
14
DbPath string `env:"DB_PATH, default=appview.db"`
15
ListenAddr string `env:"LISTEN_ADDR, default=0.0.0.0:3000"`
16
-
AppviewHost string `env:"APPVIEW_HOST, default=https://tangled.sh"`
17
Dev bool `env:"DEV, default=false"`
18
DisallowedNicknamesFile string `env:"DISALLOWED_NICKNAMES_FILE"`
19
···
13
CookieSecret string `env:"COOKIE_SECRET, default=00000000000000000000000000000000"`
14
DbPath string `env:"DB_PATH, default=appview.db"`
15
ListenAddr string `env:"LISTEN_ADDR, default=0.0.0.0:3000"`
16
+
AppviewHost string `env:"APPVIEW_HOST, default=https://tangled.org"`
17
+
AppviewName string `env:"APPVIEW_Name, default=Tangled"`
18
Dev bool `env:"DEV, default=false"`
19
DisallowedNicknamesFile string `env:"DISALLOWED_NICKNAMES_FILE"`
20
+2
appview/oauth/handler.go
+2
appview/oauth/handler.go
···
31
func (o *OAuth) clientMetadata(w http.ResponseWriter, r *http.Request) {
32
doc := o.ClientApp.Config.ClientMetadata()
33
doc.JWKSURI = &o.JwksUri
34
+
doc.ClientName = &o.ClientName
35
+
doc.ClientURI = &o.ClientUri
36
37
w.Header().Set("Content-Type", "application/json")
38
if err := json.NewEncoder(w).Encode(doc); err != nil {
+6
-2
appview/oauth/oauth.go
+6
-2
appview/oauth/oauth.go
···
26
SessStore *sessions.CookieStore
27
Config *config.Config
28
JwksUri string
29
Posthog posthog.Client
30
Db *db.DB
31
Enforcer *rbac.Enforcer
···
34
}
35
36
func New(config *config.Config, ph posthog.Client, db *db.DB, enforcer *rbac.Enforcer, res *idresolver.Resolver, logger *slog.Logger) (*OAuth, error) {
37
-
38
var oauthConfig oauth.ClientConfig
39
var clientUri string
40
-
41
if config.Core.Dev {
42
clientUri = "http://127.0.0.1:3000"
43
callbackUri := clientUri + "/oauth/callback"
···
70
clientApp := oauth.NewClientApp(&oauthConfig, authStore)
71
clientApp.Dir = res.Directory()
72
73
return &OAuth{
74
ClientApp: clientApp,
75
Config: config,
76
SessStore: sessStore,
77
JwksUri: jwksUri,
78
Posthog: ph,
79
Db: db,
80
Enforcer: enforcer,
···
26
SessStore *sessions.CookieStore
27
Config *config.Config
28
JwksUri string
29
+
ClientName string
30
+
ClientUri string
31
Posthog posthog.Client
32
Db *db.DB
33
Enforcer *rbac.Enforcer
···
36
}
37
38
func New(config *config.Config, ph posthog.Client, db *db.DB, enforcer *rbac.Enforcer, res *idresolver.Resolver, logger *slog.Logger) (*OAuth, error) {
39
var oauthConfig oauth.ClientConfig
40
var clientUri string
41
if config.Core.Dev {
42
clientUri = "http://127.0.0.1:3000"
43
callbackUri := clientUri + "/oauth/callback"
···
70
clientApp := oauth.NewClientApp(&oauthConfig, authStore)
71
clientApp.Dir = res.Directory()
72
73
+
clientName := config.Core.AppviewName
74
+
75
return &OAuth{
76
ClientApp: clientApp,
77
Config: config,
78
SessStore: sessStore,
79
JwksUri: jwksUri,
80
+
ClientName: clientName,
81
+
ClientUri: clientUri,
82
Posthog: ph,
83
Db: db,
84
Enforcer: enforcer,