Skip to content

armgit / kwant

Public Imported from GitHub
0

Your own team of AI bots in one self-hosted binary: spaces, every account you have, handoffs, approvals and routines. Open-source, self-hosted alternative to Grok Bot, Claude Duet and OpenAI dots. Rust + React.

Docs: sign in from another device (code + Approve/Deny); Signed-in devices list wording

Ada (kwant bot)abe4fa32d34a
diff --git a/README.md b/README.md
index 2a8aaeb9..62b2f84c 100644
--- a/README.md
+++ b/README.md
@@ -109,7 +109,7 @@ scp target/release/kwnt user@your-vps:/usr/local/bin/kwnt
ssh user@your-vps "kwnt serve --host 0.0.0.0 --port 8799"
```
-On your own computer there is nothing to sign in to. From another machine, open the one-time link `kwnt serve` prints at startup (it works once, for 15 minutes; with `KWNT_ALLOWED_ORIGINS` set it is ready to open and comes with a QR code), or make a new one with `kwnt signin-link`. The browser stays signed in for a year. To add your phone or another browser later, open **Settings → Signed-in devices → Add a phone or browser** in a signed-in browser and scan the one-time QR code (it also works once, for 15 minutes); the same list lets you sign any browser out. Prefer the token? On the server, as the user that runs kwnt, `cat ~/.kwnt/api-token` (or `$KWNT_DATA_DIR/api-token`, e.g. `sudo cat /var/lib/kwnt/api-token` with the systemd unit below) prints the token to paste (`kwnt token --raw` does the same; `./target/release/kwnt` if kwnt isn't on your PATH), and `kwnt token` prints a new one-time link like `kwnt signin-link`. Run them as the same user: as another user they fail, because that user can't read the token file (for the systemd unit use `sudo cat` as above). Each install has its own token, so one copied from your laptop won't open kwnt on the server. Or skip sign-in: `ssh -N -L 8799:127.0.0.1:8799 user@your-vps`, then open http://127.0.0.1:8799 on your computer (not with Docker, where requests always count as remote). A one-time link signs in as you, so keep it private until you've used it; the token never appears in the server's output. Put a TLS reverse proxy in front: see [browser service and VPS hosting](docs/browser-service.md).
+On your own computer there is nothing to sign in to. From another machine, open the one-time link `kwnt serve` prints at startup (it works once, for 15 minutes; with `KWNT_ALLOWED_ORIGINS` set it is ready to open and comes with a QR code), or make a new one with `kwnt signin-link`. The browser stays signed in for a year. To add your phone or another browser later, open **Settings → Signed-in devices → Add a phone or browser** in a signed-in browser and scan the one-time QR code (it also works once, for 15 minutes); the same list lets you sign those browsers out. A new browser can also choose **Sign in from another device** on the sign-in screen: it shows a code for 10 minutes, and a signed-in browser shows **New device wants access** with Approve or Deny. Approve only a code that is on a screen you are holding. Prefer the token? On the server, as the user that runs kwnt, `cat ~/.kwnt/api-token` (or `$KWNT_DATA_DIR/api-token`, e.g. `sudo cat /var/lib/kwnt/api-token` with the systemd unit below) prints the token to paste (`kwnt token --raw` does the same; `./target/release/kwnt` if kwnt isn't on your PATH), and `kwnt token` prints a new one-time link like `kwnt signin-link`. Run them as the same user: as another user they fail, because that user can't read the token file (for the systemd unit use `sudo cat` as above). Each install has its own token, so one copied from your laptop won't open kwnt on the server. Or skip sign-in: `ssh -N -L 8799:127.0.0.1:8799 user@your-vps`, then open http://127.0.0.1:8799 on your computer (not with Docker, where requests always count as remote). A one-time link signs in as you, so keep it private until you've used it; the token never appears in the server's output. Put a TLS reverse proxy in front: see [browser service and VPS hosting](docs/browser-service.md).
<details>
<summary>A systemd unit</summary>
diff --git a/site-src/docs-install.html b/site-src/docs-install.html
index a5ee9a11..08f7f9fe 100644
--- a/site-src/docs-install.html
+++ b/site-src/docs-install.html
@@ -45,7 +45,8 @@ ssh user@your-vps "kwnt serve --host 0.0.0.0 --port 8799"</code></pre>
<li>The token lives in <code>&lt;data dir&gt;/api-token</code> (mode 0600), or set <code>KWNT_API_TOKEN</code> (16+ characters).</li>
</ul>
<p><strong>Adding a phone or another browser:</strong> once you're signed in, open <strong>Settings → Signed-in devices</strong> and choose <strong>Add a phone or browser</strong>. kwant shows a one-time QR code and a link to copy. Like the server's link, it works once, for 15 minutes. Scan it with your phone's camera and the panel changes to <strong>Signed in ✓</strong>. The QR code is drawn in your browser, and the code is hidden again when it expires, when you press <strong>Hide</strong> or <strong>New code</strong>, or when you leave the page.</p>
-<p><strong>Signed-in devices</strong> lists every browser that can use kwant as you, with <strong>Sign out</strong> for each one. Signing a browser out doesn't change the API token. On your own computer, where there's nothing to sign in to, this section doesn't appear.</p>
+<p><strong>Signed-in devices</strong> lists the browsers signed in with a link, a QR code or an approval, with <strong>Sign out</strong> for each one. The browser you're using is marked <strong>This device</strong> and has no Sign out button. Browsers signed in by pasting the API token aren't listed. Signing a browser out doesn't change the API token. On your own computer, where there's nothing to sign in to, this section doesn't appear.</p>
+<p><strong>Signing in from a new device without a link:</strong> on the sign-in screen, choose <strong>Sign in from another device</strong>. The new browser shows a short code, valid for 10 minutes. Every browser that's already signed in shows <strong>New device wants access</strong> with the same code, the browser name and its IP address. Check that the code matches, then press <strong>Approve</strong>, and the new browser signs itself in. <strong>Approve only a code that's on a screen you're holding right now.</strong> An approved device gets full control of kwant as you, so if someone asks you to approve a code, press <strong>Deny</strong>.</p>
<div class="note warn"><strong>The link signs in as you.</strong> Anyone who can read the server's output, or <code>docker compose logs</code> with Docker, can use it. Keep that output private.</div>
<h3 id="systemd">As a systemd service</h3>
diff --git a/site-src/features.html b/site-src/features.html
index ff6ef3c4..d4f8a356 100644
--- a/site-src/features.html
+++ b/site-src/features.html
@@ -140,7 +140,8 @@ card_art: team
<li><h3>Three approval modes</h3><p>Ask only when risky, the default for new spaces. Or ask before running commands, or don't ask. Per space, and per bot.</p></li>
<li><h3>Changes with an Undo</h3><p>Bots create routines, channels and bots when asked, each with an Undo. Deletions ask first.</p></li>
<li><h3>Things bots can't change</h3><p>Keys and secrets, sign-ins, approval rules and computer mode stay yours.</p></li>
- <li><h3>Sign in your phone with a QR code</h3><p>Settings → Signed-in devices shows a one-time QR code for a new phone or browser, and lists every signed-in browser with Sign out.</p></li>
+ <li><h3>Sign in your phone with a QR code</h3><p>Settings → Signed-in devices shows a one-time QR code for a new phone or browser, and lists your signed-in browsers with Sign out.</p></li>
+ <li><h3>Approve a new device</h3><p>A new browser can ask for access with a 10-minute code. Your signed-in browsers show the code, the browser and its IP, with Approve or Deny.</p></li>
<li><h3>kwant's secrets are off limits</h3><p>In every mode, tool calls that name kwant's own secret files are refused.</p></li>
<li><h3>Safe imports</h3><p>Imported bots arrive with no tools and no keys. Their skills wait for approval and their routines start paused.</p></li>
</ul>
diff --git a/site/docs/install.html b/site/docs/install.html
index 3c8f78e5..d8a9f8aa 100644
--- a/site/docs/install.html
+++ b/site/docs/install.html
@@ -94,7 +94,8 @@ ssh user@your-vps "kwnt serve --host 0.0.0.0 --port 8799"</code></pre>
<li>The token lives in <code>&lt;data dir&gt;/api-token</code> (mode 0600), or set <code>KWNT_API_TOKEN</code> (16+ characters).</li>
</ul>
<p><strong>Adding a phone or another browser:</strong> once you're signed in, open <strong>Settings → Signed-in devices</strong> and choose <strong>Add a phone or browser</strong>. kwant shows a one-time QR code and a link to copy. Like the server's link, it works once, for 15 minutes. Scan it with your phone's camera and the panel changes to <strong>Signed in ✓</strong>. The QR code is drawn in your browser, and the code is hidden again when it expires, when you press <strong>Hide</strong> or <strong>New code</strong>, or when you leave the page.</p>
-<p><strong>Signed-in devices</strong> lists every browser that can use kwant as you, with <strong>Sign out</strong> for each one. Signing a browser out doesn't change the API token. On your own computer, where there's nothing to sign in to, this section doesn't appear.</p>
+<p><strong>Signed-in devices</strong> lists the browsers signed in with a link, a QR code or an approval, with <strong>Sign out</strong> for each one. The browser you're using is marked <strong>This device</strong> and has no Sign out button. Browsers signed in by pasting the API token aren't listed. Signing a browser out doesn't change the API token. On your own computer, where there's nothing to sign in to, this section doesn't appear.</p>
+<p><strong>Signing in from a new device without a link:</strong> on the sign-in screen, choose <strong>Sign in from another device</strong>. The new browser shows a short code, valid for 10 minutes. Every browser that's already signed in shows <strong>New device wants access</strong> with the same code, the browser name and its IP address. Check that the code matches, then press <strong>Approve</strong>, and the new browser signs itself in. <strong>Approve only a code that's on a screen you're holding right now.</strong> An approved device gets full control of kwant as you, so if someone asks you to approve a code, press <strong>Deny</strong>.</p>
<div class="note warn"><strong>The link signs in as you.</strong> Anyone who can read the server's output, or <code>docker compose logs</code> with Docker, can use it. Keep that output private.</div>
<h3 id="systemd">As a systemd service</h3>
diff --git a/site/features.html b/site/features.html
index 1b3e3bea..fa044228 100644
--- a/site/features.html
+++ b/site/features.html
@@ -179,7 +179,8 @@
<li><h3>Three approval modes</h3><p>Ask only when risky, the default for new spaces. Or ask before running commands, or don't ask. Per space, and per bot.</p></li>
<li><h3>Changes with an Undo</h3><p>Bots create routines, channels and bots when asked, each with an Undo. Deletions ask first.</p></li>
<li><h3>Things bots can't change</h3><p>Keys and secrets, sign-ins, approval rules and computer mode stay yours.</p></li>
- <li><h3>Sign in your phone with a QR code</h3><p>Settings → Signed-in devices shows a one-time QR code for a new phone or browser, and lists every signed-in browser with Sign out.</p></li>
+ <li><h3>Sign in your phone with a QR code</h3><p>Settings → Signed-in devices shows a one-time QR code for a new phone or browser, and lists your signed-in browsers with Sign out.</p></li>
+ <li><h3>Approve a new device</h3><p>A new browser can ask for access with a 10-minute code. Your signed-in browsers show the code, the browser and its IP, with Approve or Deny.</p></li>
<li><h3>kwant's secrets are off limits</h3><p>In every mode, tool calls that name kwant's own secret files are refused.</p></li>
<li><h3>Safe imports</h3><p>Imported bots arrive with no tools and no keys. Their skills wait for approval and their routines start paused.</p></li>
</ul>