Commit graph

17 commits

Author SHA1 Message Date
Glen Huang
6d61014e51 acme: standardize key_type
keylength, being an acme.sh value type, uses pure numbers for rsa keys.
This can be disorienting for other acme clients. This change introduces
a new option "key_type" that aims to remove this ambiguity, and makes
all key type names follow the same pattern, making acme-common more
client agnostic.

Signed-off-by: Glen Huang <me@glenhuang.com>
2023-05-18 12:48:47 +08:00
Glen Huang
38eeca5df9 acme-common: no exporting webroot
ACME clients shouldn't deal with deprecated values. They should be
processed by acme-common.

Reformatting is done by shfmt.

Signed-off-by: Glen Huang <me@glenhuang.com>
2023-05-17 17:27:38 +08:00
Glen Huang
8589f298a1 acme: remove redundant postinst
opkg runs uci-defaults if a package installs one, in acme-common's case
that's identical to postinst.

prerm shouldn't be run a image builder, so it's unnecessary to check
IPKG_INSTROOT

Signed-off-by: Glen Huang <me@glenhuang.com>
2023-04-26 22:42:26 +02:00
Glen Huang
e1f03d7ee4 acme: fix incompatibilty with image builder
Signed-off-by: Glen Huang <i@glenhuang.com>
2023-03-03 23:43:01 +01:00
Glen Huang
c6960a2bdc acme: merge cli into init script
Signed-off-by: Glen Huang <i@glenhuang.com>
2023-03-01 15:38:02 +01:00
Toke Høiland-Jørgensen
e3d6422dc5 acme-common: Export canonical paths for storing certificates and challenges
The contract between the acme-common framework and consumers and hook
scripts is that certificates can be consumed from /etc/ssl/acme and that
web challenges are stored in /var/run/acme/challenge. Make this explicit by
exporting $CERT_DIR and $CHALLENGE_DIR as environment variables as well,
instead of having knowledge of those paths depend on out-of-band
information. We already exported $challenge_dir, but let's change it to
upper-case to make it clear that it's not a user configuration variable.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
2022-12-14 15:28:23 +01:00
Glen Huang
b907223d57 acme: deprecate state_dir
state_dir is actually a hardcoded value in conffiles. Allowing users to
customize it could result in losing certificates after upgrading if they
don't also specify the dir as being preserved. We shouldn't default to
this dangerous behavior.

With the new ACME package, certificates live in the standard location
/etc/ssl/acme, users who need to do certificate customizations should
look for them in that dir instead.

Signed-off-by: Glen Huang <i@glenhuang.com>
2022-12-14 21:15:52 +08:00
Glen Huang
8edcd33fb7 acme: simplify flock usage
Signed-off-by: Glen Huang <i@glenhuang.com>
2022-11-11 19:19:02 +08:00
Glen Huang
230c2d5fc4 acme: update changed packages' versions
Signed-off-by: Glen Huang <i@glenhuang.com>
2022-10-24 10:48:34 +08:00
Glen Huang
4e369cf780 acme: add dns_wait option
acme.sh by default use public DNS resolvers to check if TXT record was
correctly added when using DNS-01. This can be undesirable in a private
environment where the DNS server is not publicly accessible.

This option allows bypassing such check and simply waiting for a
specific length of time for the TXT record to take effect.

Signed-off-by: Glen Huang <i@glenhuang.com>
2022-10-24 10:48:34 +08:00
Glen Huang
9d2d8787ca acme: fix staging option
Legacy use_staging option was not respected, and the example config
still use the legacy name.

Signed-off-by: Glen Huang <i@glenhuang.com>
2022-10-24 10:48:34 +08:00
Glen Huang
7f04710579 amce: use procd to restart services
Directly calling `/etc/init.d/<service> reload` in a hotplug script can
inadvertently start a stopped service.

Signed-off-by: Glen Huang <i@glenhuang.com>
2022-10-24 10:07:06 +08:00
Glen Huang
035cc09e7f acme: prevent concurrent running of acme get
Issuing certificates concurrently should not be supported.

Signed-off-by: Glen Huang <i@glenhuang.com>
2022-10-24 10:06:49 +08:00
Glen Huang
cbc06f45b9 acme: make package create dir /etc/ssl/acme
Since the dir is a standardized one, it should not be created
dynamically

Signed-off-by: Glen Huang <i@glenhuang.com>
2022-10-22 21:42:10 +08:00
Glen Huang
465f56adc2 acme: not creating state_dir in Makefile
Since state_dir can be customized, it should be create dynamically,
which it already does.

Signed-off-by: Glen Huang <i@glenhuang.com>
2022-10-22 21:38:44 +08:00
Glen Huang
671594bec2 acme: remove help info of unused command
Signed-off-by: Glen Huang <i@glenhuang.com>
2022-10-06 18:38:47 +02:00
Glen Huang
e84f651453 acme: use the hotplug system
Signed-off-by: Glen Huang <heyhgl@gmail.com>
2022-08-16 00:32:04 +02:00