Skip to content

Commit

Permalink
docs: 更新说明
Browse files Browse the repository at this point in the history
  • Loading branch information
Licoy committed Jun 19, 2022
1 parent cd4f8e1 commit e14390f
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 23 deletions.
50 changes: 27 additions & 23 deletions README.md
Expand Up @@ -4,7 +4,9 @@
`fetch-github-hosts` 是主要为解决研究及学习人员访问 `Github` 过慢或其他问题而提供的 `Github Hosts` 同步工具

[![Release](https://img.shields.io/github/v/release/Licoy/fetch-github-hosts.svg?logo=git)](https://github.com/Licoy/fetch-github-hosts)
[![Workflows-Release](https://github.com/Licoy/fetch-github-hosts/workflows/Release/badge.svg)](https://github.com/Licoy/fetch-github-hosts)
[![LinuxBuild](https://github.com/Licoy/fetch-github-hosts/workflows/Build%20for%20Linux/badge.svg)](https://github.com/Licoy/fetch-github-hosts)
[![LinuxBuild](https://github.com/Licoy/fetch-github-hosts/workflows/Build%20for%20MacOS/badge.svg)](https://github.com/Licoy/fetch-github-hosts)
[![LinuxBuild](https://github.com/Licoy/fetch-github-hosts/workflows/Build%20for%20Windows/badge.svg)](https://github.com/Licoy/fetch-github-hosts)

</div>

Expand All @@ -13,19 +15,39 @@
此项目是通过部署此项目本身的服务器来获取 `github.com``hosts`,而不是通过第三方ip地址接口来进行获取,例如 `ipaddress.com` 等。

## 使用方法
### 图形化界面
[Releases](https://github.com/Licoy/fetch-github-hosts/releases)
[FastGit镜像](https://hub.fastgit.xyz/Licoy/fetch-github-hosts/releases) 中下载您的系统版本(目前支持`Windows`/`Linux`/`MacOS`

下载完成解压`tar.gz`压缩包,运行对应平台的执行文件即可运行( ⚠️ 注意:Windows下请右键以管理员身份运行,Linux/MacOS下需要用`sudo`进行启动)

#### 客户端模式
![client](./docs/client.png)

#### 客户端启动
![client-start](./docs/client-start.png)

#### 客户端hosts源选择
![client-select](./docs/client-select.png)

#### 客户端hosts源自定义
![client-custom](./docs/client-custom.png)

#### 服务端模式
![server](./docs/server.png)

### 自动(推荐)
### 命令行终端

[Releases](https://github.com/Licoy/fetch-github-hosts/releases)
[FastGit镜像](https://hub.fastgit.xyz/Licoy/fetch-github-hosts/releases) 中下载您的系统版本(目前支持`Windows`/`Linux`/`MacOS`
),包括`ARM`
架构的系统。

#### 参数

| 参数名 | 缩写 | 默认值 | 必填 | 描述 |
|------------|-----|--------------------------------------|-----|------------------------------------|
| `mode` | `m` | client | | 启动模式 `server(服务端)` / `client(客户端)` |
| `mode` | `m` | | | 启动模式 `server(服务端)` / `client(客户端)` |
| `interval` | `i` | 60 || 获取记录值间隔(分钟) |
| `port` | `p` | 9898 || 服务模式监听端口以访问HTTP服务 |
| `url` | `u` | `https://hosts.gitcdn.top/hosts.txt` || 客户端模式远程hosts获取链接 |
Expand Down Expand Up @@ -114,24 +136,6 @@ sed -i "/# fetch-github-hosts begin/Q" /etc/hosts && curl https://hosts.gitcdn.t

> 提示:可以设置crontab定时任务定时获取更新即可,解放双手!
### 其他自动方式

#### Chrome浏览器下

使用 [FasterHosts](https://github.com/gauseen/faster-hosts) 插件,点击进入下载。

下载完成之后解压压缩包,Chrome地址栏输入`chrome://extensions/`回车进入,勾选`开发者模式`,选择`加载已解压的扩展程序`
选择刚才的解压目录即可。

#### Windows / MacOS 及其他桌面端

使用 [SwitchHosts](https://swh.app/) 桌面端应用,安装添加新规则:

- `Title`: 任意
- `Type`: `Remote`
- `Url`: `https://hosts.gitcdn.top/hosts.txt`
- `Auto refresh`: `1 hour`

## 私有部署

下载最新的发行版(到 [Releases](https://github.com/Licoy/fetch-github-hosts/releases)
Expand Down
Binary file added docs/client-custom.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/client-select.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/client-start.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/client.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/server.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e14390f

Please sign in to comment.