mirror of
https://github.com/FAUSheppy/athq-vm-management
synced 2025-12-08 14:38:33 +01:00
feat: extra content option for stream block
This commit is contained in:
@@ -13,6 +13,10 @@ server {
|
|||||||
proxy_pass {{ targetip }}:$server_port;
|
proxy_pass {{ targetip }}:$server_port;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if extra_content %}
|
||||||
|
{{ extra_content }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if transparent %}
|
{% if transparent %}
|
||||||
proxy_bind $remote_addr:{% if targetportoverwrite %}{{ targetportoverwrite }}{% else %}$remote_port{% endif %} transparent;
|
proxy_bind $remote_addr:{% if targetportoverwrite %}{{ targetportoverwrite }}{% else %}$remote_port{% endif %} transparent;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
3
vm.py
3
vm.py
@@ -66,6 +66,7 @@ class VM:
|
|||||||
proto = portStruct.get("proto") or "tcp"
|
proto = portStruct.get("proto") or "tcp"
|
||||||
isUDP = proto == "udp"
|
isUDP = proto == "udp"
|
||||||
proxy_timeout = portStruct.get("proxy_timeout") or "10s"
|
proxy_timeout = portStruct.get("proxy_timeout") or "10s"
|
||||||
|
extra_content = portStruct.get("extra-content")
|
||||||
|
|
||||||
compositeName = "-".join((self.hostname, name, portstring, proto))
|
compositeName = "-".join((self.hostname, name, portstring, proto))
|
||||||
|
|
||||||
@@ -74,7 +75,7 @@ class VM:
|
|||||||
|
|
||||||
component = template.render(targetip=self.ip, udp=isUDP, portstring=portstring,
|
component = template.render(targetip=self.ip, udp=isUDP, portstring=portstring,
|
||||||
transparent=transparent, proxy_timeout=proxy_timeout,
|
transparent=transparent, proxy_timeout=proxy_timeout,
|
||||||
comment=compositeName)
|
comment=compositeName, extra_content=extra_content)
|
||||||
components.append(component)
|
components.append(component)
|
||||||
|
|
||||||
return components
|
return components
|
||||||
|
|||||||
Reference in New Issue
Block a user