Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ UTOPIA_OPEN_REGISTRATION=true
# 没配单点登录时这个 false 不生效。单点登录开的账号没有密码、也没法重设,改回 true 也进不去——
# 包括经 SSO 引导出来的首个管理员。务必留一个有密码的管理员账号当后门。
# UTOPIA_PASSWORD_LOGIN=true
# Google Drive 来源(0074):一个人用自己的 Google 账号连接,按他选的文件夹同步。
# 在 Google Cloud 建一个「Web 应用」类型的 OAuth 客户端,回调地址填下面这个,并启用 Drive API。
# 三项都填才开放;与上面 SSO 的客户端是两回事(权限范围不同)。drive.readonly 是受限范围:
# Workspace 内部应用不需要 Google 审核,对外发布的需要。
# UTOPIA_GOOGLE_DRIVE_CLIENT_ID=
# UTOPIA_GOOGLE_DRIVE_CLIENT_SECRET=
# UTOPIA_GOOGLE_DRIVE_REDIRECT_URI=https://your-deployment/api/v1/google-drive/callback
# 数据库连接池上限。缺省 32,与 worker 并发的缺省对齐。
# 池子小于并发时症状是请求变慢、而不是任何一处说"池子不够"——调高 worker
# 并发时一并考虑这里,也别超过 Postgres 自己的 max_connections(默认 100)。
Expand Down
2 changes: 1 addition & 1 deletion crates/utopia-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ struct ManifestDataDir {
/// not a side effect of a code change.
// 是迁移文件的**个数**,不是最大的编号(守卫 `schema_version_policy_compares_against_current`
// 按个数比):编号有空缺时两者不同——0071 由一个开放 PR 占着,0072 先落,个数是 71
const CURRENT_SCHEMA_VERSION: u32 = 105;
const CURRENT_SCHEMA_VERSION: u32 = 106;

fn main() -> anyhow::Result<()> {
dotenvy::dotenv().ok();
Expand Down
4 changes: 4 additions & 0 deletions crates/utopia-core/src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ pub const SOURCE_SECRET_KEYS: &[&str] = &[
"secret_access_key",
"account_key",
"service_account_key",
// Google Drive 的 OAuth 刷新令牌(0074):能换出那个人整个 Drive 的只读权限
"refresh_token",
];

impl Source {
Expand Down Expand Up @@ -306,6 +308,8 @@ pub enum SourceKind {
Gcs,
Webdav,
Notion,
/// 一个人授权、按他选的文件夹同步(0074)
GoogleDrive,
Api,
/// 推送的不是文档而是陈述本身(0054):请求体就是开放抽取契约,抽取不问模型
Statements,
Expand Down
506 changes: 506 additions & 0 deletions crates/utopia-server/src/api/google_drive_routes.rs

Large diffs are not rendered by default.

Loading
Loading