Skip to content

Commit c66ef4c

Browse files
committed
Sanitize OPERATOR_GUIDE + make stratum URL env-driven
Removes a live admin password + hardcoded host address that were committed to the earlier OPERATOR_GUIDE commit. The leaked password has already been rotated on the deployment box. Changes: - OPERATOR_GUIDE.md: password replaced with a pointer to the box's /root/simplepool-admin-cred.txt; the specific pool host / SSH key replaced with <pool-host> / <ssh-key> placeholders. A note at the top warns to keep real values in a gitignored file only. - dashboard/views/index.ejs: 'Connect a miner' now renders whatever PUBLIC_STRATUM_URL says instead of a hardcoded address. Unset falls back to a 'stratum+tcp://<pool-host>:3334' placeholder. - dashboard/server.js: reads PUBLIC_STRATUM_URL from env and passes it to the index view. - deploy/systemd/simplepool-dashboard.service: documents the new env var alongside the existing ones.
1 parent 17b6d23 commit c66ef4c

4 files changed

Lines changed: 30 additions & 13 deletions

File tree

OPERATOR_GUIDE.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,26 @@ background on why the design looks like this).
88

99
## Quick reference
1010

11+
Substitute your own pool's public IP/hostname for `<pool-host>` and your
12+
SSH key file for `<ssh-key>` below. On the deployment I built alongside
13+
this doc, the real values are stashed in a gitignored `FORKNET_CHEATSHEET.md`
14+
at the repo root — do NOT paste real hosts / passwords into anything
15+
tracked by git.
16+
1117
| what | where | credentials |
1218
| --- | --- | --- |
13-
| Public dashboard | http://45.33.100.24:8081/ | none |
14-
| **Admin dashboard** | **http://45.33.100.24:8081/admin** | **`admin` / `4DqSK1d6jkefposLEw5DEP5luPT`** |
15-
| Admin JSON API | http://45.33.100.24:8081/api/admin/summary | same basic auth |
16-
| Stratum (miner endpoint) | `stratum+tcp://45.33.100.24:3334` | username = Thunder base58 address |
17-
| SSH | `root@45.33.100.24` | `~/.ssh/id_epitetus` |
18-
19-
The admin password is also stashed at `/root/simplepool-admin-cred.txt`
20-
on the box (root-only). To rotate, edit
19+
| Public dashboard | `http://<pool-host>:8081/` | none |
20+
| **Admin dashboard** | `http://<pool-host>:8081/admin` | **`admin` / `<see /root/simplepool-admin-cred.txt on the box>`** |
21+
| Admin JSON API | `http://<pool-host>:8081/api/admin/summary` | same basic auth |
22+
| Stratum (miner endpoint) | `stratum+tcp://<pool-host>:3334` | username = Thunder base58 address |
23+
| SSH | `root@<pool-host>` | `<ssh-key>` |
24+
25+
The admin password is stashed at `/root/simplepool-admin-cred.txt` on the
26+
box (root-only). To rotate, edit
2127
`/etc/systemd/system/simplepool-dashboard.service.d/pps-thunder.conf`
22-
and `systemctl daemon-reload && systemctl restart simplepool-dashboard`.
28+
and `systemctl daemon-reload && systemctl restart simplepool-dashboard`
29+
— there's a scripted version in [Rotating the admin
30+
password](#rotating-the-admin-password) below.
2331

2432
---
2533

@@ -114,7 +122,7 @@ reconciliation.
114122
**Currently manual — no admin button yet.** The runbook:
115123

116124
```sh
117-
ssh -i ~/.ssh/id_epitetus root@45.33.100.24
125+
ssh -i <ssh-key> root@<pool-host>
118126

119127
# 1. Get a Thunder-owned deposit address (formatted for the mainchain wallet)
120128
TCLI=/home/forknet/forknet-software/thunder-rust/target/debug/thunder_app_cli
@@ -214,7 +222,7 @@ finalize crashed" without Thunder-side mempool/chain lookup.
214222
Nothing on the pool side. The miner points their ASIC firmware at:
215223

216224
```
217-
stratum+tcp://45.33.100.24:3334
225+
stratum+tcp://<pool-host>:3334
218226
username: <their-Thunder-address>[.<rig_label>]
219227
password: (anything)
220228
```
@@ -239,7 +247,7 @@ view.
239247
## Rotating the admin password
240248

241249
```sh
242-
ssh -i ~/.ssh/id_epitetus root@45.33.100.24
250+
ssh -i <ssh-key> root@<pool-host>
243251
NEW_PASS=$(openssl rand -base64 21 | tr -d '=+/')
244252
sed -i "s/^Environment=ADMIN_PASSWORD=.*/Environment=ADMIN_PASSWORD=$NEW_PASS/" \
245253
/etc/systemd/system/simplepool-dashboard.service.d/pps-thunder.conf

dashboard/server.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ app.use('/static', express.static(path.join(__dirname, 'public'), { maxAge: '1h'
2323

2424
const db = openDb(path.resolve(__dirname, DB_PATH));
2525

26+
/* Shown on the public "Connect a miner" card. Env-driven so the shipped
27+
* template doesn't hardcode any particular deployment's host. */
28+
const PUBLIC_STRATUM_URL = process.env.PUBLIC_STRATUM_URL || 'stratum+tcp://<pool-host>:3334';
29+
2630
app.get('/', (req, res) => {
2731
const ov = stats.overview(db);
2832
const lb = stats.leaderboard(db);
@@ -31,6 +35,7 @@ app.get('/', (req, res) => {
3135
const node = stats.nodeStatus(db);
3236
res.render('index', {
3337
ov, lb, lbAddr, blocks, node,
38+
stratumUrl: PUBLIC_STRATUM_URL,
3439
fmtHashrate: stats.fmtHashrate,
3540
fmtBtc: stats.fmtBtc,
3641
});

dashboard/views/index.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const ago = (t) => {
6363
</p>
6464

6565
<h3 style="margin-top:1em;margin-bottom:0.25em">Connect a miner</h3>
66-
<pre class="mono small" style="margin:0;padding:0.5em;background:#0002;border-radius:4px;overflow-x:auto">stratum+tcp://45.33.100.24:3334
66+
<pre class="mono small" style="margin:0;padding:0.5em;background:#0002;border-radius:4px;overflow-x:auto"><%= stratumUrl %>
6767
username: &lt;your-Thunder-address&gt;[.&lt;rig_label&gt;]
6868
password: (ignored — any value)</pre>
6969
<p class="muted small" style="margin-top:0.5em">

deploy/systemd/simplepool-dashboard.service

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ Group=@USER@
1111
WorkingDirectory=@ROOT@/dashboard
1212
Environment=PORT=8081
1313
Environment=PROXY_DB_PATH=@ROOT@/data/shares.db
14+
# Rendered on the public "Connect a miner" card. Set to the actual
15+
# host miners should point their ASIC at. Leave unset to show
16+
# 'stratum+tcp://<pool-host>:3334' as a placeholder.
17+
# Environment=PUBLIC_STRATUM_URL=stratum+tcp://pool.example.com:3334
1418
# --- PPS admin panel — /admin route ---
1519
# When ADMIN_USER + ADMIN_PASSWORD are both set, /admin serves the pool
1620
# operator view (reserve balance, ledger totals, per-worker owed,

0 commit comments

Comments
 (0)