-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update .env.example with CADDY_ORIGIN_URL and CADDY_ORIGIN_DOMAIN_CHE…
…CK_URL, set CADDY_ORIGIN_URL to http://origin-server.com and CADDY_ORIGIN_DOMAIN_CHECK_URL to http://origin-server/api/domainCheck, and update CADDY_POWERDNS_SERVER_URL to http://pdns-api-server.com:8081. Additionally, update Caddyfile with http_port set to 80 and https_port set to 443, and update reverse_proxy to use {$CADDY_ORIGIN_URL}. Finally, update docker-compose.yml with CADDY_ORIGIN_URL and CADDY_ORIGIN_DOMAIN_CHECK_URL environment variables, set CADDY_ORIGIN_URL to localhost:9000, and update port mappings to forward to 80 and 443.
- Loading branch information
Showing
7 changed files
with
84 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,29 @@ | ||
## Caddy / Octane Tags | ||
OCTANE_TAG=latest | ||
CADDY_TAG=latest | ||
CADDY_BUILDER_TAG=latest | ||
|
||
## Caddy Reverse Proxy Configuration | ||
CADDY_ORIGIN_URL=http://origin-server.com | ||
CADDY_ORIGIN_DOMAIN_CHECK_URL=http://origin-server/api/domainCheck | ||
|
||
## LetsEncrypt | ||
CADDY_LETS_ENCRYPT_EMAIL= | ||
|
||
## PowerDNS Integration | ||
CADDY_POWERDNS_SERVER_URL=http://pdns-api-server.com:8081 | ||
CADDY_POWERDNS_API_TOKEN= | ||
|
||
## AWS DynamoDB Integration | ||
CADDY_DYNAMODB_TABLE_NAME=caddy_certs | ||
CADDY_DYNAMODB_AWS_REGION=us-east-1 | ||
CADDY_DYNAMODB_AWS_ENDPOINT=dynamodb:8000 | ||
CADDY_DYNAMODB_AWS_ACCESS_KEY_ID=abc123 | ||
CADDY_DYNAMODB_AWS_SECRET_ACCESS_KEY=abc123 | ||
|
||
## Local Ports | ||
FORWARD_CADDY_ADMIN_PORT=2019 | ||
FORWARD_CADDY_HTTP_PORT=2080 | ||
FORWARD_CADDY_HTTPS_PORT=2443 | ||
FORWARD_APP_PORT=9000 | ||
|
||
CADDY_DOMAIN_API_CHECK_URL= | ||
CADDY_POWERDNS_SERVER_URL= | ||
CADDY_POWERDNS_API_TOKEN= | ||
CADDY_LETS_ENCRYPT_EMAIL= | ||
CADDY_DYNAMODB_TABLE_NAME= | ||
CADDY_AWS_REGION= | ||
CADDY_AWS_ACCESS_KEY_ID= | ||
CADDY_AWS_SECRET_ACCESS_KEY= | ||
FORWARD_DYNAMODB_PORT=8000 | ||
FORWARD_APP_PORT=9001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
ARG OCTANE_TAG=latest | ||
ARG CADDY_TAG=latest | ||
ARG CADDY_BUILDER_TAG=builder | ||
|
||
FROM caddy:builder AS builder | ||
|
||
|
@@ -15,23 +17,9 @@ FROM lostlink/octane:${OCTANE_TAG} | |
|
||
LABEL maintainer="Nuno Souto <[email protected]>" | ||
|
||
ARG CADDY_DOMAIN_API_CHECK_URL | ||
ARG CADDY_POWERDNS_SERVER_URL | ||
ARG CADDY_POWERDNS_API_TOKEN | ||
ARG CADDY_LETS_ENCRYPT_EMAIL | ||
ARG CADDY_DYNAMODB_TABLE_NAME | ||
ARG CADDY_AWS_REGION | ||
ARG CADDY_AWS_ACCESS_KEY_ID | ||
ARG CADDY_AWS_SECRET_ACCESS_KEY | ||
|
||
ENV DOMAIN_API_CHECK_URL=${CADDY_DOMAIN_API_CHECK_URL} | ||
ENV POWERDNS_SERVER_URL=${CADDY_POWERDNS_SERVER_URL} | ||
ENV POWERDNS_API_TOKEN=${CADDY_POWERDNS_API_TOKEN} | ||
ENV LETS_ENCRYPT_EMAIL=${CADDY_LETS_ENCRYPT_EMAIL} | ||
ENV DYNAMODB_TABLE_NAME=${CADDY_DYNAMODB_TABLE_NAME} | ||
ENV AWS_REGION=${CADDY_AWS_REGION} | ||
ENV AWS_ACCESS_KEY_ID=${CADDY_AWS_ACCESS_KEY_ID} | ||
ENV AWS_SECRET_ACCESS_KEY=${CADDY_AWS_SECRET_ACCESS_KEY} | ||
ARG CADDY_ORIGIN_URL | ||
|
||
ENV CADDY_ORIGIN_URL=${CADDY_ORIGIN_URL} | ||
|
||
RUN apt-get update; \ | ||
apt-get upgrade -yqq; \ | ||
|
@@ -46,4 +34,4 @@ COPY --from=builder /usr/bin/caddy /usr/bin/caddy | |
COPY ./etc/supervisor/ /etc/supervisor/ | ||
COPY ./etc/caddy/ /etc/caddy/ | ||
|
||
EXPOSE 2080 2443 2019 9000 | ||
EXPOSE 80 443 2019 9000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,22 @@ | ||
{ | ||
http_port 2080 | ||
https_port 2443 | ||
http_port 80 | ||
https_port 443 | ||
|
||
on_demand_tls { | ||
ask {$CADDY_DOMAIN_API_CHECK_URL} | ||
ask {$CADDY_ORIGIN_DOMAIN_CHECK_URL} | ||
} | ||
|
||
storage dynamodb {$CADDY_DYNAMODB_TABLE_NAME} { | ||
aws_region {$CADDY_AWS_REGION} | ||
aws_region {$CADDY_DYNAMODB_AWS_REGION} | ||
} | ||
} | ||
|
||
:2080 { | ||
reverse_proxy localhost:9000 | ||
} | ||
|
||
:2443 { | ||
tls {$LETS_ENCRYPT_EMAIL} { | ||
## TODO: Allow configuring multiple origin URL/Servers | ||
: { | ||
tls {$CADDY_LETS_ENCRYPT_EMAIL} { | ||
on_demand | ||
dns powerdns {$CADDY_POWERDNS_SERVER_URL} {$CADDY_POWERDNS_API_TOKEN} | ||
} | ||
|
||
reverse_proxy localhost:9000 | ||
reverse_proxy {$CADDY_ORIGIN_URL} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters