Monorepo for Aesthetic.Computer
aesthetic.computer
1# lith production Caddyfile — full subdomain routing
2# Cloudflare handles TLS. Caddy serves HTTP on :80.
3
4# --- papers.aesthetic.computer ---
5:443 {
6 tls /etc/caddy/origin-cert.pem /etc/caddy/origin-key.pem
7 log {
8 output file /var/log/caddy/access.log {
9 roll_size 50MiB
10 roll_keep 3
11 roll_keep_for 72h
12 }
13 format json
14 level INFO
15 }
16 # --- Global performance headers ---
17 # Cache static assets (1h fresh, serve stale for 24h while revalidating)
18 @cacheable path *.mjs *.js *.css *.woff2 *.woff *.ttf *.png *.jpg *.jpeg *.svg *.gif *.webp *.ico *.mp3 *.wav *.mp4 *.json
19 header @cacheable Cache-Control "public, max-age=3600, stale-while-revalidate=86400"
20 header @cacheable Access-Control-Allow-Origin *
21
22 # HTML: no-cache (always revalidate, but use ETag for 304)
23 @html path / *.html
24 header @html Cache-Control "no-cache"
25
26 # Encode everything (Caddy does this by default, but be explicit)
27 encode zstd gzip
28
29 @papers host papers.aesthetic.computer papers.prompt.ac
30 handle @papers {
31 handle /en {
32 rewrite * /index.html?lang=en
33 root * /opt/ac/system/public/papers.aesthetic.computer
34 file_server
35 }
36 handle /da {
37 rewrite * /index.html?lang=da
38 root * /opt/ac/system/public/papers.aesthetic.computer
39 file_server
40 }
41 handle /es {
42 rewrite * /index.html?lang=es
43 root * /opt/ac/system/public/papers.aesthetic.computer
44 file_server
45 }
46 handle /cn {
47 rewrite * /index.html?lang=zh
48 root * /opt/ac/system/public/papers.aesthetic.computer
49 file_server
50 }
51 root * /opt/ac/system/public/papers.aesthetic.computer
52 try_files {path} {path}.html /index.html
53 file_server
54 }
55
56 # --- bills.aesthetic.computer ---
57 @bills host bills.aesthetic.computer
58 handle @bills {
59 root * /opt/ac/system/public/bills.aesthetic.computer
60 try_files {path} {path}.html /index.html
61 file_server
62 }
63
64 # --- give.aesthetic.computer ---
65 @give host give.aesthetic.computer
66 handle @give {
67 handle /api/* {
68 reverse_proxy localhost:8888
69 }
70 handle /da {
71 rewrite * /index.html?lang=da¤cy=dkk
72 root * /opt/ac/system/public/give.aesthetic.computer
73 file_server
74 }
75 handle /es {
76 rewrite * /index.html?lang=es¤cy=usd
77 root * /opt/ac/system/public/give.aesthetic.computer
78 file_server
79 }
80 handle /de {
81 rewrite * /index.html?lang=de¤cy=eur
82 root * /opt/ac/system/public/give.aesthetic.computer
83 file_server
84 }
85 handle /cn {
86 rewrite * /index.html?lang=zh¤cy=usd
87 root * /opt/ac/system/public/give.aesthetic.computer
88 file_server
89 }
90 root * /opt/ac/system/public/give.aesthetic.computer
91 try_files {path} {path}.html /index.html
92 file_server
93 }
94
95 # --- news.aesthetic.computer ---
96 @news host news.aesthetic.computer
97 handle @news {
98 handle /api/* {
99 reverse_proxy localhost:8888
100 }
101 handle {
102 rewrite * /api/news{uri}
103 reverse_proxy localhost:8888
104 }
105 }
106
107 # --- api.aesthetic.computer ---
108 @apidomain host api.aesthetic.computer api.prompt.ac
109 handle @apidomain {
110 reverse_proxy localhost:8888
111 }
112
113 # --- feed.aesthetic.computer (DP-1 Feed V2 — Go + Postgres) ---
114 @feed host feed.aesthetic.computer
115 handle @feed {
116 header Access-Control-Allow-Origin *
117 handle /api/* {
118 reverse_proxy localhost:8787
119 }
120 handle /health {
121 reverse_proxy localhost:8787
122 }
123 handle {
124 root * /opt/dp1-feed
125 rewrite * /landing-page.html
126 file_server
127 }
128 }
129
130 # --- ipfs.aesthetic.computer (self-hosted IPFS gateway) ---
131 @ipfs host ipfs.aesthetic.computer
132 handle @ipfs {
133 header Access-Control-Allow-Origin *
134 reverse_proxy localhost:8090
135 }
136
137 # --- justanothersystem.org ---
138 @wwwjas2 host www.justanothersystem.org
139 handle @wwwjas2 {
140 redir https://justanothersystem.org{uri} 301
141 }
142
143 @jas host justanothersystem.org
144 handle @jas {
145 handle /api/* {
146 reverse_proxy localhost:8888
147 }
148 root * /opt/ac/system/public/justanothersystem.org
149 try_files {path} {path}.html /index.html
150 file_server
151 }
152
153 # --- builds.false.work ---
154 @builds host builds.false.work
155 handle @builds {
156 handle /api/* {
157 reverse_proxy localhost:8888
158 }
159 root * /opt/ac/system/public/builds.false.work
160 try_files {path} {path}.html /index.html
161 file_server
162 }
163
164 # --- sotce.net ---
165 @sotce host sotce.net www.sotce.net
166 handle @sotce {
167 handle /api/* {
168 reverse_proxy localhost:8888
169 }
170 handle /user {
171 reverse_proxy localhost:8888
172 }
173 handle /handle {
174 reverse_proxy localhost:8888
175 }
176 handle /authorized {
177 reverse_proxy localhost:8888
178 }
179 handle /aesthetic.computer/* {
180 uri strip_prefix /aesthetic.computer
181 root * /opt/ac/system/public/aesthetic.computer
182 file_server
183 }
184 # Everything else → sotce-net function
185 handle {
186 rewrite * /api/sotce-net{uri}
187 reverse_proxy localhost:8888
188 }
189 }
190
191 # --- kidlisp.com subdomains ---
192 @keep host keep.kidlisp.com
193 handle @keep {
194 handle /api/* {
195 reverse_proxy localhost:8888
196 }
197 handle /technology {
198 root * /opt/ac/system/public/kidlisp.com
199 rewrite * /keeps-tech.html
200 file_server
201 }
202 handle /wallet {
203 root * /opt/ac/system/public/kidlisp.com
204 rewrite * /wallet/index.html
205 file_server
206 }
207 handle {
208 root * /opt/ac/system/public/kidlisp.com
209 rewrite * /keeps.html
210 file_server
211 }
212 }
213
214 @buy host buy.kidlisp.com
215 handle @buy {
216 root * /opt/ac/system/public/kidlisp.com
217 rewrite * /buy.html
218 file_server
219 }
220
221 @pj host pj.kidlisp.com
222 handle @pj {
223 root * /opt/ac/system/public/kidlisp.com
224 rewrite * /pj.html
225 file_server
226 }
227
228 @device host device.kidlisp.com
229 handle @device {
230 handle /api/* {
231 reverse_proxy localhost:8888
232 }
233 handle /js/* {
234 root * /opt/ac/system/public/kidlisp.com
235 file_server
236 }
237 handle /qr/* {
238 root * /opt/ac/system/public/kidlisp.com
239 rewrite * /qr.html
240 file_server
241 }
242 handle {
243 root * /opt/ac/system/public/kidlisp.com
244 rewrite * /device.html
245 file_server
246 }
247 }
248
249 @topcalm host top.kidlisp.com calm.kidlisp.com
250 handle @topcalm {
251 handle /js/* {
252 root * /opt/ac/system/public/kidlisp.com
253 file_server
254 }
255 reverse_proxy localhost:8888
256 }
257
258 @learn host learn.kidlisp.com
259 handle @learn {
260 handle /api/* {
261 reverse_proxy localhost:8888
262 }
263 handle /decree* {
264 root * /opt/ac/system/public/kidlisp.com
265 rewrite * /decree.html
266 file_server
267 }
268 handle {
269 root * /opt/ac/system/public/kidlisp.com
270 rewrite * /learn.html
271 file_server
272 }
273 }
274
275 @keepsredirect host keeps.kidlisp.com
276 handle @keepsredirect {
277 redir https://keep.kidlisp.com{uri} 301
278 }
279
280 @keepsac host keeps.aesthetic.computer
281 handle @keepsac {
282 reverse_proxy localhost:8888
283 }
284
285 # --- jas.life ---
286 @jaslife host jas.life
287 handle @jaslife {
288 root * /opt/ac/system/public/jas.life
289 try_files {path} {path}.html /index.html
290 file_server
291 }
292
293 # --- www.jas.life redirect ---
294 @wwwjas host www.jas.life
295 handle @wwwjas {
296 redir https://jas.life{uri} 301
297 }
298
299 # --- pals.aesthetic.computer ---
300 # pals.aesthetic.computer → /api/logo (dynamic logo generation)
301 @pals host pals.aesthetic.computer
302 handle @pals {
303 rewrite * /api/logo{uri}
304 reverse_proxy localhost:8888
305 }
306
307 @l5prompt host l5.prompt.ac
308 handle @l5prompt {
309 redir https://l5.aesthetic.computer{uri} 301
310 }
311 @p5prompt host p5.prompt.ac
312 handle @p5prompt {
313 redir https://p5.aesthetic.computer{uri} 301
314 }
315 @procprompt host processing.prompt.ac
316 handle @procprompt {
317 redir https://processing.aesthetic.computer{uri} 301
318 }
319 @siteprompt host sitemap.prompt.ac
320 handle @siteprompt {
321 redir https://sitemap.aesthetic.computer{uri} 301
322 }
323 @apiprompt host api.prompt.ac
324 handle @apiprompt {
325 redir https://api.aesthetic.computer{uri} 301
326 }
327
328 # --- legacy duckweedtri hosts ---
329 @duckweedaesthetic host duckweedtri.aesthetic.computer
330 handle @duckweedaesthetic {
331 redir https://aesthetic.computer{uri} 301
332 }
333
334 @duckweedprompt host duckweedtri.prompt.ac
335 handle @duckweedprompt {
336 redir https://aesthetic.computer{uri} 301
337 }
338
339 # --- prompt.ac → aesthetic.computer (301 redirect) ---
340 @promptac host prompt.ac
341 handle @promptac {
342 redir https://aesthetic.computer{uri} 301
343 }
344
345 @tryshared {
346 host l5.aesthetic.computer processing.aesthetic.computer
347 path /aesthetic.computer/*
348 }
349 handle @tryshared {
350 root * /opt/ac/system/public
351 file_server
352 }
353
354 # --- l5.aesthetic.computer ---
355 @l5 host l5.aesthetic.computer
356 handle @l5 {
357 handle /api/* {
358 reverse_proxy localhost:8888
359 }
360 handle /docs* {
361 reverse_proxy localhost:8888
362 }
363 root * /opt/ac/system/public/l5.aesthetic.computer
364 try_files {path} {path}.html /index.html
365 file_server
366 }
367
368 # --- processing.aesthetic.computer ---
369 @processing host processing.aesthetic.computer
370 handle @processing {
371 handle /api/* {
372 reverse_proxy localhost:8888
373 }
374 handle /docs* {
375 reverse_proxy localhost:8888
376 }
377 root * /opt/ac/system/public/processing.aesthetic.computer
378 try_files {path} {path}.html /index.html
379 file_server
380 }
381
382 # --- rdp.jas.life ---
383 @rdp host rdp.jas.life
384 handle @rdp {
385 root * /opt/ac/system/public/rdp.jas.life
386 try_files {path} {path}.html /index.html
387 file_server
388 }
389
390 # --- kidlisp.com root domain ---
391 @kidlisproot host kidlisp.com www.kidlisp.com
392 handle @kidlisproot {
393 handle /api/* {
394 reverse_proxy localhost:8888
395 }
396 handle /.netlify/functions/* {
397 reverse_proxy localhost:8888
398 }
399 handle /keeps {
400 redir https://keep.kidlisp.com/ 301
401 }
402 # Serve AC runtime assets for iframe embedding
403 handle /aesthetic.computer/* {
404 root * /opt/ac/system/public
405 file_server
406 }
407 # kidlisp.com SPA
408 handle {
409 root * /opt/ac/system/public/kidlisp.com
410 try_files {path} {path}.html /index.html
411 file_server
412 }
413 }
414
415 # --- notepat.com ---
416 @notepatroot host notepat.com www.notepat.com
417 handle @notepatroot {
418 @notepatindex path /
419 handle @notepatindex {
420 rewrite * /notepat
421 }
422 reverse_proxy localhost:8888
423 }
424 @mainspa host aesthetic.computer www.aesthetic.computer lith.aesthetic.computer notepat.com www.notepat.com p5.aesthetic.computer sitemap.aesthetic.computer
425 handle @mainspa {
426 # Preload critical assets (browser starts fetching before parsing HTML)
427 header Link "</aesthetic.computer/boot.mjs>; rel=preload; as=script, </aesthetic.computer/style.css>; rel=preload; as=style"
428
429 # Assets → DO Spaces CDN
430 handle /assets/* {
431 redir https://assets.aesthetic.computer{uri} 302
432 }
433 # API → lith
434 handle /api/* {
435 reverse_proxy localhost:8888
436 }
437 handle /.netlify/functions/* {
438 reverse_proxy localhost:8888
439 }
440 # Media → lith
441 handle /media/* {
442 reverse_proxy localhost:8888
443 }
444 # Static rewrite shortcuts
445 handle /disks/* {
446 uri strip_prefix /disks
447 root * /opt/ac/system/public/aesthetic.computer/disks
448 file_server
449 }
450 handle /lib/* {
451 uri strip_prefix /lib
452 root * /opt/ac/system/public/aesthetic.computer/lib
453 file_server
454 }
455 # Static files, then SPA fallback
456 handle {
457 root * /opt/ac/system/public
458 @static file
459 handle @static {
460 file_server
461 }
462 handle {
463 reverse_proxy localhost:8888
464 }
465 }
466 }
467
468 # --- false.work ---
469 @falseroot host false.work
470 handle @falseroot {
471 root * /opt/ac/system/public/false.work
472 try_files {path} {path}.html /index.html
473 file_server
474 }
475
476 @wwwfalse host www.false.work
477 handle @wwwfalse {
478 redir https://false.work{uri} 301
479 }
480
481 # --- Fallback for any unmatched host ---
482 handle {
483 reverse_proxy localhost:8888
484 }
485}
486
487:80 {
488 redir https://{host}{uri} 301
489}