mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-10-28 12:45:47 +00:00
fix: do not crash when docker is not connected
This commit is contained in:
@@ -97,6 +97,13 @@ func (auth *Auth) UserAuthConfigured() bool {
|
||||
}
|
||||
|
||||
func (auth *Auth) ResourceAllowed(context types.UserContext, host string) (bool, error) {
|
||||
isConnected := auth.Docker.DockerConnected()
|
||||
|
||||
if !isConnected {
|
||||
log.Debug().Msg("Docker not connected, allowing access")
|
||||
return true, nil
|
||||
}
|
||||
|
||||
appId := strings.Split(host, ".")[0]
|
||||
containers, containersErr := auth.Docker.GetContainers()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user