Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Add backend path prepend feature to handler configuration #95

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function toggleSubdomainAction($uuid, $enabled = null)

public function searchHandleAction()
{
return $this->searchBase("reverseproxy.handle", ['enabled', 'reverse', 'subdomain', 'HandleType', 'HandlePath', 'ToDomain', 'ToPort', 'HttpTls', 'HttpTlsTrustedCaCerts', 'HttpTlsServerName', 'HttpNtlm', 'Description']);
return $this->searchBase("reverseproxy.handle", ['enabled', 'reverse', 'subdomain', 'HandleType', 'HandlePath', 'ToDomain', 'ToPort', 'ToPath', 'HttpTls', 'HttpTlsTrustedCaCerts', 'HttpTlsServerName', 'HttpNtlm', 'Description']);
}

public function setHandleAction($uuid)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@
<help><![CDATA[Enter the port number of the backend server. Leave this empty for bind to port 80. For HTTPS, use 443.]]></help>
<advanced>true</advanced>
</field>
<field>
<id>handle.ToPath</id>
<label>Backend Path</label>
<type>text</type>
<help><![CDATA[Enter a path prefix like '/guacamole' that should be prepended to the backend request because the application demands it.]]></help>
<advanced>true</advanced>
</field>
<field>
<id>handle.HttpTls</id>
<label>TLS</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@
<EnableWellKnown>Y</EnableWellKnown>
<EnableRanges>N</EnableRanges>
</ToPort>
<ToPath type="TextField">
<Mask>/^(\/.*)?$/u</Mask>
<ValidationMessage>Please enter a valid 'Backend Path' that starts with '/'.</ValidationMessage>
</ToPath>
<HttpTls type="BooleanField">
<Default>0</Default>
</HttpTls>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
<th data-column-id="HandlePath" data-type="string">Handle Path</th>
<th data-column-id="ToDomain" data-type="string">Backend Domain</th>
<th data-column-id="ToPort" data-type="string">Backend Port</th>
<th data-column-id="ToPath" data-type="string">Backend Path</th>
<th data-column-id="HttpTls" data-type="boolean" data-formatter="boolean" data-visible="false">TLS</th>
<th data-column-id="HttpTlsTrustedCaCerts" data-type="string" data-visible="false">TLS CA</th>
<th data-column-id="HttpTlsServerName" data-type="string" data-visible="false">TLS Server Name</th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@

{% macro reverse_proxy_configuration(handle) %}
{{ handle.HandleType }} {{ handle.HandlePath|default("") }} {
{% if handle.ToPath|default("") != "" %}
rewrite * {{ handle.ToPath }}{uri}
{% endif %}
reverse_proxy {{ handle.ToDomain }}{% if handle.ToPort %}:{{ handle.ToPort }}{% endif %} {
{% if handle.HttpTls|default("0") == "1" %}
{% if handle.HttpNtlm|default("0") == "1" %}
Expand Down