From d9f5c4f1641a22fc7b43340e81e9a9e8234b5a8b Mon Sep 17 00:00:00 2001 From: Wildan M Date: Mon, 9 Sep 2024 09:18:33 +0700 Subject: [PATCH] HTTP version --- src/executor/runnersub.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/executor/runnersub.js b/src/executor/runnersub.js index 57b0482..a06b2e9 100644 --- a/src/executor/runnersub.js +++ b/src/executor/runnersub.js @@ -207,6 +207,19 @@ export async function runConfigSubdomain(config, domaindata, subdomain, sshExec, var phpVer = value.replace('.', ''); await sshExec(`mkdir -p ~/.local/bin; echo -e "\\u23\\u21/bin/bash\\n$(which php${phpVer}) \\u22\\u24\\u40\\u22" > ~/.local/bin/php; chmod +x ~/.local/bin/php`, false); break; + case 'http': + var nginxInfos = nginxExec.extractInfo(nginxNodes, subdomain); + value = parseInt(value); + if (![1, 2].includes(value)) { + throw new Error(`http option invalid. specify "http 1" or "http 2"`); + } + if (value === nginxInfos.http) { + await writeLog("$> http version config is set unchanged"); + } else { + await writeLog("$> Applying nginx http config on " + subdomain); + await writeLog(await nginxExec.setDirect(subdomain, nginxInfos)); + } + break; case 'ssl': // ssl also fix any misconfigurations var changed = false;