mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-06-13 05:44:12 +08:00
Merge 74fbd619fec9e0ac330e1b8e3a7268b450c2d4fd into 1635c987839da77e61504fb3fabd808c53429255
This commit is contained in:
commit
4e64e72fdb
143
.github/workflows/sing-box.yml
vendored
Normal file
143
.github/workflows/sing-box.yml
vendored
Normal file
@ -0,0 +1,143 @@
|
||||
name: Build sing-box
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
release:
|
||||
types:
|
||||
- 'prereleased'
|
||||
- 'published'
|
||||
- 'released'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config:
|
||||
- {
|
||||
name: "windows-386",
|
||||
GOARCH: 386,
|
||||
GOOS: windows,
|
||||
release: true
|
||||
}
|
||||
- {
|
||||
name: "windows-amd64",
|
||||
GOARCH: amd64,
|
||||
GOOS: windows,
|
||||
release: true
|
||||
}
|
||||
- {
|
||||
name: "linux-amd64",
|
||||
GOARCH: amd64,
|
||||
GOOS: linux,
|
||||
release: true
|
||||
}
|
||||
- {
|
||||
name: "linux-arm64",
|
||||
GOARCH: arm64,
|
||||
GOOS: linux,
|
||||
release: true
|
||||
}
|
||||
- {
|
||||
name: "freebsd-amd64",
|
||||
GOARCH: amd64,
|
||||
GOOS: freebsd,
|
||||
release: true
|
||||
}
|
||||
- {
|
||||
name: "freebsd-arm",
|
||||
GOARCH: arm,
|
||||
GOOS: linux,
|
||||
release: true
|
||||
}
|
||||
- {
|
||||
name: "darwin-arm64",
|
||||
GOARCH: arm64,
|
||||
GOOS: darwin,
|
||||
release: true
|
||||
}
|
||||
- {
|
||||
name: "darwin-amd64",
|
||||
GOARCH: amd64,
|
||||
GOOS: darwin,
|
||||
release: true
|
||||
}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '1.19.2'
|
||||
check-latest: true
|
||||
|
||||
- name: Build sing-box
|
||||
run: |
|
||||
mkdir release-tmp
|
||||
export GOARCH=${{ matrix.config.GOARCH }}
|
||||
export GOOS=${{ matrix.config.GOOS }}
|
||||
~/go install -v -tags \
|
||||
--with_quic,\
|
||||
--with_grpc,\
|
||||
--with_wireguard,\
|
||||
--with_shadowsocksr,\
|
||||
--with_ech,with_utls,\
|
||||
--with_acme,\
|
||||
--with_clash_api,\
|
||||
--with_gvisor,\
|
||||
--with_embedded_tor,\
|
||||
--with_lwip \
|
||||
--with github.com/sagernet/sing-box/cmd/sing-box@v1.1-beta10 \
|
||||
--output ./release-tmp/sing-box
|
||||
|
||||
- name: Rename for Windows
|
||||
if: matrix.config.GOOS == 'windows'
|
||||
run: |
|
||||
mv ./release-tmp/sing-box ./release-tmp/sing-box.exe
|
||||
|
||||
- name: Calculate Hash
|
||||
run: |
|
||||
cd ./release-tmp || exit 1
|
||||
sha256sum * > sha256
|
||||
|
||||
- name: Generate zip for Windows
|
||||
if: matrix.config.GOOS == 'windows'
|
||||
run: |
|
||||
mkdir release-ready
|
||||
cd ./release-tmp
|
||||
zip -r ../release-ready/sing-box-${{ matrix.config.name }}.zip *
|
||||
|
||||
- name: Generate tar for other platform
|
||||
if: matrix.config.GOOS != 'windows'
|
||||
run: |
|
||||
mkdir release-ready
|
||||
cd ./release-tmp
|
||||
tar -zcvf ../release-ready/sing-box-${{ matrix.config.name }}.tar.gz *
|
||||
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: caddy-${{ github.sha }}-${{ matrix.config.name }}
|
||||
path: ./release-ready/*
|
||||
|
||||
- name: Upload to GitHub Release for Windows
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
if: github.event_name == 'release' && matrix.config.release && matrix.config.GOOS == 'windows'
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: ./release-ready/sing-box-${{ matrix.config.name }}.zip
|
||||
tag: ${{ github.ref }}
|
||||
overwrite: true
|
||||
|
||||
- name: Upload to GitHub Release for other platform
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
if: github.event_name == 'release' && matrix.config.release && matrix.config.GOOS != 'windows'
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: ./release-ready/caddy-${{ matrix.config.name }}.tar.gz
|
||||
tag: ${{ github.ref }}
|
||||
overwrite: true
|
143
.github/工作流程/sing-box.yml
vendored
Normal file
143
.github/工作流程/sing-box.yml
vendored
Normal file
@ -0,0 +1,143 @@
|
||||
name: Build sing-box
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
release:
|
||||
types:
|
||||
- 'prereleased'
|
||||
- 'published'
|
||||
- 'released'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config:
|
||||
- {
|
||||
name: "windows-386",
|
||||
GOARCH: 386,
|
||||
GOOS: windows,
|
||||
release: true
|
||||
}
|
||||
- {
|
||||
name: "windows-amd64",
|
||||
GOARCH: amd64,
|
||||
GOOS: windows,
|
||||
release: true
|
||||
}
|
||||
- {
|
||||
name: "linux-amd64",
|
||||
GOARCH: amd64,
|
||||
GOOS: linux,
|
||||
release: true
|
||||
}
|
||||
- {
|
||||
name: "linux-arm64",
|
||||
GOARCH: arm64,
|
||||
GOOS: linux,
|
||||
release: true
|
||||
}
|
||||
- {
|
||||
name: "freebsd-amd64",
|
||||
GOARCH: amd64,
|
||||
GOOS: freebsd,
|
||||
release: true
|
||||
}
|
||||
- {
|
||||
name: "freebsd-arm",
|
||||
GOARCH: arm,
|
||||
GOOS: linux,
|
||||
release: true
|
||||
}
|
||||
- {
|
||||
name: "darwin-arm64",
|
||||
GOARCH: arm64,
|
||||
GOOS: darwin,
|
||||
release: true
|
||||
}
|
||||
- {
|
||||
name: "darwin-amd64",
|
||||
GOARCH: amd64,
|
||||
GOOS: darwin,
|
||||
release: true
|
||||
}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '1.19.2'
|
||||
check-latest: true
|
||||
|
||||
- name: Build sing-box
|
||||
run: |
|
||||
mkdir release-tmp
|
||||
export GOARCH=${{ matrix.config.GOARCH }}
|
||||
export GOOS=${{ matrix.config.GOOS }}
|
||||
~/go install -v -tags \
|
||||
--with_quic,\
|
||||
--with_grpc,\
|
||||
--with_wireguard,\
|
||||
--with_shadowsocksr,\
|
||||
--with_ech,with_utls,\
|
||||
--with_acme,\
|
||||
--with_clash_api,\
|
||||
--with_gvisor,\
|
||||
--with_embedded_tor,\
|
||||
--with_lwip \
|
||||
--with github.com/sagernet/sing-box/cmd/sing-box@v1.1-beta10 \
|
||||
--output ./release-tmp/sing-box
|
||||
|
||||
- name: Rename for Windows
|
||||
if: matrix.config.GOOS == 'windows'
|
||||
run: |
|
||||
mv ./release-tmp/sing-box ./release-tmp/sing-box.exe
|
||||
|
||||
- name: Calculate Hash
|
||||
run: |
|
||||
cd ./release-tmp || exit 1
|
||||
sha256sum * > sha256
|
||||
|
||||
- name: Generate zip for Windows
|
||||
if: matrix.config.GOOS == 'windows'
|
||||
run: |
|
||||
mkdir release-ready
|
||||
cd ./release-tmp
|
||||
zip -r ../release-ready/sing-box-${{ matrix.config.name }}.zip *
|
||||
|
||||
- name: Generate tar for other platform
|
||||
if: matrix.config.GOOS != 'windows'
|
||||
run: |
|
||||
mkdir release-ready
|
||||
cd ./release-tmp
|
||||
tar -zcvf ../release-ready/sing-box-${{ matrix.config.name }}.tar.gz *
|
||||
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: caddy-${{ github.sha }}-${{ matrix.config.name }}
|
||||
path: ./release-ready/*
|
||||
|
||||
- name: Upload to GitHub Release for Windows
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
if: github.event_name == 'release' && matrix.config.release && matrix.config.GOOS == 'windows'
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: ./release-ready/sing-box-${{ matrix.config.name }}.zip
|
||||
tag: ${{ github.ref }}
|
||||
overwrite: true
|
||||
|
||||
- name: Upload to GitHub Release for other platform
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
if: github.event_name == 'release' && matrix.config.release && matrix.config.GOOS != 'windows'
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: ./release-ready/caddy-${{ matrix.config.name }}.tar.gz
|
||||
tag: ${{ github.ref }}
|
||||
overwrite: true
|
59
README.md
59
README.md
@ -1,11 +1,59 @@
|
||||
# sing-box
|
||||
# sing-box 网络代理平台的“瑞士军刀”
|
||||
|
||||
The universal proxy platform.
|
||||
### 官方网址:https://github.com/SagerNet/sing-box
|
||||
|
||||
## Documentation
|
||||
通用代理平台 The universal proxy platform.
|
||||
|
||||
## 官方文档 Documentation
|
||||
|
||||
https://sing-box.sagernet.org
|
||||
|
||||
### Matsuri (茉莉) for Android
|
||||
安卓端支持软件Matsuri
|
||||
官方网址:https://github.com/MatsuriDayo/Matsuri
|
||||
安卓端插件地址
|
||||
https://github.com/SagerNet/SagerNet
|
||||
|
||||
### 基于 Qt/C++ 的跨平台 GUI 代理配置管理器
|
||||
|
||||
目前支持 Windows / Linux amd64 开箱即用 https://github.com/MatsuriDayo/nekoray
|
||||
|
||||
### 一键安装、管理sing-box
|
||||
网址:https://github.com/FranzKafkaYu/sing-box-yes
|
||||
|
||||
### 安装
|
||||
|
||||
sing-box 需要 Golang 1.18.5 或更高版本
|
||||
#### 安装 Golang
|
||||
```
|
||||
cd
|
||||
curl -fsL https://raw.githubusercontent.com/jetsung/golang-install/main/install.sh | bash
|
||||
source /root/.bashrc
|
||||
```
|
||||
#### 安装最新的 sing-box 版本
|
||||
```
|
||||
go install -v github.com/sagernet/sing-box/cmd/sing-box@latest
|
||||
````
|
||||
#### 自定义安装,具体方法看官方文档 https://sing-box.sagernet.org
|
||||
```
|
||||
例:
|
||||
go install -v -tags "with_acme with_clash_api with_quic with_grpc with_wireguard with_ech with_utls with_gvisor with_shadowsocksr" github.com/sagernet/sing-box/cmd/sing-box@dev-next
|
||||
```
|
||||
### 设置 DNS
|
||||
Disini akan menggantikan default dns dari WAN/Modem.
|
||||
|
||||
add resolver updater 来自https://github.com/malikshi/sing_box
|
||||
```
|
||||
wget -O /usr/local/bin/u-resolver https://raw.githubusercontent.com/malikshi/sing_box/main/u-resolver.sh && chmod +x /usr/local/bin/u-resolver && u-resolver
|
||||
```
|
||||
|
||||
### 设置 sing-box
|
||||
Download GEO Assets
|
||||
```
|
||||
wget -c -P /etc/sing-box/ "https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db"
|
||||
wget -c -P /etc/sing-box/ "https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db"
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
```
|
||||
@ -23,4 +71,7 @@ GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
```
|
||||
```
|
||||
# 致谢
|
||||
SagerNet/sing-box
|
||||
# 致谢所有github贡献者
|
||||
|
Loading…
x
Reference in New Issue
Block a user