Remove agent string

The agent string was inspired by the HTTP User-Agent header to serve as
a way to identify what's connecting to the cluster.  While there may
have been vision of other software connecting to a controller than the
Clusterio provided ones this seems highly unlikely to ever happen.

Remove redundant agent string for now.
This commit is contained in:
Hornwitser committed 2024-01-15 03:49:41 +01:00
1 parent 8704a24f26
commit 705fb90740
13 files changed
+6 -37

No files matched your search

+1 -3
View File
@@ -24,7 +24,6 @@ const queryLogTime = new lib.Summary(
* @alias module:controller/src/ControlConnection
*/
export default class ControlConnection extends BaseConnection {
private _agent: string;
private _version: string;
logTransport: lib.LinkTransport | null = null;
logSubscriptions = {
@@ -38,7 +37,7 @@ export default class ControlConnection extends BaseConnection {
declare connector: WsServerConnector;
constructor(
registerData: { agent:string, version:string },
registerData: { version: string },
connector: WsServerConnector,
controller: Controller,
public user: ControllerUser, // The user making this connection.
@@ -46,7 +45,6 @@ export default class ControlConnection extends BaseConnection {
) {
super(connector, controller);
this._agent = registerData.agent;
this._version = registerData.version;
this.connector.on("connect", () => {
@@ -16,7 +16,6 @@ import HostInfo from "./HostInfo";
* @alias module:controller/src/HostConnection
*/
export default class HostConnection extends BaseConnection {
private _agent: string;
private _id: number;
private _name: string;
private _version: string;
@@ -29,7 +28,6 @@ export default class HostConnection extends BaseConnection {
) {
super(connector, controller);
this._agent = registerData.agent;
this._id = registerData.id;
this._name = registerData.name;
this._version = registerData.version;
@@ -38,7 +36,6 @@ export default class HostConnection extends BaseConnection {
const previousHostInfo = this._controller.hosts.get(this._id);
const currentHostInfo = new HostInfo(
this._agent,
this._id,
this._name,
this._version,
-6
View File
@@ -6,8 +6,6 @@ import { HostDetails } from "@clusterio/lib";
*/
export default class HostInfo {
constructor(
/** Agent this host last connected with */
public agent: string,
/** Id of this host */
public id: number,
/** Version this host last connected with */
@@ -29,7 +27,6 @@ export default class HostInfo {
) { }
static jsonSchema = Type.Object({
"agent": Type.String(),
"id": Type.Number(),
"name": Type.String(),
"version": Type.String(),
@@ -43,7 +40,6 @@ export default class HostInfo {
static fromJSON(json: Static<typeof this.jsonSchema>) {
return new this(
json.agent,
json.id,
json.name,
json.version,
@@ -58,7 +54,6 @@ export default class HostInfo {
toJSON(): Static<typeof HostInfo.jsonSchema> {
return {
agent: this.agent,
id: this.id,
name: this.name,
version: this.version,
@@ -73,7 +68,6 @@ export default class HostInfo {
toHostDetails() {
return new HostDetails(
this.agent,
this.version,
this.name,
this.id,
+2 -2
View File
@@ -261,9 +261,9 @@ ${err.stack}`
}
logger.info(
`WsServer | registered host ${data.name} (${data.id}) using agent ${data.agent} ${data.version}`
`WsServer | registered host ${data.name} (${data.id}) using version ${data.version}`
);
if (data.agent === "Clusterio Host" && data.version !== packageVersion) {
if (data.version !== packageVersion) {
logger.warn(
`Host ${data.name} (${data.id}) connected using version ${data.version} which does not match the ` +
`version of the controller is currently running (${packageVersion}). It may not work as expected.`