Files
idsync/config.example.yml
T
caowangrenbo 979a98d502 refactor: config + lldaplib 收敛到 LLDAP 形态(读只读、删 OpenLDAP 写路径与密码包)
- config 重写:删 user-ou/inactive-ou/group-root-* / group-object-class /
  group-member-attr / initial-password;新增 lldap 写通道 + webhook + confirm-base-url
  + 两套 schedule + guard
- ldaplib 收拢为只读:属性常量/DN 归入 attrs.go;删 ops.go 写路径与 internal/password
- config.example.yml 重写成 LLDAP 形态
- 组命名修订(呼应 AGENTS.md 约束12):用部门稳定索引 cn=<dept_id> 做组身份,
  mirror_departments 增 group_id 列并跨快照保留,可读中文名只走 DB 展示
2026-09-29 23:48:49 +08:00

81 lines
3.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# idsync 配置示例。复制为 config.yml 后按实际环境修改。
#
# 两阶段架构:飞书 → SQLite 镜像 → LLDAP。
# - 快照:低频(默认每天一次),飞书 → 镜像 + 离职流程推进。
# - 物化:略高频(默认每 2–4 小时一次),镜像在职视图 → LLDAP(写走 GraphQL)。
# 本工具不参与认证链路:用户登录/密码重置/发信由 Authelia 负责,因此这里没有
# 认证相关配置,只有数据管道的调度与通道配置。
system:
# debug 会输出更详细的日志;生产环境用 release
mode: release
# 镜像数据库与运行数据目录
data-dir: data
server:
listen: 0.0.0.0:8899
# 管理界面自身的登录凭据(仅保护界面,与 LDAP 用户无关)
admin-user: admin
# 明文密码只在首次启动时用于生成哈希;建议改用 hash-password 生成下面的哈希
admin-password: change-me
# 用 `./idsync -hash-password '你的密码'` 生成,留空则使用上面的明文密码
admin-password-hash: ""
# 会话签名密钥,用 `./idsync -gen-secret` 生成。留空会自动生成临时密钥
session-secret: ""
# 经 HTTPS 反代访问时设为 true
secure-cookie: false
# 离职确认端点的对外 base-url;必须是公网/反代可达地址。飞书离职卡片的
# 「确认离职」按钮 url 用它拼接,因此该项缺失时卡片将无法提供确认入口。
confirm-base-url: "https://idsync.example.com"
feishu:
app-id: "cli_xxxxxxxxxxxx"
app-secret: "xxxxxxxxxxxxxxxxxxxxxxxx"
# 留空使用飞书开放平台;Lark 国际版填 https://open.larksuite.com
base-url: ""
# 留空表示同步全部部门;填部门 ID 则只同步这些部门,前缀 ^ 表示排除
dept-list: []
# 调用飞书的速率上限(次/秒),避免触发频控
qps: 5
timeout-sec: 30
# 离职确认卡片「自定义机器人」的 webhook 地址,发给用户管理群
webhook-url: "https://open.feishu.cn/open-apis/bot/v2/hook/xxxx"
ldap:
# LLDAP 的 LDAP 读通道(连接/搜索)。生产建议 ldaps:// 或开启 start-tls:
# Authelia 重置密码时会把新密码经此连接发送。
url: "ldaps://lldap.example.com:6360"
base-dn: "dc=example,dc=com"
# LLDAP 管理员用户(固定挂在 ou=people 下)
admin-dn: "uid=admin,ou=people,dc=example,dc=com"
admin-pass: "change-me"
timeout-sec: 15
start-tls: false
# 仅自签证书的测试环境使用
insecure-skip-verify: false
lldap:
# LLDAP 的 GraphQL 写通道地址(WebUI/GraphQL 端口)
base-url: "http://lldap:17170"
admin-user: admin
admin-pass: "change-me"
database:
source: data/idsync.db
schedule:
# 是否启用定时任务
enable: true
# 快照 cron(秒级):低频,默认每天 00:20
snapshot: "0 20 0 * * *"
# 物化 cron(秒级):略高频,默认每 2 小时 30 分
sync: "0 30 */2 * * *"
# 物化是否默认 dry-run。快照永远直接落库;建议先观察几轮物化计划再放开。
sync-dry-run: true
guard:
# 单次物化允许删除(离职确认后)的账号数上限,0 表示不限制
max-deactivate: 0
# 单次物化允许删除的账号比例上限(0-1)。
# 防止飞书应用权限被误改导致大批账号被判定为离职。
max-deactivate-percent: 0.2