komuw / ong

ong, is a Go http toolkit.
MIT License
16 stars 4 forks source link

acme: delete unused directories #403

Closed komuw closed 5 months ago

komuw commented 5 months ago

After https://github.com/komuw/ong/issues/400 was fixed, ong no longer procures certificates for unknown subdomains.
However, disk directories are still created for them.

ls -lsha .config/ong_acme/ 
example.com
login.example.com
ong_acme_account_private.key
www.example.com
api.example.com
hey.example.com

https://github.com/komuw/ong/blob/v0.0.88/internal/acme/helpers.go#L205-L210

The directory creation should be in a defer block and executed only if the call to certFromReader succeeds https://github.com/komuw/ong/blob/v0.0.88/internal/acme/helpers.go#L217