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
result = subprocess.run([
'certbot', 'certonly', '--standalone',
'--preferred-challenges', 'http',
'-d', domain, '--non-interactive --http-01-port=8688'
'certbot', 'certonly', '-n', '--standalone',
'--preferred-challenges', 'http', '--http-01-port=8688',
'-d', domain
])
if result.returncode == 0:
@ -364,7 +364,11 @@ def generate_config():
capture_output=True,
text=True
)
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:
print(f"Failed to start HAProxy: {e.stdout}\n{e.stderr}")
raise
@ -383,7 +387,11 @@ def start_haproxy():
capture_output=True,
text=True
)
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:
print(f"Failed to start HAProxy: {e.stdout}\n{e.stderr}")
raise

View File

@ -4,3 +4,4 @@ backend {{ name }}-backend
http-request add-header X-CLIENT-IP %[src]
{% 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 %}

View File

@ -46,3 +46,4 @@ defaults
timeout http-keep-alive 120s
timeout check 10s
maxconn 3000