clay-server 2.11.0-beta.13 → 2.11.0-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/daemon.js CHANGED
@@ -152,8 +152,9 @@ var relay = createServer({
152
152
  uidGid = { uid: parseInt(passwdLine[0], 10), gid: parseInt(passwdLine[1], 10) };
153
153
  } catch (e) {}
154
154
  if (uidGid) {
155
- execSync("git init", { cwd: targetDir, uid: uidGid.uid, gid: uidGid.gid, env: { PATH: "/usr/local/bin:/usr/bin:/bin" } });
155
+ fs.chmodSync(targetDir, 0o700);
156
156
  execSync("chown -R " + linuxUser + ":" + linuxUser + " " + JSON.stringify(targetDir));
157
+ execSync("git init", { cwd: targetDir, uid: uidGid.uid, gid: uidGid.gid, env: { PATH: "/usr/local/bin:/usr/bin:/bin" } });
157
158
  } else {
158
159
  execSync("git init", { cwd: targetDir });
159
160
  }
@@ -227,9 +228,12 @@ var relay = createServer({
227
228
  callback({ ok: false, error: errMsg });
228
229
  return;
229
230
  }
230
- // chown if osUsers
231
+ // chown and restrict permissions if osUsers
231
232
  if (config.osUsers && wsUser && wsUser.linuxUser) {
232
- try { execSync("chown -R " + wsUser.linuxUser + ":" + wsUser.linuxUser + " " + JSON.stringify(targetDir)); } catch (e) {}
233
+ try {
234
+ fs.chmodSync(targetDir, 0o700);
235
+ execSync("chown -R " + wsUser.linuxUser + ":" + wsUser.linuxUser + " " + JSON.stringify(targetDir));
236
+ } catch (e) {}
233
237
  }
234
238
  // Register project
235
239
  var projectEntry = { path: targetDir, slug: slug, addedAt: Date.now() };
package/lib/os-users.js CHANGED
@@ -266,6 +266,12 @@ function provisionAllUsers(usersModule) {
266
266
  if (user.linuxUser) {
267
267
  // Already mapped, verify the Linux user still exists
268
268
  if (linuxUserExists(user.linuxUser)) {
269
+ // Ensure Claude CLI is installed for existing users
270
+ var cliPath = "/home/" + user.linuxUser + "/.local/bin/claude";
271
+ if (!fs.existsSync(cliPath)) {
272
+ console.log("[os-users] Claude CLI missing for " + user.linuxUser + ", installing...");
273
+ installClaudeCli(user.linuxUser);
274
+ }
269
275
  result.skipped.push({ id: user.id, username: user.username, linuxUser: user.linuxUser });
270
276
  continue;
271
277
  }
@@ -329,7 +335,10 @@ function deactivateLinuxUser(linuxUsername) {
329
335
  function ensureProjectsDir() {
330
336
  var dir = "/var/clay/projects";
331
337
  if (!fs.existsSync(dir)) {
332
- fs.mkdirSync(dir, { recursive: true, mode: 0o755 });
338
+ fs.mkdirSync(dir, { recursive: true, mode: 0o711 });
339
+ } else {
340
+ // Tighten permissions if directory already exists (prevent listing by other users)
341
+ try { fs.chmodSync(dir, 0o711); } catch (e) {}
333
342
  }
334
343
  }
335
344
 
package/lib/pages.js CHANGED
@@ -3,13 +3,21 @@ function pinPageHtml() {
3
3
  '<meta charset="UTF-8">' +
4
4
  '<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">' +
5
5
  '<meta name="apple-mobile-web-app-capable" content="yes">' +
6
+ '<link rel="icon" type="image/png" href="/favicon-banded.png">' +
7
+ '<link rel="apple-touch-icon" href="/apple-touch-icon.png">' +
6
8
  '<title>Clay</title>' +
7
9
  '<style>' + authPageStyles + '</style></head><body><div class="c">' +
8
- '<h1>Welcome back</h1>' +
10
+ '<h1 id="greeting"></h1>' +
9
11
  '<div class="sub">Enter your PIN to continue</div>' +
10
12
  pinBoxesHtml +
11
13
  '<div class="err" id="err"></div>' +
12
14
  '<script>' +
15
+ '(function(){' +
16
+ 'var h=document.getElementById("greeting");' +
17
+ 'var visited=localStorage.getItem("clay_visited");' +
18
+ 'if(visited){h.textContent="Welcome back"}' +
19
+ 'else{h.textContent="Welcome to Clay";localStorage.setItem("clay_visited","1")}' +
20
+ '})();' +
13
21
  pinBoxScript +
14
22
  'var err=document.getElementById("err");' +
15
23
  'function submitPin(){' +
@@ -775,7 +775,7 @@ function showTermCtxMenu(e, tab) {
775
775
  // Clear
776
776
  var clearItem = document.createElement("button");
777
777
  clearItem.className = "term-ctx-item";
778
- clearItem.innerHTML = iconHtml("trash-2") + " <span>Clear Terminal</span>";
778
+ clearItem.innerHTML = iconHtml("trash-2") + " <span>Clear Console</span>";
779
779
  clearItem.addEventListener("click", function (ev) {
780
780
  ev.stopPropagation();
781
781
  closeTermCtxMenu();
package/lib/terminal.js CHANGED
@@ -32,7 +32,8 @@ function createTerminal(cwd, cols, rows, osUserInfo) {
32
32
  if (osUserInfo.shell) shell = osUserInfo.shell;
33
33
  }
34
34
 
35
- var term = pty.spawn(shell, [], spawnOpts);
35
+ var args = osUserInfo ? ["-l"] : [];
36
+ var term = pty.spawn(shell, args, spawnOpts);
36
37
 
37
38
  return term;
38
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clay-server",
3
- "version": "2.11.0-beta.13",
3
+ "version": "2.11.0-beta.15",
4
4
  "description": "Web UI for Claude Code. Any device. Push notifications.",
5
5
  "bin": {
6
6
  "clay-server": "./bin/cli.js",