time zone: a self-hosted server can tell time in its owner's zone, the way a Cloud home does
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
The first read is createTimeZoneRoutes, where adopts is false outside Cloud homes; trace its callers and the Cloud path through useTimeZone, adoptSavedTimeZone and time-zone.json. Also find how serve --public-url chooses host mode and where TZ is read, because self-hosted must adopt while TZ wins and desktops stay unchanged. Done means PUT /api/time-zone succeeds on a self-hosted server, the saved zone drives routines and bot time, and the host-detection question is settled.
由索引模型根据 Issue 内容生成。
描述
The problem
I run dusk bot on my own VPS (duskbot serve --public-url ...). The VPS clock is UTC, like most servers, but I live in Asia/Kolkata (UTC+5:30).
Only a Cloud home adopts its owner's zone. createTimeZoneRoutes gets adopts: false everywhere else, so PUT /api/time-zone answers 409 "This computer tells time in its own time zone." On a desktop that is right: the computer's clock is the person's. On a VPS it is not.
What goes wrong today:
- A
dailyroutine at 18:00 runs at 23:30 my time. - An
intervalroutine "every 15 min, Mon-Fri, 09:00-18:00" runs from 14:30 to 23:30 my time. Its window and its weekdays both follow the UTC clock. - When I ask a bot "remind me every day at 6 PM", it can make a
dailyroutine, and that fires at 23:30. - The bots' "current time" and run titles are in UTC.
cron routines with an explicit timeZone are fine, so I create everything as cron for now. But anything made by chatting, or in the routine editor with daily or interval, comes out wrong.
The only fix today is Environment=TZ=Asia/Kolkata in the systemd unit. That works, but nothing in the app says it is needed, and it does not follow me when I travel the way a Cloud home does.
What you'd like
Let a self-hosted server adopt its owner's zone with the same code path a Cloud home uses (useTimeZone, adoptSavedTimeZone, time-zone.json).
- On a self-hosted server (not a desktop),
adoptsis true, so the owner's app sends its zone and the server saves it and runs in it. - If
TZis set in the server's environment, that wins, so people who already set it see no change. - A desktop keeps today's rule: its own clock.
Anything else
- I checked the timing with dusk bot's own schedule code: with the server on UTC, the interval example above runs 5.5 hours late; with
TZ=Asia/Kolkatait matches. - I'm happy to send the PR if this shape works for you. The open question for you is how the server should know it is self-hosted and not a desktop (for example
servewith--public-url, or a flag).
- 主要语言
- TypeScript
- 星标
- 277
- 派生
- 27
- 平均合并
- 7 小时 8 分钟
- 30 天内合并 PR
- 81
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
DuskBotAI/duskbot 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug
难度 5/5 一周以上 新手友好度 20/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 63/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 62/100
维护者通常 1 天内回复
查看 DuskBotAI/duskbot 的全部 Issue
相似的 Issue
-
MCP tool results drop structuredContent when text is only a summary可能已有人在做 @Pankaj-bit361 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
inblockio/siwx-oidc-matrix-server#101 ·
维护者通常 1 天内回复
-
status:needs-triage
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
pingdotgg/t3code#42253 · 1 条评论 ·
维护者通常 1 天内回复