The main page and direct photo links open without a prompt. Each photo's pool is sealed with its own key, handed out by POST /k (served by the daemon in serve and export mode). The hold-and-solve card appears only for low-entropy clicks into a collection, too many low-entropy landings from one IP, or more than photo_limit photos per window, with escalating proof-of-work and a 429 cap. Build ids now sort chronologically within the same second. Co-Authored-By: Claude Opus 5.5 <[email protected]>
49 lines
999 B
Caddyfile
49 lines
999 B
Caddyfile
photos.luciochen.com {
|
|
root * /var/lib/luphoto/site/current
|
|
|
|
@hotlink {
|
|
path /t/*
|
|
header Referer *
|
|
not header_regexp Referer ^https?://photos\.luciochen\.com(:[0-9]+)?(/|$)
|
|
}
|
|
respond @hotlink 403
|
|
|
|
@hidden path */.* *.gz
|
|
error @hidden 404
|
|
|
|
@immutable path /t/* /og/* /assets/*
|
|
header @immutable Cache-Control "public, max-age=31536000, immutable"
|
|
|
|
@short not path /t/* /og/* /assets/* /k
|
|
header @short Cache-Control "public, max-age=60"
|
|
|
|
header {
|
|
Content-Security-Policy "default-src 'self'; img-src 'self' blob: data:; font-src 'self'; worker-src 'self'; frame-ancestors 'none'"
|
|
X-Content-Type-Options nosniff
|
|
Referrer-Policy strict-origin-when-cross-origin
|
|
-Server
|
|
}
|
|
|
|
handle /k {
|
|
reverse_proxy 127.0.0.1:8080
|
|
}
|
|
|
|
@methods {
|
|
not method GET HEAD
|
|
not path /k
|
|
}
|
|
respond @methods 405
|
|
|
|
file_server {
|
|
precompressed gzip
|
|
}
|
|
|
|
handle_errors {
|
|
@notfound expression {err.status_code} == 404
|
|
rewrite @notfound /404.html
|
|
file_server {
|
|
precompressed gzip
|
|
}
|
|
}
|
|
}
|