mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-18 23:01:49 +02:00
Merge pull request #2450 from alexbelgium/codex/remove-name-validation-from-config.yaml
Move qBittorrent VPN config filename validation to init scripts
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
## 5.1.4-9 (05-02-2026)
|
||||||
|
- Move OpenVPN/WireGuard config filename validation from schema to runtime scripts
|
||||||
|
- Validate config name only when the related VPN mode is enabled
|
||||||
|
|
||||||
## 5.1.4-8 (05-02-2026)
|
## 5.1.4-8 (05-02-2026)
|
||||||
- Allow more complex vpn config names
|
- Allow more complex vpn config names
|
||||||
- Rewrite the openvpn and wireguard scripts in order to make them more robust, secure, and compatible with more suppliers @litinoveweedle
|
- Rewrite the openvpn and wireguard scripts in order to make them more robust, secure, and compatible with more suppliers @litinoveweedle
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ schema:
|
|||||||
keyfile: str
|
keyfile: str
|
||||||
localdisks: str?
|
localdisks: str?
|
||||||
networkdisks: str?
|
networkdisks: str?
|
||||||
openvpn_config: match(^[A-Za-z0-9._-]+\.(conf|ovpn)$)?
|
openvpn_config: str?
|
||||||
openvpn_enabled: bool?
|
openvpn_enabled: bool?
|
||||||
openvpn_password: str?
|
openvpn_password: str?
|
||||||
openvpn_username: str?
|
openvpn_username: str?
|
||||||
@@ -136,10 +136,10 @@ schema:
|
|||||||
run_duration: str?
|
run_duration: str?
|
||||||
silent: bool?
|
silent: bool?
|
||||||
ssl: bool
|
ssl: bool
|
||||||
wireguard_config: match(^[A-Za-z0-9._-]+\.conf$)?
|
wireguard_config: str?
|
||||||
wireguard_enabled: bool?
|
wireguard_enabled: bool?
|
||||||
whitelist: str?
|
whitelist: str?
|
||||||
slug: qbittorrent
|
slug: qbittorrent
|
||||||
udev: true
|
udev: true
|
||||||
url: https://github.com/alexbelgium/hassio-addons
|
url: https://github.com/alexbelgium/hassio-addons
|
||||||
version: "5.1.4-8"
|
version: "5.1.4-9"
|
||||||
|
|||||||
@@ -48,6 +48,10 @@ chmod 600 "${OPENVPN_STATE_DIR}/credentials.conf"
|
|||||||
if bashio::config.has_value "openvpn_config"; then
|
if bashio::config.has_value "openvpn_config"; then
|
||||||
openvpn_config="$(bashio::config 'openvpn_config')"
|
openvpn_config="$(bashio::config 'openvpn_config')"
|
||||||
openvpn_config="${openvpn_config##*/}"
|
openvpn_config="${openvpn_config##*/}"
|
||||||
|
if [[ ! "${openvpn_config}" =~ ^[A-Za-z0-9._-]+\.(conf|ovpn)$ ]]; then
|
||||||
|
bashio::log.fatal "Invalid openvpn_config filename '${openvpn_config}'. Allowed characters: letters, numbers, dot, underscore, dash. Extension must be .conf or .ovpn."
|
||||||
|
bashio::addon.stop
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ -z "${openvpn_config}" ]]; then
|
if [[ -z "${openvpn_config}" ]]; then
|
||||||
bashio::log.info 'openvpn_config option left empty. Attempting automatic selection.'
|
bashio::log.info 'openvpn_config option left empty. Attempting automatic selection.'
|
||||||
|
|||||||
@@ -29,6 +29,10 @@ bashio::log.info "------------------------------"
|
|||||||
if bashio::config.has_value "wireguard_config"; then
|
if bashio::config.has_value "wireguard_config"; then
|
||||||
wireguard_config="$(bashio::config 'wireguard_config')"
|
wireguard_config="$(bashio::config 'wireguard_config')"
|
||||||
wireguard_config="${wireguard_config##*/}"
|
wireguard_config="${wireguard_config##*/}"
|
||||||
|
if [[ ! "${wireguard_config}" =~ ^[A-Za-z0-9._-]+\.conf$ ]]; then
|
||||||
|
bashio::log.fatal "Invalid wireguard_config filename '${wireguard_config}'. Allowed characters: letters, numbers, dot, underscore, dash. Extension must be .conf."
|
||||||
|
bashio::addon.stop
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ -z "${wireguard_config}" ]]; then
|
if [[ -z "${wireguard_config}" ]]; then
|
||||||
bashio::log.info 'wireguard_config option left empty. Attempting automatic selection.'
|
bashio::log.info 'wireguard_config option left empty. Attempting automatic selection.'
|
||||||
|
|||||||
Reference in New Issue
Block a user