Skip to content

Commit

Permalink
documentation: Update installation
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Jul 27, 2023
1 parent ffe515d commit c1e8d86
Show file tree
Hide file tree
Showing 10 changed files with 123 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/installation/clients/sfi.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Experimental iOS client for sing-box.
#### Requirements

* iOS 15.0+
* macOS 12.0+ with Apple Silicon
* An Apple account outside of mainland China

#### Download

Expand Down
2 changes: 1 addition & 1 deletion docs/installation/clients/sfi.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#### 要求

* iOS 15.0+
* macOS 12.0+ with Apple Silicon
* 一个非中国大陆地区的 Apple 账号

#### 下载

Expand Down
11 changes: 9 additions & 2 deletions docs/installation/clients/sfm.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,25 @@ Experimental macOS client for sing-box.
#### Requirements

* macOS 13.0+
* An Apple account outside of mainland China (App Store Version)

#### Download
#### Download (App Store Version)

* [AppStore](https://apps.apple.com/us/app/sing-box/id6451272673)
* [TestFlight](https://testflight.apple.com/join/AcqO44FH)

#### Download (Independent Version)

* [GitHub Release](https://github.com/SagerNet/sing-box/releases/latest)
* Homebrew (Cask): `brew install sfm`
* Homebrew (Tap): `brew tap sagernet/sing-box && brew install sagernet/sing-box/sfm`

#### Note

* User Agent in remote profile request is `SFM/$version ($version_code; sing-box $sing_box_version)`
* Crash logs is located in `Settings` -> `View Service Log`

#### Privacy policy

* SFI did not collect or share personal data.
* SFM did not collect or share personal data.
* The data generated by the software is always on your device.
9 changes: 8 additions & 1 deletion docs/installation/clients/sfm.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@
#### 要求

* macOS 13.0+
* 一个非中国大陆地区的 Apple 账号 (商店版本)

#### 下载
#### 下载 (商店版本)

* [AppStore](https://apps.apple.com/us/app/sing-box/id6451272673)
* [TestFlight](https://testflight.apple.com/join/AcqO44FH)

#### 下载 (独立版本)

* [GitHub Release](https://github.com/SagerNet/sing-box/releases/latest)
* Homebrew (Cask): `brew install sfm`
* Homebrew (Tap): `brew tap sagernet/sing-box && brew install sagernet/sing-box/sfm`

#### 注意事项

* 远程配置文件请求中的 User Agent 为 `SFM/$version ($version_code; sing-box $sing_box_version)`
Expand Down
25 changes: 25 additions & 0 deletions docs/installation/clients/specification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Specification

## Profile

Profile defines a single-box configuration with metadata in a GUI client.

## Profile Types

### Local

Create a empty configuration or import from a local file.

### iCloud (on Apple platforms)

Create a new configuration or use an existing configuration on iCloud.

### Remote

Use a remote URL as the configuration source, with HTTP basic authentication and automatic update support.

#### URL specification

```
sing-box://import-remote-profile?url=urlEncodedURL#urlEncodedName
```
7 changes: 7 additions & 0 deletions docs/installation/package-manager/android.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Android

## Termux

```shell
pkg add sing-box
```
14 changes: 14 additions & 0 deletions docs/installation/package-manager/macOS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# macOS

## Homebrew (core)

```shell
brew install sing-box
```

## Homebrew (Tap)

```shell
brew tap sagernet/sing-box
brew install sagernet/sing-box/sing-box
```
13 changes: 13 additions & 0 deletions docs/installation/package-manager/windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Windows

## Chocolatey

```shell
choco install sing-box
```

## winget

```shell
winget install sing-box
```
41 changes: 41 additions & 0 deletions experimental/libbox/remote_profile.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package libbox

import (
"net/url"
)

func GenerateRemoteProfileImportLink(name string, remoteURL string) string {
importLink := &url.URL{
Scheme: "sing-box",
Host: "import-remote-profile",
RawQuery: url.Values{"url": []string{remoteURL}}.Encode(),
Fragment: name,
}
return importLink.String()
}

type ImportRemoteProfile struct {
Name string
URL string
Host string
}

func ParseRemoteProfileImportLink(importLink string) (*ImportRemoteProfile, error) {
importURL, err := url.Parse(importLink)
if err != nil {
return nil, err
}
remoteURL, err := url.Parse(importURL.Query().Get("url"))
if err != nil {
return nil, err
}
name := importURL.Fragment
if name == "" {
name = remoteURL.Host
}
return &ImportRemoteProfile{
Name: name,
URL: remoteURL.String(),
Host: remoteURL.Host,
}, nil
}
4 changes: 4 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ nav:
- Change Log: changelog.md
- Installation:
- From source: installation/from-source.md
- Package Manager:
- macOS: installation/package-manager/macOS.md
- Windows: installation/package-manager/windows.md
- Android: installation/package-manager/android.md
- Clients:
- iOS: installation/clients/sfi.md
- macOS: installation/clients/sfm.md
Expand Down

0 comments on commit c1e8d86

Please sign in to comment.