mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-04 09:54:14 +00:00
feat(plugins): plugin system scaffold — registry tables + admin panel
First slice of the plugin system. Lays down the data model and a read-only admin surface; nothing executes yet. - Migration 155: plugins, plugin_meta_migrations, plugin_error_log and plugin_settings_fields tables. Plugin data will live in a per-plugin sqlite file under /plugins-data, never in these tables. - New Nest module server/src/nest/plugins with GET /api/admin/plugins (admin-gated, returns the installed list + the runtime-enabled flag). - TREK_PLUGINS_ENABLED kill switch (config.pluginsEnabled), off by default. - Admin → Plugins tab with a read-only panel: installed list, status badges, and a clear banner when the runtime is disabled by server config. - i18n keys for the tab and panel across all locales. Install, activation, the isolated runtime and the registry browser follow in later slices.
This commit is contained in:
@@ -174,3 +174,14 @@ export const SESSION_DURATION_REMEMBER =
|
||||
export const SESSION_DURATION_REMEMBER_MS = parsedRememberMs ?? parseDurationMs(DEFAULT_SESSION_DURATION_REMEMBER)!;
|
||||
/** "Remember me" session length in seconds — passed to `jwt.sign({ expiresIn })`. */
|
||||
export const SESSION_DURATION_REMEMBER_SECONDS = Math.floor(SESSION_DURATION_REMEMBER_MS / 1000);
|
||||
|
||||
/**
|
||||
* Plugin-system kill switch (#plugins). Off by default — a brand-new, high-risk
|
||||
* surface an instance owner must deliberately opt into. When false, the plugin
|
||||
* module serves its admin listing (so the tab isn't a dead end) but never spawns
|
||||
* a plugin process and refuses install/activate. Read at call time so tests and
|
||||
* runtime env changes take effect without re-import.
|
||||
*/
|
||||
export function pluginsEnabled(): boolean {
|
||||
return (process.env.TREK_PLUGINS_ENABLED || '').trim().toLowerCase() === 'true';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user