fix: dns-challenge

This commit is contained in:
lab 2021-12-03 04:18:31 +08:00
parent adf4eb1ffb
commit 373f94535f
3 changed files with 36 additions and 17 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.env

View File

@ -12,6 +12,8 @@ services:
- "traefik.http.routers.gitea.entrypoints=websecure" - "traefik.http.routers.gitea.entrypoints=websecure"
- "traefik.http.routers.gitea.tls=true" - "traefik.http.routers.gitea.tls=true"
- "traefik.http.routers.gitea.tls.certresolver=letsencrypt" - "traefik.http.routers.gitea.tls.certresolver=letsencrypt"
- "traefik.http.routers.gitea.tls.domains[0].main=esin.io"
- "traefik.http.routers.gitea.tls.domains[0].sans=*.esin.io"
- "traefik.http.routers.gitea.middlewares=gitea-mw" - "traefik.http.routers.gitea.middlewares=gitea-mw"
- "traefik.http.middlewares.gitea-mw.compress=true" - "traefik.http.middlewares.gitea-mw.compress=true"
- "traefik.http.middlewares.gitea-mw.compress.excludedcontenttypes=text/event-stream" - "traefik.http.middlewares.gitea-mw.compress.excludedcontenttypes=text/event-stream"
@ -23,8 +25,10 @@ services:
external_links: external_links:
- postgresql - postgresql
networks: networks:
- traefik traefik:
- database priority: 1000
database:
priority: 100
networks: networks:
traefik: traefik:
external: true external: true

View File

@ -3,38 +3,52 @@ version: "3.9"
services: services:
reverse-proxy: reverse-proxy:
image: traefik:v2.5 image: traefik:v2.5
restart: always
command: command:
- --entrypoints.web.address=:80 - "--global.sendanonymoususage=false"
- --entrypoints.websecure.address=:443 - "--global.checknewversion=false"
# EntryPoints
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
# Global HTTP -> HTTPS # Global HTTP -> HTTPS
- "--entrypoints.web.http.redirections.entryPoint.to=websecure" - "--entrypoints.web.http.redirections.entryPoint.to=websecure"
- "--entrypoints.web.http.redirections.entryPoint.scheme=https" - "--entrypoints.web.http.redirections.entryPoint.scheme=https"
# Enable dashboard # Enable dashboard
- --api.dashboard=true - "--api.dashboard=true"
- --providers.docker.exposedByDefault=false - "--ping"
- --ping # Provider docker
- "--providers.docker.watch=true"
- "--providers.docker.exposedByDefault=false"
# Provider file
- "--providers.file.watch=true"
- "--providers.file.directory=/etc/traefik"
# SSL configuration # SSL configuration
- --certificatesresolvers.letsencrypt.acme.email=hi@esin.io - "--certificatesresolvers.letsencrypt.acme.dnschallenge=true"
- --certificatesresolvers.letsencrypt.acme.storage=/etc/acme/acme.json - "--certificatesresolvers.letsencrypt.acme.dnschallenge.provider=linode"
- --certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web - "--certificatesresolvers.letsencrypt.acme.email=${ACME_EMAIL}"
- --log.filePath=/var/log/traefik.log - "--certificatesresolvers.letsencrypt.acme.storage=/etc/acme/acme.json"
- --log.format=json #- --certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web
- --log.level=INFO - "--log.filePath=/var/log/traefik.log"
- --accessLog.filepath=/var/log/access.log - "--log.format=json"
- --accessLog.format=json - "--log.level=INFO"
- --accessLog.bufferingsize=100 - "--accessLog.filepath=/var/log/access.log"
- "--accessLog.format=json"
- "--accessLog.bufferingsize=100"
ports: ports:
- "80:80" - "80:80"
- "443:443" - "443:443"
environment: environment:
- "TZ=Asia/Shanghai" - "TZ=Asia/Shanghai"
- LINODE_TOKEN=${LINODE_TOKEN}
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.routers.dashboard.entrypoints=websecure" - "traefik.http.routers.dashboard.entrypoints=websecure"
- "traefik.http.routers.dashboard.rule=Host(`traefik.esin.io`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
- "traefik.http.routers.dashboard.service=api@internal" - "traefik.http.routers.dashboard.service=api@internal"
- "traefik.http.routers.dashboard.rule=Host(`traefik.esin.io`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
- "traefik.http.routers.dashboard.tls=true" - "traefik.http.routers.dashboard.tls=true"
- "traefik.http.routers.dashboard.tls.certresolver=letsencrypt" - "traefik.http.routers.dashboard.tls.certresolver=letsencrypt"
- "traefik.http.routers.dashboard.tls.domains[0].main=esin.io"
- "traefik.http.routers.dashboard.tls.domains[0].sans=*.esin.io"
- "traefik.http.routers.dashboard.middlewares=dashboard-auth" - "traefik.http.routers.dashboard.middlewares=dashboard-auth"
- "traefik.http.middlewares.dashboard.compress=true" - "traefik.http.middlewares.dashboard.compress=true"
- "traefik.http.middlewares.dashboard.compress.excludedcontenttypes=text/event-stream" - "traefik.http.middlewares.dashboard.compress.excludedcontenttypes=text/event-stream"