-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update Let's Encrypt staging environment
In order to avoid running into Let's Encrypt rate limits, the Caddyfile configuration now uses the Let's Encrypt staging environment as a reverse proxy server.
- Loading branch information
1 parent
26ad717
commit dd4e266
Showing
4 changed files
with
16 additions
and
8 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,18 +1,23 @@ | ||
#!/bin/bash | ||
|
||
cd /etc/caddy/ || exit | ||
sudo mv Caddyfile Caddyfile.backup | ||
sudo mv Caddyfile Caddyfile.bkp | ||
touch Caddyfile | ||
echo "${DOMAIN_NAME}" >domain.txt | ||
|
||
tee -a ./Caddyfile <<END | ||
{ | ||
acme_ca https://acme-staging-v02.api.letsencrypt.org/directory | ||
if [ "$ENVIRONMENT" = "prod" ]; then | ||
echo "${DOMAIN_NAME} { | ||
root * /usr/share/caddy | ||
reverse_proxy localhost:8080 | ||
}" | tee ./Caddyfile | ||
else | ||
echo "{ | ||
acme_ca https://acme-staging-v02.api.letsencrypt.org/directory | ||
} | ||
${DOMAIN_NAME} { | ||
root * /usr/share/caddy | ||
reverse_proxy localhost:8080 | ||
} | ||
END | ||
}" | tee ./Caddyfile | ||
|
||
fi | ||
|
||
sudo systemctl restart caddy.service |
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