mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 09:01:54 +08:00
changed some defaults
This commit is contained in:
@@ -9,16 +9,16 @@ logging: !include logging.yaml
|
|||||||
kvmd:
|
kvmd:
|
||||||
server:
|
server:
|
||||||
unix: /run/kvmd/kvmd.sock
|
unix: /run/kvmd/kvmd.sock
|
||||||
unix_rm: true
|
|
||||||
unix_mode: 0660
|
|
||||||
|
|
||||||
auth: !include auth.yaml
|
auth: !include auth.yaml
|
||||||
|
|
||||||
hid:
|
hid:
|
||||||
|
type: serial
|
||||||
reset_pin: 4
|
reset_pin: 4
|
||||||
device: /dev/kvmd-hid
|
device: /dev/kvmd-hid
|
||||||
|
|
||||||
atx:
|
atx:
|
||||||
|
type: gpio
|
||||||
power_led_pin: 24
|
power_led_pin: 24
|
||||||
hdd_led_pin: 22
|
hdd_led_pin: 22
|
||||||
power_switch_pin: 23
|
power_switch_pin: 23
|
||||||
@@ -28,10 +28,6 @@ kvmd:
|
|||||||
type: disabled
|
type: disabled
|
||||||
|
|
||||||
streamer:
|
streamer:
|
||||||
sync_delay: 0
|
|
||||||
init_delay: 1
|
|
||||||
desired_fps: 30
|
|
||||||
max_fps: 60
|
|
||||||
unix: /run/kvmd/ustreamer.sock
|
unix: /run/kvmd/ustreamer.sock
|
||||||
cmd:
|
cmd:
|
||||||
- "/usr/bin/ustreamer"
|
- "/usr/bin/ustreamer"
|
||||||
|
|||||||
@@ -9,16 +9,16 @@ logging: !include logging.yaml
|
|||||||
kvmd:
|
kvmd:
|
||||||
server:
|
server:
|
||||||
unix: /run/kvmd/kvmd.sock
|
unix: /run/kvmd/kvmd.sock
|
||||||
unix_rm: true
|
|
||||||
unix_mode: 0660
|
|
||||||
|
|
||||||
auth: !include auth.yaml
|
auth: !include auth.yaml
|
||||||
|
|
||||||
hid:
|
hid:
|
||||||
|
type: serial
|
||||||
reset_pin: 4
|
reset_pin: 4
|
||||||
device: /dev/kvmd-hid
|
device: /dev/kvmd-hid
|
||||||
|
|
||||||
atx:
|
atx:
|
||||||
|
type: gpio
|
||||||
power_led_pin: 24
|
power_led_pin: 24
|
||||||
hdd_led_pin: 22
|
hdd_led_pin: 22
|
||||||
power_switch_pin: 23
|
power_switch_pin: 23
|
||||||
@@ -28,6 +28,9 @@ kvmd:
|
|||||||
type: disabled
|
type: disabled
|
||||||
|
|
||||||
streamer:
|
streamer:
|
||||||
|
sync_delay: 1.0
|
||||||
|
init_delay: 3.0
|
||||||
|
desired_fps: 0
|
||||||
unix: /run/kvmd/ustreamer.sock
|
unix: /run/kvmd/ustreamer.sock
|
||||||
cmd:
|
cmd:
|
||||||
- "/usr/bin/ustreamer"
|
- "/usr/bin/ustreamer"
|
||||||
|
|||||||
@@ -9,31 +9,28 @@ logging: !include logging.yaml
|
|||||||
kvmd:
|
kvmd:
|
||||||
server:
|
server:
|
||||||
unix: /run/kvmd/kvmd.sock
|
unix: /run/kvmd/kvmd.sock
|
||||||
unix_rm: true
|
|
||||||
unix_mode: 0660
|
|
||||||
|
|
||||||
auth: !include auth.yaml
|
auth: !include auth.yaml
|
||||||
|
|
||||||
hid:
|
hid:
|
||||||
|
type: serial
|
||||||
reset_pin: 4
|
reset_pin: 4
|
||||||
device: /dev/kvmd-hid
|
device: /dev/kvmd-hid
|
||||||
|
|
||||||
atx:
|
atx:
|
||||||
|
type: gpio
|
||||||
power_led_pin: 24
|
power_led_pin: 24
|
||||||
hdd_led_pin: 22
|
hdd_led_pin: 22
|
||||||
power_switch_pin: 23
|
power_switch_pin: 23
|
||||||
reset_switch_pin: 27
|
reset_switch_pin: 27
|
||||||
|
|
||||||
msd:
|
msd:
|
||||||
|
type: relay
|
||||||
target_pin: 12
|
target_pin: 12
|
||||||
reset_pin: 13
|
reset_pin: 13
|
||||||
device: /dev/kvmd-msd
|
device: /dev/kvmd-msd
|
||||||
|
|
||||||
streamer:
|
streamer:
|
||||||
sync_delay: 0
|
|
||||||
init_delay: 1
|
|
||||||
desired_fps: 30
|
|
||||||
max_fps: 60
|
|
||||||
unix: /run/kvmd/ustreamer.sock
|
unix: /run/kvmd/ustreamer.sock
|
||||||
cmd:
|
cmd:
|
||||||
- "/usr/bin/ustreamer"
|
- "/usr/bin/ustreamer"
|
||||||
|
|||||||
@@ -9,22 +9,23 @@ logging: !include logging.yaml
|
|||||||
kvmd:
|
kvmd:
|
||||||
server:
|
server:
|
||||||
unix: /run/kvmd/kvmd.sock
|
unix: /run/kvmd/kvmd.sock
|
||||||
unix_rm: true
|
|
||||||
unix_mode: 0660
|
|
||||||
|
|
||||||
auth: !include auth.yaml
|
auth: !include auth.yaml
|
||||||
|
|
||||||
hid:
|
hid:
|
||||||
|
type: serial
|
||||||
reset_pin: 4
|
reset_pin: 4
|
||||||
device: /dev/kvmd-hid
|
device: /dev/kvmd-hid
|
||||||
|
|
||||||
atx:
|
atx:
|
||||||
|
type: gpio
|
||||||
power_led_pin: 24
|
power_led_pin: 24
|
||||||
hdd_led_pin: 22
|
hdd_led_pin: 22
|
||||||
power_switch_pin: 23
|
power_switch_pin: 23
|
||||||
reset_switch_pin: 27
|
reset_switch_pin: 27
|
||||||
|
|
||||||
msd:
|
msd:
|
||||||
|
type: relay
|
||||||
target_pin: 12
|
target_pin: 12
|
||||||
reset_pin: 13
|
reset_pin: 13
|
||||||
device: /dev/kvmd-msd
|
device: /dev/kvmd-msd
|
||||||
@@ -32,7 +33,10 @@ kvmd:
|
|||||||
streamer:
|
streamer:
|
||||||
cap_pin: 17
|
cap_pin: 17
|
||||||
conv_pin: 18
|
conv_pin: 18
|
||||||
init_restart_after: 1
|
sync_delay: 1.0
|
||||||
|
init_delay: 3.0
|
||||||
|
init_restart_after: 1.0
|
||||||
|
desired_fps: 0
|
||||||
unix: /run/kvmd/ustreamer.sock
|
unix: /run/kvmd/ustreamer.sock
|
||||||
cmd:
|
cmd:
|
||||||
- "/usr/bin/ustreamer"
|
- "/usr/bin/ustreamer"
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ logging: !include logging.yaml
|
|||||||
kvmd:
|
kvmd:
|
||||||
server:
|
server:
|
||||||
unix: /run/kvmd/kvmd.sock
|
unix: /run/kvmd/kvmd.sock
|
||||||
unix_rm: true
|
|
||||||
unix_mode: 0660
|
|
||||||
|
|
||||||
auth: !include auth.yaml
|
auth: !include auth.yaml
|
||||||
|
|
||||||
@@ -22,6 +20,7 @@ kvmd:
|
|||||||
device: /dev/kvmd-hid-mouse
|
device: /dev/kvmd-hid-mouse
|
||||||
|
|
||||||
atx:
|
atx:
|
||||||
|
type: gpio
|
||||||
power_led_pin: 24
|
power_led_pin: 24
|
||||||
hdd_led_pin: 22
|
hdd_led_pin: 22
|
||||||
power_switch_pin: 23
|
power_switch_pin: 23
|
||||||
@@ -31,10 +30,6 @@ kvmd:
|
|||||||
type: otg
|
type: otg
|
||||||
|
|
||||||
streamer:
|
streamer:
|
||||||
sync_delay: 0
|
|
||||||
init_delay: 1
|
|
||||||
desired_fps: 30
|
|
||||||
max_fps: 60
|
|
||||||
unix: /run/kvmd/ustreamer.sock
|
unix: /run/kvmd/ustreamer.sock
|
||||||
cmd:
|
cmd:
|
||||||
- "/usr/bin/ustreamer"
|
- "/usr/bin/ustreamer"
|
||||||
|
|||||||
@@ -185,8 +185,8 @@ def _get_config_scheme() -> Dict:
|
|||||||
"host": Option("localhost", type=valid_ip_or_host),
|
"host": Option("localhost", type=valid_ip_or_host),
|
||||||
"port": Option(0, type=valid_port),
|
"port": Option(0, type=valid_port),
|
||||||
"unix": Option("", type=valid_abs_path, only_if="!port", unpack_as="unix_path"),
|
"unix": Option("", type=valid_abs_path, only_if="!port", unpack_as="unix_path"),
|
||||||
"unix_rm": Option(False, type=valid_bool),
|
"unix_rm": Option(True, type=valid_bool),
|
||||||
"unix_mode": Option(0, type=valid_unix_mode),
|
"unix_mode": Option(0o660, type=valid_unix_mode),
|
||||||
"heartbeat": Option(3.0, type=valid_float_f01),
|
"heartbeat": Option(3.0, type=valid_float_f01),
|
||||||
"sync_chunk_size": Option(65536, type=(lambda arg: valid_number(arg, min=1024))),
|
"sync_chunk_size": Option(65536, type=(lambda arg: valid_number(arg, min=1024))),
|
||||||
"access_log_format": Option("[%P / %{X-Real-IP}i] '%r' => %s; size=%b ---"
|
"access_log_format": Option("[%P / %{X-Real-IP}i] '%r' => %s; size=%b ---"
|
||||||
@@ -201,7 +201,7 @@ def _get_config_scheme() -> Dict:
|
|||||||
},
|
},
|
||||||
|
|
||||||
"external": {
|
"external": {
|
||||||
"type": Option(""),
|
"type": Option("", type=(lambda arg: str(arg).strip())),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -211,17 +211,17 @@ def _get_config_scheme() -> Dict:
|
|||||||
},
|
},
|
||||||
|
|
||||||
"hid": {
|
"hid": {
|
||||||
"type": Option("serial"),
|
"type": Option("", type=(lambda arg: str(arg).strip())),
|
||||||
# Dynamic content
|
# Dynamic content
|
||||||
},
|
},
|
||||||
|
|
||||||
"atx": {
|
"atx": {
|
||||||
"type": Option("gpio"),
|
"type": Option("", type=(lambda arg: str(arg).strip())),
|
||||||
# Dynamic content
|
# Dynamic content
|
||||||
},
|
},
|
||||||
|
|
||||||
"msd": {
|
"msd": {
|
||||||
"type": Option("relay"),
|
"type": Option("", type=(lambda arg: str(arg).strip())),
|
||||||
# Dynamic content
|
# Dynamic content
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -229,15 +229,15 @@ def _get_config_scheme() -> Dict:
|
|||||||
"cap_pin": Option(-1, type=valid_gpio_pin_optional),
|
"cap_pin": Option(-1, type=valid_gpio_pin_optional),
|
||||||
"conv_pin": Option(-1, type=valid_gpio_pin_optional),
|
"conv_pin": Option(-1, type=valid_gpio_pin_optional),
|
||||||
|
|
||||||
"sync_delay": Option(1.0, type=valid_float_f0),
|
"sync_delay": Option(0.0, type=valid_float_f0),
|
||||||
"init_delay": Option(3.0, type=valid_float_f0),
|
"init_delay": Option(1.0, type=valid_float_f0),
|
||||||
"init_restart_after": Option(0.0, type=valid_float_f0),
|
"init_restart_after": Option(0.0, type=valid_float_f0),
|
||||||
"shutdown_delay": Option(10.0, type=valid_float_f01),
|
"shutdown_delay": Option(10.0, type=valid_float_f01),
|
||||||
"state_poll": Option(1.0, type=valid_float_f01),
|
"state_poll": Option(1.0, type=valid_float_f01),
|
||||||
|
|
||||||
"quality": Option(80, type=valid_stream_quality),
|
"quality": Option(80, type=valid_stream_quality),
|
||||||
"desired_fps": Option(0, type=valid_stream_fps),
|
"desired_fps": Option(30, type=valid_stream_fps),
|
||||||
"max_fps": Option(120, type=valid_stream_fps),
|
"max_fps": Option(60, type=valid_stream_fps),
|
||||||
|
|
||||||
"host": Option("localhost", type=valid_ip_or_host),
|
"host": Option("localhost", type=valid_ip_or_host),
|
||||||
"port": Option(0, type=valid_port),
|
"port": Option(0, type=valid_port),
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ class BasePlugin:
|
|||||||
|
|
||||||
@functools.lru_cache()
|
@functools.lru_cache()
|
||||||
def get_plugin_class(sub: str, name: str) -> Type[BasePlugin]:
|
def get_plugin_class(sub: str, name: str) -> Type[BasePlugin]:
|
||||||
|
assert sub
|
||||||
|
assert name
|
||||||
try:
|
try:
|
||||||
module = importlib.import_module(f"kvmd.plugins.{sub}.{name}")
|
module = importlib.import_module(f"kvmd.plugins.{sub}.{name}")
|
||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError:
|
||||||
|
|||||||
@@ -82,4 +82,4 @@ class BaseAtx(BasePlugin):
|
|||||||
|
|
||||||
# =====
|
# =====
|
||||||
def get_atx_class(name: str) -> Type[BaseAtx]:
|
def get_atx_class(name: str) -> Type[BaseAtx]:
|
||||||
return get_plugin_class("atx", (name or "disabled")) # type: ignore
|
return get_plugin_class("atx", name) # type: ignore
|
||||||
|
|||||||
@@ -119,4 +119,4 @@ class BaseMsd(BasePlugin):
|
|||||||
|
|
||||||
# =====
|
# =====
|
||||||
def get_msd_class(name: str) -> Type[BaseMsd]:
|
def get_msd_class(name: str) -> Type[BaseMsd]:
|
||||||
return get_plugin_class("msd", (name or "disabled")) # type: ignore
|
return get_plugin_class("msd", name) # type: ignore
|
||||||
|
|||||||
Reference in New Issue
Block a user