liwan

by HelmForge

Helm chartv1.2.9App 1.8.2Apache-2.0Verified publisher

Liwan ultra-lightweight privacy-first web analytics with embedded DuckDB

About this chart

Liwan Helm Chart

Deploy Liwan on Kubernetes with the official ghcr.io/explodingcamera/liwan:1.8.2 image.

Liwan is a lightweight, privacy-focused web analytics application. It runs as a single Rust service and stores analytics data in embedded DuckDB under /data.

Features

  • Official upstream image pinned by tag
  • Single-instance topology aligned with embedded DuckDB
  • Persistent /data volume for analytics and runtime assets
  • Recreate rollout strategy to avoid overlapping DuckDB writers
  • Public URL wiring through LIWAN_BASE_URL
  • Ingress and Gateway API exposure options
  • Dual-stack Service support
  • Opt-in ingress NetworkPolicy with explicit peer support
  • Non-root security context with token automount disabled
  • Extra manifests, volumes, mounts, labels, and annotations for platform integration

Install

helm repo add helmforge https://repo.helmforge.dev
helm repo update
helm install liwan helmforge/liwan -f values.yaml

OCI registry:

helm install liwan oci://ghcr.io/helmforgedev/helm/liwan -f values.yaml

Production Example

liwan:
  baseUrl: https://analytics.example.com

persistence:
  enabled: true
  size: 5Gi

resources:
  requests:
    cpu: 25m
    memory: 64Mi
  limits:
    cpu: 250m
    memory: 256Mi

ingress:
  enabled: true
  ingressClassName: traefik
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
  hosts:
    - host: analytics.example.com
      paths:
        - path: /
          pathType: Prefix
  tls:
    - secretName: liwan-tls
      hosts:
        - analytics.example.com

Architecture

The chart renders one Deployment, one Service, and a PVC by default. Liwan listens on container port 9042; the Service exposes port 80.

The Deployment uses strategy.type: Recreate because the application stores data in embedded DuckDB. A rolling update could briefly run two writers against the same data volume, so the chart prefers a short outage during upgrades over a risky overlapping write window.

Set liwan.baseUrl to the public URL used by browsers and tracking scripts:

liwan:
  baseUrl: https://analytics.example.com

Tracking Script

After installing Liwan, create a site in the UI and use the generated tracking snippet. A typical snippet looks like:

<script defer src="https://analytics.example.com/script.js" data-site-name="my-site"></script>

Keep liwan.baseUrl, Ingress hostnames, Gateway API hostnames, and TLS hosts aligned so generated URLs match the public endpoint.

Examples

  • Simple internal deployment
  • Ingress with TLS
  • Gateway API
  • Dual-stack Service

Key Values

KeyDefaultDescription
image.repositoryghcr.io/explodingcamera/liwanLiwan image repository.
image.tag"1.8.2"Liwan image tag.
liwan.port9042Application HTTP port.
liwan.baseUrl""Public base URL for UI and tracking scripts.
liwan.extraEnv[]Extra environment variables for advanced upstream settings.
persistence.enabledtruePersist /data.
persistence.size2GiPVC size.
service.port80Kubernetes Service port.
service.ipFamilyPolicynullOptional Service IP family policy.
service.ipFamilies[]Optional ordered IP families.
networkPolicy.enabledfalseEnable ingress isolation for the Liwan pod.
networkPolicy.ingressFrom[]Allowed peers; empty permits same-namespace pods.
ingress.enabledfalseRender an Ingress.
gatewayAPI.enabledfalseRender a Gateway API HTTPRoute.
serviceAccount.automountServiceAccountTokenfalseMount a Kubernetes API token into the pod.
extraManifests[]Additional Kubernetes resources to render with the release.

Upgrade to 1.8

Liwan 1.8 retains the secure proxy contract introduced in 1.7: only loopback proxies and X-Forwarded-For are trusted by default. Behind an Ingress or Gateway, configure the actual proxy IPs or CIDRs through liwan.extraEnv; otherwise analytics records the connecting proxy address. For example, set LIWAN_TRUSTED_PROXIES to 10.42.0.0/16 only when that range belongs to your trusted ingress proxies. Multiple entries are comma-separated. Set LIWAN_TRUSTED_HEADERS when your proxy uses a different header. Do not trust arbitrary client-controlled headers or use the unrestricted * proxy setting. The removed LIWAN_USE_FORWARD_HEADERS setting now fails chart validation with a migration message.

Review the upstream 1.8 release before upgrading. Back up the persistent data directory before the rollout and keep exactly one writer during recovery.

Network isolation

NetworkPolicy is disabled by default so upgrades preserve established ingress paths. Enable it only after identifying the namespace and Pod selectors used by your Ingress or Gateway controller:

networkPolicy:
  enabled: true
  ingressFrom:
    - namespaceSelector:
        matchLabels:
          kubernetes.io/metadata.name: ingress-system
      podSelector:
        matchLabels:
          app.kubernetes.io/name: ingress-controller

An empty ingressFrom permits same-namespace pods. Enforcement requires a CNI that implements Kubernetes NetworkPolicy. Set podSelector labels to match the actual edge controller. NetworkPolicies are additive, so inspect every policy selecting the Liwan Pod before relying on this policy for isolation.

Operations

Check rollout:

kubectl rollout status deployment/liwan-liwan
kubectl get deployment,svc,pvc -l app.kubernetes.io/name=liwan,app.kubernetes.io/instance=liwan

Port-forward for local access:

kubectl port-forward svc/liwan-liwan 9042:80

Back up the PVC mounted at /data. For consistent snapshots, pause writes or scale the Deployment to zero before taking a storage-level snapshot.

Security

Default security posture:

  • ServiceAccount token automount disabled
  • non-root UID/GID 1000
  • fsGroup: 1000
  • fsGroupChangePolicy: OnRootMismatch
  • seccompProfile.type: RuntimeDefault
  • allowPrivilegeEscalation: false
  • capabilities.drop: [ALL]

Resource requests and limits are intentionally user-defined because Liwan traffic profiles vary by site. Set them for production to satisfy cluster policy and capacity planning.

Troubleshooting

  • If the Pod is pending, confirm the PVC is bound and the requested StorageClass exists.
  • If tracking records the proxy address, configure only the actual proxy CIDRs in LIWAN_TRUSTED_PROXIES and verify the forwarded header name.
  • If NetworkPolicy blocks traffic, compare the edge Pod and namespace labels with networkPolicy.ingressFrom before widening access.
  • If data appears missing, verify the mounted claim and never start a second writer against the previous DuckDB directory.

Security Scan: liwan

FrameworkScore
Overall84.85%
MITRE100.00%
NSA80.00%
SOC280.00%

Security posture acceptable. Remaining findings are resource limits, network policy, and immutable root filesystem, which are environment-specific choices for this chart.

Documentation

Deploy liwan with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has liwan on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartliwan is pinned at v1.2.9 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply