fix(installer): use core.common in runtime healthcheck and fix CLI guard in ucode modules

This commit is contained in:
Dushnilin
2026-09-17 15:45:50 +03:00
parent 3bcce51ec3
commit e610ea9ca3
20 changed files with 26 additions and 22 deletions
+2 -2
View File
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: TACHYON\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-09-17 11:53+0300\n"
"PO-Revision-Date: 2026-09-17 11:53+0300\n"
"POT-Creation-Date: 2026-09-17 12:45+0300\n"
"PO-Revision-Date: 2026-09-17 12:45+0300\n"
"Last-Translator: Dushnilin <dushnilin@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
+2 -2
View File
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: TACHYON\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-09-17 14:53+0300\n"
"PO-Revision-Date: 2026-09-17 14:53+0300\n"
"POT-Creation-Date: 2026-09-17 15:45+0300\n"
"PO-Revision-Date: 2026-09-17 15:45+0300\n"
"Last-Translator: Dushnilin\n"
"Language-Team: none\n"
"Language: ru\n"
+1 -1
View File
@@ -765,7 +765,7 @@ healthcheck() {
err "Installed runtime reports version $_version, expected $TACHYON_RELEASE_TAG"
return 1
fi
ucode -L /usr/lib/tachyon -e 'require("core.constants");' >/dev/null 2>&1 || { err "ucode cannot load Tachyon runtime"; return 1; }
ucode -L /usr/lib/tachyon -e 'require("core.common");' >/dev/null 2>&1 || { err "ucode cannot load Tachyon runtime"; return 1; }
ok "Healthcheck passed"
}
+2 -2
View File
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: TACHYON\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-09-17 14:53+0300\n"
"PO-Revision-Date: 2026-09-17 14:53+0300\n"
"POT-Creation-Date: 2026-09-17 15:45+0300\n"
"PO-Revision-Date: 2026-09-17 15:45+0300\n"
"Last-Translator: Dushnilin\n"
"Language-Team: none\n"
"Language: ru\n"
+2 -2
View File
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: TACHYON\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-09-17 11:53+0300\n"
"PO-Revision-Date: 2026-09-17 11:53+0300\n"
"POT-Creation-Date: 2026-09-17 12:45+0300\n"
"PO-Revision-Date: 2026-09-17 12:45+0300\n"
"Last-Translator: Dushnilin <dushnilin@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
+1 -1
View File
@@ -2236,7 +2236,7 @@ function module_exports() {
};
}
if (sourcepath(1) != null && sourcepath(1) != "")
if ((sourcepath(1) != null && sourcepath(1) != "") || ARGV[0] == null)
return module_exports();
exit(main(ARGV));
+1 -1
View File
@@ -258,7 +258,7 @@ function module_exports() {
return constants_map();
}
if (sourcepath(1) != null && sourcepath(1) != "")
if ((sourcepath(1) != null && sourcepath(1) != "") || ARGV[0] == null)
return module_exports();
let mode = ARGV[0] || "";
+1 -1
View File
@@ -213,7 +213,7 @@ function module_exports() {
};
}
if (sourcepath(1) != null && sourcepath(1) != "")
if ((sourcepath(1) != null && sourcepath(1) != "") || ARGV[0] == null)
return module_exports();
// CLI surface exists for the shell test suite, which has no way to import a
+1 -1
View File
@@ -590,7 +590,7 @@ function module_exports() {
};
}
if (sourcepath(1) != null && sourcepath(1) != "")
if ((sourcepath(1) != null && sourcepath(1) != "") || ARGV[0] == null)
return module_exports();
let mode = ARGV[0] || "";
+1 -1
View File
@@ -235,7 +235,7 @@ function module_exports() {
};
}
if (sourcepath(1) != null && sourcepath(1) != "")
if ((sourcepath(1) != null && sourcepath(1) != "") || ARGV[0] == null)
return module_exports();
let mode = ARGV[0] || "";
@@ -232,7 +232,7 @@ function module_exports() {
};
}
if (sourcepath(1) != null && sourcepath(1) != "")
if ((sourcepath(1) != null && sourcepath(1) != "") || ARGV[0] == null)
return module_exports();
let mode = ARGV[0] || "";
@@ -383,7 +383,7 @@ function module_exports() {
};
}
if (sourcepath(1) != null && sourcepath(1) != "")
if ((sourcepath(1) != null && sourcepath(1) != "") || ARGV[0] == null)
return module_exports();
let mode = as_string(ARGV[0]);
@@ -342,7 +342,7 @@ function run(argv, usage_path) {
}
}
if (sourcepath(1) != null && sourcepath(1) != "") {
if ((sourcepath(1) != null && sourcepath(1) != "") || ARGV[0] == null) {
return {
run,
nft_queue_overlap
@@ -364,7 +364,7 @@ function module_exports() {
};
}
if (sourcepath(1) != null && sourcepath(1) != "")
if ((sourcepath(1) != null && sourcepath(1) != "") || ARGV[0] == null)
return module_exports();
let mode = ARGV[0] || "";
@@ -17,7 +17,7 @@ function module_exports() {
};
}
if (sourcepath(1) != null && sourcepath(1) != "")
if ((sourcepath(1) != null && sourcepath(1) != "") || ARGV[0] == null)
return module_exports();
validator.run_expected(KIND, USAGE, ARGV);
@@ -17,7 +17,7 @@ function module_exports() {
};
}
if (sourcepath(1) != null && sourcepath(1) != "")
if ((sourcepath(1) != null && sourcepath(1) != "") || ARGV[0] == null)
return module_exports();
validator.run_expected(KIND, USAGE, ARGV);
@@ -1346,7 +1346,7 @@ function module_exports() {
};
}
if (sourcepath(1) != null && sourcepath(1) != "")
if ((sourcepath(1) != null && sourcepath(1) != "") || ARGV[0] == null)
return module_exports();
// CLI surface for the shell test suite, which cannot import a ucode module.
+1 -1
View File
@@ -3254,7 +3254,7 @@ function module_exports() {
};
}
if (sourcepath(1) != null && sourcepath(1) != "")
if ((sourcepath(1) != null && sourcepath(1) != "") || ARGV[0] == null)
return module_exports();
let mode = ARGV[0];
+3
View File
@@ -64,4 +64,7 @@ grep -Fq "export const FAKEIP_CHECK_DOMAIN = 'fakeip.podkop.fyi';" "$FRONTEND_CO
grep -Fq "export const IP_CHECK_DOMAIN = 'ip.podkop.fyi';" "$FRONTEND_CONSTANTS" ||
fail "LuCI diagnostics must use the deployed public IP endpoint"
ucode -L "$TACHYON_LIB" -e 'let c = require("core.constants"); exit(c.TACHYON_CONFIG_NAME == "tachyon" ? 0 : 1);' || \
fail "requiring core.constants from inline eval failed"
printf 'constants ownership checks passed\n'
+1
View File
@@ -69,6 +69,7 @@ if grep -qi 'jsdelivr' "$INSTALLER"; then
fi
grep -Fq '/usr/bin/tachyon component_action sing_box "$_action"' "$INSTALLER" || fail "sing-box must be delegated to component_action"
grep -Fq 'require("core.common")' "$INSTALLER" || fail "runtime healthcheck must require core.common"
export TACHYON_INSTALLER_TEST=1
# shellcheck source=/dev/null