|
| 1 | +# LibreDB Studio on Cosmos |
| 2 | + |
| 3 | +[Cosmos](https://cosmos-cloud.io) ([azukaar/Cosmos-Server](https://github.com/azukaar/Cosmos-Server)) |
| 4 | +is a self-hosted server manager and reverse proxy that bundles authentication, |
| 5 | +a built-in firewall, and an application-layer security proxy (SmartShield). It |
| 6 | +installs apps from a community "servapp" marketplace with one click. |
| 7 | + |
| 8 | +LibreDB Studio is listed in the official |
| 9 | +[Cosmos servapp marketplace](https://github.com/azukaar/cosmos-servapps-official) |
| 10 | +(merged in |
| 11 | +[azukaar/cosmos-servapps-official#218](https://github.com/azukaar/cosmos-servapps-official/pull/218)). |
| 12 | +The canonical servapp definition lives in the Cosmos marketplace repo at |
| 13 | +[`servapps/LibreDB-Studio/`](https://github.com/azukaar/cosmos-servapps-official/tree/master/servapps/LibreDB-Studio); |
| 14 | +this folder is a documentation mirror, not the source of truth. |
| 15 | + |
| 16 | +## Install |
| 17 | + |
| 18 | +From a running Cosmos instance (see the |
| 19 | +[Cosmos install docs](https://cosmos-cloud.io/doc/1%20index/) to set one up): |
| 20 | + |
| 21 | +1. **Open your Cosmos dashboard** → **Marketplace**. |
| 22 | +2. **Search** for **LibreDB Studio**. |
| 23 | +3. **Install.** Cosmos auto-generates the admin/user passwords and `JWT_SECRET`, |
| 24 | + provisions a persistent volume, and wires up a SmartShield-protected route. |
| 25 | +4. **Set the URL** for the app when prompted, then finish the install. |
| 26 | + |
| 27 | +## What the servapp does |
| 28 | + |
| 29 | +- Runs the prebuilt `ghcr.io/libredb/libredb-studio` image (pinned tag, never |
| 30 | + `:latest`) as a single container on HTTP port `3000`. |
| 31 | +- Persists saved connections & settings with **SQLite** |
| 32 | + (`STORAGE_PROVIDER=sqlite`, `STORAGE_SQLITE_PATH=/app/data/libredb-storage.db`) |
| 33 | + on a named volume mounted at `/app/data`, surviving restarts and redeploys — |
| 34 | + no external database required. |
| 35 | +- Auto-generates `ADMIN_PASSWORD`, `USER_PASSWORD`, and `JWT_SECRET` via Cosmos's |
| 36 | + `{Password}` template tokens, so no secrets are hard-coded. |
| 37 | +- Exposes the app through a Cosmos `SERVAPP` route with **SmartShield** enabled, |
| 38 | + bot blocking, and `cosmos-force-network-secured` — keeping the container off |
| 39 | + the public network except through the secured reverse proxy. |
| 40 | + |
| 41 | +## First login |
| 42 | + |
| 43 | +After install, open the app's URL and log in: |
| 44 | + |
| 45 | +- **Admin** (full access incl. maintenance tools): `admin@libredb.org` + the |
| 46 | + auto-generated `ADMIN_PASSWORD`. |
| 47 | +- **User** (query execution only): `user@libredb.org` + the auto-generated |
| 48 | + `USER_PASSWORD`. |
| 49 | + |
| 50 | +Retrieve the generated passwords from the Cosmos dashboard under the servapp's |
| 51 | +environment variables if you did not note them at install time. |
| 52 | + |
| 53 | +## Environment variables |
| 54 | + |
| 55 | +See the [main README environment table](../../README.md#environment-variables) |
| 56 | +for the full list. The servapp ships with: |
| 57 | + |
| 58 | +| Variable | Notes | |
| 59 | +|----------|-------| |
| 60 | +| `ADMIN_EMAIL` / `ADMIN_PASSWORD` | admin login (password auto-generated) | |
| 61 | +| `USER_EMAIL` / `USER_PASSWORD` | standard user login (password auto-generated) | |
| 62 | +| `JWT_SECRET` | auto-generated by Cosmos | |
| 63 | +| `STORAGE_PROVIDER` | `sqlite` (default here); `postgres` for an external backend | |
| 64 | +| `STORAGE_SQLITE_PATH` | `/app/data/libredb-storage.db` (on the persistent volume) | |
| 65 | + |
| 66 | +## Post-install options |
| 67 | + |
| 68 | +Add these variables to the servapp (Cosmos dashboard → the app → **Environment |
| 69 | +variables**) to extend the deployment: |
| 70 | + |
| 71 | +- **SSO / OIDC** — `NEXT_PUBLIC_AUTH_PROVIDER=oidc`, `OIDC_ISSUER`, |
| 72 | + `OIDC_CLIENT_ID`, `OIDC_CLIENT_SECRET`, `OIDC_ROLE_CLAIM`, `OIDC_ADMIN_ROLES`. |
| 73 | +- **PostgreSQL storage backend** — `STORAGE_PROVIDER=postgres`, |
| 74 | + `STORAGE_POSTGRES_URL=...`. |
| 75 | +- **AI** — `LLM_PROVIDER` (`gemini` | `openai` | `ollama` | `custom`), |
| 76 | + `LLM_API_KEY`, `LLM_MODEL`, `LLM_API_URL`. |
| 77 | + |
| 78 | +## Version bumps |
| 79 | + |
| 80 | +The servapp's `cosmos-compose.json` pins a specific image tag. On each release, |
| 81 | +bump the tag in the Cosmos marketplace repo's |
| 82 | +`servapps/LibreDB-Studio/cosmos-compose.json` (same manual-bump caveat as the |
| 83 | +Railway, CapRover, and Kubero Docker-image templates). The servapp sets |
| 84 | +`cosmos-auto-update`, so Cosmos keeps the pinned tag's digest fresh, but moving |
| 85 | +to a new version still requires updating the pinned tag upstream. |
| 86 | + |
| 87 | +More details and docs: https://github.com/libredb/libredb-studio |
0 commit comments