diff --git a/plausible/clickhouse/clickhouse-config.xml b/plausible/clickhouse/clickhouse-config.xml new file mode 100644 index 00000000..0dfaa703 --- /dev/null +++ b/plausible/clickhouse/clickhouse-config.xml @@ -0,0 +1,23 @@ + + + warning + true + + + + + + + + + + + + + + diff --git a/plausible/clickhouse/clickhouse-user-config.xml b/plausible/clickhouse/clickhouse-user-config.xml new file mode 100644 index 00000000..56cf1cd3 --- /dev/null +++ b/plausible/clickhouse/clickhouse-user-config.xml @@ -0,0 +1,8 @@ + + + + 0 + 0 + + + diff --git a/plausible/db-data/.gitkeep b/plausible/db-data/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/plausible/docker-compose.yml b/plausible/docker-compose.yml new file mode 100644 index 00000000..4a194f47 --- /dev/null +++ b/plausible/docker-compose.yml @@ -0,0 +1,43 @@ +services: + app_proxy: + environment: + APP_HOST: plausible_plausible_1 + APP_PORT: 8000 + + plausible_db: + # Plausible v2.1.1 was tested against PostgreSQL versions 15 and 16 + # https://github.com/plausible/analytics/blob/v2.1.1/.github/workflows/elixir.yml#L21-L32 + image: postgres:16-alpine@sha256:492898505cb45f9835acc327e98711eaa9298ed804e0bb36f29e08394229550d + restart: on-failure + user: "1000:1000" + volumes: + - ${APP_DATA_DIR}/db-data:/var/lib/postgresql/data + environment: + - POSTGRES_PASSWORD=postgres + + plausible_events_db: + image: clickhouse/clickhouse-server:24.3.3.102-alpine@sha256:f226fe41f0578968b7f68a54b902d203ff4decfddfccb97c89fe5bfc36a51b66 + restart: on-failure + user: "1000:1000" + volumes: + - ${APP_DATA_DIR}/event-data:/var/lib/clickhouse + - ${APP_DATA_DIR}/event-logs:/var/log/clickhouse-server + - ${APP_DATA_DIR}/clickhouse/clickhouse-config.xml:/etc/clickhouse-server/config.d/logging.xml:ro + - ${APP_DATA_DIR}/clickhouse/clickhouse-user-config.xml:/etc/clickhouse-server/users.d/logging.xml:ro + ulimits: + nofile: + soft: 262144 + hard: 262144 + + plausible: + image: ghcr.io/plausible/community-edition:v2.1.1@sha256:2085e7a4bafd4bb1824e5fa1131ebdbd8ca78da1b2ebdefbc887f971f24f53c9 + restart: on-failure + user: "1000:1000" + command: sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run" + depends_on: + - plausible_db + - plausible_events_db + environment: + - BASE_URL=http://${DEVICE_DOMAIN_NAME}:9092 + - SECRET_KEY_BASE=${APP_SEED} + - TOTP_VAULT_KEY=${APP_PLAUSIBLE_VAULT_KEY} diff --git a/plausible/event-data/.gitkeep b/plausible/event-data/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/plausible/event-logs/.gitkeep b/plausible/event-logs/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/plausible/exports.sh b/plausible/exports.sh new file mode 100644 index 00000000..a755aa9f --- /dev/null +++ b/plausible/exports.sh @@ -0,0 +1,2 @@ +# 32 byte long string used for encrypting TOTP secrets at rest using AES256-GCM. Must not change on app restart. +export APP_PLAUSIBLE_VAULT_KEY=$(openssl dgst -sha256 -binary <<< "$(derive_entropy "env-${app_entropy_identifier}-APP_VAULT_KEY")" | base64) \ No newline at end of file diff --git a/plausible/umbrel-app.yml b/plausible/umbrel-app.yml new file mode 100644 index 00000000..2c326087 --- /dev/null +++ b/plausible/umbrel-app.yml @@ -0,0 +1,29 @@ +manifestVersion: 1 +id: plausible +category: developer +name: Plausible Analytics +version: "2.1.1" +tagline: Easy to use and privacy-friendly Google Analytics alternative +description: >- + Plausible is intuitive, lightweight and open source web analytics. + No cookies and fully compliant with GDPR, CCPA and PECR. + + + ⚙️ You may need to expose Plausible to the web in order to use the app in its intended way with websites. + The easiest way to do this is to use the 'Cloudflare Tunnel' app from the Umbrel app store, and expose Plausible to the internet using your own domain. +releaseNotes: "" +developer: Plausible Community Edition +website: https://plausible.io/ +repo: https://github.com/plausible/community-edition/ +support: https://github.com/plausible/community-edition/issues +port: 9092 +gallery: + - 1.jpg + - 2.jpg + - 3.jpg +path: "" +defaultUsername: "" +defaultPassword: "" +dependencies: [] +submitter: ~dibref-labter +submission: https://github.com/getumbrel/umbrel-apps/pull/1371