Authelia (Docker-Compose) 找不到/读取现有的配置文件(卷)



我试图将 Authelia 安装为 带有 Docker-Compose 的 oAuth Server。但是每次我启动容器时,日志都会这样说

time="2020-05-23T16:51:09+02:00" level=error msg="Provide a JWT secret using "jwt_secret" key"
time="2020-05-23T16:51:09+02:00" level=error msg="Please provide `ldap` or `file` object in `authentication_backend`"
time="2020-05-23T16:51:09+02:00" level=error msg="Set domain of the session object"
time="2020-05-23T16:51:09+02:00" level=error msg="A storage configuration must be provided. It could be 'local', 'mysql' or 'postgres'"
time="2020-05-23T16:51:09+02:00" level=error msg="A notifier configuration must be provided"
panic: Some errors have been reported
goroutine 1 [running]:
main.startServer()
github.com/authelia/authelia/cmd/authelia/main.go:41 +0xc80
main.main.func1(0xc00009c000, 0xc0001e6100, 0x0, 0x2)
github.com/authelia/authelia/cmd/authelia/main.go:126 +0x20
github.com/spf13/cobra.(*Command).execute(0xc00009c000, 0xc000020190, 0x2, 0x2, 0xc00009c000, 0xc000020190)
github.com/spf13/cobra@v0.0.7/command.go:842 +0x29d
github.com/spf13/cobra.(*Command).ExecuteC(0xc00009c000, 0xc0007cdf58, 0x4, 0x4)
github.com/spf13/cobra@v0.0.7/command.go:943 +0x317
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/cobra@v0.0.7/command.go:883
main.main()
github.com/authelia/authelia/cmd/authelia/main.go:143 +0x166

并且容器正在重新启动。 我真的不明白为什么以及这种行为来自哪里。我像绑定卷一样使用命名卷,但它仍然是相同的错误。也许有人可以告诉我我在哪里犯了一个(可能是愚蠢的(错误,因为我看不到它。

我的 compose.yml 文件:

version: '3.7'
services:
authelia:
image: "authelia/authelia:latest"
container_name: authelia
restart: "unless-stopped"
#    security_opt:
#      - no-new-privileges:true
networks:
- "web"
- "intern"
volumes:
- ./authelia:/var/lib/authelia
- ./configuration.yml:/etc/authelia/configuration.yml:ro
- ./users_database.yml:/etc/authelia/users_database.yml
# Had to bind this volumen, without it, docker creates an own volumen with empty configuration.yml and 
# users_database.yml
- ./data:/etc/authelia  
environment:
- TZ=$TZ
labels:
- "traefik.enable=true"
# HTTP Routers
- "traefik.http.routers.authelia-rtr.entrypoints=https"
- "traefik.http.routers.authelia-rtr.rule=Host(`secure.$DOMAINNAME`)"
- "traefik.http.routers.authelia-rtr.tls=true"
- "traefik.http.routers.authelia-rtr.tls.certresolver=le"
# Middlewares
- "traefik.http.routers.authelia-rtr.middlewares=chain-no-auth@file"
# HTTP Service
- "traefik.http.routers.authelia-rtr.service=authelia-svc"
- "traefik.http.services.auhtelia-svc.loadbalancer.server.port=9091"

networks:
web:
external: true
intern:
external: true

卷部分下的文件和文件夹是存在的,并且 configuration.yml 不为空。我使用具有 sudo 权限的管理员(非根(用户。 谁能告诉我我做错了什么,为什么 authelia 无法找到或阅读 configuration.yml?

验证您的configuration.yml文件。当您的 yml 语法不正确时,就会显示这些错误。特别:

  • 双重检查压痕,
  • 将您的域名放在引号中(这是我遇到这个问题时的问题(。

另请参阅此处的讨论。

最新更新