diff --git a/.env.example b/.env.example index b9ee55d3..c1733ba8 100644 --- a/.env.example +++ b/.env.example @@ -84,6 +84,23 @@ JMAP_SERVER_URL=https://your-jmap-server.com # volume there (see docker-compose.yml). # ADMIN_DATA_DIR=./data/admin +# ============================================================================= +# Anonymous Telemetry +# ============================================================================= + +# Anonymous instance telemetry is enabled by default. Heartbeats contain no PII: +# version, platform, bucketed account counts, and feature toggles only. See +# https://bulwarkmail.org/docs/legal/privacy/telemetry for the full schema. +# +# Disable telemetry entirely (overrides the admin UI): +# BULWARK_TELEMETRY=off + +# Directory for telemetry state: instance id, consent, login HMACs +# (default: ./data/telemetry). For Docker, the default resolves to +# /app/data/telemetry - mount a persistent volume there (see docker-compose.yml) +# so the instance id and consent choice survive upgrades. +# TELEMETRY_DATA_DIR=./data/telemetry + # ============================================================================= # Server Listen Address # ============================================================================= diff --git a/Dockerfile b/Dockerfile index 9f5a49cf..9fec013f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,7 @@ RUN apk upgrade --no-cache && \ COPY --from=builder /app/public ./public COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static -RUN mkdir -p /app/data/settings /app/data/admin && chown -R nextjs:nodejs /app/data +RUN mkdir -p /app/data/settings /app/data/admin /app/data/telemetry && chown -R nextjs:nodejs /app/data USER nextjs EXPOSE 3000 ENV PORT=3000 diff --git a/docker-compose.yml b/docker-compose.yml index c77bb9aa..ddf1a798 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,6 +13,9 @@ services: - bulwark-settings:/app/data/settings # Admin dashboard state: config, password hash, plugins, audit logs (ADMIN_DATA_DIR). - bulwark-admin:/app/data/admin + # Anonymous telemetry: instance id, consent state, login HMACs (TELEMETRY_DATA_DIR). + # Persisting this preserves the admin's consent choice and stable instance id across upgrades. + - bulwark-telemetry:/app/data/telemetry healthcheck: test: [ @@ -32,3 +35,4 @@ services: volumes: bulwark-settings: bulwark-admin: + bulwark-telemetry: