2026-10-17 00:28:33 +02:00
|
|
|
# decePubClient published with the Pasture environment (its API is then https://privapub.test), served like the
|
2026-10-05 00:32:54 +02:00
|
|
|
# production vhost (deploy/nginx in decePubClient): static files, the SPA fallback, nothing cached that must not be.
|
2026-10-17 00:28:33 +02:00
|
|
|
# In decePubClient: dotnet publish decePubClient.csproj -c Release -p:WasmApplicationEnvironmentName=Pasture -o publish
|
|
|
|
|
DECEPUB_SITE=${DECEPUB_SITE:-$repo/../decePubClient/publish/wwwroot}
|
2026-10-05 00:32:54 +02:00
|
|
|
|
|
|
|
|
decepub_up() {
|
2026-10-17 00:28:33 +02:00
|
|
|
[ -f "$DECEPUB_SITE/index.html" ] || { echo "no published decePub in $DECEPUB_SITE (publish it with WasmApplicationEnvironmentName=Pasture)" >&2; return 1; }
|
2026-10-05 00:32:54 +02:00
|
|
|
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"
|
|
|
|
|
}
|