Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Train fixes: the installer connects in customer-run mode, and the data-format record names 0.1.152

milind-soni5cbb2477da5c
diff --git a/deploy/install.sh b/deploy/install.sh
index 846af274b3..f1b2dd3dd8 100755
--- a/deploy/install.sh
+++ b/deploy/install.sh
@@ -975,11 +975,14 @@ connect_server() {
[ -z "$fetched" ] || rm -f "$fetched"
fail "MausBot is installed and running here, but what $ADMIN_URL sent is not the connector's installer. Nothing needs reinstalling: copy the install command from MausBot again."
fi
+ # Always customer-run, on this install's folder (--dir included): the connector attaches to the server installed here
+ # and never starts a second one beside it. A connector installer that does not know --customer-run refuses it, and
+ # nothing is connected.
status=0
if [ "$INSTALL_DOCKER" = 1 ]; then
- MAUSBOT_ADMIN_URL="$ADMIN_URL" sh "$connector_script" --install-docker "$CODE" || status=$?
+ MAUSBOT_ADMIN_URL="$ADMIN_URL" MAUSBOT_INSTALL_DIR="$INSTALL_DIR" sh "$connector_script" "$CODE" --customer-run --install-docker || status=$?
else
- MAUSBOT_ADMIN_URL="$ADMIN_URL" sh "$connector_script" "$CODE" || status=$?
+ MAUSBOT_ADMIN_URL="$ADMIN_URL" MAUSBOT_INSTALL_DIR="$INSTALL_DIR" sh "$connector_script" "$CODE" --customer-run || status=$?
fi
[ -z "$fetched" ] || rm -f "$fetched"
[ "$status" = 0 ] || fail "MausBot is installed and running here, but connecting it did not finish (the reason is above). Nothing needs reinstalling: fix that and run this again with a new code."
diff --git a/scripts/server-installer.test.ts b/scripts/server-installer.test.ts
index f9ddf12f4c..366413847d 100644
--- a/scripts/server-installer.test.ts
+++ b/scripts/server-installer.test.ts
@@ -362,7 +362,7 @@ describe.skipIf(!posix)("deploy/install.sh", () => {
it("keeps the registry's token and the one-time code out of its output, and the token off every command line", () => {
const connector = mkdtempSync(join(tmpdir(), "omb-server-install-connector-"));
dirs.push(connector);
- writeFileSync(join(connector, "install.sh"), `# stands in for mausbot-connector's installer\necho "$MAUSBOT_ADMIN_URL $#" > "${connector}/ran"\nprintf '%s' "$1" > "${connector}/code"\n`);
+ writeFileSync(join(connector, "install.sh"), `# stands in for mausbot-connector's installer\necho "$MAUSBOT_ADMIN_URL $MAUSBOT_INSTALL_DIR $# $2" > "${connector}/ran"\nprintf '%s' "$1" > "${connector}/code"\n`);
const result = run(["--domain", "maus.example.com", CODE], { env: { MAUSBOT_CONNECTOR_INSTALLER: join(connector, "install.sh") } });
expect(result.status).toBe(0);
expect(result.all).not.toContain(TOKEN);
@@ -370,7 +370,8 @@ describe.skipIf(!posix)("deploy/install.sh", () => {
expect(result.calls.join("\n")).not.toContain(TOKEN);
expect(result.calls.join("\n")).not.toContain(CODE);
expect(readFileSync(join(result.dir, "calls.log.stdin"), "utf8")).toContain(`header = "Authorization: Bearer ${TOKEN}"`);
- expect(readFileSync(join(connector, "ran"), "utf8")).toBe("https://admin.example.test 1\n");
+ // Customer-run, on this install's own folder: never a second server beside it.
+ expect(readFileSync(join(connector, "ran"), "utf8")).toBe(`https://admin.example.test ${result.install} 2 --customer-run\n`);
expect(readFileSync(join(connector, "code"), "utf8")).toBe(CODE);
});
diff --git a/server/data-format-released.json b/server/data-format-released.json
index b03eb79bc2..f2bc34ba36 100644
--- a/server/data-format-released.json
+++ b/server/data-format-released.json
@@ -1,5 +1,5 @@
{
- "version": "0.1.151",
+ "version": "0.1.152",
"writes": 1,
"reads": 1
}