Uname:Linux antigravity-cli 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64

Base Dir : /var/www/moonbloom

User : wp-moonbloom


403WebShell
403Webshell
Server IP : 85.155.190.233  /  Your IP : 216.73.216.103
Web Server : nginx/1.24.0
System : Linux antigravity-cli 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User : wp-moonbloom ( 1001)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /opt/moonbloom-dashboard/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/moonbloom-dashboard/README.md
# MoonBloom Analytics Dashboard

Postgres 16 + Grafana OSS + a Python collector, isolated from the existing
WordPress site on the same VPS. Grafana is reached publicly at
`https://analytics.moonbloomwalls.com`; Postgres is never exposed.

## Prerequisites

- Docker Engine + the Docker Compose plugin on the VPS.
- nginx already running on the VPS (used for the WordPress site).

## Setup

1. Copy the env template and fill in real secrets:
   ```bash
   cp .env.example .env
   # edit .env: Postgres/Grafana passwords, DATABASE_URL, GA4_SA_JSON_HOST,
   # Pinterest / Google Ads API credentials
   ```
2. Start the datastore + dashboards (this does **not** start the collector —
   see the `collect` profile below):
   ```bash
   docker compose up -d
   ```
   `postgres` and `grafana` come up. `schema.sql` is applied automatically
   the first time Postgres initializes its data volume (idempotent —
   `CREATE TABLE IF NOT EXISTS` / `CREATE OR REPLACE VIEW`, safe to re-run
   manually if ever needed).
3. Backfill historical data once the collector's code exists (later phase):
   ```bash
   docker compose run --rm collector --backfill 90
   ```
4. Daily refresh via cron (example — adjust the repo path):
   ```cron
   0 6 * * * cd /opt/moonbloom-dashboard && docker compose run --rm collector --days 3
   ```

The `collector` service is defined under the `collect` Compose profile on
purpose, so a plain `docker compose up -d` never launches it — it only runs
on demand via `docker compose run --rm collector ...`.

## Access

- **Primary:** `https://analytics.moonbloomwalls.com` — nginx reverse-proxies
  this subdomain to `127.0.0.1:3000` with TLS via certbot (set up in the
  deploy phase, not part of this compose file). Log in with Grafana's own
  auth (`GRAFANA_ADMIN_USER` / `GRAFANA_ADMIN_PASSWORD` from `.env`) — this
  is mandatory since the URL is public.
- **Fallback / debug:** an SSH tunnel remains available if the public path
  is ever down:
  ```bash
  ssh -L 3000:localhost:3000 -i ~/.ssh/id_ed25519_new -p 50022 root@85.155.190.233
  ```
  then open `http://localhost:3000`.

## Isolation from WordPress

This is a fully separate stack: its own Postgres (no host port published,
reachable only inside the stack's internal Docker network), its own named
volumes (`moonbloom-dash-pgdata`, `moonbloom-dash-grafana-data`), and its own
Docker network (`moonbloom-dash-net`). It shares only the VPS host and the
system nginx (a second server block for a different subdomain, added in the
deploy phase) — no shared database, no shared PHP/WordPress process, no
shared container.

Youez - 2016 - github.com/yon3zu
LinuXploit