Skip to content

Commit 5a33376

Browse files
cevhericlaude
andauthored
feat: add LibreDB Studio as a CapRover one-click app (#57)
* feat(deploy): add CapRover one-click-app template Add the source-of-truth CapRover one-click-app definition under deploy/caprover/ so LibreDB Studio can be installed on CapRover in one click. The same files feed both the official caprover/one-click-apps PR and a LibreDB-owned 3rd-party repo. - deploy/caprover/libredb-studio.yml: captainVersion 4 template. Single service on container port 3000, pinned ghcr.io image (no :latest), SQLite persistence on a persistent volume, auto-generated JWT secret and admin/user passwords echoed back in instructions.end, optional AI/LLM fields. Passes CapRover validate_apps + prettier unchanged. - deploy/caprover/libredb-studio.png: 256x256 logo from public/logo.svg. - deploy/caprover/README.md: install + maintenance docs. - docs/superpowers/specs: approved design doc. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs(caprover): record live 3rd-party repo URL and mark spec criteria done Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat(caprover): add examples to install-wizard field descriptions Enrich each one-click variable description with concrete examples and expand instructions.start into a short annotated guide (mirrors the detail level of docker-compose.example.yml), so the CapRover install screen is self-explanatory. Still passes validate_apps + prettier. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent dd613bd commit 5a33376

4 files changed

Lines changed: 293 additions & 0 deletions

File tree

deploy/caprover/README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# LibreDB Studio — CapRover One-Click App
2+
3+
This folder is the **source of truth** for deploying LibreDB Studio on
4+
[CapRover](https://caprover.com) as a one-click app.
5+
6+
| File | Purpose |
7+
|------|---------|
8+
| `libredb-studio.yml` | CapRover `captainVersion: 4` template (Docker-Compose + `caproverOneClickApp` block). |
9+
| `libredb-studio.png` | 256×256 app logo used by the CapRover one-click UI. |
10+
11+
The same two files are published to two places:
12+
13+
1. **Official repo** — submitted as a PR to
14+
[`caprover/one-click-apps`](https://github.com/caprover/one-click-apps)
15+
(`public/v4/apps/libredb-studio.yml` + `public/v4/logos/libredb-studio.png`).
16+
2. **LibreDB 3rd-party repo** — hosted by LibreDB so users can install
17+
immediately, independent of the official repo's review queue.
18+
19+
## Install (official repo, once merged)
20+
21+
CapRover dashboard → **Apps → One-Click Apps/Databases** → search **LibreDB Studio**.
22+
23+
## Install (LibreDB 3rd-party repo, available now)
24+
25+
CapRover dashboard → **Apps → One-Click Apps/Databases** → scroll to
26+
**3rd party repositories** → paste the URL below → **Connect New Repository**
27+
search **LibreDB Studio**:
28+
29+
```
30+
https://libredb.org/caprover-one-click-apps
31+
```
32+
33+
Source for that repo: <https://github.com/libredb/caprover-one-click-apps>.
34+
35+
## Install (manual template — works today, no repo needed)
36+
37+
CapRover dashboard → **Apps → One-Click Apps/Databases** → select
38+
**`>> TEMPLATE <<`** at the bottom of the dropdown → paste the contents of
39+
`libredb-studio.yml`**Next**.
40+
41+
## What the template does
42+
43+
- Runs `ghcr.io/libredb/libredb-studio` (pinned version, never `:latest`) on
44+
container HTTP port `3000`.
45+
- Generates a strong `JWT_SECRET` and admin/user passwords automatically and
46+
echoes the login credentials on the final install screen.
47+
- Persists saved connections & settings with **SQLite** on a CapRover
48+
persistent volume (`$$cap_appname-data``/app/data`), surviving restarts
49+
and redeploys.
50+
- Exposes optional AI/LLM fields (Gemini, OpenAI, Ollama, custom) — leave blank
51+
to disable.
52+
53+
## Post-install options
54+
55+
Set these under the app's **App Configs** tab to extend the deployment:
56+
57+
- **SSO / OIDC**`NEXT_PUBLIC_AUTH_PROVIDER=oidc`, `OIDC_ISSUER`,
58+
`OIDC_CLIENT_ID`, `OIDC_CLIENT_SECRET`, `OIDC_ROLE_CLAIM`, `OIDC_ADMIN_ROLES`.
59+
- **PostgreSQL storage backend** (multi-node) — `STORAGE_PROVIDER=postgres`,
60+
`STORAGE_POSTGRES_URL=...`.
61+
62+
## Maintaining this template
63+
64+
When a new Studio version is released, bump the `defaultValue` of
65+
`$$cap_version` in `libredb-studio.yml` and re-publish to both repos. Validate
66+
locally with the CapRover repo's tooling:
67+
68+
```bash
69+
npm ci && npm run validate_apps && npm run formatter
70+
```

deploy/caprover/libredb-studio.png

20.2 KB
Loading

deploy/caprover/libredb-studio.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
captainVersion: 4
2+
services:
3+
$$cap_appname:
4+
image: ghcr.io/libredb/libredb-studio:$$cap_version
5+
restart: always
6+
environment:
7+
# --- Authentication (auto-generated, shown after install) ---
8+
JWT_SECRET: $$cap_gen_random_hex(48)
9+
ADMIN_EMAIL: $$cap_admin_email
10+
ADMIN_PASSWORD: $$cap_admin_password
11+
USER_EMAIL: $$cap_user_email
12+
USER_PASSWORD: $$cap_user_password
13+
NEXT_PUBLIC_AUTH_PROVIDER: local
14+
# --- Storage: SQLite file on the persistent volume below ---
15+
STORAGE_PROVIDER: sqlite
16+
STORAGE_SQLITE_PATH: /app/data/libredb-storage.db
17+
# --- AI / LLM (optional) — leave blank to disable AI features ---
18+
LLM_PROVIDER: $$cap_llm_provider
19+
LLM_API_KEY: $$cap_llm_api_key
20+
LLM_MODEL: $$cap_llm_model
21+
LLM_API_URL: $$cap_llm_api_url
22+
volumes:
23+
- $$cap_appname-data:/app/data
24+
caproverExtra:
25+
containerHttpPort: '3000'
26+
caproverOneClickApp:
27+
variables:
28+
- id: $$cap_version
29+
label: LibreDB Studio Version
30+
defaultValue: '0.9.14'
31+
description: Image tag to deploy. Always pin a fixed version, never "latest". Example - 0.9.14. Browse all valid tags at https://github.com/libredb/libredb-studio/pkgs/container/libredb-studio
32+
validRegex: '/^([^\s^\/])+$/'
33+
- id: $$cap_admin_email
34+
label: Admin Email
35+
defaultValue: admin@libredb.org
36+
description: Login email for the ADMIN account - full access, including query execution plus maintenance/admin tools. Example - admin@yourcompany.com
37+
validRegex: '/^.+@.+\..+$/'
38+
- id: $$cap_admin_password
39+
label: Admin Password
40+
defaultValue: $$cap_gen_random_hex(16)
41+
description: Password for the admin login. A strong random one is pre-filled - keep it or type your own (min 8 chars). Shown only once on the final screen, so save it. Example - MyStr0ng-AdminPass
42+
validRegex: '/.{8,}/'
43+
- id: $$cap_user_email
44+
label: User Email
45+
defaultValue: user@libredb.org
46+
description: Login email for the STANDARD account - query execution only, no admin tools. Example - analyst@yourcompany.com
47+
validRegex: '/^.+@.+\..+$/'
48+
- id: $$cap_user_password
49+
label: User Password
50+
defaultValue: $$cap_gen_random_hex(16)
51+
description: Password for the standard login. A strong random one is pre-filled - keep it or type your own (min 8 chars). Shown only once on the final screen. Example - An0ther-StrongPass
52+
validRegex: '/.{8,}/'
53+
- id: $$cap_llm_provider
54+
label: AI Provider (optional)
55+
defaultValue: ''
56+
description: OPTIONAL - turns on AI query help (natural-language to SQL, explain, fix). One of - gemini | openai | ollama | custom. Leave blank to keep AI off. Example - gemini
57+
- id: $$cap_llm_api_key
58+
label: AI API Key (optional)
59+
defaultValue: ''
60+
description: OPTIONAL - API key for the chosen provider. Needed for gemini/openai, not for a local ollama. Examples - Gemini AIza... , OpenAI sk-... . Leave blank if AI is off.
61+
- id: $$cap_llm_model
62+
label: AI Model (optional)
63+
defaultValue: ''
64+
description: OPTIONAL - model name for the provider. Leave blank to use the provider default. Examples - gemini-2.5-flash , gpt-4o-mini , llama3.1
65+
- id: $$cap_llm_api_url
66+
label: AI API URL (optional)
67+
defaultValue: ''
68+
description: OPTIONAL - base URL for ollama/custom providers only (not for gemini/openai). Example for an Ollama app on this same CapRover - http://srv-captain--ollama:11434/v1
69+
instructions:
70+
start: |-
71+
LibreDB Studio is a modern, open-source, web-based SQL IDE for the cloud era.
72+
Query PostgreSQL, MySQL, SQLite, Oracle, SQL Server, MongoDB and Redis from
73+
your browser - with AI-powered query assistance, an ERD viewer, schema diff
74+
and more.
75+
76+
What you can set below (defaults are sensible - you can usually just click Deploy):
77+
- Version: the image tag to deploy (a tested fixed version by default).
78+
- Admin login: full access, including maintenance/admin tools.
79+
- User login: query execution only.
80+
Both passwords are pre-generated; change them if you like. They are
81+
shown only once on the final screen - save them then.
82+
- AI (optional): fill these to enable query assistance with Gemini,
83+
OpenAI, Ollama or a custom provider. Leave blank to keep AI disabled.
84+
85+
Your saved connections and settings are persisted with SQLite on a CapRover
86+
volume, so they survive restarts and redeploys.
87+
88+
More details and docs: https://github.com/libredb/libredb-studio
89+
end: |-
90+
LibreDB Studio has been deployed! 🚀
91+
92+
Open it at: http://$$cap_appname.$$cap_root_domain
93+
(Enable HTTPS from the CapRover dashboard for production use.)
94+
95+
Log in with the admin account:
96+
Email: $$cap_admin_email
97+
Password: $$cap_admin_password
98+
99+
A standard query-only user was also created:
100+
Email: $$cap_user_email
101+
Password: $$cap_user_password
102+
103+
⚠️ Save these credentials now — the passwords are not shown again.
104+
105+
Your data (saved connections & settings) is stored in SQLite on the
106+
persistent volume "$$cap_appname-data" and survives restarts and redeploys.
107+
108+
To enable SSO (Auth0/Keycloak/Okta/Azure AD) or change AI settings later,
109+
add the OIDC_* / LLM_* environment variables under the app's
110+
"App Configs" tab. See https://github.com/libredb/libredb-studio
111+
displayName: LibreDB Studio
112+
isOfficial: false
113+
description: Open-source web-based SQL IDE. Query PostgreSQL, MySQL, SQLite, Oracle, SQL Server, MongoDB & Redis from your browser, with AI-powered query assistance.
114+
documentation: Image and docs - https://github.com/libredb/libredb-studio . Uses ghcr.io/libredb/libredb-studio. Deploys with SQLite persistence; supports OIDC SSO and multiple AI providers via extra env vars.
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# LibreDB Studio → CapRover One-Click App — Design
2+
3+
**Date:** 2026-06-14
4+
**Status:** Approved
5+
**Branch:** `feat/caprover-one-click-app`
6+
7+
## Goal
8+
9+
Make LibreDB Studio installable on [CapRover](https://caprover.com) in one click,
10+
as the first step of a broader strategy to integrate Studio into cloud
11+
providers / PaaS platforms. CapRover is the beachhead because it has a simple,
12+
well-documented one-click-app format and a self-serve 3rd-party repository
13+
mechanism.
14+
15+
## Strategy (decided)
16+
17+
**Official PR + LibreDB-owned 3rd-party repo.** CapRover's official repo
18+
(`caprover/one-click-apps`) gatekeeps on popularity ("apps with thousands of
19+
stars"), so the official PR may stall regardless of quality. To guarantee
20+
availability we ship two channels:
21+
22+
1. **Official PR** to `caprover/one-click-apps` — maximum discoverability.
23+
2. **LibreDB 3rd-party repo** (GitHub Pages) — instant availability, no
24+
dependency on the upstream merge decision.
25+
26+
Both channels are fed from a single **source of truth** committed to the Studio
27+
repo at `deploy/caprover/`.
28+
29+
## Deliverables
30+
31+
### A. `libredb-studio` repo
32+
- **GitHub Issue** (English) tracking the integration with rationale and
33+
acceptance criteria.
34+
- **Feature branch** `feat/caprover-one-click-app`.
35+
- **`deploy/caprover/`** folder — source of truth:
36+
- `libredb-studio.yml` — the CapRover template.
37+
- `libredb-studio.png` — 256×256 logo (rendered from `public/logo.svg`).
38+
- `README.md` — install + maintenance docs.
39+
- **Spec doc** (this file).
40+
41+
### B. `caprover/one-click-apps` (upstream) — the PR
42+
- Fork → branch → add `public/v4/apps/libredb-studio.yml` and
43+
`public/v4/logos/libredb-studio.png` → run `validate_apps` + `formatter`
44+
open PR using their template (self-check boxes ticked).
45+
46+
### C. LibreDB 3rd-party CapRover repo
47+
- A repo structured like `caprover/one-click-apps`, published via GitHub Pages,
48+
so users can add it under **3rd party repositories** in CapRover.
49+
- *Note:* creating a brand-new repo + enabling GitHub Pages may require manual
50+
steps / org permissions; the spec documents the structure and the publish
51+
flow, and flags what needs a human hand.
52+
53+
## The template (`libredb-studio.yml`)
54+
55+
`captainVersion: 4`, a single service named `$$cap_appname`:
56+
57+
- **Image:** `ghcr.io/libredb/libredb-studio:$$cap_version` — pinned, default
58+
`0.9.14`. Never `:latest` (CapRover forbids it; tag is enforced by their
59+
validator/PR checklist).
60+
- **Port:** `caproverExtra.containerHttpPort: '3000'`.
61+
- **Persistence:** named volume `$$cap_appname-data``/app/data`, with
62+
`STORAGE_PROVIDER=sqlite` and `STORAGE_SQLITE_PATH=/app/data/libredb-storage.db`.
63+
- **Auth (auto-generated):**
64+
- `JWT_SECRET: $$cap_gen_random_hex(48)` (≥32 chars guaranteed).
65+
- `ADMIN_PASSWORD` / `USER_PASSWORD` are **variables** defaulting to
66+
`$$cap_gen_random_hex(16)` so the generated values can be echoed back in
67+
`instructions.end`. (Inlining the generator in `environment` would produce a
68+
different value than any shown to the user — hence variables.)
69+
- `ADMIN_EMAIL` / `USER_EMAIL` are variables with sensible defaults so the
70+
end screen shows the exact login email.
71+
- **AI/LLM (optional):** `$$cap_llm_provider/api_key/model/api_url` variables,
72+
empty by default — power users fill them, everyone else ignores.
73+
- **`instructions.end`** echoes the login email + generated passwords and warns
74+
the user to save them, then explains where data lives and how to enable
75+
OIDC/Postgres later.
76+
77+
### Decisions & rationale
78+
79+
| Decision | Why |
80+
|----------|-----|
81+
| SQLite + persistent volume as default | Single container, survives restarts, no extra DB password/service. Simplest reliable persistence for a one-click DB tool. (localStorage loses data; bundled Postgres is heavier and more failure-prone on first install.) |
82+
| Auto-generate + echo credentials | Zero-effort install while still secure; user can log in immediately from the final screen. |
83+
| AI optional & blank | Studio works fully without AI; avoids forcing API keys at install. |
84+
| OIDC/Postgres documented post-install, not in wizard | Keeps the install wizard short; advanced setups are env-var additions in App Configs. |
85+
| `isOfficial: false` | Images are LibreDB's own (not a universally-recognized official source); honest per the repo's guidance. |
86+
| Source of truth in `deploy/caprover/` | One place to maintain; both the upstream PR and the 3rd-party repo copy from it. |
87+
88+
## Validation
89+
90+
The template passes CapRover's own tooling with no changes:
91+
92+
```bash
93+
npm ci && npm run validate_apps # "Validated libredb-studio"
94+
npm run formatter # "All matched files use Prettier code style!"
95+
```
96+
97+
## Acceptance criteria
98+
99+
- [x] `deploy/caprover/` committed on the feature branch (yml + png + README).
100+
- [x] Spec committed.
101+
- [x] GitHub Issue opened on `libredb/libredb-studio` (English) — [#56](https://github.com/libredb/libredb-studio/issues/56).
102+
- [x] PR opened on `caprover/one-click-apps` with passing validator + formatter — [#1303](https://github.com/caprover/one-click-apps/pull/1303).
103+
- [x] LibreDB 3rd-party repo live — [libredb/caprover-one-click-apps](https://github.com/libredb/caprover-one-click-apps), published at <https://libredb.org/caprover-one-click-apps> (verified serving `/v4/list`).
104+
105+
## Maintenance
106+
107+
On each Studio release, bump `$$cap_version` `defaultValue` and re-publish to
108+
both channels. CI in the 3rd-party repo can mirror the official repo's
109+
`validate_apps` + `formatter` + GitHub Pages build.

0 commit comments

Comments
 (0)