From f95000f0fcd63f396ec9cc09c1029c6a8330b3bb Mon Sep 17 00:00:00 2001 From: gokulk04 Date: Wed, 25 Jan 2017 16:07:43 -0500 Subject: [PATCH] update for Diego compatibility 1. change VCAP_APP_PORT env to PORT as per Diego guidelines 2. change "cf files" command for certificate retrieval to "cf ssh" to match Diego migration guidelines --- run.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/run.py b/run.py index 3a01424..0628525 100644 --- a/run.py +++ b/run.py @@ -12,7 +12,7 @@ work = cwd+"/work" host = cwd+"/host" -port = int(os.getenv('VCAP_APP_PORT', '5000')) +port = int(os.getenv('PORT', '5000')) # Before we switch directories, set up our args using the domains.yml settings file. with open('domains.yml') as data_file: @@ -74,10 +74,11 @@ if host == '.': path = domain -print("cf files letsencrypt app/conf/live/" + path + "/cert.pem") -print("cf files letsencrypt app/conf/live/" + path + "/chain.pem") -print("cf files letsencrypt app/conf/live/" + path + "/fullchain.pem") -print("cf files letsencrypt app/conf/live/" + path + "/privkey.pem") +print("cf ssh letsencrypt -c 'cat ~/app/conf/live/" + path + "/cert.pem' > cert.pem") +print("cf ssh letsencrypt -c 'cat ~/app/conf/live/" + path + "/chain.pem' > chain.pem") +print("cf ssh letsencrypt -c 'cat ~/app/conf/live/" + path + "/fullchain.pem' > fullchain.pem") +print("cf ssh letsencrypt -c 'cat ~/app/conf/live/" + path + "/privkey.pem' > privkey.pem") + print() print("REMEMBER TO STOP THE SERVER WITH cf stop letsencrypt")