mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-13 01:30:31 +08:00
override
This commit is contained in:
parent
8a40b1f062
commit
071fd62f41
4
PKGBUILD
4
PKGBUILD
@ -87,8 +87,8 @@ package_kvmd() {
|
|||||||
for _path in "$_cfg_default/kvmd"/*.yaml; do
|
for _path in "$_cfg_default/kvmd"/*.yaml; do
|
||||||
ln -sf "/usr/share/kvmd/configs.default/kvmd/`basename $_path`" "$pkgdir/etc/kvmd"
|
ln -sf "/usr/share/kvmd/configs.default/kvmd/`basename $_path`" "$pkgdir/etc/kvmd"
|
||||||
done
|
done
|
||||||
rm "$pkgdir/etc/kvmd"/{auth.yaml,meta.yaml}
|
rm "$pkgdir/etc/kvmd"/{override.yaml,logging.yaml,auth.yaml,meta.yaml}
|
||||||
cp "$_cfg_default/kvmd"/{auth.yaml,meta.yaml} "$pkgdir/etc/kvmd"
|
cp "$_cfg_default/kvmd"/{override.yaml,logging.yaml,auth.yaml,meta.yaml} "$pkgdir/etc/kvmd"
|
||||||
cp "$_cfg_default/kvmd/"*passwd "$pkgdir/etc/kvmd"
|
cp "$_cfg_default/kvmd/"*passwd "$pkgdir/etc/kvmd"
|
||||||
chmod 600 "$pkgdir/etc/kvmd/"*passwd
|
chmod 600 "$pkgdir/etc/kvmd/"*passwd
|
||||||
for _path in "$_cfg_default/nginx"/*.conf; do
|
for _path in "$_cfg_default/nginx"/*.conf; do
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
# Don't touch this file otherwise your device may stop working.
|
# Don't touch this file otherwise your device may stop working.
|
||||||
|
# Use override.yaml to modify required settings.
|
||||||
# You can find a working configuration in /usr/share/kvmd/configs.default/kvmd.
|
# You can find a working configuration in /usr/share/kvmd/configs.default/kvmd.
|
||||||
|
|
||||||
|
override: !include override.yaml
|
||||||
|
|
||||||
logging: !include logging.yaml
|
logging: !include logging.yaml
|
||||||
|
|
||||||
kvmd:
|
kvmd:
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
# Don't touch this file otherwise your device may stop working.
|
# Don't touch this file otherwise your device may stop working.
|
||||||
|
# Use override.yaml to modify required settings.
|
||||||
# You can find a working configuration in /usr/share/kvmd/configs.default/kvmd.
|
# You can find a working configuration in /usr/share/kvmd/configs.default/kvmd.
|
||||||
|
|
||||||
|
override: !include override.yaml
|
||||||
|
|
||||||
logging: !include logging.yaml
|
logging: !include logging.yaml
|
||||||
|
|
||||||
kvmd:
|
kvmd:
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
# Don't touch this file otherwise your device may stop working.
|
# Don't touch this file otherwise your device may stop working.
|
||||||
|
# Use override.yaml to modify required settings.
|
||||||
# You can find a working configuration in /usr/share/kvmd/configs.default/kvmd.
|
# You can find a working configuration in /usr/share/kvmd/configs.default/kvmd.
|
||||||
|
|
||||||
|
override: !include override.yaml
|
||||||
|
|
||||||
logging: !include logging.yaml
|
logging: !include logging.yaml
|
||||||
|
|
||||||
kvmd:
|
kvmd:
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
# Don't touch this file otherwise your device may stop working.
|
# Don't touch this file otherwise your device may stop working.
|
||||||
|
# Use override.yaml to modify required settings.
|
||||||
# You can find a working configuration in /usr/share/kvmd/configs.default/kvmd.
|
# You can find a working configuration in /usr/share/kvmd/configs.default/kvmd.
|
||||||
|
|
||||||
|
override: !include override.yaml
|
||||||
|
|
||||||
logging: !include logging.yaml
|
logging: !include logging.yaml
|
||||||
|
|
||||||
kvmd:
|
kvmd:
|
||||||
|
|||||||
7
configs/kvmd/override.yaml
Normal file
7
configs/kvmd/override.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# Use this file to override system settings and other configs like this:
|
||||||
|
#
|
||||||
|
# kvmd:
|
||||||
|
# server:
|
||||||
|
# heartbeat: 5.0
|
||||||
|
#
|
||||||
|
# It will be applied AFTER other configs and "!include" directives and BEFORE validation.
|
||||||
@ -108,6 +108,7 @@ def _init_config(config_path: str, sections: List[str], override_options: List[s
|
|||||||
scheme = _get_config_scheme(sections)
|
scheme = _get_config_scheme(sections)
|
||||||
try:
|
try:
|
||||||
_merge_dicts(raw_config, build_raw_from_options(override_options))
|
_merge_dicts(raw_config, build_raw_from_options(override_options))
|
||||||
|
_merge_dicts(raw_config, (raw_config.get("override") or {}))
|
||||||
config = make_config(raw_config, scheme)
|
config = make_config(raw_config, scheme)
|
||||||
|
|
||||||
if "kvmd" in sections:
|
if "kvmd" in sections:
|
||||||
@ -143,6 +144,8 @@ def _merge_dicts(dest: Dict, src: Dict) -> None:
|
|||||||
|
|
||||||
def _get_config_scheme(sections: List[str]) -> Dict:
|
def _get_config_scheme(sections: List[str]) -> Dict:
|
||||||
scheme = {
|
scheme = {
|
||||||
|
"override": Option({}),
|
||||||
|
|
||||||
"logging": Option({}),
|
"logging": Option({}),
|
||||||
|
|
||||||
"kvmd": {
|
"kvmd": {
|
||||||
|
|||||||
@ -43,3 +43,4 @@ ipmi:
|
|||||||
unix: /run/kvmd/kvmd.sock
|
unix: /run/kvmd/kvmd.sock
|
||||||
|
|
||||||
logging: !include logging.yaml
|
logging: !include logging.yaml
|
||||||
|
override: !include override.yaml
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user