@@ -7,36 +7,75 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
77This repository contains SSL certificate management scripts for Linux systems:
88
991 . ** ` tls.sh ` ** - Original comprehensive 3X-UI panel management script (full functionality)
10- 2 . ** ` cert_manager.sh ` ** - Simplified SSL certificate management script (certificates only)
10+ 2 . ** ` cert_manager.sh ` ** - Comprehensive SSL certificate management script with support for multiple CAs and validation methods
1111
12- The ` cert_manager.sh ` script is a focused version that handles only SSL certificate operations with automatic renewal capabilities .
12+ The ` cert_manager.sh ` script is a full-featured certificate management tool supporting both acme.sh and Certbot with multiple DNS providers .
1313
1414## cert_manager.sh Architecture
1515
16- The simplified SSL certificate script focuses exclusively on certificate management :
16+ The comprehensive SSL certificate management script with 20+ certificate issuance methods :
1717
1818### Core Functions
1919- ** Logging functions** : ` LOGD() ` , ` LOGE() ` , ` LOGI() ` - Color-coded output for debugging, errors, and info
2020- ** OS Detection** : Automatically detects Linux distribution and version, supporting Ubuntu, Debian, CentOS, Fedora, Arch, and others
21- - ** Dependency Management** : Automatic installation of required packages (curl, wget, socat, cron)
22-
23- ### Main Features
24- 1 . ** Certificate Issuance** : HTTP validation and Cloudflare DNS validation methods
25- 2 . ** Certificate Management** : Revoke, force renew, list certificates
26- 3 . ** Automatic Renewal** : Cron-based auto-renewal setup with logging
27- 4 . ** Dependency Installation** : Auto-installs acme.sh, cron, and other required tools
21+ - ** Dependency Management** : Automatic installation of required packages (curl, wget, socat, cron/cronie)
22+
23+ ### Certificate Issuance Methods
24+
25+ #### ACME.SH Methods (Let's Encrypt/ZeroSSL)
26+ 1 . ** ssl_cert_issue()** : HTTP validation (port 80)
27+ 2 . ** ssl_cert_issue_CF()** : Cloudflare DNS validation
28+ 3 . ** ssl_cert_issue_acme_route53()** : AWS Route53 DNS validation
29+ 4 . ** ssl_cert_issue_acme_gcloud()** : Google Cloud DNS validation
30+ 5 . ** ssl_cert_issue_acme_digitalocean()** : DigitalOcean DNS validation
31+ 6 . ** ssl_cert_issue_acme_zerossl()** : ZeroSSL CA integration
32+
33+ #### Certbot Methods
34+ 1 . ** ssl_cert_issue_certbot_standalone()** : Standalone mode (port 80)
35+ 2 . ** ssl_cert_issue_certbot_webroot()** : Webroot mode (existing web server)
36+ 3 . ** ssl_cert_issue_certbot_dns_cloudflare()** : Cloudflare DNS plugin
37+ 4 . ** ssl_cert_issue_certbot_dns_route53()** : AWS Route53 DNS plugin
38+ 5 . ** ssl_cert_issue_certbot_dns_google()** : Google Cloud DNS plugin
39+ 6 . ** ssl_cert_issue_certbot_dns_digitalocean()** : DigitalOcean DNS plugin
40+
41+ #### Other Methods
42+ - ** ssl_cert_selfsigned()** : Generate self-signed certificates for testing
43+
44+ ### Certificate Management Functions
45+ - ** revoke_certificate()** : Revoke existing certificates
46+ - ** force_renew_certificate()** : Force immediate certificate renewal
47+ - ** list_certificates()** : Display all installed certificates
48+
49+ ### Infrastructure Functions
50+ - ** install_dependencies()** : Auto-install system dependencies (curl, wget, socat, cron)
51+ - ** install_acme()** : Install and configure acme.sh
52+ - ** install_certbot()** : Install and configure Certbot
53+ - ** install_certbot_dns_plugins()** : Install DNS provider plugins for Certbot
54+ - ** setup_auto_renewal()** : Configure cron-based automatic renewal
55+ - ** check_auto_renewal()** : Verify auto-renewal status and view logs
2856
2957### Menu System
30- - ` show_menu() ` : Simple menu with 9 certificate-focused options
58+ - ` show_menu() ` : Comprehensive menu with 20+ certificate issuance options organized in 4 sections
59+ - ** ACME.SH Methods** (options 1-6): Let's Encrypt/ZeroSSL via acme.sh
60+ - ** Certbot Methods** (options 11-16): Alternative via Certbot
61+ - ** Certificate Management** (options 21-23): Revoke, renew, list
62+ - ** Other Options** (options 31-34): Self-signed, dependencies, auto-renewal
3163- Direct command execution via command line arguments
3264- ` before_show_menu() ` : Standard return-to-menu pattern
3365
3466### Command Line Interface
3567``` bash
3668./cert_manager.sh # Interactive menu
37- ./cert_manager.sh install # Install dependencies
38- ./cert_manager.sh issue # Issue new SSL certificate
39- ./cert_manager.sh cloudflare # Issue SSL certificate via Cloudflare DNS
69+ ./cert_manager.sh install # Install dependencies (acme.sh + certbot)
70+ ./cert_manager.sh issue # Issue via acme.sh HTTP
71+ ./cert_manager.sh cloudflare # Issue via acme.sh Cloudflare DNS
72+ ./cert_manager.sh route53 # Issue via acme.sh Route53 DNS
73+ ./cert_manager.sh gcloud # Issue via acme.sh Google Cloud DNS
74+ ./cert_manager.sh digitalocean # Issue via acme.sh DigitalOcean DNS
75+ ./cert_manager.sh zerossl # Issue via acme.sh ZeroSSL CA
76+ ./cert_manager.sh certbot-standalone # Issue via Certbot standalone
77+ ./cert_manager.sh certbot-webroot # Issue via Certbot webroot
78+ ./cert_manager.sh self-signed # Generate self-signed certificate
4079./cert_manager.sh revoke # Revoke SSL certificate
4180./cert_manager.sh renew # Force renew SSL certificate
4281./cert_manager.sh list # List all certificates
@@ -65,10 +104,20 @@ The simplified SSL certificate script focuses exclusively on certificate managem
65104- Uses Let's Encrypt as default CA
66105
67106## External Dependencies
68- - ** acme.sh** : Official ACME client for certificate management
107+ - ** acme.sh** : Official ACME client for Let's Encrypt/ZeroSSL certificates
108+ - ** Certbot** : Alternative ACME client with plugin ecosystem
69109- ** System packages** : curl, wget, socat, cron/cronie
70- - ** Let's Encrypt** : Default certificate authority
71- - ** Cloudflare API** : For DNS validation (optional)
110+ - ** Certificate Authorities** : Let's Encrypt (default), ZeroSSL
111+ - ** DNS Providers** (optional):
112+ - Cloudflare API: For Cloudflare DNS validation
113+ - AWS Route53 API: For Route53 DNS validation
114+ - Google Cloud DNS API: For Google Cloud DNS validation
115+ - DigitalOcean API: For DigitalOcean DNS validation
116+ - ** Certbot DNS Plugins** (installed on demand):
117+ - python3-certbot-dns-cloudflare
118+ - python3-certbot-dns-route53
119+ - python3-certbot-dns-google
120+ - python3-certbot-dns-digitalocean
72121
73122## Development Notes
74123- Self-contained single file script
@@ -79,8 +128,26 @@ The simplified SSL certificate script focuses exclusively on certificate managem
79128- No build process required - direct bash execution
80129
81130## Usage Requirements
131+
132+ ### General Requirements
82133- Must run as root user
83134- Internet connectivity required
84- - Domain must point to server (for HTTP validation)
85- - Cloudflare API credentials (for DNS validation)
86- - Port 80 available (for HTTP validation)
135+ - Valid domain name
136+
137+ ### For HTTP Validation (acme.sh/Certbot standalone)
138+ - Domain must point to server
139+ - Port 80 available
140+
141+ ### For Webroot Validation (Certbot webroot)
142+ - Existing web server configured
143+ - Webroot directory accessible
144+
145+ ### For DNS Validation (any provider)
146+ - API credentials for chosen DNS provider:
147+ - ** Cloudflare** : Global API Key + Email or API Token
148+ - ** AWS Route53** : AWS Access Key ID + Secret Access Key
149+ - ** Google Cloud** : Service Account JSON key file
150+ - ** DigitalOcean** : API Token
151+
152+ ### For Self-Signed Certificates
153+ - No external requirements (local generation only)
0 commit comments