{"id":13841698,"url":"https://github.com/ksco/reblog","last_synced_at":"2025-07-11T13:32:02.887Z","repository":{"id":126984142,"uuid":"104073051","full_name":"ksco/reblog","owner":"ksco","description":"A blog system using GitHub Issues, powered by React + Redux.","archived":true,"fork":false,"pushed_at":"2017-10-21T13:31:00.000Z","size":47,"stargazers_count":33,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-05T17:28:56.614Z","etag":null,"topics":["blog","issues","react","redux"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/ksco.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}},"created_at":"2017-09-19T12:40:35.000Z","updated_at":"2024-04-01T03:15:49.000Z","dependencies_parsed_at":"2023-06-19T14:20:43.679Z","dependency_job_id":null,"html_url":"https://github.com/ksco/reblog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksco%2Freblog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksco%2Freblog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksco%2Freblog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksco%2Freblog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ksco","download_url":"https://codeload.github.com/ksco/reblog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225729616,"owners_count":17515146,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["blog","issues","react","redux"],"created_at":"2024-08-04T17:01:18.684Z","updated_at":"2024-11-21T12:30:17.492Z","avatar_url":"https://github.com/ksco.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","JavaScript (485)"],"sub_categories":[],"readme":"# Reblog\n使用 React 技术栈，基于 GitHub Issues 的轻量级博客系统，Demo ：[KSCO](https://ksco-blog.oss-cn-beijing.aliyuncs.com)。\n\n## 安装\n\n1. 注册 GitHub OAuth 应用\n\n   打开[注册页面](https://github.com/settings/applications/new)，填写相应选项，注册应用，下面给出了一个表单示例：\n\n   | Key                        | Value                                  |\n   | -------------------------- | -------------------------------------- |\n   | Application name           | 博客名称，例如：Reblog                         |\n   | Homepage URL               | 项目主页，例如：https://github.com/ksco/reblog |\n   | Application description    | 随便写                                    |\n   | Authorization callback URL | 博客地址，例如：https://example.com            |\n\n   **成功创建之后，会得到一个 Client ID 和一个 Client Secret，后面会用到。**\n\n2. 配置项目\n\n   运行命令\n\n   ```shell\n   git clone https://github.com/ksco/reblog.git\n   cd reblog\n   mv src/constants/config.example.js src/constants/config.js\n   ```\n\n   编辑 `src/constants/config.js `文件\n\n   ```javascript\n   // 博客名称，会显示在页面上方\n   export const BLOG_NAME = 'Reblog';\n   // 博客的 Slogan，会显示在名称下方\n   export const BLOG_SLOGAN = 'Balhblah';\n\n   // GitHub 用户名\n   export const USERNAME = 'octocat';\n   // 要展示的 Repo 名称\n   export const REPONAME = 'blog';\n\n   // 刚刚拿到的 Client ID 和 Client Secret\n   export const CLIENT_ID = 'xxx';\n   export const CLIENT_SECRET = 'xxx';\n\n   // 博客的地址，必须和之前的 Authorization callback URL 字段保持一致\n   export const SITE_URL = 'http://www.example.com';\n\n   // 每页显示的博客条数\n   export const POSTS_PER_PAGE = 10;\n   ```\n\n3. 安装编译\n\n\n   运行命令\n\n   ```shell\n   cd reblog\n   npm install\n   npm run build\n   ```\n\n   编译完成后，将 build 目录下的静态文件直接放到博客的根目录下就可以了。\n\n   另外，静态文件的托管也可以考虑 [GitHub Pages](https://pages.github.com/)，不过国内的访问速度似乎比较慢。\n\n## CORS\n\n处于安全性的考虑，GitHub 的 OAuth [认证接口](https://github.com/login/oauth/access_token)不支持跨域访问，所以我写了一个简单的 node.js 脚本，并托管在了 [now.sh](https://zeit.co/now) 上，以实现 CORS 代理，脚本就在本项目中的 cors 目录下，你也可以自己启一个服务，并将 `src/constants/api.js` 文件下的 `ACCESS_URL` 变量替换掉即可。\n\n## 关于安全\n\n1. 将 Client Secret 放到客户端中似乎是一种较为危险的行为，但因为 Authorization callback URL 的存在，即使拿到了这个 ID，也做不了什么事情。如果你发现确实有安全性问题，请您给我发邮件。\n\n   如果还是不放心，你当然可以把 Client Secret 隐藏到 上面提到的 CORS 代理中，这样就万无一失了。\n\n2. 如果你不想别人在你的博客中使用 Redux DevTools，可以去除掉 `src/store.js` 中的 `window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ||` 部分。\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksco%2Freblog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fksco%2Freblog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksco%2Freblog/lists"}