Commit Graph
11 Commits
Author SHA1 Message Date
Your Name 5d49008960 ci: deploy pro with docker compose
Deploy im-server production / deploy (push) Failing after 8m46s
2026-10-18 20:11:07 +08:00
Your Name 3b186298a0 fix: configure Kafka brokers at runtime 2026-10-15 12:26:09 +08:00
Your NameandClaude Sonnet 5 b30cce950a fix(docker): mirror tinode's own log output to stdout
Confirmed live: /var/log/tinode.log-only redirection meant Loki never
received a single real tinode runtime log line (election, rehash,
connection, error output) since the container started -- Promtail
collects standard container stdout/stderr, not files written inside
the container. Every Pod's collected log was just this script's own
"NO_DB_INIT=true: skipping..." init line, nothing from tinode itself.

Now more consequential with native Cluster enabled: failover/rehash
state transitions were completely invisible to the normal Grafana/Loki
monitoring path, visible only via manual kubectl exec.

tee mirrors to both stdout (collected) and the file (still readable via
kubectl exec). PIPESTATUS[0] is required since a bare $? after a pipe
would report tee's exit status, not tinode's -- which also let this
drop the now-redundant "tail last 200 lines to stderr on crash" block,
since the full live stream already went to stdout throughout the run.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-21 20:23:25 +08:00
Your NameandClaude Sonnet 5 4abd6604d7 fix(deploy): raise rollout timeout for StatefulSet's sequential update
StatefulSet's RollingUpdate replaces Pods one at a time in strict
sequence (unlike a Deployment, and unaffected by podManagementPolicy:
Parallel, which only governs initial scale-up/down) -- confirmed live:
run #152 restarted correctly (2/3 pods updated, then the 3rd) but hit
the old 120s ceiling before the last pod turned Ready, so CI reported
"failure" for a rollout that actually completed successfully seconds
later. 300s gives enough headroom for three sequential pod cycles
(image pull + start + native-Cluster rejoin) instead of tuning it to
the exact observed timing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-21 19:49:44 +08:00
Your NameandClaude Sonnet 5 eca2ee56c0 fix(deploy): update rollout commands for StatefulSet migration
im-server moved from Deployment to StatefulSet in im-deploy-config
(native Cluster enablement) -- this workflow's kubectl commands still
targeted the old resource type, so every deploy since the migration
failed at the final step with "deployments.apps im-server not found"
(image built/pushed fine, just never got rolled out).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-21 19:40:26 +08:00
Your NameandClaude Sonnet 5 990526647c ci: retarget deploy workflow at the k3s test cluster
Old VM's blue-green im-server is decommissioned. App config
(MySQL/Redis/API key/admin-internal secrets) now lives in the
cluster's own Deployment manifest, not injected through CI --
this workflow's job is just build (from source, via
docker/tinode/Dockerfile.build as before), push under :test,
and roll the deployment.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-14 05:41:03 +08:00
Your NameandClaude Sonnet 5 9da072e6f9 ci: 部署时透传 admin_internal_api / hotgo secret
commit 7193ba2 把 config.template 里的 admin_internal_api.base_url/secret
和 internal_api hotgo-admin secret 从硬编码改成了环境变量占位符,但
deploy workflow 没有跟着传这几个 secret,导致 Fatal 退出、容器反复重启
(表现为 im-server-green 起不来)。这几个 secret 已经在 Gitea 里配好。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-03 22:36:44 +08:00
Your Name a7c5bc9bbd 修复登录500: auth/credentials表缺少tenant_id列
登录时报 Error 1054: Unknown column 'tenant_id' in 'where clause'。

根因:CreateDb里auth/credentials的建表语句从未定义过tenant_id列——这不是
版本跳过导致的迁移遗漏,而是即便全新安装也会触发的建表语句本身的缺陷,
因为查询代码(AuthAddRecord/AuthGetUniqueRecord等)一直在无条件地按
tenant_id过滤/写入这两张表。

同时migration脚本里的dropTenantIDColumns此前会把auth/credentials的
tenant_id也当成"新增多租户特性表的遗留列"一并删掉,跟前面加的列直接打架。

修复:
- adapter.go: CreateDb的auth/credentials建表语句补上tenant_id列,
  修正未来全新安装的根源问题
- apply_hotgo_tenant_db.go: 补上ALTER TABLE ADD COLUMN(现有数据回填到
  默认租户id=1);dropTenantIDColumns排除auth/credentials,不再误删
2026-08-15 14:35:02 +08:00
Your Name 76ca6147ec 修复{hi}握手拒绝未携带tenant字段的客户端
多租户改造给{hi}握手消息加了必填的tenant字段,但目前的im_webapp(以及
现有iOS/Android客户端)都是标准Tinode SDK,不知道要发这个新字段,导致
每次连接握手都被判定为malformed(400),前端表现为反复断线重连。

改为tenant为空时回退到默认租户"default"(对应迁移脚本里seed的那条记录),
不再直接拒绝;显式携带tenant code的客户端行为不受影响,仅长度校验保留。
2026-08-15 14:25:59 +08:00
Your Name b01ed29751 修复迁移脚本: 补全CreateDb版本跳过导致缺失的表
CreateDb的多个建表函数(createTenantRegistry/createIMSecurityTables/
createIMNotificationTables/createIMRelationTables)只在全新库的建表路径里
调用;UpgradeDb对已存在且版本号已达标的库直接判定"无需升级"直接跳过,
不会补建任何表。我们这个tinode库版本号刚好已经等于目标版本,所以这几个
函数从未真正执行过。

补上迁移脚本里缺失的表(与adapter.go里的建表语句保持一致):
tinode.im_tenant / im_tenant_config (原脚本假设已存在,直接ALTER导致报错)
tinode.im_realname_verifications / im_action_tokens
tinode.im_system_notifications
tinode.im_friend_requests / im_friendships / im_user_blocks / im_favorites
2026-08-15 14:17:53 +08:00
Your Name 57274778b5 接入Gitea Actions蓝绿部署:本地源码构建替代release下载,接入租户注册表迁移
- 新增docker/tinode/Dockerfile.build:从本仓库源码编译server/tinode-db/
  apply_hotgo_tenant_db,替代原Dockerfile下载GitHub release的方式(否则
  workbench/组织架构/会议等改造代码永远不会真正跑起来)
- config.template补上连接池设置(max_open_conns等,此前im_server踩过注册卡死
  的坑),并启用tenant_db_routing+tenant_registry_db=hotgo,对应本仓库自带
  tinode.conf里的默认约定,单租户场景下会透明落回同一个tinode库
- entrypoint.sh在init-db之后追加执行apply-hotgo-tenant-db,幂等地建好/
  升级hotgo租户注册表及tinode库里的workbench/组织架构/会议/日报/信箱等新表
- 新增.gitea/workflows/deploy.yml,复用服务器上已有的蓝绿部署脚本
2026-08-15 14:08:07 +08:00