Merge branch 'next' into fix-config-loading-missing-values

This commit is contained in:
James Read 2025-11-07 00:34:11 +00:00 committed by GitHub
commit 110bbd6216
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 29 additions and 9 deletions

View File

@ -208,12 +208,19 @@ func UserFromContext[T any](ctx context.Context, req *connect.Request[T], cfg *c
} else { } else {
buildUserAcls(cfg, &user) buildUserAcls(cfg, &user)
} }
path := ""
if req != nil {
path = req.Spec().Procedure
}
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"username": user.Username, "username": user.Username,
"usergroupLine": user.UsergroupLine, "usergroupLine": user.UsergroupLine,
"provider": user.Provider, "provider": user.Provider,
"acls": user.Acls, "acls": user.Acls,
}).Debugf("UserFromContext") "path": path,
}).Debugf("Authenticated API request")
return &user return &user
} }

View File

@ -666,7 +666,9 @@ func (api *oliveTinAPI) EventStream(ctx ctx.Context, req *connect.Request[apiv1.
AuthenticatedUser: user, AuthenticatedUser: user,
} }
log.Infof("EventStream: client connected: %v", client.AuthenticatedUser.Username) log.WithFields(log.Fields{
"authenticatedUser": user.Username,
}).Debugf("EventStream: client connected")
api.streamingClientsMutex.Lock() api.streamingClientsMutex.Lock()
api.streamingClients[client] = struct{}{} api.streamingClients[client] = struct{}{}
@ -818,7 +820,7 @@ func (api *oliveTinAPI) buildRootDashboards(user *acl.AuthenticatedUser, dashboa
func (api *oliveTinAPI) addDefaultDashboardIfNeeded(rootDashboards *[]string, rr *DashboardRenderRequest) { func (api *oliveTinAPI) addDefaultDashboardIfNeeded(rootDashboards *[]string, rr *DashboardRenderRequest) {
defaultDashboard := buildDefaultDashboard(rr) defaultDashboard := buildDefaultDashboard(rr)
if defaultDashboard != nil && len(defaultDashboard.Contents) > 0 { if defaultDashboard != nil && len(defaultDashboard.Contents) > 0 {
log.Infof("defaultDashboard: %+v", defaultDashboard.Contents) log.Tracef("defaultDashboard: %+v", defaultDashboard.Contents)
*rootDashboards = append(*rootDashboards, "Actions") *rootDashboards = append(*rootDashboards, "Actions")
} }
} }

View File

@ -53,7 +53,9 @@ func (e *Executor) RebuildActionMap() {
findDashboardActionTitles(req) findDashboardActionTitles(req)
log.Infof("dashboardActionTitles: %v", req.DashboardActionTitles) log.WithFields(log.Fields{
"titles": req.DashboardActionTitles,
}).Trace("dashboardActionTitles")
for configOrder, action := range e.Cfg.Actions { for configOrder, action := range e.Cfg.Actions {
if action.Entity != "" { if action.Entity != "" {

View File

@ -53,7 +53,11 @@ func StartSingleHTTPFrontend(cfg *config.Config, ex *executor.Executor) {
r.URL.Path = apiPath + fn r.URL.Path = apiPath + fn
log.Debugf("SingleFrontend HTTP API Req URL after rewrite: %v", r.URL.Path) log.WithFields(log.Fields{
"path": r.URL.Path,
}).Tracef("SingleFrontend HTTP API Req URL after rewrite")
logDebugRequest(cfg, "api", r)
apiHandler.ServeHTTP(w, r) apiHandler.ServeHTTP(w, r)
})) }))

View File

@ -45,7 +45,7 @@ func (s *webUIServer) handleWebui(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, path.Join(s.webuiDir, "index.html")) http.ServeFile(w, r, path.Join(s.webuiDir, "index.html"))
} else { } else {
log.Infof("Serving webui from %s for %s", s.webuiDir, r.URL.Path) log.Tracef("Serving webui from %s for %s", s.webuiDir, r.URL.Path)
http.ServeFile(w, r, path.Join(s.webuiDir, r.URL.Path)) http.ServeFile(w, r, path.Join(s.webuiDir, r.URL.Path))
// http.StripPrefix(dirName, http.FileServer(http.Dir(s.webuiDir))).ServeHTTP(w, r) // http.StripPrefix(dirName, http.FileServer(http.Dir(s.webuiDir))).ServeHTTP(w, r)
} }

View File

@ -151,12 +151,17 @@ func initConfig(configDir string) {
for _, directory := range directories { for _, directory := range directories {
configPath := getConfigPath(directory) configPath := getConfigPath(directory)
found := true
if _, err := os.Stat(configPath); err != nil {
found = false
}
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"configPath": configPath, "configPath": configPath,
}).Debug("Checking base config file path") "found": found,
}).Debug("Checking base config path")
if _, err := os.Stat(configPath); err != nil { if !found {
log.Debugf("Config file not found at %s: %v", configPath, err)
continue continue
} }