daemon: updates to provide config types for configurable values, without the need to specify the enumerated type
This commit is contained in:
parent
bd3e2f5d0e
commit
22e92111d0
10 changed files with 115 additions and 240 deletions
|
@ -1,8 +1,7 @@
|
|||
from typing import Any, Dict, List
|
||||
|
||||
from core.config import Configuration
|
||||
from core.config import ConfigString, Configuration
|
||||
from core.configservice.base import ConfigService, ConfigServiceMode
|
||||
from core.emulator.enumerations import ConfigDataTypes
|
||||
|
||||
GROUP_NAME: str = "Security"
|
||||
|
||||
|
@ -19,24 +18,9 @@ class VpnClient(ConfigService):
|
|||
shutdown: List[str] = ["killall openvpn"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = [
|
||||
Configuration(
|
||||
id="keydir",
|
||||
type=ConfigDataTypes.STRING,
|
||||
label="Key Dir",
|
||||
default="/etc/core/keys",
|
||||
),
|
||||
Configuration(
|
||||
id="keyname",
|
||||
type=ConfigDataTypes.STRING,
|
||||
label="Key Name",
|
||||
default="client1",
|
||||
),
|
||||
Configuration(
|
||||
id="server",
|
||||
type=ConfigDataTypes.STRING,
|
||||
label="Server",
|
||||
default="10.0.2.10",
|
||||
),
|
||||
ConfigString(id="keydir", label="Key Dir", default="/etc/core/keys"),
|
||||
ConfigString(id="keyname", label="Key Name", default="client1"),
|
||||
ConfigString(id="server", label="Server", default="10.0.2.10"),
|
||||
]
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
|
||||
|
@ -53,24 +37,9 @@ class VpnServer(ConfigService):
|
|||
shutdown: List[str] = ["killall openvpn"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = [
|
||||
Configuration(
|
||||
id="keydir",
|
||||
type=ConfigDataTypes.STRING,
|
||||
label="Key Dir",
|
||||
default="/etc/core/keys",
|
||||
),
|
||||
Configuration(
|
||||
id="keyname",
|
||||
type=ConfigDataTypes.STRING,
|
||||
label="Key Name",
|
||||
default="server",
|
||||
),
|
||||
Configuration(
|
||||
id="subnet",
|
||||
type=ConfigDataTypes.STRING,
|
||||
label="Subnet",
|
||||
default="10.0.200.0",
|
||||
),
|
||||
ConfigString(id="keydir", label="Key Dir", default="/etc/core/keys"),
|
||||
ConfigString(id="keyname", label="Key Name", default="server"),
|
||||
ConfigString(id="subnet", label="Subnet", default="10.0.200.0"),
|
||||
]
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue