部署 Obsidian Arc,配置模型、用户与额度,并将应用接入 API 网关。
Translation pending
Developer toolsGo · TypeScriptGitHub @OnyxAxisOwOOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
A standalone, bring-your-own-key AI chat workspace. No account, no server, no build step.
Taken from the repository README
Loading the full README. The saved excerpt is shown below.
自托管多用户 AI 聊天服务与 API 网关。 A self-hosted multi-user AI chat service and API gateway. Obsidian Arc 是一个自托管的多用户 AI 对话服务与 API 网关。系统采用单一 Go 二进制文件内嵌前端单页应用,使用 SQLite 或 PostgreSQL 存储数据,不依赖 Redis、消息队列或外部缓存。Read the full README ↗
Obsidian Arc 是一个自托管的多用户 AI 对话服务与 API 网关。系统采用单一 Go 二进制文件内嵌前端单页应用,使用 SQLite 或 PostgreSQL 存储数据,不依赖 Redis、消息队列或外部缓存。
完整的使用指南、管理手册、接口参考与架构设计已发布在 Cloudflare Pages: 👉 obsidianarc.pages.dev
api_name)。chat.allow_archive),支持 3 点下拉快捷菜单归档与专有归档面板(/archive)检索恢复;图片在浏览器本地压缩后上传;代码块支持命名、保存与复制。/v1):支持 API Key 认证,提供以下端点:
POST /v1/chat/completions(OpenAI 对话兼容)POST /v1/messages 与 POST /v1/messages/count_tokens(Anthropic Messages 兼容,支持 Claude Code)POST /v1/responses(OpenAI Responses 兼容,支持 Codex 等开发工具)POST /v1/images/generations(图像生成)GET /v1/models 与 GET /v1/models/{id}(模型列表与详情)settingsDraft)。右上角账户菜单里的终端是一个命令行界面,所有账号都能用(用户组可以关掉),每个人只能运行自己在页面上本来就能做的事:普通用户管理自己的资料、密钥、对话、项目、额度、反馈与生图记录,管理员另外获得其授权对应的全部后台命令(user、group、model、health、usage 等)。覆盖全部后台管理接口和账户侧所有可设置、可更改的接口,支持多标签页、双语 help、Tab 补全与 --json 输出;设置 OBSIDIAN_SSH_ADDR 后可通过 ssh 用户名@域名 直接连接(连上的是终端,不是服务器 shell),并可作为单条命令被脚本调用。health.warn_below);管理员可在系统设置中控制普通用户是否可见状态页面,对非管理员请求自动脱敏上游信息。/.well-known/openid-configuration、登记登录应用、PKCE、令牌吊销)供外部软件接入,管理员可要求部分或全部账户完成身份绑定后才能继续使用。innerHTML 与 v-html;上游 API Key 在数据库中加密存储;提供浅色、深色与跟随系统的界面配色。plugins/ 下、按构建标签编译进二进制,不编译就不带任何代码、路由、数据表和界面文字;本仓库不自带任何插件。编译进来的插件在后台「插件」页像浏览器扩展一样安装、启用、禁用和卸载(禁用与卸载需要两步验证,卸载可选同时删除数据),插件也可以带自己的后台子页面。详见插件。./obsidian-arc
默认在 :8080 端口启动,数据保存在 ./data 目录(自动创建 SQLite 数据库)。首个注册的用户自动成为管理员。
在启动时通过环境变量指定管理员账号:
OBSIDIAN_ADMIN_USER=admin OBSIDIAN_ADMIN_PASSWORD='YourStrongPassword' ./obsidian-arc
文档页面已部署在 obsidianarc.pages.dev,本地开发与编译指令如下:
# 启动本地文档开发预览
make docs-dev
# 编译文档静态站点
make docs
| 变量名 | 默认值 | 说明 |
|---|---|---|
OBSIDIAN_ADDR | :8080 | 服务监听地址与端口 |
OBSIDIAN_DB_DRIVER | sqlite | 数据库类型:sqlite 或 postgres |
OBSIDIAN_DB_DSN | ./data/obsidian.db | 数据库连接字符串(PostgreSQL 必填) |
OBSIDIAN_SECRET_KEY | 自动生成于 ./data | 上游 API Key 加密密钥;多实例部署时需保持一致 |
OBSIDIAN_DATA_DIR | ./data | 数据库文件与密钥存储路径 |
OBSIDIAN_COOKIE_SECURE | true | 是否仅允许 HTTPS 传输 Cookie;本地 HTTP 测试可设为 false |
OBSIDIAN_TRUST_PROXY | false | 是否信任反向代理传递的 X-Forwarded-For 报头 |
OBSIDIAN_TRUST_CLOUDFLARE | false | 仅当部署在 Cloudflare 之后才设为 true:否则 CF-Connecting-IP 报头可被任意客户端伪造 |
OBSIDIAN_PUBLIC_URL | 空 | 站点公开访问地址(用于邮箱验证链接) |
OBSIDIAN_SMTP_HOST | 空 | SMTP 服务器地址(用于发送验证邮件) |
OBSIDIAN_SSH_ADDR | 空 | 终端的 SSH 监听地址(例如 :2222) |
# 使用 SQLite 运行
docker build -t obsidian-arc .
docker run -d -p 8080:8080 -v arc-data:/data \
-e OBSIDIAN_SECRET_KEY=$(openssl rand -hex 32) \
obsidian-arc
使用 PostgreSQL 运行(docker-compose.yml)前,需在与它同目录的 .env 中设置 POSTGRES_PASSWORD,它没有默认值,未设置时 docker compose 会拒绝启动,建议用 openssl rand -hex 32 生成,因为它会嵌入数据库连接串:
OBSIDIAN_SECRET_KEY=$(openssl rand -hex 32) docker compose up -d
Obsidian Arc is a self-hosted multi-user AI chat service and API gateway. The entire application runs as a single Go binary with an embedded Vue 3 SPA frontend and uses SQLite or PostgreSQL for persistence, requiring no Redis, message queues, or external caches.
Online documentation is hosted on Cloudflare Pages: 👉 obsidianarc.pages.dev
api_name).chat.allow_archive), 3-dots action menu, dedicated /archive panel for reviewing and unarchiving conversations; client-side image compression; code block actions./v1): API Key authentication covering:
POST /v1/chat/completions (OpenAI format)POST /v1/messages and POST /v1/messages/count_tokens (Anthropic Messages format, compatible with Claude Code)POST /v1/responses (OpenAI Responses format, compatible with Codex)POST /v1/images/generations (image generation)GET /v1/models and (model listings)测试环境:单进程、SQLite 驱动:
| 指标 / Metric | 实测数据 / Measurement |
|---|---|
| 二进制体积 / Binary size | 28.12 MB(Linux amd64,本仓库不自带插件,其中插件运行时约 2.8 MB,构建时预压缩的 brotli 前端副本约 0.41 MB,内嵌的时区数据约 0.41 MB;使用 -tags nosqlite 为 24.41 MB) |
| 冷启动就绪时间 / Cold start | ~28 ms |
| 空闲内存占用 / Idle RSS | ~16 MB |
| 20 并发流式峰值 / Peak under 20 concurrency | ~54 MB 内存,11 个 OS 线程 |
| 首次加载传输体积 / Wire payload | 打开对话界面:支持 brotli 的浏览器传输 173.50 kB(153.33 kB JS + 20.17 kB CSS),只支持 gzip 时传输 206.67 kB(182.96 kB JS + 23.71 kB CSS)——brotli 是构建时以最高质量预压缩、嵌入二进制的副本,gzip 由服务器用 Go 的压缩器以最高级别在发送时生成(Node 的 gzip 在不同 CPU 上压出的字节不同,Go 的处处一致);首屏预算按 gzip 计。以下按 gzip 计:中文语言包 (20.76 kB;后台独用的中文词条另成一包 38.24 kB,只在中文界面进入后台时加载)、管理后台 (178.43 kB JS + 15.72 kB CSS,后台独用的英文词条和样式随它加载)、终端 (8.06 kB JS + 1.67 kB CSS)、公式渲染器 (3.76 kB)、访客官网首页 (4.17 kB JS + 3.89 kB CSS)、访客落地页 (3.12 kB JS + 0.62 kB CSS),以及每个编进二进制的插件各一个小分包,按需加载;以插件包安装的插件,其浏览器端模块只在启用后才取;账户菜单内容(1.72 kB JS + 0.81 kB CSS,首次打开时加载)、文件夹管理(2.67 kB JS + 1.08 kB CSS,有文件夹或新建时加载)、模型厂商标志(6.27 kB,首次绘制图标时加载)另成按需分包 |
| 后台常驻协程 / Background goroutines | 3 个(请求日志写入、10 分钟清理、备份调度) |
| Go 直接依赖 / Direct Go dependencies | 4 个(SQLite 驱动、pgx、x/crypto、wazero——插件包的沙箱) |
| 前端运行时依赖 / Frontend runtime dependencies | 4 个(vue、vue-router、@vueuse/core、lucide-vue-next) |
GET /v1/models/{id}settingsDraft). The Terminal in the account menu is a command line every account can open (a group can switch it off), and it runs only what that account could already do on its own screens: an ordinary account manages its own profile, keys, conversations, projects, credit, feedback and image history, and an administrator also gets the backoffice commands their grants cover (user, group, model, health, usage, …). It covers every administrative endpoint and every account-side setting that can be changed, with bilingual help, tab completion, and --json output. Setting OBSIDIAN_SSH_ADDR serves the same terminal over SSH (ssh user@host), scriptable one command at a time.health.warn_below); configurable public visibility with credential stripping for non-admin requests./.well-known/openid-configuration, registered client apps, PKCE, token revocation) for other software to sign in against, and operators can require some or all accounts to link an identity before continuing.innerHTML or v-html; upstream credentials stored encrypted; dark, light, and system theme options.plugins/ and are compiled in by build tag; one left out carries no code, routes, tables or strings, and this repository ships none. A compiled-in plugin is installed, switched on and off, and uninstalled from the backoffice's Plugins screen, the way a browser's extensions page works (switching off and uninstalling need a two-step code, and an uninstall can take the plugin's data with it); a plugin can also bring backoffice pages of its own. See plugins.