Browse Source

default to ./web when Dir and WebFS are not set


			
			
				pull/1416/head
			
			
		
Rui Yang 5 years ago committed by CI Bot
parent
commit
2f28fc7451
  1. 6
      server/server.go
  2. 2
      server/templates.go

6
server/server.go

@ -111,8 +111,10 @@ type WebConfig struct {
//
Dir string
// A file system includes web static. Will be overwritten by Dir
// It is expected to contain the directories as Dir.
// Alternative way to configure web static filesystem. Dir overrides this.
// It's expected to contain the same files and directories as mentioned
// above in Dir doc.
//
WebFS fs.FS
// Defaults to "( issuer URL )/theme/logo.png"

2
server/templates.go

@ -79,6 +79,8 @@ func loadWebConfig(c webConfig) (http.Handler, http.Handler, *templates, error)
}
if c.dir != "" {
c.webFS = os.DirFS(c.dir)
} else if c.webFS == nil {
c.webFS = os.DirFS("./web")
}
if c.logoURL == "" {
c.logoURL = "theme/logo.png"

Loading…
Cancel
Save