@samitouri / QOSami-HFS / commits / 5d8466d6

removed email for letsencrypt certificate, as it's being dismissed https://letsencrypt.org/2025/01/22/ending-expiration-emails/

Massimo Melina committed Mar 7, 2025 at 00:16 UTC 5d8466d64f9d92f3af57d0f8365ebfb6d04f6a22
3 files changed +3 -6
admin/src/InternetPage.ts
+2 -3
@@ -160,7 +160,7 @@ export default function InternetPage({ setTitleSide }: PageProps) {
160 function httpsBox() {
161 const [values, setValues] = useState<any>()
162 const cert = useApiEx('get_cert')
163 - useEffect(() => { apiCall('get_config', { only: ['acme_domain', 'acme_email', 'acme_renew'] }).then(setValues) } , [])
163 + useEffect(() => { apiCall('get_config', { only: ['acme_domain', 'acme_renew'] }).then(setValues) } , [])
164 const [saving, setSaving] = useState(false)
165 if (!status || !values) return h(CircularProgress)
166 const { https } = status.data ||{}
@@ -202,7 +202,6 @@ export default function InternetPage({ setTitleSide }: PageProps) {
202 toField: x => x.replaceAll(',', '\n'),
203 helperText: md("Example: your.domain.com\nMultiple domains on separated lines")
204 },
205 - { k: 'acme_email', label: "E-mail for certificate", sm: true },
205 {
206 k: 'acme_renew',
207 label: "Automatic renew one month before expiration",
@@ -221,7 +220,7 @@ export default function InternetPage({ setTitleSide }: PageProps) {
220 return
221 if (!await confirmDialog("HFS must temporarily serve HTTP on public port 80, and your router must be configured or this operation will fail")) return
222 if (await stopOnCheckDomain(domain)) return
224 - await apiCall('make_cert', { domain, altNames, email: values.acme_email }, { timeout: 20_000 })
223 + await apiCall('make_cert', { domain, altNames }, { timeout: 20_000 })
224 .then(async () => {
225 await alertDialog("Certificate created", 'success')
226 if (disabled)
config.md
-1
@@ -86,7 +86,6 @@ Configuration can be done in several ways
86 - `keep_session_alive` keeps you logged in while the page is left open and the computer is on. Default is true.
87 - `session_duration` after how many seconds should the login session expire. Default is a day.
88 - `acme_domain` domain used for ACME certificate generation. Default is none.
89 -- `acme_email` email used for ACME certificate generation. Default is none.
89 - `acme_renew` automatically renew acme certificate close to expiration. Default is false.
90 - `listen_interface` network interface to listen on, by specifying IP address. Default is any.
91 - `base_url` URL to be used for links generation. Default is automatic.
src/acme.ts
+1 -2
@@ -111,7 +111,6 @@ export const makeCert = debounceAsync(async (domain: string, email?: string, alt
111
112 export let acmeRenewError = ''
113 const acmeDomain = defineConfig('acme_domain', '')
114 -const acmeEmail = defineConfig('acme_email', '')
114 const acmeRenew = defineConfig('acme_renew', false) // handle config changes
115 events.once('httpsReady', () => repeat(HOUR, renewCert))
116
@@ -126,7 +125,7 @@ const renewCert = debounceAsync(async () => {
125 // not expiring in a month
126 if (now > new Date(cert.validFrom) && now < validTo && validTo.getTime() - now.getTime() >= 30 * DAY)
127 return console.log("certificate still good")
129 - await makeCert(domain, acmeEmail.get(), altNames)
128 + await makeCert(domain, undefined, altNames)
129 .catch(e => console.log(acmeRenewError = `Error renewing certificate, expiring ${validTo.toLocaleDateString()}: ${String(e.message || e)}`))
130 }, { retain: DAY, retainFailure: HOUR })
131