Installation
Activation
How Row-Template becomes the page your subscribers see on 3X-UI, PasarGuard and Rebecca — what changes on each panel, doing it automatically or by hand, and confirming it worked.
Installing Row-Template puts the page on disk. Activation tells the panel to serve it. What that means depends on the panel, and on each one Row-Template changes as little as it can:
| Panel | What activation changes | Automatic when | Restart |
|---|---|---|---|
| 3X-UI | One setting, subThemeDir |
sqlite3 is installed and the panel database is found |
Yes, briefly |
| PasarGuard | The page placed in PasarGuard’s templates directory, and one marked block in /opt/pasarguard/.env |
Always | Once, only if the panel is running |
| Rebecca | The page placed in Rebecca’s templates directory, and two fields of its subscription settings | Rebecca uses its default SQLite database and sqlite3 is installed |
Never |
The panel then serves the page to browsers that open a subscription link, filling in each subscriber’s own data. VPN apps that fetch the same link keep receiving normal subscription content.
On PasarGuard and Rebecca, activation is a transaction: the panel’s settings are snapshotted (under backups.v2/ in the install directory), changed and verified, and — if any step fails — restored exactly from the snapshot, and the restore is confirmed by reading the settings back.
3X-UI
The one setting is the subscription theme directory, stored as subThemeDir, set to:
/etc/3x-ui/sub_templates/row-template
3X-UI then serves sub.html from that directory.
Automatic activation
When sqlite3 is installed and the panel database is found (see Requirements), the installer can set subThemeDir itself. It:
- stops the
x-uiservice if it is running, so the panel cannot write an old value back over the change; - writes
subThemeDirin the panel database — nothing else; - starts the service again, if it was running;
- reads the value back and only reports success if it matches.
On an interactive install it shows the current value and asks first: Make Row-Template the active 3X-UI subscription theme now? [Y/n]. An unattended install does it without asking. Your panel is unavailable for the few seconds between stop and start.
If any step fails, the installer makes sure the service is running again and prints the manual step instead.
Manual activation
Without sqlite3 — or if you prefer to do it yourself:
Open the subscription settings
In the 3X-UI web panel, open Panel Settings → Subscription.
Set the Sub Theme Directory
Enter exactly this absolute path in Sub Theme Directory — no trailing slash, no spaces:
/etc/3x-ui/sub_templates/row-templateSave
Save the settings, then restart the panel so it picks up the new directory — from the panel itself, or with systemctl restart x-ui.
PasarGuard
Always automatic. The page is placed at:
/var/lib/pasarguard/templates/row-template/index.html
— or inside your own CUSTOM_TEMPLATES_DIRECTORY, if you set one. For a Docker install that directory must be inside /var/lib/pasarguard, the folder the container shares with the host; any other directory is refused before anything changes. Then this block is appended to /opt/pasarguard/.env:
# >>> row-template (managed by Row-Template; do not edit) nl=0 >>>
CUSTOM_TEMPLATES_DIRECTORY = "/var/lib/pasarguard/templates"
SUBSCRIPTION_PAGE_TEMPLATE = "row-template/index.html"
# <<< row-template <<<
The last assignment of a key in .env wins, so none of your own lines is edited. PasarGuard reads .env only at start-up, so a running panel is restarted once (a stopped panel is not started). .env also holds your admin password, JWT secret and database URL: it is read only for the two page keys, never printed, and never copied into a backup.
What still takes precedence: an admin with their own subscription template, and the panel’s disable subscription template setting. Both are yours to change; row-template verify reports them.
Rebecca
Row-Template supports Rebecca 1.x, the Go edition, from Rebecca’s binary install. The 0.0.x Docker image is refused before anything changes — see Requirements.
The page is placed at:
/var/lib/rebecca/templates/row-template/index.html
— or inside your own custom templates directory, if Rebecca already has one. Rebecca’s subscription settings are then set to select it. Rebecca reads them on every request, so nothing is restarted.
- Automatic with the default SQLite database and
sqlite3installed: the page and directory fields of the newest subscription settings row are set. The directory is set only when you had none, and every value — empty,NULLor set — is restored exactly on uninstall. - Manual with MySQL/MariaDB, or without
sqlite3: the page is still placed, and the installer prints the one step. In the Rebecca dashboard open Settings → Subscription → Templates and set:
Subscription page template: row-template/index.html
Custom templates directory: /var/lib/rebecca/templates
If a custom templates directory is already set, keep it and copy /var/lib/rebecca/templates/row-template/ into it instead. No database password is ever asked for, read or printed.
What still takes precedence: an admin’s own subscription template settings. row-template verify reports how many admins have one.
Activating later
The interactive manager can check and apply activation at any time: run row-template, then choose 5 — Activate / Re-apply theme. It shows the current state, asks before changing anything, and runs the live checks afterwards. On PasarGuard and Rebecca it regenerates the page first, so what is activated is exactly what verify checks.
Confirm it works
Open any client’s subscription link in a browser. You should see the Row-Template page, not the panel’s built-in one. Then run:
row-template verify
| Line | Meaning |
|---|---|
ok Panel subThemeDir points at Row-Template. |
Activation is in place. |
warn panel subThemeDir is empty; set it to … |
Not activated yet — use one of the methods above. |
warn panel subThemeDir does not point at Row-Template. |
The panel serves another theme directory. |
ok Live render check: a browser receives Row-Template. |
A real request returned the page. |
warn live render check: the panel served its built-in page. |
The setting is not active yet — restart the panel, or check the path. |
ok VPN-client check: normal subscription content is served. |
VPN apps are unaffected. |
The subThemeDir and live checks need sqlite3 to find a subscription to test with; without it they are skipped, not failed.
| Line | Meaning |
|---|---|
ok PasarGuard selects the Row-Template page, and the placed page is current. |
.env selects the page, and the placed copy is the one just generated. |
ok Live check: the running PasarGuard uses the Row-Template page. |
The running container reads the setting and can see the page (Docker install). |
warn the running PasarGuard does not use the Row-Template page yet; restart the panel. |
Restart PasarGuard (pasarguard restart). |
warn PasarGuard does not select the Row-Template page; activate it from the manager. |
Not activated yet. |
warn panel pasarguard: … admin(s) set their own subscription page … |
Those admins’ users keep their own page. |
| Line | Meaning |
|---|---|
ok Rebecca selects the Row-Template page, and the placed page is current. |
Rebecca’s settings select the page, and the placed copy is the one just generated. |
warn Rebecca does not select the Row-Template page; activate it from the manager. |
Not activated yet, or another page was chosen in the dashboard. |
Panel selection not checked (activation is manual here: …) |
MySQL/MariaDB, or no sqlite3: check Settings → Subscription → Templates yourself. |
warn panel rebecca: … admin(s) override the subscription page … |
Those admins’ users keep their own page. |
Deactivating
- 3X-UI: clear Sub Theme Directory in the panel and save: 3X-UI goes back to its built-in page, and Row-Template stays installed.
- PasarGuard: remove the
row-templateblock from/opt/pasarguard/.envand restart the panel. - Rebecca: in Settings → Subscription → Templates, set Subscription page template back to
subscription/index.html, Rebecca’s own page.
row-template uninstall does all of this for you, and on each panel changes only what Row-Template itself set. See Uninstalling.