Merge branch 'master' into dashboard3

* master:
  Ignoring terraform on master.
  Preserving original debug for query debugging.
  Adding a test for compact folders.
This commit is contained in:
Samuel Clay 2021-02-08 12:32:21 -05:00
commit 0f0de15801
2 changed files with 27 additions and 2 deletions

File diff suppressed because one or more lines are too long

8
fabfile.py vendored
View file

@ -854,11 +854,17 @@ def assemble_certificates():
local('pwd')
local('cat STAR_newsblur_com.crt EssentialSSLCA_2.crt ComodoUTNSGCCA.crt UTNAddTrustSGCCA.crt AddTrustExternalCARoot.crt > newsblur.com.crt')
def copy_certificates():
def copy_certificates(copy=False):
cert_path = os.path.join(env.NEWSBLUR_PATH, 'config/certificates')
run('mkdir -p %s' % cert_path)
fullchain_path = "/etc/letsencrypt/live/newsblur.com/fullchain.pem"
privkey_path = "/etc/letsencrypt/live/newsblur.com/privkey.pem"
if copy:
sudo('mkdir -p %s' % os.path.dirname(fullchain_path))
put(os.path.join(env.SECRETS_PATH, 'certificates/newsblur.com.pem'), fullchain_path, use_sudo=True)
put(os.path.join(env.SECRETS_PATH, 'certificates/newsblur.com.key'), privkey_path, use_sudo=True)
run('ln -fs %s %s' % (fullchain_path, os.path.join(cert_path, 'newsblur.com.crt')))
run('ln -fs %s %s' % (fullchain_path, os.path.join(cert_path, 'newsblur.com.pem'))) # For backwards compatibility with hard-coded nginx configs
run('ln -fs %s %s' % (privkey_path, os.path.join(cert_path, 'newsblur.com.key')))