beachfront/ API for enabling website creation
- creates/overwrites
index.htmlin/etc/caddy/sandcastles/<customer-uuid>/<domain> - updates Caddy config of said domain
- reloads Caddy
- Caddy: https://caddyserver.com
- unzip:
brew install unziporapt install unzip -y - Deno:
curl -fsSL https://deno.land/install.sh | shexport DENO_INSTALL="/root/.deno"export PATH="$DENO_INSTALL/bin:$PATH"
.envfile with a strongTOKEN
- sandcastle expects to find a Caddy config and will fail gracefully if it isn't found
- this should be run with golfer on the same server
- when in development, create the Caddy config with golfer and place the generated files within
dist/
deno task startWebsites will live in /var/www/sandcastles. Contents will look like:
00000000-0000-0000-0000-000000000000
└─ domain.tld
└─ index.html
00000000-0000-0000-0000-000000000001
└─ domain1.tld
└─ index.html
00000000-0000-0000-0000-000000000002
├─ domain2.tld
│ └─ index.html
└─ domain3.tld
└─ index.html
…where each immediate child is a customer's UUID.
deno task dev# using curl
curl -d '{ "customer": "00000000-0000-0000-0000-000000000000", "data": "markdown compiled to HTML", "domain": "www.lynk" }' -H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" -X POST http://localhost:3700/api | jq