This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
esxi:caddy_server [2024/07/29 18:59] derek |
esxi:caddy_server [2025/12/25 09:41] (current) derek |
||
|---|---|---|---|
| Line 15: | Line 15: | ||
| * '' | * '' | ||
| * Add a ' | * Add a ' | ||
| + | * If not using a wildcard CNAME record, add a CNAME record for the desired subdomain as above | ||
| * '' | * '' | ||
| * '' | * '' | ||
| Line 61: | Line 62: | ||
| # Generate a GitHub Personal Access Token at https:// | # Generate a GitHub Personal Access Token at https:// | ||
| # Enter the key when this command asks | # Enter the key when this command asks | ||
| - | read -rp "Enter github api token: " token && echo " | + | read -rp "Enter github api token: " token && echo " |
| - | + | ||
| - | # Get a DNS API token from https:// | + | |
| - | # Edit zone DNS > Use template: | + | |
| - | # Zone.Zone: | + | |
| - | # Zone.DNS: | + | |
| - | # Restriction of the domain you're managing with Caddy | + | |
| - | # Enter the key when this command asks | + | |
| - | read -rp "Enter Cloudflare api token: " token && echo " | + | |
| - | + | ||
| - | # Set up Google OAuth 2.0: | + | |
| - | # Go to: [[https:// | + | |
| - | # | + | |
| - | # Enter the keys after the following commands | + | |
| - | read -rp "Enter Google OAuth Client ID: " token && echo " | + | |
| - | read -rp "Enter Google OAuth Client Secret: " token && echo " | + | |
| # Reload the shell so it exports the tokens in this session | # Reload the shell so it exports the tokens in this session | ||
| exec $SHELL | exec $SHELL | ||
| Line 84: | Line 69: | ||
| chmod -R a=r,u+w,a+X /etc/caddy | chmod -R a=r,u+w,a+X /etc/caddy | ||
| - | # Setup startup, and run | + | # Setup caddy startup |
| curl -L -o / | curl -L -o / | ||
| systemctl daemon-reload | systemctl daemon-reload | ||
| + | |||
| + | # Get a DNS API token from https:// | ||
| + | # Edit zone DNS > Use template: | ||
| + | # | ||
| + | # Add a Permissions entry for: Zone.Zone: | ||
| + | # | ||
| + | # | ||
| + | |||
| + | # Set up Google OAuth 2.0: | ||
| + | # Go to: [[https:// | ||
| + | # | ||
| + | # | ||
| + | |||
| + | systemctl edit caddy | ||
| + | # Paste in the following lines with their respective keys filled in: | ||
| + | [Service] | ||
| + | Environment=" | ||
| + | Environment=" | ||
| + | Environment=" | ||
| + | # Then save and exit the file with: ESC, :wq | ||
| + | |||
| + | # Enable and run the Caddy service | ||
| systemctl enable --now caddy | systemctl enable --now caddy | ||
| </ | </ | ||
| Line 104: | Line 111: | ||
| systemctl reload caddy | systemctl reload caddy | ||
| </ | </ | ||
| + | |||
| + | Edit the Caddyfile at [[https:// | ||
| + | |||
| + | Services that require setting Trusted Proxies: | ||
| + | * [[esxi: | ||
| + | * [[home:Home Assistant]] | ||
| + | * [[esxi:AMP Game Server]] | ||
| @No_Backup | @No_Backup | ||
| Line 117: | Line 131: | ||
| # Update Caddy | # Update Caddy | ||
| caddy update | caddy update | ||
| + | chmod 755 / | ||
| systemctl reload caddy | systemctl reload caddy | ||
| # Once a year generate a GitHub Personal Access Token at https:// | # Once a year generate a GitHub Personal Access Token at https:// | ||
| # Enter the key when this command asks | # Enter the key when this command asks | ||
| - | read -rp "Enter api token: " token && echo " | + | read -rp "Enter api token: " token && echo " |
| # Reload the shell so it exports the tokens in this session | # Reload the shell so it exports the tokens in this session | ||
| exec $SHELL | exec $SHELL | ||