1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-21 13:23:07 +01:00

feat: implement ability to disable avatars (#4091)

Co-authored-by: uponminiature <226739065+uponminiature@users.noreply.github.com>
This commit is contained in:
uponminiature
2025-08-29 22:20:03 +01:00
committed by GitHub
parent ae083e955a
commit 6df66dade9
7 changed files with 34 additions and 21 deletions

View File

@@ -23,6 +23,7 @@ type Args struct {
AuthHeaderFilter string `arg:"--auth-header-filter,env:DOZZLE_AUTH_HEADER_FILTER" default:"Remote-Filter" help:"sets the HTTP Header to use for filtering in Forward Proxy configuration."`
EnableActions bool `arg:"--enable-actions,env:DOZZLE_ENABLE_ACTIONS" default:"false" help:"enables essential actions on containers from the web interface."`
EnableShell bool `arg:"--enable-shell,env:DOZZLE_ENABLE_SHELL" default:"false" help:"enables shell access to containers from the web interface."`
DisableAvatars bool `arg:"--disable-avatars,env:DOZZLE_DISABLE_AVATARS" default:"false" help:"disables avatars for authenticated users."`
FilterStrings []string `arg:"env:DOZZLE_FILTER,--filter,separate" help:"filters docker containers using Docker syntax."`
Filter map[string][]string `arg:"-"`
RemoteHost []string `arg:"env:DOZZLE_REMOTE_HOST,--remote-host,separate" help:"list of hosts to connect remotely"`

View File

@@ -51,6 +51,7 @@ func (h *handler) executeTemplate(w http.ResponseWriter, req *http.Request) {
config["hosts"] = hosts
config["enableActions"] = h.config.EnableActions
config["enableShell"] = h.config.EnableShell
config["disableAvatars"] = h.config.DisableAvatars
}
if user != nil {

View File

@@ -27,16 +27,17 @@ const (
// Config is a struct for configuring the web service
type Config struct {
Base string
Addr string
Version string
Hostname string
NoAnalytics bool
Dev bool
Authorization Authorization
EnableActions bool
EnableShell bool
Labels container.ContainerLabels
Base string
Addr string
Version string
Hostname string
NoAnalytics bool
Dev bool
Authorization Authorization
EnableActions bool
EnableShell bool
DisableAvatars bool
Labels container.ContainerLabels
}
type Authorization struct {
@@ -122,7 +123,9 @@ func createRouter(h *handler) *chi.Mux {
r.Get("/hosts/{host}/containers/{id}/exec", h.exec)
}
r.Get("/releases", h.releases)
r.Get("/profile/avatar", h.avatar)
if !h.config.DisableAvatars {
r.Get("/profile/avatar", h.avatar)
}
r.Patch("/profile", h.updateProfile)
r.Get("/version", h.version)
if log.Debug().Enabled() {