1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

feat(authentication): add a --no-auth flag to disable authentication (#553)

This commit is contained in:
Anthony Lapenna 2017-02-01 22:13:48 +13:00 committed by GitHub
parent 779fcf8e7f
commit 10f7744a62
16 changed files with 203 additions and 191 deletions

View file

@ -25,8 +25,9 @@ func main() {
}
settings := &portainer.Settings{
HiddenLabels: *flags.Labels,
Logo: *flags.Logo,
HiddenLabels: *flags.Labels,
Logo: *flags.Logo,
Authentication: !*flags.NoAuth,
}
fileService, err := file.NewService(*flags.Data, "")
@ -41,9 +42,12 @@ func main() {
}
defer store.Close()
jwtService, err := jwt.NewService()
if err != nil {
log.Fatal(err)
var jwtService portainer.JWTService
if !*flags.NoAuth {
jwtService, err = jwt.NewService()
if err != nil {
log.Fatal(err)
}
}
var cryptoService portainer.CryptoService = &crypto.Service{}
@ -76,6 +80,7 @@ func main() {
AssetsPath: *flags.Assets,
Settings: settings,
TemplatesURL: *flags.Templates,
AuthDisabled: *flags.NoAuth,
UserService: store.UserService,
EndpointService: store.EndpointService,
CryptoService: cryptoService,