Compare commits
	
		
			26 Commits
		
	
	
		
			7fae370ef0
			...
			master
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 257fb6e98f | ||
|   | d32885b732 | ||
|   | e73027a3c8 | ||
|   | 0a4f4bf1d4 | ||
|   | 561a3b23f6 | ||
|   | c42250196f | ||
|   | 81d13e44eb | ||
|   | dccad5d7a4 | ||
|   | 864ee27d01 | ||
|   | f9e388f08e | ||
|   | 32c2dbc281 | ||
|   | 41dc2818f1 | ||
|   | d3a10d2734 | ||
|   | b8751516bd | ||
|   | cb9eb16e96 | ||
|   | 2249136f16 | ||
|   | 9355644da1 | ||
|   | b9ae19865c | ||
|   | afafb8aeef | ||
|   | 519f7ac5f2 | ||
|   | 62537ce93c | ||
|   | f6a7a621f9 | ||
|   | 92f9e1edd1 | ||
|   | 5a37e451a5 | ||
|   | 7fc8b3894c | ||
|   | 736fdd2bac | 
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -9,3 +9,4 @@ config.ini | ||||
| venv/ | ||||
| *.swp | ||||
| .DS_Store | ||||
| logs/*.log | ||||
							
								
								
									
										837
									
								
								certpusher.py
									
									
									
									
									
								
							
							
						
						
									
										837
									
								
								certpusher.py
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -1,11 +1,19 @@ | ||||
| # ╔═══════════════════════════════════════════════════════════╗ | ||||
| # ║              CertPusher Configuration File                ║ | ||||
| # ║      SSL Certificate Distribution Configuration           ║ | ||||
| # ╚═══════════════════════════════════════════════════════════╝ | ||||
|  | ||||
| [global] | ||||
| # Path to source SSL certificate (fullchain recommended) | ||||
| # Global source certificate and private key | ||||
| source_cert_path = /etc/letsencrypt/live/example.com/fullchain.pem | ||||
| source_key_path = /etc/letsencrypt/live/example.com/privkey.pem | ||||
|  | ||||
| # Default SSH key for all hosts (can be overridden per host) | ||||
| default_ssh_key = /root/.ssh/id_rsa | ||||
|  | ||||
| # ==================== MIKROTIK DEVICES ==================== | ||||
| # ═══════════════════════════════════════════════════════════ | ||||
| # MIKROTIK DEVICES | ||||
| # ═══════════════════════════════════════════════════════════ | ||||
|  | ||||
| [mikrotik_router] | ||||
| type = mikrotik | ||||
| @@ -13,62 +21,52 @@ hostname = 172.16.0.1 | ||||
| port = 51022 | ||||
| username = admin | ||||
| ssh_key_path = /root/.ssh/id_rsa_proxy | ||||
| # For MikroTik, you need to provide the private key separately | ||||
| source_key_path = /etc/letsencrypt/live/example.com/privkey.pem | ||||
| # Note: check_url not used for MikroTik | ||||
| # Check certificate before upload (default: true) | ||||
| check_before_upload = true | ||||
| mikrotik_services = www-ssl,api-ssl | ||||
|  | ||||
|  | ||||
| [mikrotik_switch] | ||||
| type = mikrotik | ||||
| hostname = 192.168.1.50 | ||||
| port = 22 | ||||
| username = admin | ||||
| source_key_path = /etc/letsencrypt/live/example.com/privkey.pem | ||||
| # Always upload without checking | ||||
| check_before_upload = false | ||||
| mikrotik_services = www-ssl,api-ssl | ||||
|  | ||||
| # ==================== PROXMOX HOSTS ==================== | ||||
|  | ||||
| [proxmox_node1] | ||||
| type = standard | ||||
| hostname = pve1.example.com | ||||
| port = 22 | ||||
| # ═══════════════════════════════════════════════════════════ | ||||
| # PROXMOX VE SERVERS | ||||
| # ═══════════════════════════════════════════════════════════ | ||||
|  | ||||
| [proxmox1] | ||||
| type = proxmox | ||||
| hostname = 10.87.2.150 | ||||
| port = 11922 | ||||
| username = root | ||||
| # Proxmox uses /etc/pve/local/ which is a symlink to /etc/pve/nodes/NODENAME/ | ||||
| remote_cert_path = /etc/pve/local/pveproxy-ssl.pem | ||||
| additional_files = /etc/letsencrypt/live/example.com/privkey.pem:/etc/pve/local/pveproxy-ssl.key | ||||
| post_upload_command = systemctl restart pveproxy | ||||
| check_url = https://pve1.example.com:8006 | ||||
| check_url = https://10.87.2.150:8006 | ||||
| check_before_upload = true | ||||
|  | ||||
| [proxmox_node2] | ||||
| type = standard | ||||
| hostname = 10.0.0.51 | ||||
| port = 22 | ||||
| [proxmox2] | ||||
| type = proxmox | ||||
| hostname = 10.87.2.151 | ||||
| port = 11922 | ||||
| username = root | ||||
| remote_cert_path = /etc/pve/local/pveproxy-ssl.pem | ||||
| additional_files = /etc/letsencrypt/live/example.com/privkey.pem:/etc/pve/local/pveproxy-ssl.key | ||||
| post_upload_command = systemctl restart pveproxy | ||||
| check_url = https://10.0.0.51:8006 | ||||
| check_url = https://10.87.2.151:8006 | ||||
| check_before_upload = true | ||||
|  | ||||
| [proxmox_cluster_node] | ||||
| type = standard | ||||
| hostname = pve-cluster.local | ||||
| port = 22 | ||||
| username = root | ||||
| # For clustered Proxmox, certificate is stored per-node | ||||
| remote_cert_path = /etc/pve/nodes/pve-cluster/pveproxy-ssl.pem | ||||
| additional_files = /etc/letsencrypt/live/example.com/privkey.pem:/etc/pve/nodes/pve-cluster/pveproxy-ssl.key | ||||
| post_upload_command = chmod 600 /etc/pve/nodes/pve-cluster/pveproxy-ssl.key && systemctl restart pveproxy | ||||
| check_url = https://pve-cluster.local:8006 | ||||
|  | ||||
| # ==================== HOME ASSISTANT ==================== | ||||
| # ═══════════════════════════════════════════════════════════ | ||||
| # HOME ASSISTANT INSTALLATIONS | ||||
| # ═══════════════════════════════════════════════════════════ | ||||
|  | ||||
| [homeassistant_supervised] | ||||
| type = standard | ||||
| hostname = 192.168.1.100 | ||||
| port = 22 | ||||
| username = root | ||||
| # Home Assistant Supervised stores SSL in /ssl/ directory | ||||
| remote_cert_path = /usr/share/hassio/ssl/fullchain.pem | ||||
| additional_files = /etc/letsencrypt/live/example.com/privkey.pem:/usr/share/hassio/ssl/privkey.pem | ||||
| # Home Assistant needs to be restarted via ha command | ||||
| remote_key_path = /usr/share/hassio/ssl/privkey.pem | ||||
| post_upload_command = ha core restart | ||||
| check_url = https://homeassistant.local:8123 | ||||
|  | ||||
| @@ -78,9 +76,8 @@ hostname = 192.168.1.101 | ||||
| port = 22 | ||||
| username = homeassistant | ||||
| ssh_key_path = /root/.ssh/homeassistant_key | ||||
| # Home Assistant Core uses the config directory | ||||
| remote_cert_path = /home/homeassistant/.homeassistant/fullchain.pem | ||||
| additional_files = /etc/letsencrypt/live/example.com/privkey.pem:/home/homeassistant/.homeassistant/privkey.pem | ||||
| remote_key_path = /home/homeassistant/.homeassistant/privkey.pem | ||||
| post_upload_command = sudo systemctl restart home-assistant@homeassistant | ||||
| check_url = https://192.168.1.101:8123 | ||||
|  | ||||
| @@ -89,10 +86,8 @@ type = standard | ||||
| hostname = 192.168.1.102 | ||||
| port = 22 | ||||
| username = root | ||||
| # Home Assistant in Docker - certificate goes to mounted config volume | ||||
| remote_cert_path = /opt/homeassistant/config/fullchain.pem | ||||
| additional_files = /etc/letsencrypt/live/example.com/privkey.pem:/opt/homeassistant/config/privkey.pem | ||||
| # Restart Docker container | ||||
| remote_key_path = /opt/homeassistant/config/privkey.pem | ||||
| post_upload_command = docker restart homeassistant | ||||
| check_url = https://ha.example.com:8123 | ||||
|  | ||||
| @@ -101,26 +96,24 @@ type = standard | ||||
| hostname = 192.168.1.103 | ||||
| port = 22 | ||||
| username = root | ||||
| # Home Assistant OS (HassOS) - using SSH add-on | ||||
| remote_cert_path = /ssl/fullchain.pem | ||||
| additional_files = /etc/letsencrypt/live/example.com/privkey.pem:/ssl/privkey.pem | ||||
| remote_key_path = /ssl/privkey.pem | ||||
| post_upload_command = ha core restart | ||||
| check_url = https://192.168.1.103:8123 | ||||
|  | ||||
| # ==================== HOME ASSISTANT WITH NGINX PROXY ==================== | ||||
|  | ||||
| [homeassistant_nginx_proxy] | ||||
| type = standard | ||||
| hostname = 192.168.1.104 | ||||
| port = 22 | ||||
| username = root | ||||
| # When using nginx as reverse proxy for Home Assistant | ||||
| remote_cert_path = /etc/nginx/ssl/homeassistant/fullchain.pem | ||||
| additional_files = /etc/letsencrypt/live/example.com/privkey.pem:/etc/nginx/ssl/homeassistant/privkey.pem | ||||
| remote_key_path = /etc/nginx/ssl/homeassistant/privkey.pem | ||||
| post_upload_command = nginx -t && systemctl reload nginx | ||||
| check_url = https://ha.example.com | ||||
|  | ||||
| # ==================== STANDARD WEB SERVERS ==================== | ||||
| # ═══════════════════════════════════════════════════════════ | ||||
| # WEB SERVERS (NGINX & APACHE) | ||||
| # ═══════════════════════════════════════════════════════════ | ||||
|  | ||||
| [webserver_nginx] | ||||
| type = standard | ||||
| @@ -128,7 +121,7 @@ hostname = 192.168.1.110 | ||||
| port = 22 | ||||
| username = root | ||||
| remote_cert_path = /etc/nginx/ssl/fullchain.pem | ||||
| additional_files = /etc/letsencrypt/live/example.com/privkey.pem:/etc/nginx/ssl/privkey.pem | ||||
| remote_key_path = /etc/nginx/ssl/privkey.pem | ||||
| post_upload_command = nginx -t && systemctl reload nginx | ||||
| check_url = https://example.com | ||||
|  | ||||
| @@ -139,11 +132,13 @@ port = 2222 | ||||
| username = admin | ||||
| ssh_key_path = /root/.ssh/webserver_key | ||||
| remote_cert_path = /etc/apache2/ssl/fullchain.pem | ||||
| additional_files = /etc/letsencrypt/live/example.com/privkey.pem:/etc/apache2/ssl/privkey.pem | ||||
| remote_key_path = /etc/apache2/ssl/privkey.pem | ||||
| post_upload_command = apachectl configtest && systemctl reload apache2 | ||||
| check_url = https://subdomain.example.com | ||||
|  | ||||
| # ==================== MAIL SERVERS ==================== | ||||
| # ═══════════════════════════════════════════════════════════ | ||||
| # MAIL SERVERS (POSTFIX/DOVECOT) | ||||
| # ═══════════════════════════════════════════════════════════ | ||||
|  | ||||
| [mailserver_postfix] | ||||
| type = standard | ||||
| @@ -151,18 +146,21 @@ hostname = mail.example.com | ||||
| port = 22 | ||||
| username = root | ||||
| remote_cert_path = /etc/postfix/ssl/cert.pem | ||||
| additional_files = /etc/letsencrypt/live/example.com/privkey.pem:/etc/postfix/ssl/privkey.pem | ||||
| remote_key_path = /etc/postfix/ssl/privkey.pem | ||||
| post_upload_command = systemctl restart postfix && systemctl restart dovecot | ||||
| check_url = https://mail.example.com:587 | ||||
|  | ||||
| # ==================== DOCKER / CONTAINER HOSTS ==================== | ||||
| # ═══════════════════════════════════════════════════════════ | ||||
| # DOCKER / CONTAINER PLATFORMS | ||||
| # ═══════════════════════════════════════════════════════════ | ||||
|  | ||||
| [docker_traefik] | ||||
| type = standard | ||||
| hostname = 10.0.0.60 | ||||
| port = 22 | ||||
| username = root | ||||
| remote_cert_path = /opt/docker/traefik/certs/cert.pem | ||||
| additional_files = /etc/letsencrypt/live/example.com/privkey.pem:/opt/docker/traefik/certs/key.pem | ||||
| remote_cert_path = /opt/docker/traefik/certs/fullchain.pem | ||||
| remote_key_path = /opt/docker/traefik/certs/privkey.pem | ||||
| post_upload_command = docker restart traefik | ||||
| check_url = https://traefik.example.com | ||||
|  | ||||
| @@ -171,12 +169,14 @@ type = standard | ||||
| hostname = 10.0.0.61 | ||||
| port = 22 | ||||
| username = root | ||||
| remote_cert_path = /opt/docker/nginx-proxy-manager/letsencrypt/live/npm-1/fullchain.pem | ||||
| additional_files = /etc/letsencrypt/live/example.com/privkey.pem:/opt/docker/nginx-proxy-manager/letsencrypt/live/npm-1/privkey.pem | ||||
| remote_cert_path = /opt/docker/npm/ssl/fullchain.pem | ||||
| remote_key_path = /opt/docker/npm/ssl/privkey.pem | ||||
| post_upload_command = docker exec nginx-proxy-manager nginx -s reload | ||||
| check_url = https://npm.example.com | ||||
|  | ||||
| # ==================== STORAGE / NAS ==================== | ||||
| # ═══════════════════════════════════════════════════════════ | ||||
| # STORAGE / NAS DEVICES | ||||
| # ═══════════════════════════════════════════════════════════ | ||||
|  | ||||
| [truenas_scale] | ||||
| type = standard | ||||
| @@ -184,7 +184,7 @@ hostname = 10.0.0.70 | ||||
| port = 22 | ||||
| username = root | ||||
| remote_cert_path = /etc/certificates/truenas_cert.crt | ||||
| additional_files = /etc/letsencrypt/live/example.com/privkey.pem:/etc/certificates/truenas_cert.key | ||||
| remote_key_path = /etc/certificates/truenas_cert.key | ||||
| post_upload_command = midclt call system.general.ui_restart | ||||
| check_url = https://truenas.local | ||||
|  | ||||
| @@ -194,6 +194,116 @@ hostname = 10.0.0.71 | ||||
| port = 22 | ||||
| username = root | ||||
| remote_cert_path = /usr/syno/etc/certificate/system/default/fullchain.pem | ||||
| additional_files = /etc/letsencrypt/live/example.com/privkey.pem:/usr/syno/etc/certificate/system/default/privkey.pem | ||||
| remote_key_path = /usr/syno/etc/certificate/system/default/privkey.pem | ||||
| post_upload_command = /usr/syno/sbin/synoservicectl --reload nginx | ||||
| check_url = https://synology.local:5001 | ||||
|  | ||||
| # ═══════════════════════════════════════════════════════════ | ||||
| # HOSTS WITH CUSTOM CERTIFICATES | ||||
| # ═══════════════════════════════════════════════════════════ | ||||
|  | ||||
| [mailserver_custom_domain] | ||||
| type = standard | ||||
| hostname = mail.company.com | ||||
| port = 22 | ||||
| username = root | ||||
| # Override global certificate with domain-specific cert | ||||
| source_cert_path = /etc/letsencrypt/live/mail.company.com/fullchain.pem | ||||
| source_key_path = /etc/letsencrypt/live/mail.company.com/privkey.pem | ||||
| remote_cert_path = /etc/postfix/ssl/cert.pem | ||||
| remote_key_path = /etc/postfix/ssl/privkey.pem | ||||
| post_upload_command = systemctl restart postfix && systemctl restart dovecot | ||||
| check_url = https://mail.company.com:465 | ||||
|  | ||||
| [api_server_subdomain] | ||||
| type = standard | ||||
| hostname = 192.168.1.200 | ||||
| port = 22 | ||||
| username = ubuntu | ||||
| ssh_key_path = /root/.ssh/api_key | ||||
| # API server with its own certificate | ||||
| source_cert_path = /etc/letsencrypt/live/api.subdomain.org/fullchain.pem | ||||
| source_key_path = /etc/letsencrypt/live/api.subdomain.org/privkey.pem | ||||
| remote_cert_path = /etc/nginx/ssl/api/fullchain.pem | ||||
| remote_key_path = /etc/nginx/ssl/api/privkey.pem | ||||
| post_upload_command = systemctl reload nginx | ||||
| check_url = https://api.subdomain.org | ||||
|  | ||||
| [client_website] | ||||
| type = standard | ||||
| hostname = 203.0.113.50 | ||||
| port = 2222 | ||||
| username = admin | ||||
| # Client's own domain and certificate | ||||
| source_cert_path = /etc/letsencrypt/live/client-domain.com/fullchain.pem | ||||
| source_key_path = /etc/letsencrypt/live/client-domain.com/privkey.pem | ||||
| remote_cert_path = /var/www/ssl/fullchain.pem | ||||
| remote_key_path = /var/www/ssl/privkey.pem | ||||
| post_upload_command = systemctl reload apache2 | ||||
| check_url = https://www.client-domain.com | ||||
|  | ||||
| [client_mikrotik] | ||||
| type = mikrotik | ||||
| hostname = 203.0.113.51 | ||||
| port = 22 | ||||
| username = admin | ||||
| ssh_key_path = /root/.ssh/client_key | ||||
| # Client's MikroTik with custom certificate | ||||
| source_cert_path = /etc/letsencrypt/live/client-domain.com/fullchain.pem | ||||
| source_key_path = /etc/letsencrypt/live/client-domain.com/privkey.pem | ||||
| check_before_upload = true | ||||
|  | ||||
| # ═══════════════════════════════════════════════════════════ | ||||
| # DEVELOPMENT / STAGING SERVERS | ||||
| # ═══════════════════════════════════════════════════════════ | ||||
|  | ||||
| [dev_server] | ||||
| type = standard | ||||
| hostname = dev.local | ||||
| port = 22 | ||||
| username = developer | ||||
| # Dev server with staging certificate | ||||
| source_cert_path = /etc/letsencrypt-staging/live/dev.example.com/fullchain.pem | ||||
| source_key_path = /etc/letsencrypt-staging/live/dev.example.com/privkey.pem | ||||
| remote_cert_path = /opt/app/ssl/fullchain.pem | ||||
| remote_key_path = /opt/app/ssl/privkey.pem | ||||
| post_upload_command = docker-compose restart nginx | ||||
| # No check_url - always upload to dev environment | ||||
|  | ||||
| # ═══════════════════════════════════════════════════════════ | ||||
| # ADVANCED EXAMPLES | ||||
| # ═══════════════════════════════════════════════════════════ | ||||
|  | ||||
| [nginx_with_chain] | ||||
| type = standard | ||||
| hostname = 192.168.1.120 | ||||
| port = 22 | ||||
| username = root | ||||
| remote_cert_path = /etc/nginx/ssl/cert.pem | ||||
| remote_key_path = /etc/nginx/ssl/private/key.pem | ||||
| # Upload additional chain file | ||||
| additional_files = /etc/letsencrypt/live/example.com/chain.pem:/etc/nginx/ssl/chain.pem | ||||
| post_upload_command = nginx -t && systemctl reload nginx | ||||
| check_url = https://example.com | ||||
|  | ||||
| [apache_separate_dirs] | ||||
| type = standard | ||||
| hostname = 192.168.1.121 | ||||
| port = 22 | ||||
| username = root | ||||
| # Certificate and key in completely different directories | ||||
| remote_cert_path = /etc/ssl/certs/apache-cert.pem | ||||
| remote_key_path = /etc/ssl/private/apache-key.pem | ||||
| post_upload_command = apachectl configtest && systemctl reload apache2 | ||||
|  | ||||
| [multi_service_host] | ||||
| type = standard | ||||
| hostname = 192.168.1.130 | ||||
| port = 22 | ||||
| username = root | ||||
| remote_cert_path = /etc/ssl/certs/fullchain.pem | ||||
| remote_key_path = /etc/ssl/private/privkey.pem | ||||
| # Deploy cert to multiple services | ||||
| additional_files = /etc/letsencrypt/live/example.com/fullchain.pem:/opt/app1/ssl/cert.pem,/etc/letsencrypt/live/example.com/privkey.pem:/opt/app1/ssl/key.pem,/etc/letsencrypt/live/example.com/fullchain.pem:/opt/app2/ssl/cert.pem | ||||
| post_upload_command = systemctl reload nginx && systemctl restart app1 && systemctl restart app2 | ||||
| check_url = https://example.com | ||||
|   | ||||
							
								
								
									
										16
									
								
								logrotate_certpusher
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								logrotate_certpusher
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| /opt/certpusher/logs/*.log { | ||||
|     daily | ||||
|     rotate 7 | ||||
|     compress | ||||
|     delaycompress | ||||
|     missingok | ||||
|     notifempty | ||||
|     create 0644 root root | ||||
|     dateext | ||||
|     dateformat -%Y%m%d | ||||
|     extension .log | ||||
|     nomail | ||||
|     postrotate | ||||
|         find /opt/certpusher/logs -name "*.log*" -type f -mtime +3 -delete | ||||
|     endscript | ||||
| } | ||||
		Reference in New Issue
	
	Block a user