mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-18 18:23:18 +02:00
Adjust sudo mode on the roles to full for use of ssh
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { build } from "@server/build";
|
||||
import { APP_PATH } from "@server/lib/consts";
|
||||
import Database from "better-sqlite3";
|
||||
import fs from "fs";
|
||||
@@ -343,6 +344,19 @@ export default async function migration() {
|
||||
`ALTER TABLE 'roles' RENAME COLUMN "sshSudoModeNew" TO "sshSudoMode";`
|
||||
).run();
|
||||
|
||||
const licenseKeyCount = db
|
||||
.prepare(`SELECT COUNT(*) as count FROM 'licenseKey';`)
|
||||
.get() as { count: number };
|
||||
|
||||
if (
|
||||
build === "oss" ||
|
||||
(build === "enterprise" && licenseKeyCount.count === 0)
|
||||
) {
|
||||
db.prepare(
|
||||
`UPDATE 'roles' SET "sshSudoMode" = 'full' WHERE "sshSudoMode" = 'none';`
|
||||
).run();
|
||||
}
|
||||
|
||||
db.prepare(
|
||||
`
|
||||
CREATE TABLE '__new_targets' (
|
||||
|
||||
Reference in New Issue
Block a user