# decePubClient published with the Pasture environment (its API is then https://privapub.test), served like the # production vhost (deploy/nginx in decePubClient): static files, the SPA fallback, nothing cached that must not be. # In decePubClient: dotnet publish decePubClient.csproj -c Release -p:WasmApplicationEnvironmentName=Pasture -o publish DECEPUB_SITE=${DECEPUB_SITE:-$repo/../decePubClient/publish/wwwroot} decepub_up() { [ -f "$DECEPUB_SITE/index.html" ] || { echo "no published decePub in $DECEPUB_SITE (publish it with WasmApplicationEnvironmentName=Pasture)" >&2; return 1; } mkdir -p "$here/.state" cat > "$here/.state/decepub.Caddyfile" <<'CADDY' :80 { root * /srv header { X-Content-Type-Options nosniff Referrer-Policy strict-origin-when-cross-origin X-Frame-Options SAMEORIGIN } @fresh path /index.html /appsettings.json /appsettings.Pasture.json /service-worker.js /service-worker-assets.js /build.json header @fresh Cache-Control no-cache try_files {path} /index.html file_server { precompressed br gzip } } CADDY podman run -d --replace --name pasture-decepub --network $net -v "$DECEPUB_SITE:/srv:z,ro" \ -v "$here/.state/decepub.Caddyfile:/etc/caddy/Caddyfile:z,ro" docker.io/library/caddy:2 >/dev/null podman exec pasture-caddy caddy reload --config /etc/caddy/Caddyfile >/dev/null 2>&1 || true echo "decepub: https://decepub.test:6443" }