Skip to content

Commit

Permalink
n8n container
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Dec 27, 2023
1 parent 6834668 commit 2832254
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 23 deletions.
18 changes: 13 additions & 5 deletions plogical/DockerSites.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def run(self):
self.DeployWPContainer()
elif self.function_run == 'SubmitDockersiteCreation':
self.SubmitDockersiteCreation()
elif self.function_run == 'DeployN8NContainer':
self.DeployN8NContainer()


except BaseException as msg:
Expand Down Expand Up @@ -399,8 +401,12 @@ def SubmitDockersiteCreation(self):
)
dockersiteobj.save()

background = Docker_Sites('DeployWPContainer', f_data)
background.start()
if self.data['App'] == 'WordPress':
background = Docker_Sites('DeployWPContainer', f_data)
background.start()
elif self.data['App'] == 'n8n':
background = Docker_Sites('DeployN8NContainer', f_data)
background.start()

except BaseException as msg:
logging.writeToFile("Error Submit Docker site Creation ....... %s" % str(msg))
Expand Down Expand Up @@ -579,19 +585,21 @@ def DeployN8NContainer(self):
services:
'{self.data['ServiceName']}-db':
image: docker.io/bitnami/postgresql:16
user: root
restart: always
environment:
# - POSTGRES_USER:root
- POSTGRESQL_USERNAME={self.data['MySQLPassword']}
- POSTGRESQL_USERNAME={self.data['MySQLDBNUser']}
- POSTGRESQL_DATABASE={self.data['MySQLDBName']}
- POSTGRESQL_POSTGRES_PASSWORD={self.data['MySQLDBNUser']}
- POSTGRESQL_POSTGRES_PASSWORD={self.data['MySQLPassword']}
- POSTGRESQL_PASSWORD={self.data['MySQLPassword']}
volumes:
# - "/home/docker/{self.data['finalURL']}/db:/var/lib/postgresql/data"
- "/home/docker/{self.data['finalURL']}/db:/bitnami/postgresql"
'{self.data['ServiceName']}':
image: docker.n8n.io/n8nio/n8n
user: root
restart: always
environment:
- DB_TYPE=postgresdb
Expand Down Expand Up @@ -704,7 +712,7 @@ def Main():
# port, SitePath, CPUsSite, MemorySite, SiteName
# finalURL, blogTitle, adminUser, adminPassword, adminEmail, htaccessPath, externalApp
data = {
"JobID": '/home/cyberpanel/error-logs.txt',
"JobID": '/home/cyberpanel/hey.txt',
"ComposePath": "/home/docker.cyberpanel.net/docker-compose.yml",
"MySQLPath": '/home/docker.cyberpanel.net/public_html/sqldocker',
"MySQLRootPass": 'testdbwp12345',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ <h3 class="content-box-header">
<label class="col-sm-3 control-label">{% trans "Select App" %}</label>
<div class="col-sm-6">
<select ng-model="App" class="form-control">
<option>Wordpress</option>
<option>WordPress</option>
<option>n8n</option>
</select>
</div>
</div>
Expand Down
19 changes: 2 additions & 17 deletions websiteFunctions/website.py
Original file line number Diff line number Diff line change
Expand Up @@ -6863,23 +6863,7 @@ def submitDockerSiteCreation(self, userID=None, data=None):
data_ret = {'status': 0, 'createWebSiteStatus': 0, 'error_message': "Blacklisted domain."}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
# extraArgs = {}
# extraArgs['admin'] = admin
# extraArgs['domainName'] = data['domain']
# extraArgs['home'] = data['home']
# extraArgs['shopName'] = data['shopName']
# extraArgs['firstName'] = data['firstName']
# extraArgs['lastName'] = data['lastName']
# extraArgs['databasePrefix'] = data['databasePrefix']
# extraArgs['email'] = data['email']
# extraArgs['password'] = data['passwordByPass']
# extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
#
# if data['home'] == '0':
# extraArgs['path'] = data['path']
#
# background = ApplicationInstaller('prestashop', extraArgs)
# background.start()

tempStatusPath = "/home/cyberpanel/" + str(randint(1000, 9999))
data = {}

Expand All @@ -6896,6 +6880,7 @@ def submitDockerSiteCreation(self, userID=None, data=None):
data['WPusername'] = WPusername
data['WPpasswd'] = WPpasswd
data['externalApp'] = "".join(re.findall("[a-zA-Z]+", Domain))[:5] + str(randint(1000, 9999))
data['App'] = App

background = Docker_Sites('SubmitDockersiteCreation', data)
background.start()
Expand Down

0 comments on commit 2832254

Please sign in to comment.