mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-11 07:46:10 +01:00
n8n container deployment improvement
This commit is contained in:
@@ -831,21 +831,64 @@ services:
|
|||||||
command = f"chmod 755 {directory}"
|
command = f"chmod 755 {directory}"
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
# Create n8n config with the encryption key
|
# Create n8n config with the encryption key - using n8n's exact format
|
||||||
config_content = {
|
config_content = {
|
||||||
"encryptionKey": encryption_key,
|
"database": {
|
||||||
"instanceId": f"n8n_{randomPassword.generate_pass(12)}",
|
"type": "postgresdb",
|
||||||
"nodes": {},
|
"postgresdb": {
|
||||||
"credentials": {},
|
"host": f"{self.data['ServiceName']}-db",
|
||||||
"settings": {
|
"port": 5432,
|
||||||
"instanceId": f"n8n_{randomPassword.generate_pass(12)}",
|
"database": self.data['MySQLDBName'],
|
||||||
"tunnelSubdomain": None,
|
"user": self.data['MySQLDBNUser'],
|
||||||
"deployment": "default"
|
"password": self.data['MySQLPassword']
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
"credentials": {
|
||||||
|
"overwrite": {
|
||||||
|
"defaults": False,
|
||||||
|
"oauth2": False
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"userManagement": {
|
||||||
|
"disabled": False,
|
||||||
|
"jwtAuth": {
|
||||||
|
"jwtExpiration": "7d",
|
||||||
|
"jwtRefreshExpiration": "30d"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nodes": {
|
||||||
|
"exclude": [],
|
||||||
|
"include": []
|
||||||
|
},
|
||||||
|
"encryptionKey": encryption_key,
|
||||||
|
"onboardingCallPromptEnabled": False,
|
||||||
|
"instanceId": f"n8n_{randomPassword.generate_pass(12)}",
|
||||||
|
"deployment": {
|
||||||
|
"type": "default"
|
||||||
|
},
|
||||||
|
"generic": {
|
||||||
|
"timezone": "UTC"
|
||||||
|
},
|
||||||
|
"security": {
|
||||||
|
"basicAuth": {
|
||||||
|
"active": True,
|
||||||
|
"user": self.data['adminUser'],
|
||||||
|
"password": self.data['MySQLPassword']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"endpoints": {
|
||||||
|
"rest": "/"
|
||||||
|
},
|
||||||
|
"executions": {
|
||||||
|
"process": "main",
|
||||||
|
"mode": "regular",
|
||||||
|
"timeout": 3600,
|
||||||
|
"maxTimeout": 7200
|
||||||
|
},
|
||||||
|
"workflowTagsDisabled": False,
|
||||||
|
"logLevel": "info",
|
||||||
"versionNotifications": {
|
"versionNotifications": {
|
||||||
"enabled": False,
|
"enabled": False
|
||||||
"endpoint": "https://api.n8n.io/api/v1/versions/notifications.json",
|
|
||||||
"infoUrl": "https://docs.n8n.io/reference/release-notes.html"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -891,6 +934,17 @@ services:
|
|||||||
command = f"chmod 600 {config_file}"
|
command = f"chmod 600 {config_file}"
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
|
# Write debug file to verify encryption key
|
||||||
|
debug_file = f"{base_dir}/.n8n/.n8n/debug_encryption_key"
|
||||||
|
with open(debug_file, 'w') as f:
|
||||||
|
f.write(f"Config file key: {encryption_key}\nEnvironment variable: {self.data['N8N_ENCRYPTION_KEY']}")
|
||||||
|
|
||||||
|
command = f"chown 1000:1000 {debug_file}"
|
||||||
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
|
command = f"chmod 600 {debug_file}"
|
||||||
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
except BaseException as msg:
|
except BaseException as msg:
|
||||||
|
|||||||
Reference in New Issue
Block a user