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

Commit fa16997

Browse files
committed
feat(Makefile, compose.yaml, entrypoint.sh): enhance SSL setup process with improved certbot management
Improve the SSL setup process by enhancing the certbot service management. The Makefile now includes steps to start the certbot service, wait for it to be ready, and issue certificates. This ensures a more reliable and automated certificate issuance process. In `compose.yaml`, an entrypoint is added to keep the certbot container running, which is necessary for the service to be available for certificate issuance. The `entrypoint.sh` script is updated to use `sh` instead of `bash` for better compatibility across different environments. These changes aim to streamline the SSL setup and renewal process, reducing manual intervention and potential errors.
1 parent 5a50b6e commit fa16997

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,13 @@ setup-ssl: ## Setup SSL certificates with Let's Encrypt (ONE-TIME MANUAL SETUP)
503503
@echo -e "$(BLUE)[INFO]$(NC) and fill in your Cloudflare credentials."
504504
@echo -e "$(BLUE)[INFO]$(NC) After this, certificates renew AUTOMATICALLY every 30 days"
505505
@echo
506-
$(DOCKER_COMPOSE) --profile cert-issue up unrealircd-certbot
506+
@echo -e "$(BLUE)[INFO]$(NC) Starting certbot service to issue certificates..."
507+
$(DOCKER_COMPOSE) up -d certbot
508+
@echo -e "$(BLUE)[INFO]$(NC) Waiting for certbot service to be ready..."
509+
@timeout 60 bash -c 'until $(DOCKER_COMPOSE) exec certbot echo "Service ready" >/dev/null 2>&1; do sleep 2; done' || (echo -e "$(RED)[ERROR]$(NC) Certbot service failed to start properly" && exit 1)
510+
@echo -e "$(BLUE)[INFO]$(NC) Issuing certificates..."
511+
$(DOCKER_COMPOSE) exec certbot /usr/local/bin/certbot-scripts/entrypoint.sh issue
512+
@echo -e "$(GREEN)[SUCCESS]$(NC) SSL certificate setup completed!"
507513

508514
ssl-renew: ## Renew SSL certificates
509515
@echo -e "$(PURPLE)=== Renewing SSL Certificates ===$(NC)"

compose.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ services:
8888
hostname: certbot-manager
8989
restart: unless-stopped
9090

91+
# Keep container running
92+
entrypoint: ["sleep", "infinity"]
93+
9194
# Environment from main project
9295
env_file:
9396
- path: .env.production

scripts/certbot/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22

33
# ============================================================================
44
# CERTBOT ENTRYPOINT SCRIPT

0 commit comments

Comments
 (0)