Skip to content
Permalink
Browse files
feature: allow custom path for child-domains
  • Loading branch information
usmannasir committed Apr 4, 2020
1 parent a82a1bf commit 2d891fdd46674ba8a4d6f31b530345104def1457
Showing 8 changed files with 9 additions and 9 deletions.
@@ -19,7 +19,7 @@
# Create your views here.

VERSION = '2.0'
BUILD = 0
BUILD = 1

@ensure_csrf_cookie
def renderBase(request):
@@ -15,7 +15,7 @@
import stat

VERSION = '2.0'
BUILD = 0
BUILD = 1

char_set = {'small': 'abcdefghijklmnopqrstuvwxyz',
'nums': '0123456789',
@@ -19,7 +19,7 @@
# Create your views here.

VERSION = '2.0'
BUILD = 0
BUILD = 1

def verifyLogin(request):
try:
@@ -13,7 +13,7 @@
from baseTemplate.models import version

VERSION = '2.0'
BUILD = 0
BUILD = 1

if not os.geteuid() == 0:
sys.exit("\nOnly root can run this script\n")
@@ -14,7 +14,7 @@
import string

VERSION = '2.0'
BUILD = 0
BUILD = 1

class Upgrade:
logPath = "/usr/local/lscp/logs/upgradeLog"
@@ -857,7 +857,7 @@ def createDirectoryForDomain(masterDomain, domain, phpVersion, path, administrat
cmd = shlex.split(command)
subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)

command = "chmod 755 %s" % (path)
command = "chmod 750 %s" % (path)
cmd = shlex.split(command)
subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)

@@ -303,7 +303,7 @@ <h3 class="glyph-icon icon-close text-danger mt-5"></h3>
</div>

<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Path" %}</label>
<label class="col-sm-3 control-label">{% trans "Path" %}: /home/{{ domain }}/ </label>
<div class="col-sm-6">
<input placeholder="{% trans 'This path is relative to: ' %}{$ masterDomain $}. {% trans 'Leave empty to set default.' %}"
type="text" class="form-control" ng-model="docRootPath" required>
@@ -285,9 +285,9 @@ def submitDomainCreation(self, userID=None, data=None):

if len(path) > 0:
path = path.lstrip("/")
path = "/home/" + masterDomain + "/public_html/" + path
path = "/home/" + masterDomain + "/" + path
else:
path = "/home/" + masterDomain + "/public_html/" + domain
path = "/home/" + masterDomain + "/" + domain

try:
apacheBackend = str(data['apacheBackend'])

4 comments on commit 2d891fd

@Ezyweb-uk
Copy link

@Ezyweb-uk Ezyweb-uk commented on 2d891fd Apr 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied the updates for website.py and website.html to Cyberpanel v2 (which I'm sure is NOT recommended) and then created a new child domain. The process says it suceeded and I've checked that the directory exists in /home/maindomain/subdomain but I notice in the listing the path appears as /home/maindomain/public_html/subdomain It looks like the record.path in line 486 is still referencing public_html

@usmannasir
Copy link
Owner Author

@usmannasir usmannasir commented on 2d891fd Apr 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not seem to be the case @Ezyweb-uk .

I've created two domains and the path does not contain public_html

And you need not update any files manually. You can run the upgrade script and input 2.0.1 when asked for version prompt.

@Ezyweb-uk
Copy link

@Ezyweb-uk Ezyweb-uk commented on 2d891fd Apr 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I upgraded to 2.0.1 (thanks for the advice) and this time it showed the correct path. (I noticed on the previous test I had omitted to delete the sub domain dns record).

@usmannasir
Copy link
Owner Author

@usmannasir usmannasir commented on 2d891fd Apr 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good.

Please sign in to comment.