feat: v2.7.6 — edit users in one form, Settings → Account, display names, copy over plain HTTP
- Users page: one Edit user form (display name, email, role, active, a new or generated password, workspaces given or taken back, sign out everywhere), validated as a whole before anything is written (PATCH /api/users/:id, GET /api/users/:id); users.display_name/email added migration-safe. - Settings → Account for every signed-in user: profile, own password (the current one required, this login kept), sign out other devices (/api/me/account, /api/me/password, /api/me/sign-out-others; login cookie only, never a pane token). - Display names wherever a person is named (sidebar, workspace owner groups, Users page and audit log); owner_display_name / reader_display additive. - Users page: admins add and remove Claude/Codex pool accounts. - Folder browser: an admin with their own Linux account opens in their home; the "Server folder" tick opens the host's (never remembered). - AI Proxy: "Config 9router" beside Add profile when 9router is installed, opened on the dashboard's own host (GET /api/ai-proxies/9router). - Terminal: a tmux selection reaches the clipboard over plain HTTP too (writeClipboard's textarea fallback, focus handed back). - Chat: a file the session touched outside the workspace previews (GET /api/sessions/:id/file). - install-system: `!requiretty` only when visudo accepts it (sudo-rs on Ubuntu 25.10+ rejects the setting). - openapi.yaml regenerated; docs (API, SERVER-MODE, LANES) updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -299,6 +299,36 @@ function scratchFile(cwd, prefix) {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark a member's Claude Code as onboarded (`hasCompletedOnboarding: true` in
|
||||
* `~/.claude.json`), so a pane that brings its own credentials — a pool
|
||||
* account's `CLAUDE_CODE_OAUTH_TOKEN`, an AI Proxy — starts at the prompt
|
||||
* instead of the first-run "Select login method" screen, which a fresh home
|
||||
* shows even with the token set. Only that key — plus, for a pool login,
|
||||
* `extra` (its `oauthAccount`/`userID`, so Claude Code names the account it
|
||||
* runs as) — is added, AS the member (`write-as private`); a file that is not
|
||||
* the member's own regular file or not JSON is left alone. Best effort: false
|
||||
* when nothing was written.
|
||||
*/
|
||||
function markClaudeOnboarded(acct, extra = {}) {
|
||||
const file = path.join(acct.home, ".claude.json");
|
||||
let state = {};
|
||||
try {
|
||||
state = JSON.parse(readFileSafe(file, "utf8"));
|
||||
} catch (e) {
|
||||
if (e.code !== "ENOENT") return false;
|
||||
}
|
||||
if (!state || typeof state !== "object" || Array.isArray(state)) return false;
|
||||
const next = { ...state, ...extra, hasCompletedOnboarding: true };
|
||||
if (JSON.stringify(next) === JSON.stringify(state)) return false;
|
||||
try {
|
||||
writeAs(acct, file, "private", `${JSON.stringify(next, null, 2)}\n`);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/** A user's account by AgentHub username (S3, provisioned), or null. */
|
||||
function accountForUser(username) {
|
||||
const conf = linux.s3Enabled() ? linux.serverConf() : null;
|
||||
@@ -541,6 +571,7 @@ module.exports = {
|
||||
memberNameForUid,
|
||||
sudoArgv,
|
||||
memberPaneEnv,
|
||||
markClaudeOnboarded,
|
||||
MEMBER_PATH,
|
||||
writeFileAs,
|
||||
scratchFile,
|
||||
|
||||
Reference in New Issue
Block a user