====== Information ======
* Let's Encrypt ((https://letsencrypt.org))
* Certbot ((https://certbot.eff.org))
* [[Information:Realm of Espionage]]
===== Prerequisites =====
* [[windows;11_ltsc_server|Windows 11 (24H2)]]
* [[servers;windows;nginx_php_php-cgi|nginx]]
====== Install ======
===== Python =====
* https://www.python.org/downloads/windows/
* Last tested: ''python-3.13.7-amd64.exe''
* Install ''pip'' ((nothing else (admin, PATH, etc) is required and can be unchecked))
===== Certbot =====
****
"%LocalAppData%\Programs\Python\Python313\Scripts\pip.exe" install "certbot"
====== Settings ======
MKDIR "%SystemDrive%\www\certbot"
"notepad.exe" "%SystemDrive%\www\certbot\cli-custom.ini"
verbose = true
text = true
non-interactive = true
standalone = true
force-renewal = true
agree-tos = true
##################################################
email = espionage724@x
##################################################
no-eff-email = true
rsa-key-size = 4096
redirect = true
hsts = true
uir = true
staple-ocsp = false
domains = realmofespionage.xyz, blog.realmofespionage.xyz, files.realmofespionage.xyz, forums.realmofespionage.xyz, media.realmofespionage.xyz, wiki.realmofespionage.xyz, social.realmofespionage.xyz, test.realmofespionage.xyz
# End
====== Obtain Certs Test ======
* :!: Admin Command Prompt
"netsh.exe" advfirewall firewall add rule name="Certbot (Standalone)" dir="in" action="allow" program="%LocalAppData%\Programs\Python\Python313\python.exe" protocol="tcp" localport="80"
"%LocalAppData%\Programs\Python\Python313\Scripts\certbot.exe" "certonly" --config "%SystemDrive%\www\certbot\cli-custom.ini" --dry-run
"netsh.exe" advfirewall firewall delete rule name="Certbot (Standalone)"
====== Scripts ======
MKDIR "%SystemDrive%\www\scripts\certbot"
"explorer.exe" "%SystemDrive%\www\scripts\certbot"
===== Renewal =====
"notepad.exe" "%SystemDrive%\www\scripts\certbot\Renewal.bat"
@echo off
:: Update Certbot
CALL "%SystemDrive%\www\scripts\certbot\Update.bat"
:: Stop nginx
CALL "%SystemDrive%\www\scripts\nginx\Stop.bat"
:: Renew Certs
sudo --disable-input "netsh.exe" advfirewall firewall add rule name="Certbot (Standalone)" dir="in" action="allow" program="%LocalAppData%\Programs\Python\Python313\python.exe" protocol="tcp" localport="80"
sudo --disable-input "%LocalAppData%\Programs\Python\Python313\Scripts\certbot.exe" "certonly" --config "%SystemDrive%\www\certbot\cli-custom.ini" --quiet
sudo --disable-input "netsh.exe" advfirewall firewall delete rule name="Certbot (Standalone)"
:: Copy/Update Certs
"explorer.exe" "%SystemDrive%\Certbot\archive\realmofespionage.xyz"
"explorer.exe" "%SystemDrive%\www\certbot\certs"
"notepad.exe" "%SystemDrive%\www\nginx\conf.d\ssl.conf"
:: Start nginx
CALL "%SystemDrive%\www\scripts\nginx\Start.bat"
:: End
"%SystemDrive%\www\scripts\certbot\Renewal.bat"
===== Update =====
"notepad.exe" "%SystemDrive%\www\scripts\certbot\Update.bat"
@echo off
:: Update pip
"%LocalAppData%\Programs\Python\Python313\python.exe" -m "pip" install --upgrade "pip" --quiet
:: Update Certbot
"%LocalAppData%\Programs\Python\Python313\Scripts\pip.exe" install --upgrade "certbot" --quiet
:: End
"%SystemDrive%\www\scripts\certbot\Update.bat"
====== Shortcuts ======
===== Desktop =====
==== Renewal ====
"%SystemDrive%\www\scripts\certbot\Renewal.bat"
Certbot Renewal