Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
shanmiteko committed Jun 25, 2022
1 parent a5b213c commit b1ef406
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,32 @@
- [pixiv](https://pixiv.net)
- [twitch](https://twitch.tv)

可在配置文件中添加更多网站
可在[配置文件](#配置文件)中添加更多网站

## How to use
**安装ssl根证书**

证书文件`ca.crt`

**运行snimap**

授予执行权限

### windows
以管理员方式运行

### linux
使用`sudo`

*注意此时的配置文件在root用户目录内*

或者使用`setcap`授予更小粒度的权限 ([capabilities](https://man7.org/linux/man-pages/man7/capabilities.7.html))
```
$ sudo setcap 'cap_dac_override+ep cap_net_bind_service=+ep' ./target/release/snimap
```
完成后即可用非root用户运行

## 配置文件

**配置文件位置**

Expand Down Expand Up @@ -85,8 +110,9 @@ sni = "www.fanbox.cc"
## How to Build
On OpenSUSE
```bash
$ git clone [email protected]:shanmiteko/snimap.git --depth=1
$ cargo build --release
$ sudo zypper install libcap2
$ sudo setcap 'CAP_DAC_OVERRIDE+ep cap_net_bind_service=+ep' ./target/release/snimap
$ cargo run
$ sudo setcap 'cap_dac_override+ep cap_net_bind_service=+ep' ./target/release/snimap
$ cargo run --release
```
1 change: 1 addition & 0 deletions src/config/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ impl Default for Config {
"gist.githubusercontent.com",
"github.com",
"github.githubassets.com",
"objects.githubusercontent.com",
"raw.githubusercontent.com",
"user-images.githubusercontent.com",
]
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ async fn main() -> Result<(), AnyError> {
CtrlC::new()
.expect("Failed to install Ctrl-C handler")
.await;
log::info!(target: "proxy", "waiting for server stop ...");
server_handle.stop(true).await;
edit_hosts(&Vec::new()).await?;
log::info!(target: "proxy", "restore hosts");
Expand Down

0 comments on commit b1ef406

Please sign in to comment.