-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
94 additions
and
18 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { spawnSudoUtil } from "../util.js"; | ||
|
||
export async function fixPHP(test) { | ||
for (const [name, logs] of Object.entries(test.logs.fpms)) { | ||
const [lastLog] = logs.splice(logs.length - 1); | ||
if (lastLog.endsWith("ERROR: FPM initialization failed")) { | ||
for (const element of logs) { | ||
let m = element.match(/\[pool (\d+)\] cannot get uid for user '(.+)'/); | ||
if (m) { | ||
await spawnSudoUtil("CLEAN_DOMAIN", ["mv", m[1], ""]); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
export async function fixNGINX(test) { | ||
const logs = test.logs.nginx; | ||
const [lastLog] = logs.splice(logs.length - 1); | ||
if (lastLog == "nginx: configuration file /etc/nginx/nginx.conf test failed") { | ||
for (const element of logs) { | ||
let m = element.match(/nginx: \[emerg\] cannot load certificate \"([\w.\/]+)\"/); | ||
if (m) { | ||
let find = (await spawnSudoUtil("SHELL_SUDO", [ | ||
"root", "grep", "-lr", m[1], "/etc/nginx/conf.d" | ||
])).stdout.trim().split("\n"); | ||
for (const f of find) { | ||
let m2 = f.match(/\/etc\/nginx\/conf.d\/(.+)\.conf/); | ||
if (m2) { | ||
await spawnSudoUtil("CLEAN_DOMAIN", ["mv", "", m2[1]]); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters