mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-24 06:28:42 +01:00
feat: adds forward-proxy (#2442)
This commit is contained in:
22
main.go
22
main.go
@@ -50,6 +50,7 @@ type args struct {
|
||||
Filter map[string][]string `arg:"-"`
|
||||
Healthcheck *HealthcheckCmd `arg:"subcommand:healthcheck" help:"checks if the server is running."`
|
||||
RemoteHost []string `arg:"env:DOZZLE_REMOTE_HOST,--remote-host,separate" help:"list of hosts to connect remotely"`
|
||||
AuthProvider string `arg:"env:DOZZLE_AUTH_PROVIDER" default:"none" help:"sets the auth provider to use. Currently only forward proxy is supported."`
|
||||
}
|
||||
|
||||
type HealthcheckCmd struct {
|
||||
@@ -71,6 +72,10 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
if args.AuthProvider != "none" && args.AuthProvider != "forward-proxy" && args.AuthProvider != "simple" {
|
||||
log.Fatalf("Invalid auth provider %s", args.AuthProvider)
|
||||
}
|
||||
|
||||
log.Infof("Dozzle version %s", version)
|
||||
|
||||
clients := createClients(args, docker.NewClientWithFilters, docker.NewClientWithTlsAndFilter, args.Hostname)
|
||||
@@ -168,14 +173,15 @@ func createClients(args args,
|
||||
func createServer(args args, clients map[string]web.DockerClient) *http.Server {
|
||||
_, dev := os.LookupEnv("DEV")
|
||||
config := web.Config{
|
||||
Addr: args.Addr,
|
||||
Base: args.Base,
|
||||
Version: version,
|
||||
Username: args.Username,
|
||||
Password: args.Password,
|
||||
Hostname: args.Hostname,
|
||||
NoAnalytics: args.NoAnalytics,
|
||||
Dev: dev,
|
||||
Addr: args.Addr,
|
||||
Base: args.Base,
|
||||
Version: version,
|
||||
Username: args.Username,
|
||||
Password: args.Password,
|
||||
Hostname: args.Hostname,
|
||||
NoAnalytics: args.NoAnalytics,
|
||||
Dev: dev,
|
||||
AuthProvider: args.AuthProvider,
|
||||
}
|
||||
|
||||
assets, err := fs.Sub(content, "dist")
|
||||
|
||||
Reference in New Issue
Block a user