@sockethub/server 5.0.0-alpha.21 → 5.0.0-alpha.22
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.
- package/README.md +15 -5
- package/dist/cli.d.ts +13 -0
- package/dist/index.js +187 -65
- package/dist/index.js.map +11 -9
- package/dist/platform.js +38 -20
- package/dist/platform.js.map +6 -6
- package/dist/sentry.d.ts +9 -0
- package/dist/trust-proxy.d.ts +24 -0
- package/package.json +15 -15
- package/res/sockethub-client.js +9 -4
- package/res/sockethub-client.min.js +11 -11
package/dist/sentry.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
/** Privacy-conscious Sentry observability for the server and platform workers. */
|
|
2
2
|
type MetricAttributes = Record<string, string | number | boolean>;
|
|
3
|
+
/** How long fatal-error paths wait for queued events to reach Sentry. */
|
|
4
|
+
export declare const SENTRY_FLUSH_TIMEOUT_MS = 2000;
|
|
3
5
|
export declare function reportError(err: Error): void;
|
|
6
|
+
/**
|
|
7
|
+
* Drain queued events to Sentry. `captureException` only enqueues; a process
|
|
8
|
+
* that exits without flushing discards everything still in the buffer, which
|
|
9
|
+
* is exactly the case for fatal-error paths that call `process.exit`.
|
|
10
|
+
* Resolves `false` if the timeout elapsed with events still unsent.
|
|
11
|
+
*/
|
|
12
|
+
export declare function flush(timeoutMs?: number): Promise<boolean>;
|
|
4
13
|
export declare function count(name: string, value?: number, attributes?: MetricAttributes): void;
|
|
5
14
|
export declare function gauge(name: string, value: number, attributes?: MetricAttributes): void;
|
|
6
15
|
export declare function startAction(platform: string, action: string): (error?: boolean) => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolution of Express's `trust proxy` setting.
|
|
3
|
+
*
|
|
4
|
+
* Without it, `req.ip` is the socket peer — the reverse proxy — so every
|
|
5
|
+
* proxied request shares one rate-limit bucket, and `express-rate-limit`
|
|
6
|
+
* raises ERR_ERL_UNEXPECTED_X_FORWARDED_FOR when it sees the header it has
|
|
7
|
+
* been told not to believe.
|
|
8
|
+
*/
|
|
9
|
+
export type TrustProxySetting = boolean | number | string;
|
|
10
|
+
/**
|
|
11
|
+
* The `trust proxy` value to apply, given the configured `sockethub.trustProxy`
|
|
12
|
+
* and the `credentialCheck` reconnect settings. Declaring `reconnectIpSource:
|
|
13
|
+
* "proxy"` already states that a trusted proxy sets the forwarded header, so
|
|
14
|
+
* an otherwise-unset `trustProxy` follows it and trusts a single hop, keeping
|
|
15
|
+
* the socket and HTTP paths from disagreeing about who the client is.
|
|
16
|
+
*
|
|
17
|
+
* That inference only holds while the socket path reads the same header
|
|
18
|
+
* Express does. A deployment naming a custom `proxyHeader` has vouched for
|
|
19
|
+
* that header alone; its proxy may well leave `x-forwarded-for` untouched and
|
|
20
|
+
* client-settable, and trusting it would hand clients control of their own
|
|
21
|
+
* HTTP rate-limit identity. Such a deployment must set `trustProxy`
|
|
22
|
+
* explicitly.
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveTrustProxy(configured: unknown, reconnectIpSource: unknown, proxyHeader?: unknown): TrustProxySetting;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sockethub/server",
|
|
3
3
|
"description": "A polyglot messaging service, server libraries",
|
|
4
|
-
"version": "5.0.0-alpha.
|
|
4
|
+
"version": "5.0.0-alpha.22",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
7
7
|
"author": "Nick Jennings <nick@silverbucket.net>",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@sentry/node": "^10.36.0",
|
|
54
54
|
"@sentry/profiling-node": "10.36.0",
|
|
55
|
-
"@sockethub/client": "^5.0.0-alpha.
|
|
56
|
-
"@sockethub/data-layer": "^1.0.0-alpha.
|
|
57
|
-
"@sockethub/logger": "^1.0.0-alpha.
|
|
58
|
-
"@sockethub/schemas": "^3.0.0-alpha.
|
|
59
|
-
"@sockethub/util": "^1.0.0-alpha.
|
|
55
|
+
"@sockethub/client": "^5.0.0-alpha.22",
|
|
56
|
+
"@sockethub/data-layer": "^1.0.0-alpha.22",
|
|
57
|
+
"@sockethub/logger": "^1.0.0-alpha.22",
|
|
58
|
+
"@sockethub/schemas": "^3.0.0-alpha.22",
|
|
59
|
+
"@sockethub/util": "^1.0.0-alpha.10",
|
|
60
60
|
"chalk": "^5.6.2",
|
|
61
61
|
"convict": "^6.2.5",
|
|
62
62
|
"ejs": "^3.1.10",
|
|
@@ -87,15 +87,15 @@
|
|
|
87
87
|
"web-streams-polyfill": "^3.3.3"
|
|
88
88
|
},
|
|
89
89
|
"optionalDependencies": {
|
|
90
|
-
"@sockethub/examples": "^1.0.0-alpha.
|
|
91
|
-
"@sockethub/platform-caldav": "^1.0.0-alpha.
|
|
92
|
-
"@sockethub/platform-carddav": "^1.0.0-alpha.
|
|
93
|
-
"@sockethub/platform-dummy": "^3.0.0-alpha.
|
|
94
|
-
"@sockethub/platform-feeds": "^4.0.0-alpha.
|
|
95
|
-
"@sockethub/platform-irc": "^4.0.0-alpha.
|
|
96
|
-
"@sockethub/platform-metadata": "^1.0.1-alpha.
|
|
97
|
-
"@sockethub/platform-xmpp": "^5.0.0-alpha.
|
|
90
|
+
"@sockethub/examples": "^1.0.0-alpha.22",
|
|
91
|
+
"@sockethub/platform-caldav": "^1.0.0-alpha.6",
|
|
92
|
+
"@sockethub/platform-carddav": "^1.0.0-alpha.3",
|
|
93
|
+
"@sockethub/platform-dummy": "^3.0.0-alpha.22",
|
|
94
|
+
"@sockethub/platform-feeds": "^4.0.0-alpha.22",
|
|
95
|
+
"@sockethub/platform-irc": "^4.0.0-alpha.22",
|
|
96
|
+
"@sockethub/platform-metadata": "^1.0.1-alpha.17",
|
|
97
|
+
"@sockethub/platform-xmpp": "^5.0.0-alpha.22"
|
|
98
98
|
},
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "643a19160301186e428add63a79ae42ee26e8844",
|
|
100
100
|
"types": "./dist/index.d.ts"
|
|
101
101
|
}
|