
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Authelia是一个开源认证和授权服务器,通过Web门户为应用程序提供双因素认证和单点登录(SSO)功能。它作为反向代理的配套工具,允许、拒绝或重定向请求。
!Authelia架构图
Authelia可作为独立服务安装,也可通过Docker或Kubernetes作为容器部署,为各类应用提供集中式身份验证和授权控制。
Authelia适用于需要集中式身份验证和授权控制的各种环境,包括:
Authelia特别适合与反向代理配合使用,为多个应用程序提供统一的身份验证层,而无需修改应用程序本身。
Docker Run命令示例
bashdocker run -d \ --name=authelia \ -p 9091:9091 \ -v /path/to/authelia/config:/config \ -e TZ=Asia/Shanghai \ --restart unless-stopped \ docker.xuanyuan.run/authelia/authelia:latest
Docker Compose配置示例
Local模式(本地测试)
yamlversion: '3.8' services: authelia: image: docker.xuanyuan.run/authelia/authelia:latest container_name: authelia volumes: - ./authelia/config:/config ports: - "9091:9091" environment: - TZ=Asia/Shanghai restart: unless-stopped depends_on: - redis - mysql redis: image: docker.xuanyuan.run/redis:alpine container_name: authelia-redis volumes: - ./redis:/data restart: unless-stopped mysql: image: docker.xuanyuan.run/mariadb:10 container_name: authelia-mysql volumes: - ./mysql:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=rootpassword - MYSQL_DATABASE=authelia - MYSQL_USER=authelia - MYSQL_PASSWORD=autheliapassword restart: unless-stopped
Lite模式(轻量级生产部署)
yamlversion: '3.8' services: authelia: image: docker.xuanyuan.run/authelia/authelia:latest container_name: authelia volumes: - ./authelia/config:/config - ./authelia/users:/users ports: - "9091:9091" environment: - TZ=Asia/Shanghai restart: unless-stopped networks: - authelia-network nginx: image: docker.xuanyuan.run/nginx:alpine container_name: authelia-nginx volumes: - ./nginx/conf:/etc/nginx/conf.d - ./nginx/ssl:/etc/nginx/ssl ports: - "80:80" - "443:443" depends_on: - authelia restart: unless-stopped networks: - authelia-network networks: authelia-network: driver: bridge
Authelia的主要配置文件是configuration.yml,位于配置目录中。以下是关键配置部分:
基本配置
yamlserver: host: 0.0.0.0 port: 9091 path: "" read_buffer_size: 4096 write_buffer_size: 4096 enable_pprof: false enable_expvars: false disable_healthcheck: false tls: key: "" certificate: "" client_certificates: [] log: level: info format: text file_path: "" keep_stdout: true
认证配置
yamlauthentication_backend: password_reset: enabled: true disable_notifier: false issuer: Authelia <support@example.com> file: path: /config/users_database.yml password: algorithm: argon2id iterations: 3 key_length: 32 memory: 65536 parallelism: 4 salt_length: 16
会话配置
yamlsession: name: authelia_session secret: unsecure_session_secret expiration: 3600 inactivity: 300 domain: example.com cookie: path: / secure: false http_only: true same_site: lax partitioned: false
访问控制规则
yamlaccess_control: default_policy: deny rules: - domain: "public.example.com" policy: bypass - domain: "login.example.com" policy: one_factor - domain: "secure.example.com" policy: two_factor groups: - admins - domain: "singlefactor.example.com" policy: one_factor
Authelia支持以下关键环境变量:
| 环境变量 | 描述 | 默认值 |
|---|---|---|
TZ | 设置时区 | UTC |
AUTHELIA_CONFIG | 配置文件路径 | /config/configuration.yml |
AUTHELIA_SESSION_SECRET_FILE | 会话密钥文件路径 | 无 |
AUTHELIA_STORAGE_ENCRYPTION_KEY_FILE | 存储加密密钥文件路径 | 无 |
AUTHELIA_JWT_SECRET_FILE | JWT密钥文件路径 | 无 |
Nginx配置示例
nginxlocation /authelia { internal; proxy_pass http://authelia:9091/api/verify; proxy_set_header Host $host; proxy_set_header X-Original-URL $scheme://$http_host$request_uri; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $http_host; proxy_set_header X-Forwarded-Uri $request_uri; proxy_set_header X-Forwarded-Ssl on; proxy_pass_request_body off; proxy_set_header Content-Length ""; } location / { auth_request /authelia; auth_request_set $target_url $scheme://$http_host$request_uri; auth_request_set $user $upstream_http_remote_user; auth_request_set $groups $upstream_http_remote_groups; auth_request_set $name $upstream_http_remote_name; auth_request_set $email $upstream_http_remote_email; proxy_set_header Remote-User $user; proxy_set_header Remote-Groups $groups; proxy_set_header Remote-Name $name; proxy_set_header Remote-Email $email; proxy_pass http://protected-service:80; }
Authelia采用Apache 2.0许可证。详细信息请参见https://github.com/authelia/authelia/blob/master/LICENSE%E6%96%87%E4%BB%B6%E3%80%82
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务
以下是 authelia/authelia 相关的常用 Docker 镜像,适用于 不同场景 等不同场景: