1. Enabled/Active state separation: - Enable() sets Enabled=true (persisted in config), does NOT create runtime - ActivatePlugin() checks Enabled && !Active, creates VM + scheduler - DeactivatePlugin() stops runtime, keeps Enabled=true - InitRuntimes() iterates Enabled plugins, sets Active=true after creation - SyncConfig() restores Enabled from config, does NOT touch Active 2. ActivatePlugin: добавлен vm.SetServices(m.Services) 3. Discover: атомарная замена списка (newPlugins slice), нет дублирования 4. CallPluginFunction: thread-safe через LuaVM.CallFunction (vm.mu + callWithTimeout) 5. Uninstall активного плагина: полная деактивация (StopScheduler → on_shutdown → CloseVM → Active=false) 6. GetPluginPanelHTML: валидация panel path (no absolute, no .., must be .html, must be within plugin dir) 7. PluginPage: убран hardcoded 'calendar-plugin', используется funcPrefix из pluginName Тесты: - security_test.go: +8 тестов (FullLifecycle, ActivatePlugin_Services, Discover_Idempotent, ReloadPlugins_NoDuplicates, CallPluginFunction_Timeout, Uninstall_ActivePlugin, GetPluginPanelHTML_PathTraversal, FullLifecycle_EndToEnd) - manager_test.go: обновлены тесты под новую семантику Enabled/Active
29 lines
988 B
HTML
29 lines
988 B
HTML
<!DOCTYPE html>
|
|
<html lang="ru">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<link rel="icon" type="image/png" sizes="16x16" href="/assets/app-icons/icon_16x16.png" />
|
|
<link rel="icon" type="image/png" sizes="32x32" href="/assets/app-icons/icon_32x32.png" />
|
|
<link rel="icon" type="image/png" sizes="64x64" href="/assets/app-icons/icon_64x64.png" />
|
|
<link rel="icon" type="image/png" sizes="128x128" href="/assets/app-icons/icon_128x128.png" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Верстак</title>
|
|
<style>
|
|
/* Critical reset — no white borders, full viewport */
|
|
html, body, #app {
|
|
width: 100%;
|
|
height: 100%;
|
|
margin: 0;
|
|
padding: 0;
|
|
overflow: hidden;
|
|
background: #13131f;
|
|
}
|
|
</style>
|
|
<script type="module" crossorigin src="/assets/main-8qmy5tDO.js"></script>
|
|
<link rel="stylesheet" crossorigin href="/assets/main-Cjkp2F09.css">
|
|
</head>
|
|
<body>
|
|
<div id="app"></div>
|
|
</body>
|
|
</html>
|