{"id":29106730,"url":"https://github.com/versun/sponsorgen","last_synced_at":"2026-03-02T11:01:31.780Z","repository":{"id":289388784,"uuid":"970574080","full_name":"versun/SponsorGen","owner":"versun","description":"一个基于Go的动态赞助者图片生成工具，支持多平台赞助数据聚合与展示","archived":false,"fork":false,"pushed_at":"2025-04-23T05:37:16.000Z","size":6575,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-01T20:14:54.741Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://supporters.versun.me","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/versun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-04-22T08:05:37.000Z","updated_at":"2025-05-25T04:26:29.000Z","dependencies_parsed_at":"2025-04-23T03:29:37.796Z","dependency_job_id":null,"html_url":"https://github.com/versun/SponsorGen","commit_stats":null,"previous_names":["versun/sponsorgen"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/versun/SponsorGen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/versun%2FSponsorGen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/versun%2FSponsorGen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/versun%2FSponsorGen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/versun%2FSponsorGen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/versun","download_url":"https://codeload.github.com/versun/SponsorGen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/versun%2FSponsorGen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29999216,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T09:59:02.300Z","status":"ssl_error","status_checked_at":"2026-03-02T09:59:02.001Z","response_time":60,"last_error":"SSL_read: 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":[],"created_at":"2025-06-29T04:37:20.516Z","updated_at":"2026-03-02T11:01:31.752Z","avatar_url":"https://github.com/versun.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SponsorGen\n\n一个基于Go的动态赞助者显示生成工具，支持多平台赞助数据聚合与展示。SponsorGen可以生成SVG和JSON格式的赞助者展示，适用于开源项目的README文件或网站，支持GitHub、OpenCollective、Patreon和Afdian等平台。\n\n**请注意：所有代码(包括本README文档)均由 AI 生成，不保证其安全性和可用性，请酌情使用**\n\n## 效果预览\n\n下面是一个示例SVG赞助者展示：\n\n![赞助者展示示例](https://supporters.versun.me/sponsors.png)\n\n## 功能特性\n\n- 多平台支持：集成GitHub Sponsors、OpenCollective、Patreon和Afdian等赞助平台\n- 灵活配置：通过环境变量管理所有设置\n- 动态更新：支持基于时间间隔的自动刷新和每日凌晨00:00的定时刷新\n- 多格式输出：生成SVG图像和JSON数据\n- 自定义样式：支持自定义字体、颜色、尺寸等显示参数\n- Docker支持：提供容器化部署方案\n- 缓存机制：减少API请求，提高性能\n\n## 快速开始\n\n### 使用Docker\n\n```bash\n# 拉取镜像\ndocker pull ghcr.io/versun/sponsorgen:latest\n\n# 运行容器（使用环境变量配置）\ndocker run -p 5000:5000 \\\n  -e GITHUB_TOKEN=your_github_token \\\n  -e GITHUB_LOGIN=your_github_login \\\n  -e AFDIAN_USER_ID=your_afdian_user_id \\\n  -e AFDIAN_TOKEN=your_afdian_token \\\n  ghcr.io/versun/sponsorgen:latest\n```\n\n或者使用docker-compose:\n\n```bash\n# 使用docker-compose启动服务\ndocker-compose up -d\n```\n\n### 本地运行\n\n1. 克隆仓库\n\n```bash\ngit clone https://github.com/versun/sponsorgen.git\ncd sponsorgen\n```\n\n2. 设置环境变量（示例）\n\n```bash\n# 输出设置\nexport OUTPUT_DIR=\"./output\"\nexport CACHE_DIR=\"./cache\"\nexport REFRESH_MINUTES=\"60\"\nexport DEFAULT_AVATAR=\"./assets/default_avatar.svg\"\n\n# GitHub赞助设置（可选）\nexport GITHUB_TOKEN=\"your_github_token\"\nexport GITHUB_LOGIN=\"your_github_login\"\n\n# Afdian赞助设置（可选）\nexport AFDIAN_USER_ID=\"your_afdian_user_id\"\nexport AFDIAN_TOKEN=\"your_afdian_token\"\n\n# 渲染设置（可选）\nexport AVATAR_SIZE=\"45\"\nexport SVG_WIDTH=\"800\"\nexport SHOW_AMOUNT=\"false\"\nexport SHOW_NAME=\"false\"\n```\n\n3. 构建并运行\n\n```bash\ngo build -o sponsorgen\n./sponsorgen -port 5000\n```\n\n4. 访问服务\n\n- SVG输出: http://localhost:5000/sponsors.svg\n- JSON输出: http://localhost:5000/sponsors.json\n- 强制刷新: http://localhost:5000/refresh\n\n## 配置选项\n\n以下是可用的环境变量配置选项：\n\n| 环境变量 | 类型 | 默认值 | 说明 |\n|--------|------|--------|------|\n| OUTPUT_DIR | string | \"./output\" | 输出文件目录 |\n| CACHE_DIR | string | \"./cache\" | 缓存文件目录 |\n| REFRESH_MINUTES | int | 60 | 自动刷新间隔（分钟） |\n| DEFAULT_AVATAR | string | \"./assets/default_avatar.svg\" | 默认头像路径 |\n| GITHUB_TOKEN | string | \"\" | GitHub Personal Access Token |\n| GITHUB_LOGIN | string | \"\" | GitHub用户名 |\n| INCLUDE_PRIVATE | bool | false | 是否包含私人赞助者 |\n| GITHUB_ORGS | string | \"\" | 包含的GitHub组织，用逗号分隔 |\n| EXCLUDE_SPONSORS | string | \"\" | 排除的赞助者，用逗号分隔 |\n| INCLUDE_SPONSORS | string | \"\" | 强制包含的赞助者，用逗号分隔 |\n| OPENCOLLECTIVE_SLUG | string | \"\" | OpenCollective项目标识 |\n| OPENCOLLECTIVE_KEY | string | \"\" | OpenCollective API密钥 |\n| PATREON_TOKEN | string | \"\" | Patreon访问令牌 |\n| PATREON_CAMPAIGN_ID | string | \"\" | Patreon活动ID |\n| AFDIAN_USER_ID | string | \"\" | 爱发电用户ID |\n| AFDIAN_TOKEN | string | \"\" | 爱发电TOKEN |\n| AVATAR_SIZE | int | 45 | 头像尺寸（像素） |\n| AVATAR_MARGIN | int | 5 | 头像间距（像素） |\n| SVG_WIDTH | int | 800 | SVG宽度（像素） |\n| FONT_SIZE | int | 14 | 字体大小（像素） |\n| FONT_FAMILY | string | \"system-ui...\" | 字体系列 |\n| SHOW_AMOUNT | bool | false | 是否显示赞助金额 |\n| SHOW_NAME | bool | false | 是否显示赞助者名称 |\n| BACKGROUND_COLOR | string | \"transparent\" | 背景颜色 |\n| PADDING_X | int | 10 | X轴内边距（像素） |\n| PADDING_Y | int | 10 | Y轴内边距（像素） |\n\n## 在GitHub README中使用\n\n将以下内容添加到您的README.md文件中：\n\n```markdown\n## 赞助者\n\n![赞助者](https://your-sponsorgen-url.com/sponsors.svg)\n```\n\n## Docker镜像发布\n\n本项目使用GitHub Actions自动构建并发布Docker镜像。详情请查看 [Docker发布指南](.github/docker-publish-guide.md)。\n\n## API端点\n\n| 端点 | 方法 | 说明 |\n|------|------|------|\n| / | GET | 首页，显示简单的使用说明 |\n| /sponsors.svg | GET | 生成并返回赞助者SVG |\n| /sponsors.json | GET | 返回赞助者JSON数据 |\n| /refresh | GET | 强制刷新赞助者数据 |\n| /static/* | GET | 访问生成的静态文件 |\n\n## 贡献指南\n\n欢迎提交Pull Request或Issue！以下是一些贡献指南：\n\n1. Fork仓库\n2. 创建您的特性分支 (`git checkout -b feature/amazing-feature`)\n3. 提交您的改动 (`git commit -m 'Add some amazing feature'`)\n4. 推送到分支 (`git push origin feature/amazing-feature`)\n5. 开启一个Pull Request\n\n## 许可证\n\n此项目采用MIT许可证 - 详情请参阅 [LICENSE](LICENSE) 文件。\n\n## 技术栈\n\n- Go 1.19+\n- Docker/Docker Compose\n- GitHub Actions (CI/CD)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fversun%2Fsponsorgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fversun%2Fsponsorgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fversun%2Fsponsorgen/lists"}