# miniSCP landing page + artifact host.
# Local / internal, plain HTTP on :80 (no domain, no TLS).
# Deploy target is /srv/miniscp — see site/README.md.

:80 {
	root * /srv/miniscp
	encode zstd gzip

	# Flat artifact feed: these files are BOTH the human downloads AND (later) the
	# electrobun updater baseUrl. Publishing a build = drop its artifacts/ files here;
	# stable-named installers overwrite in place, hashed .patch files accumulate.
	handle /dl/* {
		# Incremental update patches have unique hashed names → cache forever.
		@patch path *.patch
		header @patch Cache-Control "public, max-age=31536000, immutable"

		# The updater feed must always reflect the newest published version.
		@feed path *update.json
		header @feed Cache-Control "no-cache"

		# Installers/payloads keep stable names but get overwritten each release.
		@pkg path *.dmg *.zip *.tar.zst
		header @pkg Cache-Control "public, max-age=300"

		# browse => directory listing; file_server serves range requests
		# (resumable large .dmg downloads) by default.
		file_server browse
	}

	# Static landing page + assets. No SPA index fallback: unknown paths 404.
	handle {
		file_server
	}
}
