Fix Templates from causing errors with haproxy when added, Fix add notice when haproxy fails check
All checks were successful
HAProxy Manager Build and Push / Build-and-Push (push) Successful in 38s

This commit is contained in:
jknapp 2025-02-21 06:28:51 -08:00
parent c951103b3b
commit ff529be07f
4 changed files with 18 additions and 8 deletions

View File

@ -174,9 +174,9 @@ def request_ssl():
# Request Let's Encrypt certificate # Request Let's Encrypt certificate
result = subprocess.run([ result = subprocess.run([
'certbot', 'certonly', '--standalone', 'certbot', 'certonly', '-n', '--standalone',
'--preferred-challenges', 'http', '--preferred-challenges', 'http', '--http-01-port=8688',
'-d', domain, '--non-interactive --http-01-port=8688' '-d', domain
]) ])
if result.returncode == 0: if result.returncode == 0:
@ -364,7 +364,11 @@ def generate_config():
capture_output=True, capture_output=True,
text=True text=True
) )
print("HAProxy started successfully") if result.returncode == 0:
print("HAProxy started successfully")
else:
print(f"HAProxy start command returned: {result.stdout}")
print(f"Error output: {result.stderr}")
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
print(f"Failed to start HAProxy: {e.stdout}\n{e.stderr}") print(f"Failed to start HAProxy: {e.stdout}\n{e.stderr}")
raise raise
@ -383,7 +387,11 @@ def start_haproxy():
capture_output=True, capture_output=True,
text=True text=True
) )
print("HAProxy started successfully") if result.returncode == 0:
print("HAProxy started successfully")
else:
print(f"HAProxy start command returned: {result.stdout}")
print(f"Error output: {result.stderr}")
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
print(f"Failed to start HAProxy: {e.stdout}\n{e.stderr}") print(f"Failed to start HAProxy: {e.stdout}\n{e.stderr}")
raise raise

View File

@ -3,4 +3,5 @@ backend {{ name }}-backend
option forwardfor option forwardfor
http-request add-header X-CLIENT-IP %[src] http-request add-header X-CLIENT-IP %[src]
{% if ssl_enabled %}http-request set-header X-Forwarded-Proto https if { ssl_fc }{% endif %} {% if ssl_enabled %}http-request set-header X-Forwarded-Proto https if { ssl_fc }{% endif %}
{% for server in servers %}server {{ server.server_name }} {{ server.server_address }}:{{ server.server_port }} {{ server.server_options }}{% endfor %} {% for server in servers %}server {{ server.server_name }} {{ server.server_address }}:{{ server.server_port }} {{ server.server_options }}{% endfor %}

View File

@ -45,4 +45,5 @@ defaults
timeout server 10m timeout server 10m
timeout http-keep-alive 120s timeout http-keep-alive 120s
timeout check 10s timeout check 10s
maxconn 3000 maxconn 3000

View File

@ -1,4 +1,4 @@
#Pass SSL Requests to Lets Encrypt #Pass SSL Requests to Lets Encrypt
backend letsencrypt-backend backend letsencrypt-backend
server letsencrypt 127.0.0.1:8688 server letsencrypt 127.0.0.1:8688