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

Letsencrypt easy way #44

Open
atol71 opened this issue Sep 9, 2022 · 0 comments
Open

Letsencrypt easy way #44

atol71 opened this issue Sep 9, 2022 · 0 comments

Comments

@atol71
Copy link

atol71 commented Sep 9, 2022

Hi,

One can use Letsencrypt deploy script for this:

  1. make folder for certs in some folder ipa can use (docker:/data/etc/letsencrypt_certs, i have /data/scripts. Requires mount from disk to ipa docker)
  2. Install CA certs with script
  3. get certs for ipa with letsencrypt
    In (/etc/letsencrypt/renewal-hooks/deploy/renew.sh) script one can:
#!/bin/bash
echo "Letsencrypt renewal hook running..."
echo "RENEWED_DOMAINS=$RENEWED_DOMAINS"
echo "RENEWED_LINEAGE=$RENEWED_LINEAGE"
if grep --quiet ">ipa_host_fqdn>" <<< "$RENEWED_DOMAINS"; then
  cp $RENEWED_LINEAGE/cert.pem /<path_to_ipa_accessable_folde>/cert.pem
  cp $RENEWED_LINEAGE/privkey.pem  /<path_to_ipa_accessable_folde>/privkey.pem
****
//  inside docker a script to update certs for ipa:
  docker exec -it freeipa-serv /data/scripts/installCertsforHttp.sh
//  if not in docker restart ipa with: 
  ipactl restart
****
  echo "ipa certs updated and ipa restarted"
fi

If docker then (installCertsforHttp.sh):

#!/bin/bash
ipa-server-certinstall -w -d /<path_to_docker_inside_folder>/privkey.pem /<path_to_docker_inside_folder>/cert.pem --pin='' --dirman-password=<pwd_to_prevent_query>
ipactl restart

And this way letsencrypt certmonger do the work for renewal when needed.

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

No branches or pull requests

1 participant