How to create FTP account automatically when website created — CyberPanel - WebHosting Control Panel for OpenLiteSpeed

How to create FTP account automatically when website created

Hi Guys,

I'm trying to find which file I should be editing to achieve my goal of creating ftp accounts automatically after new website created.

I found for create website function but I didnt understand how does it communicate to create websites

def createWebsite(self, package, owner, domainName, email, php, ssl, dkim, openBasedir):

externalApp = "".join(re.findall("[a-zA-Z]+", domainName))[:7]
phpSelection = 'PHP ' + php

result = virtualHostUtilities.createVirtualHost(domainName, email, phpSelection, externalApp, ssl, dkim,
openBasedir, owner, package, 0)

if result[0] == 1:
self.printStatus(0, result[1])

except BaseException as msg:
logger.writeforCLI(str(msg), "Error", stack()[0][3])
self.printStatus(0, str(msg))

I'm trying to add this there some how

cyberpanel createFTPAccount --domainName --userName cyberpanel --password cyberpanel --owner admin

IS that the right place to start digging or should I look for some other location to understand how new website creation function works on CyberPanel

Many thanks for any input.
Sign In or Register to comment.
CyberPanel Discord

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!