diff --git a/core/caddy/compose.yml b/core/caddy/compose.yml index ac64f81..2cdebb7 100644 --- a/core/caddy/compose.yml +++ b/core/caddy/compose.yml @@ -5,7 +5,6 @@ services: restart: unless-stopped ports: - "80:80" - - "443:443" volumes: - caddy-caddyfiles:/etc/caddy - caddy-data:/data diff --git a/core/caddy/config/Caddyfile b/core/caddy/config/Caddyfile index 1b91a66..b54a478 100644 --- a/core/caddy/config/Caddyfile +++ b/core/caddy/config/Caddyfile @@ -1,25 +1,4 @@ -outils.localhost { +{ local_certs - header X-Chatons "miaou" - - respond /healthcheck "OK" - #handle_path or handle are the same except you need to prefix things instead of already having it uri strip_prefix /prefix - handle_path /hello/* { - respond "Hello {path.0}!" - close - } - handle /date { - respond "{http.date} {http.time}" - close - } - handle /ip { - respond {{.ClientIP}} - - } - handle_path /b64/encode { - - } - handle_path /b64/decode { - - } -} \ No newline at end of file +} +import /etc/caddy/sites/*.caddy diff --git a/core/caddy/config/outils.caddy b/core/caddy/config/outils.caddy new file mode 100644 index 0000000..1d18973 --- /dev/null +++ b/core/caddy/config/outils.caddy @@ -0,0 +1,27 @@ +http://outils.localhost { + header X-Chatons "miaou" + + respond /healthcheck "OK" + + redir / /hello/world + redir /hello /hello/world + + handle_path /hello/* { + respond "Hello {path.0}!" + } + + handle /date { + templates + respond `{{now | date "2006-01-02 15:04:05"}}` + } + + handle /ip { + respond "{{.ClientIP}" + } + + handle_path /b64/encode/* { + } + + handle_path /b64/decode/* { + } +} diff --git a/core/caddy/tools/setup-config b/core/caddy/tools/setup-config deleted file mode 100644 index f1f641a..0000000 --- a/core/caddy/tools/setup-config +++ /dev/null @@ -1 +0,0 @@ -#!/usr/bin/env bash