narraeon 0.1.1-oidc.1 → 0.1.1
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 +4 -1
- package/README.zh-CN.md +2 -2
- package/dist/node/server/createServer.js +0 -27
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -59,6 +59,9 @@ Then open <http://127.0.0.1:4317>. The named volume preserves worlds,
|
|
|
59
59
|
configuration, credentials, logs, and recovery state across container
|
|
60
60
|
recreation. Keep the host-side address as `127.0.0.1`; publishing the port on
|
|
61
61
|
all interfaces would unnecessarily expose a local, single-user Runtime.
|
|
62
|
+
Narraeon does not currently provide built-in web authentication or access
|
|
63
|
+
control. Run it only on loopback or a trusted private network; public exposure
|
|
64
|
+
is unsupported until a unified security model is designed.
|
|
62
65
|
Stable releases move `latest`, prereleases move `next`, and every release also
|
|
63
66
|
has an exact version tag.
|
|
64
67
|
|
|
@@ -156,7 +159,7 @@ The container image maps all three storage roots under
|
|
|
156
159
|
`/var/lib/narraeon`, which is why the Docker example persists that single
|
|
157
160
|
directory as a volume.
|
|
158
161
|
|
|
159
|
-
|
|
162
|
+
By default, the browser talks only to the same-machine Runtime. Local-first does not mean that remote model inference is offline: prompts, selected world material, tool exchanges, and generated text are sent to the provider you configure. API keys are stored in the local configuration and are not returned to the browser after saving.
|
|
160
163
|
|
|
161
164
|
When a provider, response-format, Runtime-tool, or candidate-check error occurs, Narraeon creates a JSONL incident under `NARRAEON_LOG_ROOT/ai-failures`. It preserves the raw provider exchange and later recovery attempts, including reasoning or thinking actually returned by the provider. It does not invent hidden reasoning or record API keys and request headers. The files can still contain private prompts, world content, tool arguments, and provider-returned reasoning, so treat the log directory as sensitive.
|
|
162
165
|
|
package/README.zh-CN.md
CHANGED
|
@@ -55,7 +55,7 @@ docker run --detach --name narraeon \
|
|
|
55
55
|
ghcr.io/narraeon/narraeon:latest
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
然后打开 <http://127.0.0.1:4317>。命名卷会在重建容器后继续保留世界、配置、凭据、日志和恢复数据。宿主机一侧应继续绑定 `127.0.0.1`;绑定所有网卡会把本地单用户 Runtime
|
|
58
|
+
然后打开 <http://127.0.0.1:4317>。命名卷会在重建容器后继续保留世界、配置、凭据、日志和恢复数据。宿主机一侧应继续绑定 `127.0.0.1`;绑定所有网卡会把本地单用户 Runtime 不必要地暴露出去。Narraeon 当前不内置 Web 认证或访问控制,只应运行在回环地址或受信任私网中;在统一安全模型设计完成前,不支持暴露到公网。稳定版会移动 `latest`,预发布版会移动 `next`,每次发布还会保留精确版本标签。
|
|
59
59
|
|
|
60
60
|
## 从源码运行
|
|
61
61
|
|
|
@@ -149,7 +149,7 @@ Narraeon 默认使用当前操作系统的标准用户应用目录。如果要
|
|
|
149
149
|
|
|
150
150
|
容器镜像把前三类存储目录统一放在 `/var/lib/narraeon` 下,因此 Docker 示例只需要持久化这一个目录。
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
默认情况下,浏览器只与同机 Runtime 通信。“本地优先”不等于远程模型推理也离线:提示词、选中的世界材料、工具交换和生成文本会发送到你配置的 Provider。API Key 保存在本地配置中,保存后不会再返回给浏览器。
|
|
153
153
|
|
|
154
154
|
发生 Provider、响应格式、Runtime 工具或候选检查错误时,Narraeon 会在 `NARRAEON_LOG_ROOT/ai-failures` 下创建 JSONL 事故记录。它会保存原始 Provider 交换和后续恢复尝试,包括 Provider 真实返回的 reasoning/thinking。它不会伪造隐藏思考,也不会记录 API Key 和请求 header。不过日志仍可能包含私密提示词、世界内容、工具参数和 Provider 返回的思考,因此应当把该目录视为敏感数据。
|
|
155
155
|
|
|
@@ -58,24 +58,7 @@ export async function createServer(input) {
|
|
|
58
58
|
: { stream: input.logStream }),
|
|
59
59
|
},
|
|
60
60
|
});
|
|
61
|
-
const suffix = input.port === 80 ? "" : `:${input.port}`;
|
|
62
|
-
const origins = new Set([
|
|
63
|
-
`http://127.0.0.1${suffix}`,
|
|
64
|
-
`http://localhost${suffix}`,
|
|
65
|
-
]);
|
|
66
61
|
const html = await readFile(join(input.staticRoot, "index.html"), "utf8");
|
|
67
|
-
// Origin is what actually stops a hostile page from driving this server: a
|
|
68
|
-
// cross-site request carries its own origin, and a JSON POST always triggers
|
|
69
|
-
// a preflight, so the header is always there to check. A per-boot token on
|
|
70
|
-
// top bought nothing against that threat and made every restart invalidate
|
|
71
|
-
// the tab the user already had open.
|
|
72
|
-
const sameOrigin = (request, reply, done) => {
|
|
73
|
-
if (request.headers.origin === undefined ||
|
|
74
|
-
!origins.has(request.headers.origin))
|
|
75
|
-
void forbidden(reply);
|
|
76
|
-
else
|
|
77
|
-
done();
|
|
78
|
-
};
|
|
79
62
|
const logRuntimeRequest = (request, _reply, done) => {
|
|
80
63
|
if (!isPollingRequest(request))
|
|
81
64
|
request.log.info({ req: request }, "incoming request");
|
|
@@ -100,7 +83,6 @@ export async function createServer(input) {
|
|
|
100
83
|
}));
|
|
101
84
|
server.post("/api/runtime/v1", {
|
|
102
85
|
bodyLimit: runtimeRequestBodyLimit,
|
|
103
|
-
onRequest: [sameOrigin],
|
|
104
86
|
preHandler: [logRuntimeRequest],
|
|
105
87
|
}, async (request, reply) => {
|
|
106
88
|
let runtimeRequestType;
|
|
@@ -207,12 +189,3 @@ function isPlayCallChainView(value) {
|
|
|
207
189
|
value.status === "running" ||
|
|
208
190
|
value.status === "interrupted"));
|
|
209
191
|
}
|
|
210
|
-
function forbidden(reply) {
|
|
211
|
-
return reply.status(403).send({
|
|
212
|
-
protocol: "narraeon.runtime/v1",
|
|
213
|
-
error: {
|
|
214
|
-
code: "forbidden_request",
|
|
215
|
-
message: "Local web request is not authorized",
|
|
216
|
-
},
|
|
217
|
-
});
|
|
218
|
-
}
|