@sockethub/server 5.0.0-alpha.15 → 5.0.0-alpha.16
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/dist/config-schema.d.ts +58 -0
- package/dist/index.js +154769 -154593
- package/dist/index.js.map +45 -42
- package/dist/platform.js +284 -231
- package/dist/platform.js.map +8 -6
- package/dist/write-config.d.ts +18 -0
- package/package.json +13 -13
- package/res/sockethub-client.js +91 -8
- package/res/sockethub-client.min.js +19 -19
package/dist/platform.js
CHANGED
|
@@ -19800,9 +19800,87 @@ var init_activity_stream = __esm(() => {
|
|
|
19800
19800
|
// ../schemas/src/schemas/platform.ts
|
|
19801
19801
|
var init_platform = () => {};
|
|
19802
19802
|
|
|
19803
|
+
// ../schemas/package.json
|
|
19804
|
+
var package_default;
|
|
19805
|
+
var init_package = __esm(() => {
|
|
19806
|
+
package_default = {
|
|
19807
|
+
name: "@sockethub/schemas",
|
|
19808
|
+
description: "JSON schema files for validating Sockethub Activity Streams",
|
|
19809
|
+
version: "3.0.0-alpha.16",
|
|
19810
|
+
type: "module",
|
|
19811
|
+
private: false,
|
|
19812
|
+
author: "Nick Jennings <nick@silverbucket.net>",
|
|
19813
|
+
license: "MIT",
|
|
19814
|
+
publishConfig: {
|
|
19815
|
+
access: "public"
|
|
19816
|
+
},
|
|
19817
|
+
main: "dist/index.js",
|
|
19818
|
+
exports: {
|
|
19819
|
+
".": {
|
|
19820
|
+
types: "./dist/index.d.ts",
|
|
19821
|
+
import: "./dist/index.js",
|
|
19822
|
+
default: "./dist/index.js"
|
|
19823
|
+
},
|
|
19824
|
+
"./context": {
|
|
19825
|
+
types: "./dist/context.d.ts",
|
|
19826
|
+
import: "./dist/context.js",
|
|
19827
|
+
default: "./dist/context.js"
|
|
19828
|
+
},
|
|
19829
|
+
"./object-types": {
|
|
19830
|
+
types: "./dist/object-types.d.ts",
|
|
19831
|
+
import: "./dist/object-types.js",
|
|
19832
|
+
default: "./dist/object-types.js"
|
|
19833
|
+
},
|
|
19834
|
+
"./schemas/json/sockethub-config.json": {
|
|
19835
|
+
default: "./dist/schemas/json/sockethub-config.json"
|
|
19836
|
+
}
|
|
19837
|
+
},
|
|
19838
|
+
files: [
|
|
19839
|
+
"dist/"
|
|
19840
|
+
],
|
|
19841
|
+
engines: {
|
|
19842
|
+
node: ">=20"
|
|
19843
|
+
},
|
|
19844
|
+
keywords: [
|
|
19845
|
+
"sockethub",
|
|
19846
|
+
"sockethub schema",
|
|
19847
|
+
"activity streams",
|
|
19848
|
+
"activity objects",
|
|
19849
|
+
"sockethub platforms"
|
|
19850
|
+
],
|
|
19851
|
+
repository: {
|
|
19852
|
+
type: "git",
|
|
19853
|
+
url: "git+https://github.com/sockethub/sockethub.git",
|
|
19854
|
+
directory: "packages/schemas"
|
|
19855
|
+
},
|
|
19856
|
+
homepage: "https://github.com/sockethub/sockethub/tree/master/packages/schemas",
|
|
19857
|
+
devDependencies: {
|
|
19858
|
+
"@types/bun": "latest"
|
|
19859
|
+
},
|
|
19860
|
+
scripts: {
|
|
19861
|
+
build: "bun ./scripts/export-json-schema.ts && bun ./scripts/export-canonical-assets.ts && bun build src/index.ts src/object-types.ts --outdir dist --target node --format esm --sourcemap=external && bun build src/context.ts src/activity-stream-helper.ts --outdir dist --target browser --format esm --sourcemap=external",
|
|
19862
|
+
clean: "rm -rf dist",
|
|
19863
|
+
"clean:deps": "rm -rf node_modules"
|
|
19864
|
+
},
|
|
19865
|
+
dependencies: {
|
|
19866
|
+
ajv: "^8.17.1",
|
|
19867
|
+
"ajv-formats": "^2.1.1",
|
|
19868
|
+
"ajv-formats-draft2019": "^1.6.1"
|
|
19869
|
+
},
|
|
19870
|
+
gitHead: "1a1a01ffe7b9d356aacfc4ae583d553e5df6f97d",
|
|
19871
|
+
types: "./dist/index.d.ts"
|
|
19872
|
+
};
|
|
19873
|
+
});
|
|
19874
|
+
|
|
19875
|
+
// ../schemas/src/schema-id.ts
|
|
19876
|
+
function versionedSchemaId(id, version) {
|
|
19877
|
+
return id.replace("/v/", `/${version}/`);
|
|
19878
|
+
}
|
|
19879
|
+
|
|
19803
19880
|
// ../schemas/src/schemas/sockethub-config.ts
|
|
19804
|
-
var SockethubConfigSchema;
|
|
19881
|
+
var SockethubConfigSchema, SockethubConfigSchemaId;
|
|
19805
19882
|
var init_sockethub_config = __esm(() => {
|
|
19883
|
+
init_package();
|
|
19806
19884
|
SockethubConfigSchema = {
|
|
19807
19885
|
$id: "https://sockethub.org/schemas/v/sockethub-config.json",
|
|
19808
19886
|
description: "Sockethub Config Schema",
|
|
@@ -19815,11 +19893,13 @@ var init_sockethub_config = __esm(() => {
|
|
|
19815
19893
|
},
|
|
19816
19894
|
examples: {
|
|
19817
19895
|
type: "boolean",
|
|
19818
|
-
default: true
|
|
19896
|
+
default: true,
|
|
19897
|
+
description: "Enable the examples pages served at [host]:[port]/examples"
|
|
19819
19898
|
},
|
|
19820
19899
|
info: {
|
|
19821
19900
|
type: "boolean",
|
|
19822
|
-
default: false
|
|
19901
|
+
default: false,
|
|
19902
|
+
description: "Display Sockethub runtime information"
|
|
19823
19903
|
},
|
|
19824
19904
|
logging: {
|
|
19825
19905
|
type: "object",
|
|
@@ -19846,6 +19926,7 @@ var init_sockethub_config = __esm(() => {
|
|
|
19846
19926
|
items: {
|
|
19847
19927
|
type: "string"
|
|
19848
19928
|
},
|
|
19929
|
+
description: "Platform packages to load",
|
|
19849
19930
|
default: [
|
|
19850
19931
|
"@sockethub/platform-dummy",
|
|
19851
19932
|
"@sockethub/platform-feeds",
|
|
@@ -19856,6 +19937,8 @@ var init_sockethub_config = __esm(() => {
|
|
|
19856
19937
|
},
|
|
19857
19938
|
packageConfig: {
|
|
19858
19939
|
type: "object",
|
|
19940
|
+
default: {},
|
|
19941
|
+
description: "Per-platform config keyed by package name, validated against " + "each platform's config schema and forwarded to its child process",
|
|
19859
19942
|
properties: {
|
|
19860
19943
|
"@sockethub/platform-dummy": {
|
|
19861
19944
|
type: "object",
|
|
@@ -19965,7 +20048,8 @@ var init_sockethub_config = __esm(() => {
|
|
|
19965
20048
|
maxConnectionsPerIp: {
|
|
19966
20049
|
type: "number",
|
|
19967
20050
|
minimum: 0,
|
|
19968
|
-
default: 0
|
|
20051
|
+
default: 0,
|
|
20052
|
+
description: "Maximum concurrent socket connections per client IP. " + "The per-event rate limiter is keyed by socket id, so " + "without a connection cap a client can bypass it by " + "opening more sockets. 0 disables the cap."
|
|
19969
20053
|
}
|
|
19970
20054
|
}
|
|
19971
20055
|
},
|
|
@@ -19976,7 +20060,8 @@ var init_sockethub_config = __esm(() => {
|
|
|
19976
20060
|
maxPlatformInstances: {
|
|
19977
20061
|
type: "number",
|
|
19978
20062
|
minimum: 0,
|
|
19979
|
-
default: 0
|
|
20063
|
+
default: 0,
|
|
20064
|
+
description: "Upper bound on concurrently running platform instances " + "(child processes). Each persistent-platform actor forks " + "its own process, so an unbounded count is a resource " + "exhaustion risk on public instances. 0 disables the cap."
|
|
19980
20065
|
}
|
|
19981
20066
|
}
|
|
19982
20067
|
},
|
|
@@ -20041,7 +20126,8 @@ var init_sockethub_config = __esm(() => {
|
|
|
20041
20126
|
properties: {
|
|
20042
20127
|
origin: {
|
|
20043
20128
|
type: "string",
|
|
20044
|
-
default: "*"
|
|
20129
|
+
default: "*",
|
|
20130
|
+
description: "Allowed CORS origin(s) for socket.io connections " + "and the HTTP actions endpoint. '*' allows any " + "website to connect visitors' browsers to this " + "instance; public deployments should set an " + "explicit origin or comma-separated list of " + "origins."
|
|
20045
20131
|
}
|
|
20046
20132
|
}
|
|
20047
20133
|
}
|
|
@@ -20053,7 +20139,8 @@ var init_sockethub_config = __esm(() => {
|
|
|
20053
20139
|
properties: {
|
|
20054
20140
|
enabled: {
|
|
20055
20141
|
type: "boolean",
|
|
20056
|
-
default: false
|
|
20142
|
+
default: false,
|
|
20143
|
+
description: "Enable the HTTP actions endpoint"
|
|
20057
20144
|
},
|
|
20058
20145
|
path: {
|
|
20059
20146
|
type: "string",
|
|
@@ -20106,6 +20193,7 @@ var init_sockethub_config = __esm(() => {
|
|
|
20106
20193
|
}
|
|
20107
20194
|
}
|
|
20108
20195
|
};
|
|
20196
|
+
SockethubConfigSchemaId = versionedSchemaId(SockethubConfigSchema.$id, package_default.version);
|
|
20109
20197
|
});
|
|
20110
20198
|
|
|
20111
20199
|
// ../../node_modules/ajv/dist/compile/codegen/code.js
|
|
@@ -69637,6 +69725,184 @@ var require_main = __commonJS((exports, module) => {
|
|
|
69637
69725
|
module.exports = convict;
|
|
69638
69726
|
});
|
|
69639
69727
|
|
|
69728
|
+
// src/config-schema.ts
|
|
69729
|
+
function isLeaf(node, overlay) {
|
|
69730
|
+
if (overlay?.leaf) {
|
|
69731
|
+
return true;
|
|
69732
|
+
}
|
|
69733
|
+
return !(node.type === "object" && node.properties);
|
|
69734
|
+
}
|
|
69735
|
+
function hasDefault(node, overlay) {
|
|
69736
|
+
return Object.hasOwn(node, "default") || overlay !== undefined && Object.hasOwn(overlay, "default");
|
|
69737
|
+
}
|
|
69738
|
+
function defaultOf(node, overlay) {
|
|
69739
|
+
const value = Object.hasOwn(node, "default") ? node.default : overlay?.default;
|
|
69740
|
+
return value !== null && typeof value === "object" ? structuredClone(value) : value;
|
|
69741
|
+
}
|
|
69742
|
+
function convictFormat(node, path, overlay) {
|
|
69743
|
+
if (overlay?.format !== undefined) {
|
|
69744
|
+
return overlay.format;
|
|
69745
|
+
}
|
|
69746
|
+
if (Array.isArray(node.enum)) {
|
|
69747
|
+
return [...node.enum];
|
|
69748
|
+
}
|
|
69749
|
+
if (Array.isArray(node.type)) {
|
|
69750
|
+
return "*";
|
|
69751
|
+
}
|
|
69752
|
+
switch (node.type) {
|
|
69753
|
+
case "boolean":
|
|
69754
|
+
return Boolean;
|
|
69755
|
+
case "string":
|
|
69756
|
+
return String;
|
|
69757
|
+
case "number":
|
|
69758
|
+
case "integer":
|
|
69759
|
+
return Number;
|
|
69760
|
+
case "array":
|
|
69761
|
+
return Array;
|
|
69762
|
+
case "object":
|
|
69763
|
+
return Object;
|
|
69764
|
+
default:
|
|
69765
|
+
throw new Error(`config schema: unsupported type "${node.type}" at "${path}"`);
|
|
69766
|
+
}
|
|
69767
|
+
}
|
|
69768
|
+
function buildDefinition(node, overlays, consumed, prefix = "") {
|
|
69769
|
+
const definition = {};
|
|
69770
|
+
for (const [key, child] of Object.entries(node.properties ?? {})) {
|
|
69771
|
+
const path = prefix ? `${prefix}.${key}` : key;
|
|
69772
|
+
const overlay = overlays[path];
|
|
69773
|
+
if (overlay) {
|
|
69774
|
+
consumed.add(path);
|
|
69775
|
+
}
|
|
69776
|
+
if (!isLeaf(child, overlay)) {
|
|
69777
|
+
definition[key] = buildDefinition(child, overlays, consumed, path);
|
|
69778
|
+
continue;
|
|
69779
|
+
}
|
|
69780
|
+
if (!hasDefault(child, overlay)) {
|
|
69781
|
+
throw new Error(`config schema: no default declared for "${path}" in the ` + "JSON schema or its overlay entry");
|
|
69782
|
+
}
|
|
69783
|
+
const leaf = {
|
|
69784
|
+
format: convictFormat(child, path, overlay),
|
|
69785
|
+
default: defaultOf(child, overlay)
|
|
69786
|
+
};
|
|
69787
|
+
if (child.description) {
|
|
69788
|
+
leaf.doc = child.description;
|
|
69789
|
+
}
|
|
69790
|
+
if (overlay?.env) {
|
|
69791
|
+
leaf.env = overlay.env;
|
|
69792
|
+
}
|
|
69793
|
+
if (overlay?.arg) {
|
|
69794
|
+
leaf.arg = overlay.arg;
|
|
69795
|
+
}
|
|
69796
|
+
definition[key] = leaf;
|
|
69797
|
+
}
|
|
69798
|
+
return definition;
|
|
69799
|
+
}
|
|
69800
|
+
function buildConvictDefinition(jsonSchema, overlays) {
|
|
69801
|
+
const consumed = new Set;
|
|
69802
|
+
const definition = buildDefinition(jsonSchema, overlays, consumed);
|
|
69803
|
+
const unknown = Object.keys(overlays).filter((path) => !consumed.has(path));
|
|
69804
|
+
if (unknown.length > 0) {
|
|
69805
|
+
throw new Error("config schema: overlay entries reference paths missing from " + `the JSON schema: ${unknown.join(", ")}`);
|
|
69806
|
+
}
|
|
69807
|
+
return definition;
|
|
69808
|
+
}
|
|
69809
|
+
function buildSchema() {
|
|
69810
|
+
return import_convict.default(buildConvictDefinition(SockethubConfigSchema, OVERLAY));
|
|
69811
|
+
}
|
|
69812
|
+
var import_convict, OVERLAY, EMPTY_ENV_IS_UNSET_VARS;
|
|
69813
|
+
var init_config_schema = __esm(() => {
|
|
69814
|
+
init_src2();
|
|
69815
|
+
import_convict = __toESM(require_main(), 1);
|
|
69816
|
+
OVERLAY = {
|
|
69817
|
+
$schema: { default: "" },
|
|
69818
|
+
examples: { arg: "examples" },
|
|
69819
|
+
info: { arg: "info" },
|
|
69820
|
+
"logging.level": { env: "LOG_LEVEL", emptyEnvIsUnset: true },
|
|
69821
|
+
"logging.fileLevel": { env: "LOG_FILE_LEVEL", emptyEnvIsUnset: true },
|
|
69822
|
+
"logging.file": { env: "LOG_FILE", emptyEnvIsUnset: true },
|
|
69823
|
+
packageConfig: { leaf: true, format: Object },
|
|
69824
|
+
"public.port": { format: "port" },
|
|
69825
|
+
"rateLimiter.windowMs": { format: "nat" },
|
|
69826
|
+
"rateLimiter.maxRequests": { format: "nat" },
|
|
69827
|
+
"rateLimiter.blockDurationMs": { format: "nat" },
|
|
69828
|
+
"rateLimiter.maxConnectionsPerIp": { format: "nat" },
|
|
69829
|
+
"limits.maxPlatformInstances": { format: "nat" },
|
|
69830
|
+
"credentials.ttlMs": {
|
|
69831
|
+
format: "nat",
|
|
69832
|
+
env: "SOCKETHUB_CREDENTIALS_TTL_MS",
|
|
69833
|
+
emptyEnvIsUnset: true
|
|
69834
|
+
},
|
|
69835
|
+
"redis.url": {
|
|
69836
|
+
env: "REDIS_URL",
|
|
69837
|
+
emptyEnvIsUnset: true,
|
|
69838
|
+
arg: "redis.url"
|
|
69839
|
+
},
|
|
69840
|
+
"redis.connectTimeout": { format: "nat" },
|
|
69841
|
+
"redis.disconnectTimeout": { format: "nat" },
|
|
69842
|
+
"redis.maxRetriesPerRequest": { format: "*" },
|
|
69843
|
+
"sentry.dsn": { arg: "sentry.dsn" },
|
|
69844
|
+
"sockethub.port": {
|
|
69845
|
+
format: "port",
|
|
69846
|
+
env: "PORT",
|
|
69847
|
+
emptyEnvIsUnset: true,
|
|
69848
|
+
arg: "port"
|
|
69849
|
+
},
|
|
69850
|
+
"sockethub.host": { env: "HOST", emptyEnvIsUnset: true, arg: "host" },
|
|
69851
|
+
"sockethub.cors.origin": {
|
|
69852
|
+
env: "SOCKETHUB_CORS_ORIGIN",
|
|
69853
|
+
arg: "cors.origin"
|
|
69854
|
+
},
|
|
69855
|
+
"httpActions.enabled": {
|
|
69856
|
+
env: "SOCKETHUB_HTTP_ACTIONS_ENABLED",
|
|
69857
|
+
emptyEnvIsUnset: true
|
|
69858
|
+
},
|
|
69859
|
+
"httpActions.path": {
|
|
69860
|
+
env: "SOCKETHUB_HTTP_ACTIONS_PATH",
|
|
69861
|
+
emptyEnvIsUnset: true
|
|
69862
|
+
},
|
|
69863
|
+
"httpActions.requireRequestId": {
|
|
69864
|
+
env: "SOCKETHUB_HTTP_ACTIONS_REQUIRE_REQUEST_ID",
|
|
69865
|
+
emptyEnvIsUnset: true
|
|
69866
|
+
},
|
|
69867
|
+
"httpActions.maxMessagesPerRequest": {
|
|
69868
|
+
format: "nat",
|
|
69869
|
+
env: "SOCKETHUB_HTTP_ACTIONS_MAX_MESSAGES_PER_REQUEST",
|
|
69870
|
+
emptyEnvIsUnset: true
|
|
69871
|
+
},
|
|
69872
|
+
"httpActions.maxPayloadBytes": {
|
|
69873
|
+
format: "nat",
|
|
69874
|
+
env: "SOCKETHUB_HTTP_ACTIONS_MAX_PAYLOAD_BYTES",
|
|
69875
|
+
emptyEnvIsUnset: true
|
|
69876
|
+
},
|
|
69877
|
+
"httpActions.idempotencyTtlMs": {
|
|
69878
|
+
format: "nat",
|
|
69879
|
+
env: "SOCKETHUB_HTTP_ACTIONS_IDEMPOTENCY_TTL_MS",
|
|
69880
|
+
emptyEnvIsUnset: true
|
|
69881
|
+
},
|
|
69882
|
+
"httpActions.requestTimeoutMs": {
|
|
69883
|
+
format: "nat",
|
|
69884
|
+
env: "SOCKETHUB_HTTP_ACTIONS_REQUEST_TIMEOUT_MS",
|
|
69885
|
+
emptyEnvIsUnset: true
|
|
69886
|
+
},
|
|
69887
|
+
"httpActions.idleTimeoutMs": {
|
|
69888
|
+
format: "nat",
|
|
69889
|
+
env: "SOCKETHUB_HTTP_ACTIONS_IDLE_TIMEOUT_MS",
|
|
69890
|
+
emptyEnvIsUnset: true
|
|
69891
|
+
},
|
|
69892
|
+
"platformHeartbeat.intervalMs": {
|
|
69893
|
+
format: "nat",
|
|
69894
|
+
env: "SOCKETHUB_PLATFORM_HEARTBEAT_INTERVAL_MS",
|
|
69895
|
+
emptyEnvIsUnset: true
|
|
69896
|
+
},
|
|
69897
|
+
"platformHeartbeat.timeoutMs": {
|
|
69898
|
+
format: "nat",
|
|
69899
|
+
env: "SOCKETHUB_PLATFORM_HEARTBEAT_TIMEOUT_MS",
|
|
69900
|
+
emptyEnvIsUnset: true
|
|
69901
|
+
}
|
|
69902
|
+
};
|
|
69903
|
+
EMPTY_ENV_IS_UNSET_VARS = Object.values(OVERLAY).filter((entry) => entry.emptyEnvIsUnset && entry.env).map((entry) => entry.env);
|
|
69904
|
+
});
|
|
69905
|
+
|
|
69640
69906
|
// src/logger-core.ts
|
|
69641
69907
|
function createWinstonLogger(namespace, options = {}) {
|
|
69642
69908
|
const cfg = {
|
|
@@ -69681,199 +69947,6 @@ var init_logger_core = __esm(() => {
|
|
|
69681
69947
|
// src/config.ts
|
|
69682
69948
|
import fs from "node:fs";
|
|
69683
69949
|
import path from "node:path";
|
|
69684
|
-
function buildSchema() {
|
|
69685
|
-
return import_convict.default({
|
|
69686
|
-
$schema: { format: String, default: "" },
|
|
69687
|
-
examples: {
|
|
69688
|
-
doc: "Enable the examples pages served at [host]:[port]/examples",
|
|
69689
|
-
format: Boolean,
|
|
69690
|
-
default: true,
|
|
69691
|
-
arg: "examples"
|
|
69692
|
-
},
|
|
69693
|
-
info: {
|
|
69694
|
-
doc: "Display Sockethub runtime information",
|
|
69695
|
-
format: Boolean,
|
|
69696
|
-
default: false,
|
|
69697
|
-
arg: "info"
|
|
69698
|
-
},
|
|
69699
|
-
logging: {
|
|
69700
|
-
level: {
|
|
69701
|
-
format: LOG_LEVELS,
|
|
69702
|
-
default: "info",
|
|
69703
|
-
env: "LOG_LEVEL"
|
|
69704
|
-
},
|
|
69705
|
-
fileLevel: {
|
|
69706
|
-
format: LOG_LEVELS,
|
|
69707
|
-
default: "debug",
|
|
69708
|
-
env: "LOG_FILE_LEVEL"
|
|
69709
|
-
},
|
|
69710
|
-
file: {
|
|
69711
|
-
format: String,
|
|
69712
|
-
default: "sockethub.log",
|
|
69713
|
-
env: "LOG_FILE"
|
|
69714
|
-
}
|
|
69715
|
-
},
|
|
69716
|
-
platforms: {
|
|
69717
|
-
doc: "Platform packages to load",
|
|
69718
|
-
format: Array,
|
|
69719
|
-
default: [
|
|
69720
|
-
"@sockethub/platform-dummy",
|
|
69721
|
-
"@sockethub/platform-feeds",
|
|
69722
|
-
"@sockethub/platform-irc",
|
|
69723
|
-
"@sockethub/platform-metadata",
|
|
69724
|
-
"@sockethub/platform-xmpp"
|
|
69725
|
-
]
|
|
69726
|
-
},
|
|
69727
|
-
packageConfig: {
|
|
69728
|
-
doc: "Per-platform config keyed by package name, validated against " + "each platform's config schema and forwarded to its child process",
|
|
69729
|
-
format: Object,
|
|
69730
|
-
default: {}
|
|
69731
|
-
},
|
|
69732
|
-
public: {
|
|
69733
|
-
protocol: { format: String, default: "http" },
|
|
69734
|
-
host: { format: String, default: "localhost" },
|
|
69735
|
-
port: { format: "port", default: 10550 },
|
|
69736
|
-
path: { format: String, default: "/" }
|
|
69737
|
-
},
|
|
69738
|
-
rateLimiter: {
|
|
69739
|
-
windowMs: { format: "nat", default: 1000 },
|
|
69740
|
-
maxRequests: { format: "nat", default: 100 },
|
|
69741
|
-
blockDurationMs: { format: "nat", default: 5000 },
|
|
69742
|
-
maxConnectionsPerIp: {
|
|
69743
|
-
doc: "Maximum concurrent socket connections per client IP. " + "The per-event rate limiter is keyed by socket id, so " + "without a connection cap a client can bypass it by " + "opening more sockets. 0 disables the cap.",
|
|
69744
|
-
format: "nat",
|
|
69745
|
-
default: 0
|
|
69746
|
-
}
|
|
69747
|
-
},
|
|
69748
|
-
limits: {
|
|
69749
|
-
maxPlatformInstances: {
|
|
69750
|
-
doc: "Upper bound on concurrently running platform instances " + "(child processes). Each persistent-platform actor forks " + "its own process, so an unbounded count is a resource " + "exhaustion risk on public instances. 0 disables the cap.",
|
|
69751
|
-
format: "nat",
|
|
69752
|
-
default: 0
|
|
69753
|
-
}
|
|
69754
|
-
},
|
|
69755
|
-
credentials: {
|
|
69756
|
-
ttlMs: {
|
|
69757
|
-
doc: "Sliding TTL in milliseconds for per-session encrypted " + "credential keys in Redis, refreshed on every save and " + "read. A backstop against keys orphaned by crashes; " + "sessions normally delete their key on disconnect. " + "Size generously — idle sessions do not refresh it. " + "0 disables expiry.",
|
|
69758
|
-
format: "nat",
|
|
69759
|
-
default: 604800000,
|
|
69760
|
-
env: "SOCKETHUB_CREDENTIALS_TTL_MS"
|
|
69761
|
-
}
|
|
69762
|
-
},
|
|
69763
|
-
credentialCheck: {
|
|
69764
|
-
reconnectIpSource: {
|
|
69765
|
-
format: ["socket", "proxy"],
|
|
69766
|
-
default: "socket"
|
|
69767
|
-
},
|
|
69768
|
-
proxyHeader: { format: String, default: "x-forwarded-for" }
|
|
69769
|
-
},
|
|
69770
|
-
redis: {
|
|
69771
|
-
url: {
|
|
69772
|
-
format: String,
|
|
69773
|
-
default: "redis://127.0.0.1:6379",
|
|
69774
|
-
env: "REDIS_URL",
|
|
69775
|
-
arg: "redis.url"
|
|
69776
|
-
},
|
|
69777
|
-
connectTimeout: {
|
|
69778
|
-
format: "nat",
|
|
69779
|
-
default: 1e4,
|
|
69780
|
-
doc: "Connection timeout in milliseconds"
|
|
69781
|
-
},
|
|
69782
|
-
disconnectTimeout: {
|
|
69783
|
-
format: "nat",
|
|
69784
|
-
default: 5000,
|
|
69785
|
-
doc: "Disconnect timeout in milliseconds"
|
|
69786
|
-
},
|
|
69787
|
-
maxRetriesPerRequest: {
|
|
69788
|
-
format: "*",
|
|
69789
|
-
default: null
|
|
69790
|
-
}
|
|
69791
|
-
},
|
|
69792
|
-
sentry: {
|
|
69793
|
-
dsn: { format: String, default: "", arg: "sentry.dsn" },
|
|
69794
|
-
traceSampleRate: { format: Number, default: 1 }
|
|
69795
|
-
},
|
|
69796
|
-
sockethub: {
|
|
69797
|
-
port: {
|
|
69798
|
-
format: "port",
|
|
69799
|
-
default: 10550,
|
|
69800
|
-
env: "PORT",
|
|
69801
|
-
arg: "port"
|
|
69802
|
-
},
|
|
69803
|
-
host: {
|
|
69804
|
-
format: String,
|
|
69805
|
-
default: "localhost",
|
|
69806
|
-
env: "HOST",
|
|
69807
|
-
arg: "host"
|
|
69808
|
-
},
|
|
69809
|
-
path: { format: String, default: "/sockethub" },
|
|
69810
|
-
cors: {
|
|
69811
|
-
origin: {
|
|
69812
|
-
doc: "Allowed CORS origin(s) for socket.io connections " + "and the HTTP actions endpoint. '*' allows any " + "website to connect visitors' browsers to this " + "instance; public deployments should set an " + "explicit origin or comma-separated list of " + "origins.",
|
|
69813
|
-
format: String,
|
|
69814
|
-
default: "*",
|
|
69815
|
-
env: "SOCKETHUB_CORS_ORIGIN",
|
|
69816
|
-
arg: "cors.origin"
|
|
69817
|
-
}
|
|
69818
|
-
}
|
|
69819
|
-
},
|
|
69820
|
-
httpActions: {
|
|
69821
|
-
enabled: {
|
|
69822
|
-
doc: "Enable the HTTP actions endpoint",
|
|
69823
|
-
format: Boolean,
|
|
69824
|
-
default: false,
|
|
69825
|
-
env: "SOCKETHUB_HTTP_ACTIONS_ENABLED"
|
|
69826
|
-
},
|
|
69827
|
-
path: {
|
|
69828
|
-
format: String,
|
|
69829
|
-
default: "/sockethub-http",
|
|
69830
|
-
env: "SOCKETHUB_HTTP_ACTIONS_PATH"
|
|
69831
|
-
},
|
|
69832
|
-
requireRequestId: {
|
|
69833
|
-
format: Boolean,
|
|
69834
|
-
default: true,
|
|
69835
|
-
env: "SOCKETHUB_HTTP_ACTIONS_REQUIRE_REQUEST_ID"
|
|
69836
|
-
},
|
|
69837
|
-
maxMessagesPerRequest: {
|
|
69838
|
-
format: "nat",
|
|
69839
|
-
default: 20,
|
|
69840
|
-
env: "SOCKETHUB_HTTP_ACTIONS_MAX_MESSAGES_PER_REQUEST"
|
|
69841
|
-
},
|
|
69842
|
-
maxPayloadBytes: {
|
|
69843
|
-
format: "nat",
|
|
69844
|
-
default: 262144,
|
|
69845
|
-
env: "SOCKETHUB_HTTP_ACTIONS_MAX_PAYLOAD_BYTES"
|
|
69846
|
-
},
|
|
69847
|
-
idempotencyTtlMs: {
|
|
69848
|
-
format: "nat",
|
|
69849
|
-
default: 300000,
|
|
69850
|
-
env: "SOCKETHUB_HTTP_ACTIONS_IDEMPOTENCY_TTL_MS"
|
|
69851
|
-
},
|
|
69852
|
-
requestTimeoutMs: {
|
|
69853
|
-
format: "nat",
|
|
69854
|
-
default: 30000,
|
|
69855
|
-
env: "SOCKETHUB_HTTP_ACTIONS_REQUEST_TIMEOUT_MS"
|
|
69856
|
-
},
|
|
69857
|
-
idleTimeoutMs: {
|
|
69858
|
-
format: "nat",
|
|
69859
|
-
default: 15000,
|
|
69860
|
-
env: "SOCKETHUB_HTTP_ACTIONS_IDLE_TIMEOUT_MS"
|
|
69861
|
-
}
|
|
69862
|
-
},
|
|
69863
|
-
platformHeartbeat: {
|
|
69864
|
-
intervalMs: {
|
|
69865
|
-
format: "nat",
|
|
69866
|
-
default: 5000,
|
|
69867
|
-
env: "SOCKETHUB_PLATFORM_HEARTBEAT_INTERVAL_MS"
|
|
69868
|
-
},
|
|
69869
|
-
timeoutMs: {
|
|
69870
|
-
format: "nat",
|
|
69871
|
-
default: 15000,
|
|
69872
|
-
env: "SOCKETHUB_PLATFORM_HEARTBEAT_TIMEOUT_MS"
|
|
69873
|
-
}
|
|
69874
|
-
}
|
|
69875
|
-
});
|
|
69876
|
-
}
|
|
69877
69950
|
function resolveConfigFile() {
|
|
69878
69951
|
const argv = process.argv.slice(2);
|
|
69879
69952
|
for (let i = 0;i < argv.length; i++) {
|
|
@@ -69907,7 +69980,7 @@ class Config {
|
|
|
69907
69980
|
level: "info"
|
|
69908
69981
|
});
|
|
69909
69982
|
this.log.debug("initializing config");
|
|
69910
|
-
for (const name of
|
|
69983
|
+
for (const name of EMPTY_ENV_IS_UNSET_VARS) {
|
|
69911
69984
|
if (process.env[name] === "") {
|
|
69912
69985
|
delete process.env[name];
|
|
69913
69986
|
}
|
|
@@ -69936,31 +70009,11 @@ class Config {
|
|
|
69936
70009
|
return this.conf.get(path2);
|
|
69937
70010
|
};
|
|
69938
70011
|
}
|
|
69939
|
-
var
|
|
70012
|
+
var defaultConfig = "sockethub.config.json", config, config_default;
|
|
69940
70013
|
var init_config = __esm(() => {
|
|
69941
70014
|
init_src2();
|
|
70015
|
+
init_config_schema();
|
|
69942
70016
|
init_logger_core();
|
|
69943
|
-
import_convict = __toESM(require_main(), 1);
|
|
69944
|
-
MAPPED_ENV_VARS = [
|
|
69945
|
-
"HOST",
|
|
69946
|
-
"PORT",
|
|
69947
|
-
"REDIS_URL",
|
|
69948
|
-
"LOG_LEVEL",
|
|
69949
|
-
"LOG_FILE_LEVEL",
|
|
69950
|
-
"LOG_FILE",
|
|
69951
|
-
"SOCKETHUB_PLATFORM_HEARTBEAT_INTERVAL_MS",
|
|
69952
|
-
"SOCKETHUB_PLATFORM_HEARTBEAT_TIMEOUT_MS",
|
|
69953
|
-
"SOCKETHUB_HTTP_ACTIONS_ENABLED",
|
|
69954
|
-
"SOCKETHUB_HTTP_ACTIONS_PATH",
|
|
69955
|
-
"SOCKETHUB_HTTP_ACTIONS_REQUIRE_REQUEST_ID",
|
|
69956
|
-
"SOCKETHUB_HTTP_ACTIONS_MAX_MESSAGES_PER_REQUEST",
|
|
69957
|
-
"SOCKETHUB_HTTP_ACTIONS_MAX_PAYLOAD_BYTES",
|
|
69958
|
-
"SOCKETHUB_HTTP_ACTIONS_IDEMPOTENCY_TTL_MS",
|
|
69959
|
-
"SOCKETHUB_HTTP_ACTIONS_REQUEST_TIMEOUT_MS",
|
|
69960
|
-
"SOCKETHUB_HTTP_ACTIONS_IDLE_TIMEOUT_MS",
|
|
69961
|
-
"SOCKETHUB_CREDENTIALS_TTL_MS"
|
|
69962
|
-
];
|
|
69963
|
-
LOG_LEVELS = ["error", "warn", "info", "debug"];
|
|
69964
70017
|
config = new Config;
|
|
69965
70018
|
config_default = config;
|
|
69966
70019
|
});
|
|
@@ -103003,7 +103056,7 @@ function isPromiseLike(value) {
|
|
|
103003
103056
|
function shouldIgnoreSpan2(spanName, ignoreSpanTypes) {
|
|
103004
103057
|
return ignoreSpanTypes.some((pattern) => typeof pattern === "string" ? pattern === spanName : pattern.test(spanName));
|
|
103005
103058
|
}
|
|
103006
|
-
var import_api17, import_instrumentation9, import_api18,
|
|
103059
|
+
var import_api17, import_instrumentation9, import_api18, package_default2, majorVersion, GLOBAL_INSTRUMENTATION_KEY = "PRISMA_INSTRUMENTATION", GLOBAL_VERSIONED_INSTRUMENTATION_KEY, globalThisWithPrismaInstrumentation, showAllTraces, nonSampledTraceParent = `00-10-10-00`, ActiveTracingHelper = class {
|
|
103007
103060
|
tracerProvider;
|
|
103008
103061
|
ignoreSpanTypes;
|
|
103009
103062
|
constructor({ tracerProvider, ignoreSpanTypes }) {
|
|
@@ -103050,12 +103103,12 @@ var import_api17, import_instrumentation9, import_api18, package_default, majorV
|
|
|
103050
103103
|
}
|
|
103051
103104
|
return tracer.startActiveSpan(name, options, (span) => endSpan2(span, callback(span, context10)));
|
|
103052
103105
|
}
|
|
103053
|
-
},
|
|
103106
|
+
}, package_default22, VERSION, NAME, MODULE_NAME = "@prisma/client", PrismaInstrumentation;
|
|
103054
103107
|
var init_dist = __esm(() => {
|
|
103055
103108
|
import_api17 = __toESM(require_src4(), 1);
|
|
103056
103109
|
import_instrumentation9 = __toESM(require_src28(), 1);
|
|
103057
103110
|
import_api18 = __toESM(require_src4(), 1);
|
|
103058
|
-
|
|
103111
|
+
package_default2 = {
|
|
103059
103112
|
name: "@prisma/instrumentation-contract",
|
|
103060
103113
|
version: "7.2.0",
|
|
103061
103114
|
description: "Shared types and utilities for Prisma instrumentation",
|
|
@@ -103099,11 +103152,11 @@ var init_dist = __esm(() => {
|
|
|
103099
103152
|
"@opentelemetry/api": "^1.8"
|
|
103100
103153
|
}
|
|
103101
103154
|
};
|
|
103102
|
-
majorVersion =
|
|
103155
|
+
majorVersion = package_default2.version.split(".")[0];
|
|
103103
103156
|
GLOBAL_VERSIONED_INSTRUMENTATION_KEY = `V${majorVersion}_PRISMA_INSTRUMENTATION`;
|
|
103104
103157
|
globalThisWithPrismaInstrumentation = globalThis;
|
|
103105
103158
|
showAllTraces = process.env.PRISMA_SHOW_ALL_TRACES === "true";
|
|
103106
|
-
|
|
103159
|
+
package_default22 = {
|
|
103107
103160
|
name: "@prisma/instrumentation",
|
|
103108
103161
|
version: "7.2.0",
|
|
103109
103162
|
description: "OpenTelemetry compliant instrumentation for Prisma Client",
|
|
@@ -103159,8 +103212,8 @@ var init_dist = __esm(() => {
|
|
|
103159
103212
|
},
|
|
103160
103213
|
sideEffects: false
|
|
103161
103214
|
};
|
|
103162
|
-
VERSION =
|
|
103163
|
-
NAME =
|
|
103215
|
+
VERSION = package_default22.version;
|
|
103216
|
+
NAME = package_default22.name;
|
|
103164
103217
|
PrismaInstrumentation = class extends import_instrumentation9.InstrumentationBase {
|
|
103165
103218
|
tracerProvider;
|
|
103166
103219
|
constructor(config2 = {}) {
|
|
@@ -128441,4 +128494,4 @@ export {
|
|
|
128441
128494
|
derivePlatformCredentialsSecret
|
|
128442
128495
|
};
|
|
128443
128496
|
|
|
128444
|
-
//# debugId=
|
|
128497
|
+
//# debugId=D2C58EBF7939E3F364756E2164756E21
|