max / makenotwork
| 1 | #!/bin/bash |
| 2 | # Firewall setup for Makenotwork production server (ufw). |
| 3 | # |
| 4 | # Rules: |
| 5 | # - Allow all traffic on Tailscale interface (tailscale0) |
| 6 | # - Allow SSH (port 22) from anywhere (needed for git SSH access) |
| 7 | # - Allow HTTP/HTTPS (80/443) from anywhere (custom domains need direct access) |
| 8 | # - Drop everything else |
| 9 | # |
| 10 | # HTTP/HTTPS is open to all because custom domains bypass Cloudflare. |
| 11 | # makenot.work subdomains remain protected by Caddy mTLS (Authenticated Origin Pulls): |
| 12 | # requests without a valid Cloudflare client cert are rejected by Caddy before |
| 13 | # reaching the application. |
| 14 | |
| 15 | |
| 16 | |
| 17 | if [; then |
| 18 | |
| 19 | |
| 20 | fi |
| 21 | |
| 22 | # Reset to defaults |
| 23 | |
| 24 | |
| 25 | # Default policies |
| 26 | |
| 27 | |
| 28 | |
| 29 | # Tailscale — unrestricted |
| 30 | |
| 31 | |
| 32 | # SSH — open from anywhere (git clone over SSH) |
| 33 | |
| 34 | |
| 35 | # HTTP/HTTPS — open to all (custom domains need direct access) |
| 36 | # makenot.work is still protected by Caddy mTLS (Authenticated Origin Pulls) |
| 37 | |
| 38 | |
| 39 | |
| 40 | # Enable |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 |