diff --git a/.github/sower.hcl b/.github/sower.hcl new file mode 100644 index 0000000..fa9f30d --- /dev/null +++ b/.github/sower.hcl @@ -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", + ] +} \ No newline at end of file diff --git a/.github/sower.plist b/.github/sower.plist new file mode 100644 index 0000000..a93edba --- /dev/null +++ b/.github/sower.plist @@ -0,0 +1,20 @@ + + + + + Label + sower + ProgramArguments + + /usr/local/bin/sower + -f + /usr/local/etc/sower/sower.hcl + + KeepAlive + + RunAtLoad + + WorkingDirectory + /usr/local/etc + + \ No newline at end of file diff --git a/.github/sower.service b/.github/sower.service new file mode 100644 index 0000000..c31f99a --- /dev/null +++ b/.github/sower.service @@ -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 \ No newline at end of file diff --git a/.github/sower_run.vbs b/.github/sower_run.vbs new file mode 100644 index 0000000..528edda --- /dev/null +++ b/.github/sower_run.vbs @@ -0,0 +1 @@ +CreateObject("WScript.Shell").Run "C:\Software\Sower\sower.exe -f sower.hcl",0 \ No newline at end of file diff --git a/.github/sowerd.service b/.github/sowerd.service new file mode 100644 index 0000000..7a7bdc5 --- /dev/null +++ b/.github/sowerd.service @@ -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 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c0f2e73..23a9e4f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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