{"id":15349046,"url":"https://github.com/suyanhanx/hub","last_synced_at":"2026-01-30T11:25:49.068Z","repository":{"id":42321064,"uuid":"157800024","full_name":"suyanhanx/hub","owner":"suyanhanx","description":"docker image hub","archived":false,"fork":false,"pushed_at":"2023-03-30T14:51:36.000Z","size":1173,"stargazers_count":1,"open_issues_count":18,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-24T18:52:58.027Z","etag":null,"topics":["docker","docker-image","dockerfile"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/suyanhanx/hub/builds/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suyanhanx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-16T02:16:43.000Z","updated_at":"2023-03-07T03:42:10.000Z","dependencies_parsed_at":"2025-02-12T19:46:56.286Z","dependency_job_id":"f73d3e7a-9cc1-457c-ac3b-bdffe15a324e","html_url":"https://github.com/suyanhanx/hub","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/suyanhanx/hub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suyanhanx%2Fhub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suyanhanx%2Fhub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suyanhanx%2Fhub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suyanhanx%2Fhub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suyanhanx","download_url":"https://codeload.github.com/suyanhanx/hub/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suyanhanx%2Fhub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28911821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T08:15:08.179Z","status":"ssl_error","status_checked_at":"2026-01-30T08:14:31.507Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-image","dockerfile"],"created_at":"2024-10-01T11:53:41.070Z","updated_at":"2026-01-30T11:25:49.051Z","avatar_url":"https://github.com/suyanhanx.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wakatime Sync To Gist\n\n\u003e Waktime 是一款专门为程序员打造的时间统计工具。可以在各大编辑器、IDE 安装插件，然后统计你的 coding 时间。统计的维度包括：在具体项目的时长、所用的操作系统、所用的编辑器、所用的语言等。更多具体的可以前往 [Wakatime 官网](https://wakatime.com/).对于程序员而言，我强烈建议每个人都去使用 WakaTime。这样就能非常详细的记录你每天在 coding 的时间。\n\n这是我自己的 WakaTime 统计首页：\n![](./screenshot/summaries.jpg)\n\nWakaTime 非常完美，但是它有区分免费版和付费版。免费版只能保持两个礼拜的 Dashboard History，而付费版则要 \\$9 每个月。这样使用免费版的你，就无法查看历史更多的统计数据了。用订阅去支持这样的优秀的工具是件好事，可以帮助企业获得更好的收入，进而提升工具的质量和用户体验。\n\n但是对于可能不太需要去看历史统计数据，但是可能偶尔需要看一看的人（比如一个季度或者一年看一次等），每个月花 \\$9 的成本确实不低。因此就产生了 **wakatiem-sync** 这个项目。\n\n`wakatime-sync` 可以帮助你每天定时去请求 WakaTime 的统计数据，然后将数据同步到 Gist 上面。这样就可以永远的将你的统计数据保存到 Gist 上面，随时想看都可以。\n目前只同步该接口的数据 `https://wakatime.com/api/v1/users/current/summaries`。因为通过该接口，基本上就能获取你所需要的各类信息。\n\n通过 [Wakatime Dashboard](https://github.com/superman66/wakatime-dashboard)这个项目，你就可以在上面保存查看 Gist 上面的统计数据，突破 WakaTime 免费版只能查看过去 14 天的数据。\n![](./screenshot/wakatime-dashboard.jpg)\n\n如果觉得对你有帮助，请点波 star 支持下作者，非常感谢~\n\n## ChANGELOG\n\n- 使用[Server 酱](http://sc.ftqq.com/3.version)推送每天同步的状态到微信\n- 添加 Dockerfile，支持 docker 部署\n\n## 用法\n\n**第一步**\n\n你需要先去 [Gist](https://gist.github.com) 创建一个 Gist，记得设置为 `secret`.\n\n**第二步**\n\ngit clone 该项目到你的本地或者你的服务器。由于需要每天定时跑任务同步数据到 Gist，因此强烈建议有服务器的同学直接部署到自己的服务器，这样部署完了之后就不需要管它了，脚本会在每天的 `每天1点30分30秒` 执行。\n如果没有服务器的同学，也可以部署到本地。至于部署到本地效果如何，我没有测试过。\n\n```\ngit clone https://github.com/superman66/wakatime-sync.git \u0026\u0026 cd wakatime-sync\nnpm install\n// 项目通过 pm2 来管理 node，因此你还需要全局安装 pm2，如果你还没有安装过。\nnpm i pm2 -g\n```\n\n**第三步**\n\n在根目录下创建 `config.json` 配置文件，将第一步创建的 Gist ID 填入。同时还需要:\n\n- wakatime apiKey - 用于请求 wakatime api 的 key。[Waketime Setting](https://wakatime.com/settings/account)\n- gistToken - 用于创建和修改 Gist 的 Token。[生成 Personal access tokens](https://github.com/settings/tokens)\n\n需要注意的是，生成 token 需要勾选 gist 权限:\n![](./screenshot/generate-token.jpg)\n\n```json\n{\n  \"wakatimeApiKey\": \"xxxxxxxxx\",\n  \"gistToken\": \"xxxxxxxxx\",\n  \"syncGistId\": \"xxxxxxxxx\"\n}\n```\n\n\u003e Waketime apikey 截图\n\n![how to get wakatime apikey](./screenshot/get-wakatime-apikey.jpg)\n安装完依赖后，你可以通过几个命令来运行该项目：\n\n- `npm start` 启动 pm2 进程\n- `npm run build` 构建项目\n\n如果是部署到服务器，则可以直接运行 `npm run pm2` 即可。\n\n这是我保存在 Gist 上的数据\n![](./screenshot/gist-data.jpg)\n\n## Docker 部署\n\n在配置好上面所说的数据后，可以直接在服务器使用 docker 进行部署（前提是已安装 docker 服务）。\n\n```\n// 构建镜像\ndocker build -t wakatime-sync .\n\n// 镜像构建成功后，直接运行容器即可\ndocker run -d wakatime-sync\n```\n\n也可以在启动容器的时候，通过环境变量的方式来设置 `wakatimeApiKey`、`gistToken`、`syncGistId`\n```\ndocker run -d -e DOCKER_ENV=\"docker\" -e API_KEY=\"xxx\" -e GIST_TOKEN=\"xxx\" -e GIST_ID=\"xxx\" wakatime-sync\n```\n\n## 定时任务\n\n该项目使用的是 `node-schedule` 来执行定时任务的，我的设置是`每天1点30分30秒`执行（该时间是基于服务器的时间）。如果你要更改时间的话，只需要在 `src/server/index.js` 中更改即可：\n\n```js\n// 每天1点30分30秒执行该job\nconst job = schedule.scheduleJob('30 30 1 * * *', function() {\n  syncWakaTimeToGist(config.syncGistId)\n})\n```\n\nnode-schedule 的规则如下：\n\n```\n*    *    *    *    *    *\n┬    ┬    ┬    ┬    ┬    ┬\n│    │    │    │    │    │\n│    │    │    │    │    └ day of week (0 - 7) (0 or 7 is Sun)\n│    │    │    │    └───── month (1 - 12)\n│    │    │    └────────── day of month (1 - 31)\n│    │    └─────────────── hour (0 - 23)\n│    └──────────────────── minute (0 - 59)\n└───────────────────────── second (0 - 59, OPTIONAL)\n```\n\n更多请看 [node-schedule 文档](https://github.com/node-schedule/node-schedule)。\n\n## 推送同步状态到微信\n\n不得不说 [Server 酱](http://sc.ftqq.com/3.version) 是个好东西，简单快捷方便。感谢作者创造了一个这么好用到工具。\nServer 酱到具体配置去官网看就可以了。没有任何难度，只要能看懂中文，就能懂得如何使用。\n把 Server 酱提供的 `SCKEY` 放到前面说的 `config.json`，新建 `SCUKey` 字段：\n\n```json\n{\n  \"wakatimeApiKey\": \"xxxxxxxxx\",\n  \"gistToken\": \"xxxxxxxxx\",\n  \"syncGistId\": \"xxxxxxxxx\",\n  \"SCUKey\": \"xxxxx\"\n}\n```\n\n这样就可以在每次同步成功或者失败时，将消息推送到你在 Server 酱 后台绑定的微信上。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuyanhanx%2Fhub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuyanhanx%2Fhub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuyanhanx%2Fhub/lists"}