Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-pkg-server

Source of release 0.6.1

0.6.1 / deploy / Caddyfile

pkg.luciaos.com {
	header {
		Strict-Transport-Security "max-age=31536000; includeSubDomains"
		X-Content-Type-Options "nosniff"
		X-Frame-Options "DENY"
		Referrer-Policy "no-referrer"
		-Server
	}

	# Accounts, Git and health go to the registry. Nothing here is cached.
	@registry path /git/* /v1/* /health
	handle @registry {
		request_body {
			max_size 65MiB
		}
		header Cache-Control "no-store"
		reverse_proxy 127.0.0.1:9420 {
			header_up Host 127.0.0.1:9420
			transport http {
				dial_timeout 5s
				response_header_timeout 5m
			}
		}
	}

	# Everything else is the public, anonymous registry: static files the
	# registry wrote when a version tag was pushed. Releases never change.
	handle {
		root * /var/lib/luce-pkg-site
		# Pages carry package-supplied README text: no inline script, no foreign code.
		header Content-Security-Policy "default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' https:; base-uri 'none'; form-action 'none'; frame-ancestors 'none'"
		# Caddy would guess a Java type for .pack and none for the listings.
		@pack path *.pack
		header @pack Content-Type "application/octet-stream"
		@text path /index */versions *.prisma
		header @text Content-Type "text/plain; charset=utf-8"
		@release path_regexp (\.(pack|prisma)$|/raw/)
		header @release Cache-Control "public, max-age=31536000, immutable"
		@listing not path_regexp (\.(pack|prisma)$|/raw/)
		header @listing Cache-Control "public, max-age=60"
		file_server
	}

	log {
		output file /var/log/caddy/luce-pkg-server.log {
			roll_size 20MiB
			roll_keep 8
			roll_keep_for 2160h
		}
		format json
	}
}