mirror of
https://github.com/anotherhadi/spilltea.git
synced 2026-05-20 01:32:33 +02:00
Add "disable_by_default" flag for plugins
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
@@ -18,6 +18,7 @@ Plugin = {
|
|||||||
name = "My Plugin",
|
name = "My Plugin",
|
||||||
description = "What this plugin does.",
|
description = "What this plugin does.",
|
||||||
priority = 0, -- higher = runs before other plugins (default: 0)
|
priority = 0, -- higher = runs before other plugins (default: 0)
|
||||||
|
disable_by_default = true, -- if true, plugin starts disabled on first load (default: false)
|
||||||
|
|
||||||
-- Declare which hooks you use and whether they are synchronous (default: false).
|
-- Declare which hooks you use and whether they are synchronous (default: false).
|
||||||
-- on_config and on_quit are always sync and do not need to be declared here.
|
-- on_config and on_quit are always sync and do not need to be declared here.
|
||||||
|
|||||||
@@ -117,6 +117,10 @@ func (m *Manager) loadPlugin(path string) (*Plugin, error) {
|
|||||||
p.Priority = int(n)
|
p.Priority = int(n)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if pluginTable.RawGetString("disable_by_default") == lua.LTrue {
|
||||||
|
p.Enabled = false
|
||||||
|
}
|
||||||
|
|
||||||
// Hooks configurable via the Plugin table (sync field).
|
// Hooks configurable via the Plugin table (sync field).
|
||||||
configurableHooks := map[string]bool{
|
configurableHooks := map[string]bool{
|
||||||
"on_start": false, // async by default
|
"on_start": false, // async by default
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ Checks that the proxy's outbound IP is in an allowed list on startup.
|
|||||||
- if no IPs are configured, the check is skipped
|
- if no IPs are configured, the check is skipped
|
||||||
]],
|
]],
|
||||||
on_start = { sync = false },
|
on_start = { sync = false },
|
||||||
|
disable_by_default = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
local whitelist = {}
|
local whitelist = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user