Support OVH configuration
continuous-integration/drone/push Build is failing Details

See https://github.com/Autonomic-Cooperative/traefik/pull/1.
This commit is contained in:
decentral1se 2021-06-10 12:36:54 +02:00
parent bbbdfc272d
commit 7258b129c4
No known key found for this signature in database
GPG Key ID: 92DAD76BD9567B8A
5 changed files with 50 additions and 9 deletions

View File

@ -13,6 +13,14 @@ LOG_LEVEL=WARN
#LETS_ENCRYPT_DNS_CHALLENGE_ENABLED=1
#LETS_ENCRYPT_DNS_CHALLENGE_PROVIDER=ovh
## OVH configuration
# COMPOSE_FILE="compose.yml:compose.ovh.yml"
# OVH_ENABLED=1
# OVH_APPLICATION_KEY=
# OVH_ENDPOINT=
# SECRET_OVH_APP_SECRET_VERSION=v1
# SECRET_OVH_CONSUMER_KEY=v1
## Enable Keycloak
#COMPOSE_FILE="compose.yml:compose.keycloak.yml"
#KEYCLOAK_MIDDLEWARE_ENABLED=1

View File

@ -1,2 +1,3 @@
export TRAEFIK_YML_VERSION=v8
export TRAEFIK_YML_VERSION=v9
export FILE_PROVIDER_YML_VERSION=v2
export ENTRYPOINT_VERSION=v1

21
compose.ovh.yml Normal file
View File

@ -0,0 +1,21 @@
version: "3.8"
services:
app:
environment:
- OVH_APPLICATION_KEY
- OVH_APPLICATION_SECRET_FILE=/run/secrets/ovh_app_secret
- OVH_CONSUMER_KEY_FILE=/run/secrets/ovh_consumer_key
- OVH_ENABLED
- OVH_ENDPOINT
secrets:
- ovh_app_secret
- ovh_consumer_key
secrets:
ovh_app_secret:
name: ${STACK_NAME}_ovh_app_secret_${SECRET_OVH_APP_SECRET_VERSION}
external: true
ovh_consumer_key:
name: ${STACK_NAME}_ovh_consumer_key_${SECRET_OVH_CONSUMER_KEY}
external: true

View File

@ -16,25 +16,22 @@ services:
target: /etc/traefik/traefik.yml
- source: file_provider_yml
target: /etc/traefik/file-provider.yml
- source: entrypoint
target: /custom-entrypoint.sh
mode: 0555
networks:
- proxy
environment:
- DASHBOARD_ENABLED
- LOG_LEVEL
{{ if eq (env "LETS_ENCRYPT_DNS_CHALLENGE_ENABLED") "1" }}
{{ if eq (env "LETS_ENCRYPT_DNS_CHALLENGE_PROVIDER") "ovh" }}
- OVH_APPLICATION_KEY
- OVH_APPLICATION_SECRET
- OVH_CONSUMER_KEY
- OVH_ENDPOINT
{{ end }}
{{ end }}
healthcheck:
test: ["CMD", "traefik", "healthcheck"]
interval: 30s
timeout: 10s
retries: 10
start_period: 1m
command: traefik
entrypoint: /custom-entrypoint.sh
deploy:
update_config:
failure_action: rollback
@ -61,5 +58,9 @@ configs:
name: ${STACK_NAME}_file_provider_yml_${FILE_PROVIDER_YML_VERSION}
file: file-provider.yml.tmpl
template_driver: golang
entrypoint:
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_VERSION}
file: entrypoint.sh.tmpl
template_driver: golang
volumes:
letsencrypt:

10
entrypoint.sh.tmpl Normal file
View File

@ -0,0 +1,10 @@
#!/bin/sh
set -e
{{ if eq (env "OVH_ENABLED") "1" }}
export OVH_CONSUMER_KEY=$(cat "$OVH_CONSUMER_KEY_FILE")
export OVH_APPLICATION_SECRET=$(cat "$OVH_APPLICATION_SECRET_FILE")
{{ end }}
/entrypoint.sh "$@"