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