mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-30 15:15:24 +00:00
feat: turn session recording into a plugin (B13)
This commit is contained in:
1 parent
a276f6898c
commit
0af2c94983
147 files changed
+25915
-2074
No files matched your search
@@ -0,0 +1,22 @@
|
||||
-- session-recording 0001: adopt_session_recordings
|
||||
-- Generated by termix-plugin migrations. Review before committing.
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `session_recordings` (
|
||||
`id` int AUTO_INCREMENT PRIMARY KEY,
|
||||
`host_id` int NOT NULL,
|
||||
`user_id` varchar(255),
|
||||
`username` text,
|
||||
`access_id` int,
|
||||
`started_at` varchar(255) NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||
`ended_at` text,
|
||||
`duration` int,
|
||||
`commands` text,
|
||||
`dangerous_actions` text,
|
||||
`recording_path` text,
|
||||
`protocol` text NOT NULL DEFAULT ('ssh'),
|
||||
`format` text NOT NULL DEFAULT ('text'),
|
||||
`terminated_by_owner` boolean DEFAULT false,
|
||||
`termination_reason` text,
|
||||
FOREIGN KEY (`host_id`) REFERENCES `ssh_data` (`id`) ON DELETE CASCADE
|
||||
);
|
||||
RENAME TABLE `session_recordings` TO `p_session_recording_session_recordings`;
|
||||
@@ -0,0 +1,24 @@
|
||||
-- session-recording 0001: adopt_session_recordings
|
||||
-- Generated by termix-plugin migrations. Review before committing.
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "session_recordings" (
|
||||
"id" serial PRIMARY KEY,
|
||||
"host_id" integer NOT NULL,
|
||||
"user_id" varchar(255),
|
||||
"username" text,
|
||||
"access_id" integer,
|
||||
"started_at" varchar(255) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"ended_at" text,
|
||||
"duration" integer,
|
||||
"commands" text,
|
||||
"dangerous_actions" text,
|
||||
"recording_path" text,
|
||||
"protocol" text NOT NULL DEFAULT 'ssh',
|
||||
"format" text NOT NULL DEFAULT 'text',
|
||||
"terminated_by_owner" boolean DEFAULT false,
|
||||
"termination_reason" text,
|
||||
FOREIGN KEY ("host_id") REFERENCES "ssh_data" ("id") ON DELETE CASCADE
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS "idx_session_recordings_user_started" ON "session_recordings" ("user_id", "started_at");
|
||||
CREATE INDEX IF NOT EXISTS "idx_session_recordings_host" ON "session_recordings" ("host_id");
|
||||
ALTER TABLE "session_recordings" RENAME TO "p_session_recording_session_recordings";
|
||||
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"version": 1,
|
||||
"tables": {
|
||||
"session_recordings": {
|
||||
"columns": {
|
||||
"id": {
|
||||
"type": "id",
|
||||
"primaryKey": true,
|
||||
"notNull": true
|
||||
},
|
||||
"hostId": {
|
||||
"type": "refHost",
|
||||
"notNull": true
|
||||
},
|
||||
"userId": {
|
||||
"type": "varchar",
|
||||
"length": 255
|
||||
},
|
||||
"username": {
|
||||
"type": "text"
|
||||
},
|
||||
"accessId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"startedAt": {
|
||||
"type": "timestamp",
|
||||
"notNull": true,
|
||||
"defaultNow": true
|
||||
},
|
||||
"endedAt": {
|
||||
"type": "timestamp"
|
||||
},
|
||||
"duration": {
|
||||
"type": "integer"
|
||||
},
|
||||
"commands": {
|
||||
"type": "text"
|
||||
},
|
||||
"dangerousActions": {
|
||||
"type": "text"
|
||||
},
|
||||
"recordingPath": {
|
||||
"type": "text"
|
||||
},
|
||||
"protocol": {
|
||||
"type": "text",
|
||||
"notNull": true,
|
||||
"defaultValue": "ssh"
|
||||
},
|
||||
"format": {
|
||||
"type": "text",
|
||||
"notNull": true,
|
||||
"defaultValue": "text"
|
||||
},
|
||||
"terminatedByOwner": {
|
||||
"type": "boolean",
|
||||
"defaultValue": false
|
||||
},
|
||||
"terminationReason": {
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
"indexes": [
|
||||
{
|
||||
"name": "idx_session_recordings_user_started",
|
||||
"columns": ["userId", "startedAt"]
|
||||
},
|
||||
{
|
||||
"name": "idx_session_recordings_host",
|
||||
"columns": ["hostId"]
|
||||
}
|
||||
],
|
||||
"adopts": "session_recordings"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
-- session-recording 0001: adopt_session_recordings
|
||||
-- Generated by termix-plugin migrations. Review before committing.
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "session_recordings" (
|
||||
"id" integer PRIMARY KEY AUTOINCREMENT,
|
||||
"host_id" integer NOT NULL,
|
||||
"user_id" text,
|
||||
"username" text,
|
||||
"access_id" integer,
|
||||
"started_at" text NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"ended_at" text,
|
||||
"duration" integer,
|
||||
"commands" text,
|
||||
"dangerous_actions" text,
|
||||
"recording_path" text,
|
||||
"protocol" text NOT NULL DEFAULT 'ssh',
|
||||
"format" text NOT NULL DEFAULT 'text',
|
||||
"terminated_by_owner" integer DEFAULT 0,
|
||||
"termination_reason" text,
|
||||
FOREIGN KEY ("host_id") REFERENCES "ssh_data" ("id") ON DELETE CASCADE
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS "idx_session_recordings_user_started" ON "session_recordings" ("user_id", "started_at");
|
||||
CREATE INDEX IF NOT EXISTS "idx_session_recordings_host" ON "session_recordings" ("host_id");
|
||||
ALTER TABLE "session_recordings" RENAME TO "p_session_recording_session_recordings";
|
||||
Reference in new issue
Block a user