Skip to content
Permalink
Browse files

Setup Hostname SSL to work for OLS LS admin

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
whattheserver committed Oct 22, 2019
1 parent c5dc8b1 commit 9bedc44487333bc06a29cea62991471ed98f011a
Showing with 29 additions and 0 deletions.
  1. +29 −0 plogical/virtualHostUtilities.py
@@ -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'
@@ -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

0 comments on commit 9bedc44

Please sign in to comment.
You can’t perform that action at this time.