tmex-cli 0.1.4

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.
@@ -0,0 +1,14 @@
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
6
+ <meta name="description" content="tmex - Web 接入多设备 tmux 的终端控制平台" />
7
+ <title>tmex</title>
8
+ <script type="module" crossorigin src="/assets/index-DNlxXBdI.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-D7lUHQCR.css">
10
+ </head>
11
+ <body>
12
+ <div id="root"></div>
13
+ </body>
14
+ </html>
@@ -0,0 +1,76 @@
1
+ CREATE TABLE `device_runtime_status` (
2
+ `device_id` text PRIMARY KEY NOT NULL,
3
+ `last_seen_at` text,
4
+ `tmux_available` integer DEFAULT false NOT NULL,
5
+ `last_error` text,
6
+ FOREIGN KEY (`device_id`) REFERENCES `devices`(`id`) ON UPDATE no action ON DELETE cascade
7
+ );
8
+ --> statement-breakpoint
9
+ CREATE TABLE `devices` (
10
+ `id` text PRIMARY KEY NOT NULL,
11
+ `name` text NOT NULL,
12
+ `type` text NOT NULL,
13
+ `host` text,
14
+ `port` integer DEFAULT 22,
15
+ `username` text,
16
+ `ssh_config_ref` text,
17
+ `session` text DEFAULT 'tmex',
18
+ `auth_mode` text NOT NULL,
19
+ `password_enc` text,
20
+ `private_key_enc` text,
21
+ `private_key_passphrase_enc` text,
22
+ `created_at` text NOT NULL,
23
+ `updated_at` text NOT NULL,
24
+ CONSTRAINT "devices_type_check" CHECK("devices"."type" in ('local', 'ssh')),
25
+ CONSTRAINT "devices_auth_mode_check" CHECK("devices"."auth_mode" in ('password', 'key', 'agent', 'configRef', 'auto'))
26
+ );
27
+ --> statement-breakpoint
28
+ CREATE TABLE `site_settings` (
29
+ `id` integer PRIMARY KEY NOT NULL,
30
+ `site_name` text NOT NULL,
31
+ `site_url` text NOT NULL,
32
+ `bell_throttle_seconds` integer NOT NULL,
33
+ `ssh_reconnect_max_retries` integer NOT NULL,
34
+ `ssh_reconnect_delay_seconds` integer NOT NULL,
35
+ `language` text DEFAULT 'en_US' NOT NULL,
36
+ `updated_at` text NOT NULL,
37
+ CONSTRAINT "site_settings_singleton_check" CHECK("site_settings"."id" = 1),
38
+ CONSTRAINT "site_settings_language_check" CHECK("site_settings"."language" in ('en_US', 'zh_CN'))
39
+ );
40
+ --> statement-breakpoint
41
+ CREATE TABLE `telegram_bot_chats` (
42
+ `id` text PRIMARY KEY NOT NULL,
43
+ `bot_id` text NOT NULL,
44
+ `chat_id` text NOT NULL,
45
+ `chat_type` text NOT NULL,
46
+ `display_name` text NOT NULL,
47
+ `status` text NOT NULL,
48
+ `applied_at` text NOT NULL,
49
+ `authorized_at` text,
50
+ `updated_at` text NOT NULL,
51
+ FOREIGN KEY (`bot_id`) REFERENCES `telegram_bots`(`id`) ON UPDATE no action ON DELETE cascade,
52
+ CONSTRAINT "telegram_bot_chats_status_check" CHECK("telegram_bot_chats"."status" in ('pending', 'authorized')),
53
+ CONSTRAINT "telegram_bot_chats_chat_type_check" CHECK("telegram_bot_chats"."chat_type" in ('private', 'group', 'supergroup', 'channel', 'unknown'))
54
+ );
55
+ --> statement-breakpoint
56
+ CREATE UNIQUE INDEX `telegram_bot_chats_bot_chat_unique` ON `telegram_bot_chats` (`bot_id`,`chat_id`);--> statement-breakpoint
57
+ CREATE TABLE `telegram_bots` (
58
+ `id` text PRIMARY KEY NOT NULL,
59
+ `name` text NOT NULL,
60
+ `token_enc` text NOT NULL,
61
+ `enabled` integer DEFAULT true NOT NULL,
62
+ `allow_auth_requests` integer DEFAULT true NOT NULL,
63
+ `last_update_id` integer,
64
+ `created_at` text NOT NULL,
65
+ `updated_at` text NOT NULL
66
+ );
67
+ --> statement-breakpoint
68
+ CREATE TABLE `webhook_endpoints` (
69
+ `id` text PRIMARY KEY NOT NULL,
70
+ `enabled` integer DEFAULT true NOT NULL,
71
+ `url` text NOT NULL,
72
+ `secret` text NOT NULL,
73
+ `event_mask` text NOT NULL,
74
+ `created_at` text NOT NULL,
75
+ `updated_at` text NOT NULL
76
+ );
@@ -0,0 +1,2 @@
1
+ ALTER TABLE `site_settings` ADD `enable_browser_bell_toast` integer DEFAULT true NOT NULL;--> statement-breakpoint
2
+ ALTER TABLE `site_settings` ADD `enable_telegram_bell_push` integer DEFAULT true NOT NULL;
@@ -0,0 +1,499 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "25e820fb-f95f-46de-ae52-10b67c645ae4",
5
+ "prevId": "00000000-0000-0000-0000-000000000000",
6
+ "tables": {
7
+ "device_runtime_status": {
8
+ "name": "device_runtime_status",
9
+ "columns": {
10
+ "device_id": {
11
+ "name": "device_id",
12
+ "type": "text",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "last_seen_at": {
18
+ "name": "last_seen_at",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": false,
22
+ "autoincrement": false
23
+ },
24
+ "tmux_available": {
25
+ "name": "tmux_available",
26
+ "type": "integer",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false,
30
+ "default": false
31
+ },
32
+ "last_error": {
33
+ "name": "last_error",
34
+ "type": "text",
35
+ "primaryKey": false,
36
+ "notNull": false,
37
+ "autoincrement": false
38
+ }
39
+ },
40
+ "indexes": {},
41
+ "foreignKeys": {
42
+ "device_runtime_status_device_id_devices_id_fk": {
43
+ "name": "device_runtime_status_device_id_devices_id_fk",
44
+ "tableFrom": "device_runtime_status",
45
+ "tableTo": "devices",
46
+ "columnsFrom": [
47
+ "device_id"
48
+ ],
49
+ "columnsTo": [
50
+ "id"
51
+ ],
52
+ "onDelete": "cascade",
53
+ "onUpdate": "no action"
54
+ }
55
+ },
56
+ "compositePrimaryKeys": {},
57
+ "uniqueConstraints": {},
58
+ "checkConstraints": {}
59
+ },
60
+ "devices": {
61
+ "name": "devices",
62
+ "columns": {
63
+ "id": {
64
+ "name": "id",
65
+ "type": "text",
66
+ "primaryKey": true,
67
+ "notNull": true,
68
+ "autoincrement": false
69
+ },
70
+ "name": {
71
+ "name": "name",
72
+ "type": "text",
73
+ "primaryKey": false,
74
+ "notNull": true,
75
+ "autoincrement": false
76
+ },
77
+ "type": {
78
+ "name": "type",
79
+ "type": "text",
80
+ "primaryKey": false,
81
+ "notNull": true,
82
+ "autoincrement": false
83
+ },
84
+ "host": {
85
+ "name": "host",
86
+ "type": "text",
87
+ "primaryKey": false,
88
+ "notNull": false,
89
+ "autoincrement": false
90
+ },
91
+ "port": {
92
+ "name": "port",
93
+ "type": "integer",
94
+ "primaryKey": false,
95
+ "notNull": false,
96
+ "autoincrement": false,
97
+ "default": 22
98
+ },
99
+ "username": {
100
+ "name": "username",
101
+ "type": "text",
102
+ "primaryKey": false,
103
+ "notNull": false,
104
+ "autoincrement": false
105
+ },
106
+ "ssh_config_ref": {
107
+ "name": "ssh_config_ref",
108
+ "type": "text",
109
+ "primaryKey": false,
110
+ "notNull": false,
111
+ "autoincrement": false
112
+ },
113
+ "session": {
114
+ "name": "session",
115
+ "type": "text",
116
+ "primaryKey": false,
117
+ "notNull": false,
118
+ "autoincrement": false,
119
+ "default": "'tmex'"
120
+ },
121
+ "auth_mode": {
122
+ "name": "auth_mode",
123
+ "type": "text",
124
+ "primaryKey": false,
125
+ "notNull": true,
126
+ "autoincrement": false
127
+ },
128
+ "password_enc": {
129
+ "name": "password_enc",
130
+ "type": "text",
131
+ "primaryKey": false,
132
+ "notNull": false,
133
+ "autoincrement": false
134
+ },
135
+ "private_key_enc": {
136
+ "name": "private_key_enc",
137
+ "type": "text",
138
+ "primaryKey": false,
139
+ "notNull": false,
140
+ "autoincrement": false
141
+ },
142
+ "private_key_passphrase_enc": {
143
+ "name": "private_key_passphrase_enc",
144
+ "type": "text",
145
+ "primaryKey": false,
146
+ "notNull": false,
147
+ "autoincrement": false
148
+ },
149
+ "created_at": {
150
+ "name": "created_at",
151
+ "type": "text",
152
+ "primaryKey": false,
153
+ "notNull": true,
154
+ "autoincrement": false
155
+ },
156
+ "updated_at": {
157
+ "name": "updated_at",
158
+ "type": "text",
159
+ "primaryKey": false,
160
+ "notNull": true,
161
+ "autoincrement": false
162
+ }
163
+ },
164
+ "indexes": {},
165
+ "foreignKeys": {},
166
+ "compositePrimaryKeys": {},
167
+ "uniqueConstraints": {},
168
+ "checkConstraints": {
169
+ "devices_type_check": {
170
+ "name": "devices_type_check",
171
+ "value": "\"devices\".\"type\" in ('local', 'ssh')"
172
+ },
173
+ "devices_auth_mode_check": {
174
+ "name": "devices_auth_mode_check",
175
+ "value": "\"devices\".\"auth_mode\" in ('password', 'key', 'agent', 'configRef', 'auto')"
176
+ }
177
+ }
178
+ },
179
+ "site_settings": {
180
+ "name": "site_settings",
181
+ "columns": {
182
+ "id": {
183
+ "name": "id",
184
+ "type": "integer",
185
+ "primaryKey": true,
186
+ "notNull": true,
187
+ "autoincrement": false
188
+ },
189
+ "site_name": {
190
+ "name": "site_name",
191
+ "type": "text",
192
+ "primaryKey": false,
193
+ "notNull": true,
194
+ "autoincrement": false
195
+ },
196
+ "site_url": {
197
+ "name": "site_url",
198
+ "type": "text",
199
+ "primaryKey": false,
200
+ "notNull": true,
201
+ "autoincrement": false
202
+ },
203
+ "bell_throttle_seconds": {
204
+ "name": "bell_throttle_seconds",
205
+ "type": "integer",
206
+ "primaryKey": false,
207
+ "notNull": true,
208
+ "autoincrement": false
209
+ },
210
+ "ssh_reconnect_max_retries": {
211
+ "name": "ssh_reconnect_max_retries",
212
+ "type": "integer",
213
+ "primaryKey": false,
214
+ "notNull": true,
215
+ "autoincrement": false
216
+ },
217
+ "ssh_reconnect_delay_seconds": {
218
+ "name": "ssh_reconnect_delay_seconds",
219
+ "type": "integer",
220
+ "primaryKey": false,
221
+ "notNull": true,
222
+ "autoincrement": false
223
+ },
224
+ "language": {
225
+ "name": "language",
226
+ "type": "text",
227
+ "primaryKey": false,
228
+ "notNull": true,
229
+ "autoincrement": false,
230
+ "default": "'en_US'"
231
+ },
232
+ "updated_at": {
233
+ "name": "updated_at",
234
+ "type": "text",
235
+ "primaryKey": false,
236
+ "notNull": true,
237
+ "autoincrement": false
238
+ }
239
+ },
240
+ "indexes": {},
241
+ "foreignKeys": {},
242
+ "compositePrimaryKeys": {},
243
+ "uniqueConstraints": {},
244
+ "checkConstraints": {
245
+ "site_settings_singleton_check": {
246
+ "name": "site_settings_singleton_check",
247
+ "value": "\"site_settings\".\"id\" = 1"
248
+ },
249
+ "site_settings_language_check": {
250
+ "name": "site_settings_language_check",
251
+ "value": "\"site_settings\".\"language\" in ('en_US', 'zh_CN')"
252
+ }
253
+ }
254
+ },
255
+ "telegram_bot_chats": {
256
+ "name": "telegram_bot_chats",
257
+ "columns": {
258
+ "id": {
259
+ "name": "id",
260
+ "type": "text",
261
+ "primaryKey": true,
262
+ "notNull": true,
263
+ "autoincrement": false
264
+ },
265
+ "bot_id": {
266
+ "name": "bot_id",
267
+ "type": "text",
268
+ "primaryKey": false,
269
+ "notNull": true,
270
+ "autoincrement": false
271
+ },
272
+ "chat_id": {
273
+ "name": "chat_id",
274
+ "type": "text",
275
+ "primaryKey": false,
276
+ "notNull": true,
277
+ "autoincrement": false
278
+ },
279
+ "chat_type": {
280
+ "name": "chat_type",
281
+ "type": "text",
282
+ "primaryKey": false,
283
+ "notNull": true,
284
+ "autoincrement": false
285
+ },
286
+ "display_name": {
287
+ "name": "display_name",
288
+ "type": "text",
289
+ "primaryKey": false,
290
+ "notNull": true,
291
+ "autoincrement": false
292
+ },
293
+ "status": {
294
+ "name": "status",
295
+ "type": "text",
296
+ "primaryKey": false,
297
+ "notNull": true,
298
+ "autoincrement": false
299
+ },
300
+ "applied_at": {
301
+ "name": "applied_at",
302
+ "type": "text",
303
+ "primaryKey": false,
304
+ "notNull": true,
305
+ "autoincrement": false
306
+ },
307
+ "authorized_at": {
308
+ "name": "authorized_at",
309
+ "type": "text",
310
+ "primaryKey": false,
311
+ "notNull": false,
312
+ "autoincrement": false
313
+ },
314
+ "updated_at": {
315
+ "name": "updated_at",
316
+ "type": "text",
317
+ "primaryKey": false,
318
+ "notNull": true,
319
+ "autoincrement": false
320
+ }
321
+ },
322
+ "indexes": {
323
+ "telegram_bot_chats_bot_chat_unique": {
324
+ "name": "telegram_bot_chats_bot_chat_unique",
325
+ "columns": [
326
+ "bot_id",
327
+ "chat_id"
328
+ ],
329
+ "isUnique": true
330
+ }
331
+ },
332
+ "foreignKeys": {
333
+ "telegram_bot_chats_bot_id_telegram_bots_id_fk": {
334
+ "name": "telegram_bot_chats_bot_id_telegram_bots_id_fk",
335
+ "tableFrom": "telegram_bot_chats",
336
+ "tableTo": "telegram_bots",
337
+ "columnsFrom": [
338
+ "bot_id"
339
+ ],
340
+ "columnsTo": [
341
+ "id"
342
+ ],
343
+ "onDelete": "cascade",
344
+ "onUpdate": "no action"
345
+ }
346
+ },
347
+ "compositePrimaryKeys": {},
348
+ "uniqueConstraints": {},
349
+ "checkConstraints": {
350
+ "telegram_bot_chats_status_check": {
351
+ "name": "telegram_bot_chats_status_check",
352
+ "value": "\"telegram_bot_chats\".\"status\" in ('pending', 'authorized')"
353
+ },
354
+ "telegram_bot_chats_chat_type_check": {
355
+ "name": "telegram_bot_chats_chat_type_check",
356
+ "value": "\"telegram_bot_chats\".\"chat_type\" in ('private', 'group', 'supergroup', 'channel', 'unknown')"
357
+ }
358
+ }
359
+ },
360
+ "telegram_bots": {
361
+ "name": "telegram_bots",
362
+ "columns": {
363
+ "id": {
364
+ "name": "id",
365
+ "type": "text",
366
+ "primaryKey": true,
367
+ "notNull": true,
368
+ "autoincrement": false
369
+ },
370
+ "name": {
371
+ "name": "name",
372
+ "type": "text",
373
+ "primaryKey": false,
374
+ "notNull": true,
375
+ "autoincrement": false
376
+ },
377
+ "token_enc": {
378
+ "name": "token_enc",
379
+ "type": "text",
380
+ "primaryKey": false,
381
+ "notNull": true,
382
+ "autoincrement": false
383
+ },
384
+ "enabled": {
385
+ "name": "enabled",
386
+ "type": "integer",
387
+ "primaryKey": false,
388
+ "notNull": true,
389
+ "autoincrement": false,
390
+ "default": true
391
+ },
392
+ "allow_auth_requests": {
393
+ "name": "allow_auth_requests",
394
+ "type": "integer",
395
+ "primaryKey": false,
396
+ "notNull": true,
397
+ "autoincrement": false,
398
+ "default": true
399
+ },
400
+ "last_update_id": {
401
+ "name": "last_update_id",
402
+ "type": "integer",
403
+ "primaryKey": false,
404
+ "notNull": false,
405
+ "autoincrement": false
406
+ },
407
+ "created_at": {
408
+ "name": "created_at",
409
+ "type": "text",
410
+ "primaryKey": false,
411
+ "notNull": true,
412
+ "autoincrement": false
413
+ },
414
+ "updated_at": {
415
+ "name": "updated_at",
416
+ "type": "text",
417
+ "primaryKey": false,
418
+ "notNull": true,
419
+ "autoincrement": false
420
+ }
421
+ },
422
+ "indexes": {},
423
+ "foreignKeys": {},
424
+ "compositePrimaryKeys": {},
425
+ "uniqueConstraints": {},
426
+ "checkConstraints": {}
427
+ },
428
+ "webhook_endpoints": {
429
+ "name": "webhook_endpoints",
430
+ "columns": {
431
+ "id": {
432
+ "name": "id",
433
+ "type": "text",
434
+ "primaryKey": true,
435
+ "notNull": true,
436
+ "autoincrement": false
437
+ },
438
+ "enabled": {
439
+ "name": "enabled",
440
+ "type": "integer",
441
+ "primaryKey": false,
442
+ "notNull": true,
443
+ "autoincrement": false,
444
+ "default": true
445
+ },
446
+ "url": {
447
+ "name": "url",
448
+ "type": "text",
449
+ "primaryKey": false,
450
+ "notNull": true,
451
+ "autoincrement": false
452
+ },
453
+ "secret": {
454
+ "name": "secret",
455
+ "type": "text",
456
+ "primaryKey": false,
457
+ "notNull": true,
458
+ "autoincrement": false
459
+ },
460
+ "event_mask": {
461
+ "name": "event_mask",
462
+ "type": "text",
463
+ "primaryKey": false,
464
+ "notNull": true,
465
+ "autoincrement": false
466
+ },
467
+ "created_at": {
468
+ "name": "created_at",
469
+ "type": "text",
470
+ "primaryKey": false,
471
+ "notNull": true,
472
+ "autoincrement": false
473
+ },
474
+ "updated_at": {
475
+ "name": "updated_at",
476
+ "type": "text",
477
+ "primaryKey": false,
478
+ "notNull": true,
479
+ "autoincrement": false
480
+ }
481
+ },
482
+ "indexes": {},
483
+ "foreignKeys": {},
484
+ "compositePrimaryKeys": {},
485
+ "uniqueConstraints": {},
486
+ "checkConstraints": {}
487
+ }
488
+ },
489
+ "views": {},
490
+ "enums": {},
491
+ "_meta": {
492
+ "schemas": {},
493
+ "tables": {},
494
+ "columns": {}
495
+ },
496
+ "internal": {
497
+ "indexes": {}
498
+ }
499
+ }