@yeaft/webchat-agent 1.0.524 → 1.0.526

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,7 @@ import { CONFIG, isEmailConfigured, validateProductionConfig } from './config.js
11
11
  import { agents, webClients, userFileTabs, userStatsDeltas } from './context.js';
12
12
  import { invitationDb, userDb, userStatsDb, closeDb } from './database.js';
13
13
  import { registerApiRoutes } from './api.js';
14
+ import { registerInstallerRoutes } from './routes/installer-routes.js';
14
15
  import { registerProxyRoutes, handleProxyWebSocketUpgrade } from './proxy.js';
15
16
  import { handleAgentConnection } from './ws-agent.js';
16
17
  import { handleWebConnection } from './ws-client.js';
@@ -139,6 +140,7 @@ app.use(compression({
139
140
  const webDir = process.env.WEB_DIR || (process.env.SERVE_DIST === 'true'
140
141
  ? join(__dirname, '../web/dist')
141
142
  : join(__dirname, '../web'));
143
+ registerInstallerRoutes(app, webDir);
142
144
  app.use(express.static(webDir, {
143
145
  maxAge: process.env.SERVE_DIST === 'true' ? '1y' : 0,
144
146
  etag: true,
@@ -0,0 +1,19 @@
1
+ import { join } from 'node:path';
2
+
3
+ /**
4
+ * Public, static bootstraps for a machine that has no Agent or browser session yet.
5
+ * No user, Host header or query data is interpolated; credentials stay in CLI arguments.
6
+ * webDir is the same trusted source/dist root used by the Server's static middleware.
7
+ */
8
+ export function registerInstallerRoutes(app, webDir) {
9
+ for (const file of ['install.sh', 'install.ps1']) {
10
+ app.get(`/installers/${file}`, (_req, res) => {
11
+ res.set({
12
+ 'Content-Type': 'text/plain; charset=utf-8',
13
+ 'Cache-Control': 'no-store',
14
+ 'X-Content-Type-Options': 'nosniff',
15
+ });
16
+ res.sendFile(join(webDir, 'installers', file), { cacheControl: false });
17
+ });
18
+ }
19
+ }
@@ -1 +1 @@
1
- {"version":"1.0.524"}
1
+ {"version":"1.0.526"}