Skip to content

Commit 9bedc44

Browse files
authored
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.
1 parent c5dc8b1 commit 9bedc44

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

plogical/virtualHostUtilities.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,12 @@ def issueSSLForHostName(virtualHost, path):
553553

554554
destPrivKey = "/usr/local/lscp/conf/key.pem"
555555
destCert = "/usr/local/lscp/conf/cert.pem"
556+
557+
lswsAdminPrivKey = "/usr/local/lsws/admin/conf/cert/admin.key"
558+
lswsAdminCert = "/usr/local/lsws/admin/conf/cert/admin.crt"
559+
560+
olsAdminPrivKey = "/usr/local/lsws/admin/conf/webadmin.key"
561+
olsAdminCert = "/usr/local/lsws/admin/conf/webadmin.crt"
556562

557563
pathToStoreSSLFullChain = '/etc/letsencrypt/live/' + virtualHost + '/fullchain.pem'
558564
pathToStoreSSLPrivKey = '/etc/letsencrypt/live/' + virtualHost + '/privkey.pem'
@@ -562,6 +568,29 @@ def issueSSLForHostName(virtualHost, path):
562568
os.remove(destPrivKey)
563569
if os.path.exists(destCert):
564570
os.remove(destCert)
571+
572+
## removing self signed certs for lsws webadmin
573+
if os.path.exists(lswsAdminCert):
574+
os.remove(lswsAdminCert)
575+
if os.path.exists(lswsAdminPrivKey):
576+
os.remove(lswsAdminPrivKey)
577+
## create symlink for hostname SSL for lsws webadmin SSL
578+
command = 'ln -s /usr/local/lscp/conf/cert.pem /usr/local/lsws/admin/conf/cert/admin.crt'
579+
ProcessUtilities.normalExecutioner(command)
580+
command = 'ln -s /usr/local/lscp/conf/key.pem /usr/local/lsws/admin/conf/cert/admin.key'
581+
ProcessUtilities.normalExecutioner(command)
582+
583+
## removing self signed certs for ols webadmin
584+
if os.path.exists(olsAdminCert):
585+
os.remove(olsAdminCert)
586+
if os.path.exists(olsAdminPrivKey):
587+
os.remove(olsAdminPrivKey)
588+
## create symlink for hostname SSL for lsws webadmin SSL
589+
command = 'ln -s /usr/local/lscp/conf/cert.pem /usr/local/lsws/admin/conf/webadmin.crt'
590+
ProcessUtilities.normalExecutioner(command)
591+
command = 'ln -s /usr/local/lscp/conf/key.pem /usr/local/lsws/admin/conf/webadmin.key'
592+
ProcessUtilities.normalExecutioner(command)
593+
565594

566595
adminEmail = "email@" + virtualHost
567596

0 commit comments

Comments
 (0)