Skip to content
This repository was archived by the owner on Dec 30, 2025. It is now read-only.

Commit 2238be8

Browse files
committed
feat(Makefile, compose.yaml): enhance SSL certificate management for UnrealIRCd
Add steps to copy CA bundle and restart UnrealIRCd after SSL setup and renewal to ensure new certificates are loaded. Introduce a delay to allow certificate syncing. Update compose.yaml to include UnrealIRCd TLS directory for certificate storage and automate copying of certificates to this directory. These changes improve the automation and reliability of SSL certificate management for UnrealIRCd, ensuring that the server always uses the latest certificates without manual intervention. This enhances security and reduces downtime related to certificate updates.
1 parent 664fad6 commit 2238be8

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,11 +519,22 @@ setup-ssl: ## Setup SSL certificates with Let's Encrypt (ONE-TIME MANUAL SETUP)
519519
done
520520
@echo -e "$(BLUE)[INFO]$(NC) Issuing certificates..."
521521
$(DOCKER_COMPOSE) exec certbot /usr/local/bin/certbot-scripts/entrypoint.sh issue
522+
@echo -e "$(BLUE)[INFO]$(NC) Waiting for certificates to be synced..."
523+
@sleep 10
524+
@echo -e "$(BLUE)[INFO]$(NC) Copying CA bundle for HTTPS client..."
525+
@cp unrealircd/default/tls/curl-ca-bundle.crt unrealircd/conf/tls/ 2>/dev/null || true
526+
@echo -e "$(BLUE)[INFO]$(NC) Restarting UnrealIRCd to load new certificates..."
527+
@$(DOCKER_COMPOSE) restart unrealircd >/dev/null 2>&1 || true
522528
@echo -e "$(GREEN)[SUCCESS]$(NC) SSL certificate setup completed!"
523529

524530
ssl-renew: ## Renew SSL certificates
525531
@echo -e "$(PURPLE)=== Renewing SSL Certificates ===$(NC)"
526532
$(DOCKER_COMPOSE) exec certbot /usr/local/bin/certbot-scripts/entrypoint.sh renew
533+
@echo -e "$(BLUE)[INFO]$(NC) Waiting for certificates to be synced..."
534+
@sleep 10
535+
@echo -e "$(BLUE)[INFO]$(NC) Restarting UnrealIRCd to load renewed certificates..."
536+
@$(DOCKER_COMPOSE) restart unrealircd >/dev/null 2>&1 || true
537+
@echo -e "$(GREEN)[SUCCESS]$(NC) SSL certificate renewal completed!"
527538

528539
ssl-check: ## Check SSL certificate status
529540
@echo -e "$(PURPLE)=== SSL Certificate Status ===$(NC)"
@@ -565,6 +576,11 @@ certbot-issue: ## Issue new certificates
565576
certbot-renew: ## Renew certificates
566577
@echo -e "$(PURPLE)=== Renewing Certificates ===$(NC)"
567578
$(DOCKER_COMPOSE) exec certbot /usr/local/bin/certbot-scripts/entrypoint.sh renew
579+
@echo -e "$(BLUE)[INFO]$(NC) Waiting for certificates to be synced..."
580+
@sleep 10
581+
@echo -e "$(BLUE)[INFO]$(NC) Restarting UnrealIRCd to load renewed certificates..."
582+
@$(DOCKER_COMPOSE) restart unrealircd >/dev/null 2>&1 || true
583+
@echo -e "$(GREEN)[SUCCESS]$(NC) Certificate renewal completed!"
568584

569585
certbot-status-check: ## Check certificate status
570586
@echo -e "$(PURPLE)=== Certificate Status ===$(NC)"

compose.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,17 +142,27 @@ services:
142142
volumes:
143143
- certbot_conf:/etc/letsencrypt:ro
144144
- ./.runtime/certs:/app/certs
145+
- ./unrealircd/conf/tls:/app/unrealircd-tls
145146

146147
# Sync certificates
147148
command: >
148149
sh -c "
149150
apk add --no-cache inotify-tools &&
150-
mkdir -p /app/certs &&
151+
mkdir -p /app/certs /app/unrealircd-tls &&
151152
while true; do
152-
# Copy latest certificates
153+
# Copy latest certificates to runtime directory
153154
if [ -d /etc/letsencrypt/live ]; then
154155
cp -r /etc/letsencrypt/live/* /app/certs/ 2>/dev/null || true
155156
fi
157+
# Copy certificates to UnrealIRCd TLS directory
158+
if [ -d /etc/letsencrypt/live ]; then
159+
for domain_dir in /etc/letsencrypt/live/*; do
160+
if [ -d \"\$$domain_dir\" ]; then
161+
cp \"\$$domain_dir/fullchain.pem\" /app/unrealircd-tls/server.cert.pem 2>/dev/null || true
162+
cp \"\$$domain_dir/privkey.pem\" /app/unrealircd-tls/server.key.pem 2>/dev/null || true
163+
fi
164+
done
165+
fi
156166
sleep 3600 # Check every hour
157167
done
158168
"

0 commit comments

Comments
 (0)