Skip to content

Commit

Permalink
Setup Hostname SSL to work for OLS LS admin
Browse files Browse the repository at this point in the history
This modification should make things more user-friendly and upon hostname SSL install it will setup OLS LS Admin SSL with the signed SSL via symlinks.
  • Loading branch information
meramsey committed Oct 22, 2019
1 parent c5dc8b1 commit 9bedc44
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions plogical/virtualHostUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,12 @@ def issueSSLForHostName(virtualHost, path):

destPrivKey = "/usr/local/lscp/conf/key.pem"
destCert = "/usr/local/lscp/conf/cert.pem"

lswsAdminPrivKey = "/usr/local/lsws/admin/conf/cert/admin.key"
lswsAdminCert = "/usr/local/lsws/admin/conf/cert/admin.crt"

olsAdminPrivKey = "/usr/local/lsws/admin/conf/webadmin.key"
olsAdminCert = "/usr/local/lsws/admin/conf/webadmin.crt"

pathToStoreSSLFullChain = '/etc/letsencrypt/live/' + virtualHost + '/fullchain.pem'
pathToStoreSSLPrivKey = '/etc/letsencrypt/live/' + virtualHost + '/privkey.pem'
Expand All @@ -562,6 +568,29 @@ def issueSSLForHostName(virtualHost, path):
os.remove(destPrivKey)
if os.path.exists(destCert):
os.remove(destCert)

## removing self signed certs for lsws webadmin
if os.path.exists(lswsAdminCert):
os.remove(lswsAdminCert)
if os.path.exists(lswsAdminPrivKey):
os.remove(lswsAdminPrivKey)
## create symlink for hostname SSL for lsws webadmin SSL
command = 'ln -s /usr/local/lscp/conf/cert.pem /usr/local/lsws/admin/conf/cert/admin.crt'
ProcessUtilities.normalExecutioner(command)
command = 'ln -s /usr/local/lscp/conf/key.pem /usr/local/lsws/admin/conf/cert/admin.key'
ProcessUtilities.normalExecutioner(command)

## removing self signed certs for ols webadmin
if os.path.exists(olsAdminCert):
os.remove(olsAdminCert)
if os.path.exists(olsAdminPrivKey):
os.remove(olsAdminPrivKey)
## create symlink for hostname SSL for lsws webadmin SSL
command = 'ln -s /usr/local/lscp/conf/cert.pem /usr/local/lsws/admin/conf/webadmin.crt'
ProcessUtilities.normalExecutioner(command)
command = 'ln -s /usr/local/lscp/conf/key.pem /usr/local/lsws/admin/conf/webadmin.key'
ProcessUtilities.normalExecutioner(command)


adminEmail = "email@" + virtualHost

Expand Down

0 comments on commit 9bedc44

Please sign in to comment.