====== Information ======
* Let's Encrypt ((https://letsencrypt.org/))
* Certbot ((https://certbot.eff.org/))
* [[information;realm_of_espionage|Realm of Espionage]]
===== Prerequisites =====
* [[windows;10_ltsc_server|Windows 10 (21H2)]]
* [[servers;windows;nginx_php_php-cgi|nginx]]
====== Install ======
===== Python =====
* https://www.python.org/downloads/windows/
* https://www.python.org/ftp/python/3.14.2/python-3.14.2-amd64.exe
* Last tested: ''python-3.14.2-amd64.exe''
* Install ''pip'' ((nothing else (admin, PATH, etc) is required and can be unchecked))
===== Certbot =====
****
"%LocalAppData%\Programs\Python\Python314\Scripts\pip.exe" install "certbot"
====== Settings ======
* https://eff-certbot.readthedocs.io/en/latest/using.html#certbot-command-line-options
* :!: Set ''email''
* :!: TODO: Add chat to DNS
MKDIR "%SystemDrive%\www\certbot"
"notepad.exe" "%SystemDrive%\www\certbot\cli-custom.ini"
verbose = "true"
max-log-backups = "0"
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"
key-type = "ecdsa"
elliptic-curve = "secp384r1"
domains = "realmofespionage.xyz, wiki.realmofespionage.xyz, media.realmofespionage.xyz, blog.realmofespionage.xyz, social.realmofespionage.xyz, forums.realmofespionage.xyz, status.realmofespionage.xyz, chat.realmofespionage.xyz, files.realmofespionage.xyz, test.realmofespionage.xyz"
# End
====== Obtain Certs Test ======
"netsh.exe" advfirewall firewall add rule name="Certbot (Standalone)" dir="in" action="allow" program="%LocalAppData%\Programs\Python\Python314\python.exe" protocol="tcp" localport="80"
"%LocalAppData%\Programs\Python\Python314\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
CD "%Temp%"
CALL "%SystemDrive%\www\scripts\certbot\Update.bat"
CALL "%SystemDrive%\www\scripts\nginx\Stop.bat"
TITLE Certbot Renewal
"netsh.exe" advfirewall firewall add rule name="Certbot (Standalone)" dir="in" action="allow" program="%LocalAppData%\Programs\Python\Python314\python.exe" protocol="tcp" localport="80"
"%LocalAppData%\Programs\Python\Python314\Scripts\certbot.exe" "certonly" --config "%SystemDrive%\www\certbot\cli-custom.ini" --quiet
"netsh.exe" advfirewall firewall delete rule name="Certbot (Standalone)"
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
TITLE Certbot Update
CD "%Temp%"
"%LocalAppData%\Programs\Python\Python314\python.exe" -m "pip" install --upgrade "pip" --quiet
"%LocalAppData%\Programs\Python\Python314\Scripts\pip.exe" install --upgrade "certbot" --quiet
:: End
"%SystemDrive%\www\scripts\certbot\Update.bat"
====== Task Scheduler ======
===== Renewal =====
* Weekly (Sunday) ''07:00:00 AM''
SCHTASKS /Create /SC "WEEKLY" /D "SUN" /TN "Certbot Renewal" /TR "%SystemDrive%\www\scripts\certbot\Renewal.bat" /ST "07:00" /F