Skip to content

Commit

Permalink
chore: add default config and service scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
wweir committed Nov 10, 2021
1 parent ffca422 commit a86de61
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 8 deletions.
81 changes: 81 additions & 0 deletions .github/sower.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
remote {
type = "sower"
addr = "proxy.com"
password = "I_am_Passw0rd"
# type="socks5"
# addr="127.0.0.1:7890"
}

dns {
serve = "127.0.0.1"
fallback = "223.5.5.5"
}

socks_5 {
addr = ":1080"
}

router "block" {
file = "https://raw.githubusercontent.com/pexcn/daily/gh-pages/adlist/adlist.txt"
rules = []
}

router "direct" {
file = "https://raw.githubusercontent.com/pexcn/daily/gh-pages/chinalist/chinalist.txt"
rules = [
"imap.*.*",
"imap.*.*.*",
"smtp.*.*",
"smtp.*.*.*",
"pop.*.*",
"pop.*.*.*",
"pop3.*.*",
"pop3.*.*.*",
"**.cn",
]
}

router "proxy" {
file = "https://raw.githubusercontent.com/pexcn/daily/gh-pages/gfwlist/gfwlist.txt"
rules = [
"**.google.*",
"**.goo.gl",
"**.googleusercontent.com",
"**.googleapis.com",
"*.googlesource.com",
"**.youtube.com",
"**.ytimg.com",
"**.ggpht.com",
"**.googlevideo.com",
"**.facebook.com",
"**.fbcdn.net",
"**.twitter.com",
"**.twimg.com",
"**.blogspot.com",
"**.appspot.com",
"**.wikipedia.org",
"**.wikimedia.org",
"*.cloudfront.net",
"**.amazon.com",
"**.amazonaws.com",
"*.githubusercontent.com",
"*.githubassets.com",
"*.github.*",
"lookup-api.apple.com",
]
}

router "country" {
mmdb = "Country.mmdb" # https://github.com/alecthw/mmdb_china_ip_list
file = "https://raw.githubusercontent.com/pexcn/daily/gh-pages/chnroute/chnroute.txt"
rules = [
"127.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16",
"10.0.0.0/8",
"17.0.0.0/8",
"100.64.0.0/10",
"224.0.0.0/4",
"fe80::/10",
]
}
20 changes: 20 additions & 0 deletions .github/sower.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>sower</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/sower</string>
<string>-f</string>
<string>/usr/local/etc/sower/sower.hcl</string>
</array>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>/usr/local/etc</string>
</dict>
</plist>
11 changes: 11 additions & 0 deletions .github/sower.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=sower client service
After=network.target

[Service]
Type=simple
WorkingDirectory=/etc/sower
ExecStart=/usr/local/bin/sower -f /etc/sower/sower.hcl

[Install]
WantedBy=multi-user.target
1 change: 1 addition & 0 deletions .github/sower_run.vbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CreateObject("WScript.Shell").Run "C:\Software\Sower\sower.exe -f sower.hcl",0
12 changes: 12 additions & 0 deletions .github/sowerd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=sowerd server service
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/sowerd
Environment="FAKE_SITE=127.0.0.1:8080"
Environment="PASSWORD=I_am_Passw0rd"

[Install]
WantedBy=multi-user.target
18 changes: 10 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,35 @@ jobs:

- name: build matrix
run: |
mv .github/* . || true
make build GO='GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go'
tar czvf sower-linux-amd64.tar.gz sower sowerd
tar czvf sower-linux-amd64.tar.gz sower sowerd sower.hcl sower.service sowerd.service
make clean
make build GO='GOOS=linux GOARCH=arm CGO_ENABLED=0 go'
tar czvf sower-linux-arm.tar.gz sower sowerd
tar czvf sower-linux-arm.tar.gz sower sowerd sower.hcl sower.service sowerd.service
make clean
make build GO='GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go'
tar czvf sower-linux-arm64.tar.gz sower sowerd
tar czvf sower-linux-arm64.tar.gz sower sowerd sower.hcl sower.service sowerd.service
make clean
make build GO='GOOS=linux GOARCH=mips CGO_ENABLED=0 go'
tar czvf sower-linux-mips.tar.gz sower sowerd
tar czvf sower-linux-mips.tar.gz sower sowerd sower.hcl sower.service sowerd.service
make clean
make build GO='GOOS=linux GOARCH=mipsle CGO_ENABLED=0 go'
tar czvf sower-linux-mipsle.tar.gz sower sowerd
tar czvf sower-linux-mipsle.tar.gz sower sowerd sower.hcl sower.service sowerd.service
make clean
make build GO='GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go'
tar czvf sower-darwin-amd64.tar.gz sower sowerd
tar czvf sower-darwin-amd64.tar.gz sower sowerd sower.hcl sower.plist
make clean
make build GO='GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go'
tar czvf sower-darwin-arm64.tar.gz sower sowerd
tar czvf sower-darwin-arm64.tar.gz sower sowerd sower.hcl sower.plist
make clean
make build GO='GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go'
mv sower sower.exe
mv sowerd sowerd.exe
tar czvf sower-windows-amd64.tar.gz sower.exe sowerd.exe
tar czvf sower-windows-amd64.tar.gz sower.exe sowerd.exe sower.hcl sower_run.vbs
make clean
- uses: ncipollo/release-action@v1
Expand Down

0 comments on commit a86de61

Please sign in to comment.