-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from djerfy/feat/improvements
feat: global improvements of OpenChia proxy
- Loading branch information
Showing
5 changed files
with
69 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.git | ||
README.md |
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,4 @@ | ||
FROM caddy:2.6.2-alpine | ||
FROM caddy:2.7.4-alpine | ||
|
||
# Identify the maintainer of an image | ||
LABEL maintainer="[email protected]" | ||
|
@@ -8,7 +8,7 @@ EXPOSE 443 | |
|
||
RUN rm -rf /tmp/build | ||
|
||
COPY ./Caddyfile /etc/ | ||
COPY ./entrypoint.sh /root/ | ||
COPY ./docker/caddy/Caddyfile /etc/Caddyfile.tpl | ||
COPY ./docker/entrypoint.sh / | ||
|
||
CMD ["sh", "/root/entrypoint.sh"] | ||
CMD ["sh", "/entrypoint.sh"] |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/sh | ||
set -x | ||
|
||
if [ ! -e "/etc/Caddyfile" ]; then | ||
if [ -z "${CERTBOT_EMAIL}" ]; then | ||
echo "CERTBOT_EMAIL required" | ||
exit 1 | ||
fi | ||
|
||
if [ -n "${TLS_CERT}" -a -n "${TLS_KEY}" ]; then | ||
sed -i "s,%%TLS%%,tls ${TLS_CERT} ${TLS_KEY},g" /etc/Caddyfile.tpl | ||
else | ||
sed -i s,%%TLS%%,,g /etc/Caddyfile.tpl | ||
fi | ||
|
||
sed -i s,%%EMAIL%%,${CERTBOT_EMAIL},g /etc/Caddyfile.tpl | ||
sed -i s,%%WWW_DOMAIN%%,${WWW_DOMAIN:=localhost},g /etc/Caddyfile.tpl | ||
sed -i s,%%POOL_DOMAIN%%,${POOL_DOMAIN:=pool},g /etc/Caddyfile.tpl | ||
sed -i s,%%REDIRECT_DOMAIN%%,${REDIRECT_DOMAIN:=www},g /etc/Caddyfile.tpl | ||
sed -i s,%%API_HOSTNAME%%,${API_HOSTNAME:=api},g /etc/Caddyfile.tpl | ||
sed -i s,%%POOL_HOSTNAME%%,${POOL_HOSTNAME:=pool},g /etc/Caddyfile.tpl | ||
sed -i s,%%WEB_HOSTNAME%%,${WEB_HOSTNAME:=web},g /etc/Caddyfile.tpl | ||
sed -i s,%%TRUSTED_PROXIES%%,${TRUSTED_PROXIES},g /etc/Caddyfile.tpl | ||
sed -i s,%%LOGFORMAT,${LOGFORMAT:=json},g /etc/Caddyfile.tpl | ||
sed -i s,%%LOGLEVEL%%,${LOGLEVEL:=INFO},g /etc/Caddyfile.tpl | ||
|
||
# Allow a second pool domain | ||
if [ -n "${POOL2_DOMAIN}" ]; then | ||
sed -i s,%%POOL2_DOMAIN%%,${POOL2_DOMAIN},g /etc/Caddyfile.tpl | ||
sed -i s,%%POOL2_DOMAIN_END%%,,g /etc/Caddyfile.tpl | ||
else | ||
sed -i '/%%POOL2_DOMAIN%%/,/%%POOL2_DOMAIN_END%%/c' /etc/Caddyfile.tpl | ||
fi | ||
|
||
mv /etc/Caddyfile.tpl /etc/Caddyfile | ||
else | ||
rm -f /etc/Caddyfile.tpl | ||
fi | ||
|
||
exec caddy run --config /etc/Caddyfile |
This file was deleted.
Oops, something went wrong.