Skip to content

Commit

Permalink
feature: allow custom path for child-domains
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Apr 4, 2020
1 parent a82a1bf commit 2d891fd
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion baseTemplate/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Create your views here.

VERSION = '2.0'
BUILD = 0
BUILD = 1

@ensure_csrf_cookie
def renderBase(request):
Expand Down
2 changes: 1 addition & 1 deletion install/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import stat

VERSION = '2.0'
BUILD = 0
BUILD = 1

char_set = {'small': 'abcdefghijklmnopqrstuvwxyz',
'nums': '0123456789',
Expand Down
2 changes: 1 addition & 1 deletion loginSystem/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Create your views here.

VERSION = '2.0'
BUILD = 0
BUILD = 1

def verifyLogin(request):
try:
Expand Down
2 changes: 1 addition & 1 deletion plogical/adminPass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion plogical/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import string

VERSION = '2.0'
BUILD = 0
BUILD = 1

class Upgrade:
logPath = "/usr/local/lscp/logs/upgradeLog"
Expand Down
2 changes: 1 addition & 1 deletion plogical/vhost.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion websiteFunctions/templates/websiteFunctions/website.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions websiteFunctions/website.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down

4 comments on commit 2d891fd

@Ezyweb-uk
Copy link

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

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

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

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.