# https://pkgs.bluerune.dev (disco project bluerune-pkgs; disco's own Caddy does TLS): the
# package repository's files from the volume the release scripts upload to, and the Arch
# snapshot mirror under /arch/, which is the bluerune-arch project (release/arch-mirror).
{
	admin off
	auto_https off
}

:8080 {
	@arch path /arch /arch/*
	handle @arch {
		reverse_proxy bluerune-arch-mirror:8000 {
			# Sent on as it comes from the archive, never held back.
			flush_interval -1
		}
	}

	handle {
		# The date a channel is held at (release/arch-date/promote.sh) is read on every
		# update, so nothing may keep an old one.
		@dates path /edge/arch-date /stable/arch-date
		header @dates Cache-Control no-cache
		header @dates Content-Type "text/plain; charset=utf-8"
		root * /srv
		file_server browse
	}
}
