Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse account between multiples apps #211

Closed
wants to merge 2 commits into from
Closed

Conversation

bjelline
Copy link

@bjelline bjelline commented Nov 23, 2020

Fixes #158

To avoid generating a new account for every app we must
supply the files account_key.json and account_reg.json
when the simp_le docker image is run.

If we don't supply them a new account and new files account_key.json and account_reg.json
are created.

If you have already used dokku letsencrypt sucessfully once you can
copy the two files from /home/dokku/APPNAME/letsencrypt/certs/current/ to /home/dokku/
then each subsequent run of dokku letsencrypt will pick them up and copy
them over to the new apps configuration. The account will be reused
and you will not run into the "too many accounts created" rate limit of letsencrypt

…ey.json and account_reg.json files if available.
@bjelline bjelline changed the title Reuse account between multiples apps #158 Reuse account between multiples apps Nov 23, 2020
@fruitl00p
Copy link
Contributor

👍 i like the fact its optional based on the existence of the files in the dokku home dir. However i'd also still like to disable the reuse of the files are there... (i.e. put the check behind a flag --reuse-account or something) as to allow separate apps to still enjoy separate accounts and only reuse when explicitly told to do so... (possibly even passing the other app name to copy from instead of checking the homedir?)

@bjelline
Copy link
Author

@fruitl00p : you're right, there is a need for separate accounts.

We already have the variable DOKKU_LETSENCRYPT_EMAIL, the account should probably be linked to the value of this variable...

@josegonzalez
Copy link
Member

@bjelline looks good so far, please re-comment when the feedback from @fruitl00p gets implemented :)

@bjelline
Copy link
Author

bjelline commented Nov 29, 2020

in this version the accounts are linked to the value of DOKKU_LETSENCRYPT_EMAIL:

when dokku letsencrypt is called, we look through the other apps to find one that
has the same value of DOKKU_LETSENCRYPT_EMAIL and use this app as the
source for the account_key.json and account_reg.json files.

@josegonzalez
Copy link
Member

I don't think we should fetch the env vars like that - manually parsing the env isn't great. Can you switch that to using the config-get plugin trigger?

Additionally, would you be able to gate this behind a flag, as mentioned by @fruitl00p ?

@josegonzalez
Copy link
Member

Going to close this. We'll need to redo this once the acme/lego switch gets merged. Thanks for the initial PR though!

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.

Reuse account between multiples apps
3 participants