mirror of
https://github.com/narrrl/narl-workspace.git
synced 2026-11-03 16:41:27 +01:00
Add an in-process SFTP server (russh) backed directly by the nodes table, so a space can be edited from nvim or synced with sshfs without a separate filesystem mirror. Access is authenticated by public key against a new ssh_keys table, managed via :sshkey in the app; the feature stays off until WORKSPACE_SFTP_BIND is set.
14 lines
626 B
SQL
14 lines
626 B
SQL
-- Public keys allowed to mount the workspace over SFTP. A single-user
|
|
-- application still wants more than one key: one per machine that mounts it,
|
|
-- so losing a laptop means revoking one row rather than a shared secret.
|
|
CREATE TABLE ssh_keys (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
name TEXT NOT NULL,
|
|
-- `ssh-ed25519 AAAA...`, comment stripped: the comment is not part of the
|
|
-- key and would otherwise make the same key look different twice.
|
|
public_key TEXT NOT NULL UNIQUE,
|
|
fingerprint TEXT NOT NULL UNIQUE,
|
|
created_at INTEGER NOT NULL,
|
|
last_used_at INTEGER
|
|
);
|