mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 23:33:12 +09:00
Pair hosts when they start instead of in the installer
The installer only writes the controller URL and host name. Running the host requests to join the cluster if it has not been approved yet, or if the controller no longer accepts its token, and waits until an admin approves it. Once approved it saves its id and token and starts as normal. A rejected host exits with code 8. clusteriohost run --user-token approves the host right away with the token of a user allowed to approve hosts. The token is not saved. This moves the pairing client into the host package, where it uses the same certificate setup as the host's connection to the controller, and removes --no-pair and the rerun handling from the installer.
This commit is contained in:
25 files changed
+948
-1131
No files matched your search
@@ -12,7 +12,7 @@ import { LineSplitter, logger } from "@clusterio/lib";
|
||||
|
||||
import { selectTargetCommand, initialize as initializeCtl } from "@clusterio/ctl";
|
||||
import { _listFactorioVersions } from "@clusterio/host/dist/node/src/server.js";
|
||||
import { pairHost } from "../../packages/create/pair.js";
|
||||
import { pairHost } from "@clusterio/host";
|
||||
|
||||
import "../setup_logging.js";
|
||||
|
||||
@@ -276,7 +276,7 @@ export async function pairTestHost(name) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Write a new host config for a paired host, with the fields the installer sets
|
||||
* Write a new host config for a paired host, with the fields the installer and pairing set
|
||||
*
|
||||
* @param {string} configPath - Path to write the config to.
|
||||
* @param {{ hostId: number, token: string, name: string }} pairing - Host returned by pairing.
|
||||
|
||||
Reference in new issue
Block a user