mirror of
https://github.com/xvzc/SpoofDPI.git
synced 2025-01-08 17:54:05 +00:00
support snap
This commit is contained in:
parent
a2993ac68d
commit
1a4c441df9
@ -5,6 +5,7 @@
|
|||||||
<!--ts-->
|
<!--ts-->
|
||||||
* [Binary](#binary)
|
* [Binary](#binary)
|
||||||
* [Go](#go)
|
* [Go](#go)
|
||||||
|
* [Snap](#snap)
|
||||||
<!--te-->
|
<!--te-->
|
||||||
|
|
||||||
## Binary
|
## Binary
|
||||||
@ -40,3 +41,32 @@ curl -fsSL https://raw.githubusercontent.com/xvzc/SpoofDPI/main/install.sh | bas
|
|||||||
```bash
|
```bash
|
||||||
go install github.com/xvzc/SpoofDPI/cmd/spoofdpi@latest
|
go install github.com/xvzc/SpoofDPI/cmd/spoofdpi@latest
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Snap
|
||||||
|
```bash
|
||||||
|
# Install from snapstore
|
||||||
|
snap install spoofdpi
|
||||||
|
|
||||||
|
# List services
|
||||||
|
snap services spoofdpi
|
||||||
|
|
||||||
|
# Enable and start spoofdpi.spoofdpi-daemon snap service
|
||||||
|
snap start --enable spoofdpi.spoofdpi-daemon
|
||||||
|
|
||||||
|
# Show generated systemd service status
|
||||||
|
systemctl status snap.spoofdpi.spoofdpi-daemon.service
|
||||||
|
|
||||||
|
# Override generated systemd service (configure startup options)
|
||||||
|
systemctl edit snap.spoofdpi.spoofdpi-daemon.service
|
||||||
|
|
||||||
|
## NOTE: you can pass args to spoofdpi:
|
||||||
|
## [Service]
|
||||||
|
## ExecStart=
|
||||||
|
## ExecStart=/usr/bin/snap run spoofdpi.spoofdpi-daemon --arg1 --arg2 .....
|
||||||
|
|
||||||
|
# Restart generated systemd service to apply changes
|
||||||
|
systemctl restart snap.spoofdpi.spoofdpi-daemon.service
|
||||||
|
|
||||||
|
# ... and show service status
|
||||||
|
systemctl status snap.spoofdpi.spoofdpi-daemon.service
|
||||||
|
```
|
||||||
|
37
snap/snapcraft.yaml
Normal file
37
snap/snapcraft.yaml
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
name: spoofdpi
|
||||||
|
adopt-info: spoofdpi
|
||||||
|
summary: A simple and fast anti-censorship tool written in Go
|
||||||
|
description: |
|
||||||
|
A simple and fast software designed to bypass Deep Packet Inspection.
|
||||||
|
base: core22
|
||||||
|
grade: stable
|
||||||
|
confinement: strict
|
||||||
|
architectures:
|
||||||
|
- build-on: amd64
|
||||||
|
- build-on: arm64
|
||||||
|
- build-on: armhf
|
||||||
|
- build-on: ppc64el
|
||||||
|
- build-on: riscv64
|
||||||
|
license: Apache-2.0
|
||||||
|
source-code: https://github.com/xvzc/SpoofDPI
|
||||||
|
|
||||||
|
apps:
|
||||||
|
spoofdpi-daemon:
|
||||||
|
command: spoofdpi
|
||||||
|
daemon: simple
|
||||||
|
install-mode: disable
|
||||||
|
plugs: [network, network-bind, network-control]
|
||||||
|
|
||||||
|
parts:
|
||||||
|
spoofdpi:
|
||||||
|
plugin: go
|
||||||
|
build-snaps: [go/latest/stable]
|
||||||
|
source: https://github.com/xvzc/SpoofDPI.git
|
||||||
|
source-type: git
|
||||||
|
override-pull: |
|
||||||
|
snapcraftctl pull
|
||||||
|
LAST_RELEASE=$(git tag --list | grep -P --regexp='v\d' | sort --version-sort | tail -1)
|
||||||
|
git checkout $LAST_RELEASE
|
||||||
|
snapcraftctl set-version ${LAST_RELEASE}+$(git rev-parse --short HEAD)
|
||||||
|
override-build: |
|
||||||
|
go build -o $SNAPCRAFT_PART_INSTALL/spoofdpi -ldflags '-w -s -extldflags "-static"' -tags timetzdata github.com/xvzc/SpoofDPI/cmd/spoofdpi
|
Loading…
Reference in New Issue
Block a user