Skip to content

acme: use OpenLiteSpeed's built-in ACME with optional www - #127

Open
rperper wants to merge 1 commit into
litespeedtech:masterfrom
rperper:ols-builtin-acme
Open

rperper wants to merge 1 commit into
litespeedtech:masterfrom
rperper:ols-builtin-acme

Conversation

@rperper

@rperper rperper commented Oct 6, 2026

Copy link
Copy Markdown

What changed:

  • bin/acme.sh now has OpenLiteSpeed request and renew certificates instead of running acme.sh in the container's root account.
  • A domain is moved from the docker template to a new dockerAcme template whose vhssl block enables ACME; --revoke, --remove and --uninstall move it back.
  • docker-compose.yml mounts ./lsws/acme at /usr/local/lsws/acme.
  • bin/container/certhookctl.sh is removed and the README is updated.

Why:

  • OpenLiteSpeed ACME adds www. to a certificate only when it is reachable, so a domain without a working www record still gets a certificate, and www is added at a later renewal.
  • The old renewals and the restart hook relied on cron, which the container never starts, so certificates were never renewed.

How:

  • install_acme.sh and uninstall_acme.sh from the image run in throwaway containers that share the conf and acme volumes: the installer skips an existing acme directory (always a mount point here), and acme.sh --uninstall would also remove root's acme.sh in the litespeed container.
  • After the restart, the script follows the [ACME] lines in error.log until the certificate is replaced or the request fails, then checks that port 443 serves the new certificate.
  • Manual renew and revoke run the installed acme.sh as lsadm with the same environment OpenLiteSpeed uses.

What changed:
- bin/acme.sh now has OpenLiteSpeed request and renew certificates instead
  of running acme.sh in the container's root account.
- A domain is moved from the docker template to a new dockerAcme template
  whose vhssl block enables ACME; --revoke, --remove and --uninstall move
  it back.
- docker-compose.yml mounts ./lsws/acme at /usr/local/lsws/acme.
- bin/container/certhookctl.sh is removed and the README is updated.

Why:
- OpenLiteSpeed ACME adds www.<domain> to a certificate only when it is
  reachable, so a domain without a working www record still gets a
  certificate, and www is added at a later renewal.
- The old renewals and the restart hook relied on cron, which the
  container never starts, so certificates were never renewed.

How:
- install_acme.sh and uninstall_acme.sh from the image run in throwaway
  containers that share the conf and acme volumes: the installer skips an
  existing acme directory (always a mount point here), and acme.sh
  --uninstall would also remove root's acme.sh in the litespeed container.
- After the restart, the script follows the [ACME] lines in error.log
  until the certificate is replaced or the request fails, then checks that
  port 443 serves the new certificate.
- Manual renew and revoke run the installed acme.sh as lsadm with the same
  environment OpenLiteSpeed uses.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant