Add olm agentVersion to separate the library from the agent

This commit is contained in:
Owen
2026-10-22 14:59:33 -04:00
parent 8b509da19f
commit 290f1f2ff0
14 changed files with 107 additions and 46 deletions
+2
View File
@@ -228,6 +228,7 @@ export type GetClientResponse = NonNullable<
olmId: string | null;
agent: string | null;
olmVersion: string | null;
agentVersion: string | null;
userEmail: string | null;
userName: string | null;
userUsername: string | null;
@@ -421,6 +422,7 @@ export async function getClient(
olmId: client.olms ? client.olms.olmId : null,
agent: client.olms?.agent || null,
olmVersion: client.olms?.version || null,
agentVersion: client.olms?.agentVersion || null,
userEmail: client.user?.email ?? null,
userName: client.user?.name ?? null,
userUsername: client.user?.username ?? null,
+1
View File
@@ -187,6 +187,7 @@ function queryClientsBase() {
userEmail: users.email,
niceId: clients.niceId,
agent: olms.agent,
agentVersion: olms.agentVersion,
approvalState: clients.approvalState,
olmArchived: olms.archived,
archived: clients.archived,
+1
View File
@@ -172,6 +172,7 @@ function queryUserDevicesBase() {
idpVariant: idpOidcConfig.variant,
niceId: clients.niceId,
agent: olms.agent,
agentVersion: olms.agentVersion,
approvalState: clients.approvalState,
olmArchived: olms.archived,
archived: clients.archived,
+6 -12
View File
@@ -6,12 +6,12 @@ import {
SubnetProxyTarget,
SubnetProxyTargetV2
} from "@server/lib/ip";
import { canCompress } from "@server/lib/clientVersionChecks";
import {
canCompress,
supportsTargetsV2
} from "@server/lib/clientVersionChecks";
import logger from "@server/logger";
import { eq, inArray } from "drizzle-orm";
import semver from "semver";
const NEWT_V2_TARGETS_VERSION = ">=1.10.3";
export async function convertTargetsIfNecessary(
newtId: string,
@@ -27,10 +27,7 @@ export async function convertTargetsIfNecessary(
}
// check the semver
if (
newt.version &&
!semver.satisfies(newt.version, NEWT_V2_TARGETS_VERSION)
) {
if (newt.version && !supportsTargetsV2(newt.version)) {
logger.debug(
`addTargets Newt version ${newt.version} does not support targets v2 falling back`
);
@@ -167,10 +164,7 @@ export async function updateTargets(
}
// check the semver
if (
newt.version &&
!semver.satisfies(newt.version, NEWT_V2_TARGETS_VERSION)
) {
if (newt.version && !supportsTargetsV2(newt.version)) {
logger.debug(
`addTargets Newt version ${newt.version} does not support targets v2 falling back`
);