Allow changing the allow ssh and update shcmea

This commit is contained in:
Owen
2026-08-17 14:06:26 -04:00
parent 87a3e5ceea
commit a74b0934fc
4 changed files with 5 additions and 10 deletions
+1 -1
View File
@@ -763,7 +763,7 @@ export const roles = pgTable("roles", {
name: varchar("name").notNull(), name: varchar("name").notNull(),
description: varchar("description"), description: varchar("description"),
requireDeviceApproval: boolean("requireDeviceApproval").default(false), requireDeviceApproval: boolean("requireDeviceApproval").default(false),
sshSudoMode: varchar("sshSudoMode", { length: 32 }).default("none"), // "none" | "full" | "commands" sshSudoMode: varchar("sshSudoMode", { length: 32 }).default("full"), // "none" | "full" | "commands"
sshSudoCommands: text("sshSudoCommands").default("[]"), sshSudoCommands: text("sshSudoCommands").default("[]"),
sshCreateHomeDir: boolean("sshCreateHomeDir").default(true), sshCreateHomeDir: boolean("sshCreateHomeDir").default(true),
sshUnixGroups: text("sshUnixGroups").default("[]") sshUnixGroups: text("sshUnixGroups").default("[]")
+1 -1
View File
@@ -995,7 +995,7 @@ export const roles = sqliteTable("roles", {
requireDeviceApproval: integer("requireDeviceApproval", { requireDeviceApproval: integer("requireDeviceApproval", {
mode: "boolean" mode: "boolean"
}).default(false), }).default(false),
sshSudoMode: text("sshSudoMode").default("none"), // "none" | "full" | "commands" sshSudoMode: text("sshSudoMode").default("full"), // "none" | "full" | "commands"
sshSudoCommands: text("sshSudoCommands").default("[]"), sshSudoCommands: text("sshSudoCommands").default("[]"),
sshCreateHomeDir: integer("sshCreateHomeDir", { mode: "boolean" }).default( sshCreateHomeDir: integer("sshCreateHomeDir", { mode: "boolean" }).default(
true true
-1
View File
@@ -33,7 +33,6 @@ import { calculateUserClientsForOrgs } from "@server/lib/calculateUserClientsFor
import { doCidrsOverlap } from "@server/lib/ip"; import { doCidrsOverlap } from "@server/lib/ip";
import { generateCA } from "@server/lib/sshCA"; import { generateCA } from "@server/lib/sshCA";
import { encrypt } from "@server/lib/crypto"; import { encrypt } from "@server/lib/crypto";
import { generateId } from "@server/auth/sessions/app";
const validOrgIdRegex = /^[a-z0-9_]+(-[a-z0-9_]+)*$/; const validOrgIdRegex = /^[a-z0-9_]+(-[a-z0-9_]+)*$/;
+3 -7
View File
@@ -506,20 +506,16 @@ export function RoleForm({
<OptionSelect<"allow" | "disallow"> <OptionSelect<"allow" | "disallow">
options={allowSshOptions} options={allowSshOptions}
value={ value={
sshDisabled field.value
? "disallow" ? "allow"
: field.value : "disallow"
? "allow"
: "disallow"
} }
onChange={(v) => { onChange={(v) => {
if (sshDisabled) return;
field.onChange( field.onChange(
v === "allow" v === "allow"
); );
}} }}
cols={2} cols={2}
disabled={sshDisabled}
/> />
<FormDescription> <FormDescription>
{t("roleAllowSshDescription")} {t("roleAllowSshDescription")}