Skip to content

Allow changing dehydrated BASEDIR (to be placed in a volume for example) and other improvements#3

Open
jjakob wants to merge 6 commits intoschnatterer:masterfrom
jjakob:issue_2
Open

Allow changing dehydrated BASEDIR (to be placed in a volume for example) and other improvements#3
jjakob wants to merge 6 commits intoschnatterer:masterfrom
jjakob:issue_2

Conversation

@jjakob
Copy link
Copy Markdown

@jjakob jjakob commented Aug 11, 2022

See commit messages and the updated README and examples for more information.
I have not tested any of the examples but I have tested the meta-entrypoint and dehydrated config in my own container that's close to the standalone example and it works.

jjakob added 5 commits August 12, 2022 01:41
This is to allow it to be placed in a volume that the user mounts into
the container, usually in /certs.
Introduce a new env variable DEHYDRATED_BASEDIR.
If this is unset, the behavior will stay the same as before:
`BASEDIR=/dehydrated`. This is for backwards compatibility.

`DEHYDRATED_BASEDIR` and `CERT_DIR` interact:
  * default (<=0.4.0) if `DEHYDRATED_BASEDIR` is not set:
    * `DEHYDRATED_BASEDIR="/dehydrated" CERT_DIR="/certs"`
    * `/dehydrated` is not stored in persistent storage and will be deleted with the container (including the letsencrypt account)
  * recommended (>0.4.0):
    * set `DEHYDRATED_BASEDIR="/certs/dehydrated"`. This will set `CERT_DIR="$DEHYDRATED_BASEDIR/certs"`. This allows all the certificates and dehydrated state (most importantly, accounts) to be stored in one directory, usually a volume mounted at `/certs`.

Introduce a new variable, DEHYDRATED_WELLKNOWN, to set the directory
where dehydrated will place .well-known. This allows the user to point
it to the webserver document root and not have to create any symlinks.
Sometimes on first start they don't exist yet.
The output directory for certificates is set via CERTDIR in
/etc/dehydrated/config.
- use new DEHYDRATED_BASEDIR env variable
- point DEHYDRATED_WELLKNOWN to document root of webserver instead of
  symlinking /static to it
@schnatterer
Copy link
Copy Markdown
Owner

Hey @jjakob, Thank you very much for taking the time to compose this PR!
At the moment I have too much on my plate to look into this. But I will, eventually. Sorry for the delay.

@schnatterer
Copy link
Copy Markdown
Owner

Fixes #2

WELLKNOWN path was missing '.well-known/acme-challenge'
which was causing the ACME challenge to fail.
Env variables used in dehydrated config must be exported.
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.

2 participants