diff --git a/server/lib/logAccessAudit.ts b/server/lib/logAccessAudit.ts index 5f3601da0..bfff44441 100644 --- a/server/lib/logAccessAudit.ts +++ b/server/lib/logAccessAudit.ts @@ -7,6 +7,7 @@ export async function logAccessAudit(data: { type: string; orgId: string; resourceId?: number; + siteResourceId?: number; user?: { username: string; userId: string }; apiKey?: { name: string | null; apiKeyId: string }; metadata?: any; diff --git a/server/private/routers/browserGatewayTarget/index.ts b/server/private/routers/browserGatewayTarget/index.ts deleted file mode 100644 index 3c1b3d6f9..000000000 --- a/server/private/routers/browserGatewayTarget/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This file is part of a proprietary work. - * - * Copyright (c) 2025-2026 Fossorial, Inc. - * All rights reserved. - * - * This file is licensed under the Fossorial Commercial License. - * You may not use this file except in compliance with the License. - * Unauthorized use, copying, modification, or distribution is strictly prohibited. - * - * This file is not licensed under the AGPLv3. - */ - -export * from "./getBrowserTarget"; diff --git a/server/private/routers/internal.ts b/server/private/routers/internal.ts index 23188dcd7..29b9b9506 100644 --- a/server/private/routers/internal.ts +++ b/server/private/routers/internal.ts @@ -17,13 +17,8 @@ import * as orgIdp from "#private/routers/orgIdp"; import * as billing from "#private/routers/billing"; import * as license from "#private/routers/license"; import * as resource from "#private/routers/resource"; -import * as ws from "@server/routers/ws"; -import * as browserTarget from "#private/routers/browserGatewayTarget"; -import { - verifySessionUserMiddleware, - verifyUserFromResourceSessionMiddleware -} from "@server/middlewares"; +import { verifySessionUserMiddleware } from "@server/middlewares"; import { internalRouter as ir } from "@server/routers/internal"; @@ -45,11 +40,3 @@ internalRouter.post( internalRouter.get(`/license/status`, license.getLicenseStatus); internalRouter.get("/maintenance/info", resource.getMaintenanceInfo); - -internalRouter.get( - "/ws/round-trip-message/:messageId", - verifyUserFromResourceSessionMiddleware, - ws.checkRoundTripMessage -); - -internalRouter.get("/resource/browser-target", browserTarget.getBrowserTarget); diff --git a/server/private/startSchedulers.ts b/server/private/startSchedulers.ts index ee80d5efd..63237fb42 100644 --- a/server/private/startSchedulers.ts +++ b/server/private/startSchedulers.ts @@ -1,3 +1,16 @@ +/* + * This file is part of a proprietary work. + * + * Copyright (c) 2025-2026 Fossorial, Inc. + * All rights reserved. + * + * This file is licensed under the Fossorial Commercial License. + * You may not use this file except in compliance with the License. + * Unauthorized use, copying, modification, or distribution is strictly prohibited. + * + * This file is not licensed under the AGPLv3. + */ + import { build } from "@server/build"; import { startRemoteExitNodeOfflineChecker } from "./routers/remoteExitNode"; import { startExitNodeReconnectScheduler } from "./routers/remoteExitNode/exitNodeReconnectScheduler"; diff --git a/server/private/routers/browserGatewayTarget/getBrowserTarget.ts b/server/routers/browserGatewayTarget/getBrowserTarget.ts similarity index 89% rename from server/private/routers/browserGatewayTarget/getBrowserTarget.ts rename to server/routers/browserGatewayTarget/getBrowserTarget.ts index b8e32d836..1e95de5bc 100644 --- a/server/private/routers/browserGatewayTarget/getBrowserTarget.ts +++ b/server/routers/browserGatewayTarget/getBrowserTarget.ts @@ -1,16 +1,3 @@ -/* - * This file is part of a proprietary work. - * - * Copyright (c) 2025-2026 Fossorial, Inc. - * All rights reserved. - * - * This file is licensed under the Fossorial Commercial License. - * You may not use this file except in compliance with the License. - * Unauthorized use, copying, modification, or distribution is strictly prohibited. - * - * This file is not licensed under the AGPLv3. - */ - import { Request, Response, NextFunction } from "express"; import { z } from "zod"; import { db, resources, targets } from "@server/db"; diff --git a/server/routers/browserGatewayTarget/index.ts b/server/routers/browserGatewayTarget/index.ts index eea524d65..614b7621d 100644 --- a/server/routers/browserGatewayTarget/index.ts +++ b/server/routers/browserGatewayTarget/index.ts @@ -1 +1,2 @@ export * from "./types"; +export * from "./getBrowserTarget"; diff --git a/server/routers/internal.ts b/server/routers/internal.ts index 27414c47b..0b0e28ad8 100644 --- a/server/routers/internal.ts +++ b/server/routers/internal.ts @@ -13,6 +13,8 @@ import { verifySessionUserMiddleware, verifyUserFromResourceSessionMiddleware } from "@server/middlewares"; +import * as ws from "@server/routers/ws"; +import * as browserTarget from "@server/routers/browserGatewayTarget"; // Root routes export const internalRouter = Router(); @@ -71,3 +73,11 @@ internalRouter.use("/badger", badgerRouter); badgerRouter.post("/verify-session", badger.verifyResourceSession); badgerRouter.post("/exchange-session", badger.exchangeSession); + +internalRouter.get("/resource/browser-target", browserTarget.getBrowserTarget); + +internalRouter.get( + "/ws/round-trip-message/:messageId", + verifyUserFromResourceSessionMiddleware, + ws.checkRoundTripMessage +); diff --git a/server/routers/ssh/signSshKey.ts b/server/routers/ssh/signSshKey.ts index dfd73fd13..1935bd6eb 100644 --- a/server/routers/ssh/signSshKey.ts +++ b/server/routers/ssh/signSshKey.ts @@ -21,7 +21,7 @@ import { Resource, SiteResource } from "@server/db"; -import { logAccessAudit } from "#private/lib/logAccessAudit"; +import { logAccessAudit } from "#dynamic/lib/logAccessAudit"; import response from "@server/lib/response"; import HttpCode from "@server/types/HttpCode"; import createHttpError from "http-errors"; @@ -32,7 +32,7 @@ import { canUserAccessResource } from "@server/auth/canUserAccessResource"; import { canUserAccessSiteResource } from "@server/auth/canUserAccessSiteResource"; import { signPublicKey, getOrgCAKeys } from "@server/lib/sshCA"; import config from "@server/lib/config"; -import { sendToClient } from "#private/routers/ws"; +import { sendToClient } from "#dynamic/routers/ws"; import { ActionsEnum } from "@server/auth/actions"; import type { SignSshKeyResponse } from "@server/routers/ssh/types";