new options

This commit is contained in:
Mateusz Gruszczyński
2025-11-03 12:17:32 +01:00
parent c7a09171e1
commit 2d53843f34
3 changed files with 120 additions and 161 deletions

View File

@@ -13,7 +13,6 @@
</nav>
{% endblock %}
{% block content %}
<div class="row mb-4">
@@ -67,32 +66,24 @@
<div class="card-body">
<!-- FRONTEND SECTION -->
<h6 class="text-primary mb-3"><i class="bi bi-hdd-network me-2"></i>Frontend</h6>
<h6 class="text-primary mb-3"><i class="bi bi-hdd-network me-2"></i>Frontend Configuration</h6>
<div class="row g-3 mb-3">
<div class="col-md-4">
<label for="frontend_name" class="form-label">Frontend Name</label>
<input type="text" class="form-control" id="frontend_name" name="frontend_name"
placeholder="e.g. fe_web" required>
</div>
<div class="col-md-4">
<label for="frontend_ip" class="form-label">IP Address (bind)</label>
<label for="frontend_ip" class="form-label">Listener IP</label>
<input type="text" class="form-control" id="frontend_ip" name="frontend_ip"
placeholder="0.0.0.0" value="0.0.0.0" required>
</div>
<div class="col-md-4">
<label for="frontend_port" class="form-label">Port</label>
<label for="frontend_port" class="form-label">Listener Port</label>
<input type="number" class="form-control" id="frontend_port" name="frontend_port"
placeholder="443" value="443" min="1" max="65535" required>
</div>
</div>
<div class="row g-3 mb-3">
<div class="col-md-12">
<label for="frontend_hostname" class="form-label">Frontend Hostname (Domain)</label>
<div class="col-md-4">
<label for="frontend_hostname" class="form-label">Frontend Hostname</label>
<input type="text" class="form-control" id="frontend_hostname" name="frontend_hostname"
placeholder="e.g. host.domain.com" required>
<div class="form-text">Domain name for the ACL rule - traffic will be matched by Host header</div>
<small class="text-muted d-block mt-1">Frontend name will be generated automatically</small>
</div>
</div>
@@ -114,7 +105,6 @@
<option value="static-rr">Static Round Robin (WRR)</option>
<option value="no-lb">No Load Balancing (single host)</option>
</select>
<div class="form-text">Choose load balancing algorithm or simple single host</div>
</div>
</div>
@@ -135,7 +125,7 @@
<label for="ssl_cert_path" class="form-label">SSL Certificate Path</label>
<input type="text" class="form-control" id="ssl_cert_path" name="ssl_cert_path"
value="/app/ssl/haproxy-configurator.pem">
<div class="form-text">Full path to .pem file, upload certs in /ssl/</div>
<small class="text-muted">Full path to .pem file</small>
</div>
<div class="col-md-12">
<div class="form-check">
@@ -157,24 +147,23 @@
<label class="form-check-label" for="backend_ssl_redirect">
<i class="bi bi-arrow-repeat me-1"></i>Add HTTP Redirect to HTTPS
</label>
<div class="form-text small">Creates additional frontend on port 80 to redirect HTTP to HTTPS backend</div>
<small class="text-muted d-block">Creates additional frontend on port 80</small>
</div>
</div>
</div>
<div class="row g-3 mb-3 d-none" id="backend_ssl_fields">
<div class="col-md-12">
<label for="ssl_redirect_backend_name" class="form-label">Redirect Backend Name (HTTP → HTTPS)</label>
<label for="ssl_redirect_backend_name" class="form-label">Redirect Backend Name</label>
<input type="text" class="form-control" id="ssl_redirect_backend_name"
name="ssl_redirect_backend_name" placeholder="e.g. be_redirect">
<div class="form-text">Name for the redirect backend that will push traffic to HTTPS</div>
name="ssl_redirect_backend_name" placeholder="e.g. redirect">
</div>
</div>
<hr class="my-4">
<!-- BACKEND SECTION -->
<h6 class="text-primary mb-3"><i class="bi bi-hdd-rack me-2"></i>Backend</h6>
<h6 class="text-primary mb-3"><i class="bi bi-hdd-rack me-2"></i>Backend Configuration</h6>
<div class="row g-3 mb-3">
<div class="col-md-12">
@@ -297,9 +286,7 @@
<label class="form-check-label" for="del_server_header">
<i class="bi bi-shield-lock me-1"></i>Hide Server Header
</label>
<div class="form-text small">
Adds: <code>http-response del-header Server</code> (security)
</div>
<small class="text-muted d-block">Adds: <code>http-response del-header Server</code></small>
</div>
</div>
</div>
@@ -336,7 +323,7 @@
<label for="ban_duration" class="form-label">Ban Duration</label>
<input type="text" class="form-control" id="ban_duration" name="ban_duration"
value="30m" placeholder="30m">
<div class="form-text">e.g. 30m, 1h, 24h</div>
<small class="text-muted">e.g. 30m, 1h, 24h</small>
</div>
<div class="col-md-6 d-none" id="dos_fields">
<label for="limit_requests" class="form-label">Request Limit (per min)</label>
@@ -398,7 +385,7 @@
<hr class="my-4">
<!-- CUSTOM ACL SECTION (NEW) -->
<!-- CUSTOM ACL SECTION -->
<h6 class="text-primary mb-3"><i class="bi bi-shuffle me-2"></i>Custom ACL Rules (Advanced)</h6>
<div class="row g-3 mb-3 http-only">
@@ -408,18 +395,17 @@
<label class="form-check-label" for="add_custom_acl">
<i class="bi bi-sliders me-1"></i>Add Custom ACL Rule
</label>
<div class="form-text small">Create additional routing or blocking rules beyond hostname matching</div>
<small class="text-muted d-block">Create additional routing or blocking rules</small>
</div>
</div>
</div>
<!-- Custom ACL Fields (Hidden by default) -->
<!-- Custom ACL Fields -->
<div class="row g-3 mb-3 http-only d-none" id="custom_acl_fields">
<div class="col-md-3">
<label for="custom_acl_name" class="form-label">ACL Name</label>
<input type="text" class="form-control" id="custom_acl_name" name="custom_acl_name"
placeholder="e.g. is_admin_path">
<div class="form-text small">Unique identifier for this rule</div>
</div>
<div class="col-md-3">
@@ -437,8 +423,7 @@
<div class="col-md-3">
<label for="custom_acl_value" class="form-label">Rule Value</label>
<input type="text" class="form-control" id="custom_acl_value" name="custom_acl_value"
placeholder="e.g. /admin, api, 192.168.1.0/24, GET">
<div class="form-text small">Value to match (path, header name, IP, method)</div>
placeholder="e.g. /admin, api, 192.168.1.0/24">
</div>
<div class="col-md-3">
@@ -454,14 +439,12 @@
<label for="custom_acl_backend" class="form-label">Target Backend</label>
<input type="text" class="form-control" id="custom_acl_backend" name="custom_acl_backend"
placeholder="e.g. be_admin">
<div class="form-text small">Backend to send matching traffic to</div>
</div>
<div class="col-md-6 d-none" id="acl_redirect_select">
<label for="custom_acl_redirect_url" class="form-label">Redirect URL</label>
<input type="text" class="form-control" id="custom_acl_redirect_url" name="custom_acl_redirect_url"
placeholder="e.g. https://example.com/new-path">
<div class="form-text small">URL to redirect matching requests to</div>
</div>
</div>