Skip to content

Commit

Permalink
Merge pull request #135 from bird-house/doc-extra-requirements-for-le…
Browse files Browse the repository at this point in the history
…tsencrypt-renew-job

doc LetsEncrypt SSL renew job should be sourced after SSL_CERTIFICATE in env.local

Found accidentally when manually harmonizing `env.local` produced by
Vagrant with the template `env.local.example`.

Vagrant automatic provisioning does the right thing to activate
`renew_letsencrypt_ssl_cert_extra_job.env` after the redefined
SSL_CERTIFICATE but if someone like me, manually re-order this, it
will break.

Fix the follow error, SSL_CERTIFICATE was set to /home/vagrant/certkey.pem.
```
+ '[' -s /tmp/tmp_certbotwrapper_ssl_cert.pem ]
+ diff /home/vagrant/certkey.pem /tmp/tmp_certbotwrapper_ssl_cert.pem
diff: can't stat '/home/vagrant/certkey.pem': No such file or directory
+ '[' 0 -eq 0 ]
+ cp -v /tmp/tmp_certbotwrapper_ssl_cert.pem /home/vagrant/certkey.pem
cp: can't create '/home/vagrant/certkey.pem': No such file or directory
```
  • Loading branch information
tlvu authored Mar 23, 2021
2 parents 091bf47 + b5b7b08 commit c0ffb41
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# Configuration vars, set in env.local before sourcing this file.
# This job assume the "scheduler" component is enabled.
#
# This job will write to the value of SSL_CERTIFICATE in env.local so make sure
# this job is sourced after the last definition of SSL_CERTIFICATE.
#
## Sample way to override default configs here in env.local:
#
## Set the variable to override.
Expand Down
3 changes: 3 additions & 0 deletions birdhouse/env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ export POSTGRES_MAGPIE_PASSWORD=postgres-qwerty
# See the job for additional possible configurations. The "scheduler"
# component needs to be enabled for this pre-configured job to work.
#
# This job will write to the value of SSL_CERTIFICATE here so make sure this
# job is sourced after the last definition of SSL_CERTIFICATE.
#
#if [ -f "/<absolute path>/components/scheduler/renew_letsencrypt_ssl_cert_extra_job.env" ]; then
# . /<absolute path>/components/scheduler/renew_letsencrypt_ssl_cert_extra_job.env
#fi
Expand Down
3 changes: 3 additions & 0 deletions birdhouse/vagrant-utils/configure-pavics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ RENEW_LETSENCRYPT_SSL_NUM_PARENTS_MOUNT="/"
# Only source if file exist. Allow for config file to be backward-compat with
# older version of the repo where the .env file do not exist yet.
# Keep this sourcing of renew_letsencrypt_ssl_cert_extra_job.env after
# latest definition of SSL_CERTIFICATE because it needs the valid value of
# SSL_CERTIFICATE.
if [ -f "$PWD/components/scheduler/renew_letsencrypt_ssl_cert_extra_job.env" ]; then
. $PWD/components/scheduler/renew_letsencrypt_ssl_cert_extra_job.env
fi
Expand Down

0 comments on commit c0ffb41

Please sign in to comment.