Update Harbor client and gateway integration workflows
Build and Deploy Gateway / build-and-push (push) Failing after 14s
Build and Deploy Gateway / deploy (push) Has been skipped

This commit is contained in:
2026-08-19 18:16:10 +03:00
parent 416b2b294a
commit daec12e013
63 changed files with 5016 additions and 108 deletions
+18
View File
@@ -19,6 +19,23 @@ export function createSingboxRuntime({
const state = () => ({ running: Boolean(child), startedAt });
function checkConfig(config: unknown) {
const directory = fs.mkdtempSync(`${configPath}.check-`);
const candidatePath = `${directory}/config.json`;
try {
fs.writeFileSync(candidatePath, JSON.stringify(config));
const check = spawnSync('sing-box', ['check', '-c', candidatePath], { encoding: 'utf8' });
if (check.status !== 0) {
throw new HarborError('CONFIG_INVALID', {
cause: new Error((check.stderr || check.stdout || check.error?.message || 'sing-box check failed').trim()),
});
}
return { valid: true };
} finally {
fs.rmSync(directory, { recursive: true, force: true });
}
}
async function stop() {
if (gateway) setGatewayInterception(false, tproxyChain);
if (!child) {
@@ -100,6 +117,7 @@ export function createSingboxRuntime({
get running() { return Boolean(child); },
get startedAt() { return startedAt; },
refresh: async () => state(),
checkConfig,
apply,
restart: () => apply({ force: true }),
stop,