Copied original

main
Anthony 2024-09-19 20:52:54 +08:00
parent cd68165b71
commit 16c461129c
1 changed files with 31 additions and 71 deletions

View File

@ -1,4 +1,4 @@
/* var wpbfp = '${settings.wp_protect}' == 'true' ? "THROTTLE" : "OFF"; var wpbfp = '${settings.wp_protect}' == 'true' ? "THROTTLE" : "OFF";
var resp = { var resp = {
result: 0, result: 0,
@ -6,14 +6,13 @@ var resp = {
nodes: [] nodes: []
} }
resp.nodes.push({ if ('${settings.ls-addon:false}'== 'true') {
resp.nodes.push({
nodeType: "llsmp", nodeType: "llsmp",
engine: "${settings.php_engine:php8.3}",
count: 1, count: 1,
cloudlets: "${settings.cloudlets:16}", flexibleCloudlets: ${settings.flexibleCloudlets:16},
diskLimit: "${settings.diskspace:[quota.disk.limitation]}", fixedCloudlets: ${settings.fixedCloudlets:1},
nodeGroup: "cp", nodeGroup: "cp",
skipNodeEmails: "true",
displayName: "AppServer", displayName: "AppServer",
env: { env: {
SERVER_WEBROOT: "/var/www/webroot/ROOT", SERVER_WEBROOT: "/var/www/webroot/ROOT",
@ -23,58 +22,19 @@ resp.nodes.push({
WP_PROTECT_LIMIT: 100 WP_PROTECT_LIMIT: 100
} }
}) })
} else {
return resp; */ resp.nodes.push({
nodeType: "lemp",
var wpbfp = '${settings.wp_protect}' == 'true' ? "THROTTLE" : "OFF";
var resp = {
result: 0,
ssl: !!jelastic.billing.account.GetQuotas('environment.jelasticssl.enabled').array[0].value,
nodes: []
}
// Existing Application Server Node
resp.nodes.push({
nodeType: "llsmp",
engine: "${settings.php_engine:php8.3}",
count: 1, count: 1,
cloudlets: "${settings.cloudlets:16}", flexibleCloudlets: ${settings.flexibleCloudlets:16},
diskLimit: "${settings.diskspace:[quota.disk.limitation]}", fixedCloudlets: ${settings.fixedCloudlets:1},
nodeGroup: "cp", nodeGroup: "cp",
skipNodeEmails: "true",
displayName: "AppServer", displayName: "AppServer",
env: { env: {
SERVER_WEBROOT: "/var/www/webroot/ROOT", SERVER_WEBROOT: "/var/www/webroot/ROOT",
REDIS_ENABLED: "true", REDIS_ENABLED: "true"
WAF: "${settings.waf}",
WP_PROTECT: wpbfp,
WP_PROTECT_LIMIT: 100
} }
}) })
}
// Adding the Storage Node
resp.nodes.push({
nodeType: "storage", // Valid nodeType as per your environment
count: 1,
cloudlets: "${settings.storage_cloudlets:6}", // Default to 6 cloudlets if not specified
diskLimit: "${settings.storage_diskspace:30000}", // Default to 30000 MB if not specified
nodeGroup: "storage",
skipNodeEmails: "true",
displayName: "Shared Storage",
env: {
// Include necessary environment variables
STACK_VERSION: "2.0-9.6",
STACK_USER: "root",
// Add other variables if needed
},
customitem: {
dockerName: "jelastic/storage",
dockerTag: "2.0-9.6",
dockerVolumes: [
"/data"
]
}
})
return resp; return resp;