mirror of
https://github.com/nadoo/glider.git
synced 2025-02-23 01:15:41 +08:00
chore: document updates
This commit is contained in:
parent
b0b043a280
commit
755a8ca565
15
.github/workflows/build.yml
vendored
15
.github/workflows/build.yml
vendored
@ -1,5 +1,5 @@
|
|||||||
name: Build
|
name: Build
|
||||||
on: [push]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -10,17 +10,28 @@ jobs:
|
|||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Get Go version
|
- name: Get Go version
|
||||||
run: |
|
run: |
|
||||||
echo "GO_VERSION=$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | grep $(grep -P "go \d+\." go.mod | cut -d " " -f2) | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g')" >> $GITHUB_ENV
|
echo "GO_VERSION=$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | grep $(grep -P "go \d+\." go.mod | cut -d " " -f2) | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g')" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: ${{ env.GO_VERSION}}
|
go-version: ${{ env.GO_VERSION}}
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: go test -v .
|
run: go test -v .
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: go build -v .
|
uses: goreleaser/goreleaser-action@v2
|
||||||
|
if: "!startsWith(github.ref, 'refs/tags/')"
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
|
args: build --snapshot --rm-dist
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Run GoReleaser
|
- name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v2
|
uses: goreleaser/goreleaser-action@v2
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
2
.github/workflows/docker.yml
vendored
2
.github/workflows/docker.yml
vendored
@ -11,7 +11,7 @@ on:
|
|||||||
env:
|
env:
|
||||||
DOCKERHUB_REPO: nadoo/glider
|
DOCKERHUB_REPO: nadoo/glider
|
||||||
GHCR_REPO: ghcr.io/nadoo/glider
|
GHCR_REPO: ghcr.io/nadoo/glider
|
||||||
PLATFORMS: linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6
|
PLATFORMS: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
|
@ -1,30 +1,11 @@
|
|||||||
# Make sure to check the documentation at http://goreleaser.com
|
|
||||||
|
|
||||||
# release:
|
|
||||||
# git tag -a v0.1.0 -m "v0.1.0"
|
|
||||||
# git push origin v0.1.0
|
|
||||||
# goreleaser release --skip-publish --rm-dist
|
|
||||||
|
|
||||||
# #git tag -d v0.1.0
|
|
||||||
# #git push origin --delete tag v0.1.0
|
|
||||||
|
|
||||||
# snapshot:
|
|
||||||
# goreleaser --snapshot --rm-dist
|
|
||||||
|
|
||||||
# https://goreleaser.com/customization/
|
|
||||||
|
|
||||||
before:
|
before:
|
||||||
hooks:
|
hooks:
|
||||||
- go mod tidy
|
- go mod tidy
|
||||||
|
|
||||||
# https://goreleaser.com/customization/build/
|
|
||||||
builds:
|
builds:
|
||||||
- id: default
|
- id: default
|
||||||
env:
|
env:
|
||||||
- CGO_ENABLED=0
|
- CGO_ENABLED=0
|
||||||
# GOOS list to build for.
|
|
||||||
# For more info refer to: https://go.dev/doc/install/source#environment
|
|
||||||
# Defaults are darwin and linux.
|
|
||||||
goos:
|
goos:
|
||||||
- windows
|
- windows
|
||||||
- linux
|
- linux
|
||||||
@ -47,7 +28,6 @@ builds:
|
|||||||
- hardfloat
|
- hardfloat
|
||||||
- softfloat
|
- softfloat
|
||||||
|
|
||||||
# https://goreleaser.com/customization/archive/
|
|
||||||
archives:
|
archives:
|
||||||
- id: default
|
- id: default
|
||||||
builds:
|
builds:
|
||||||
@ -66,23 +46,18 @@ archives:
|
|||||||
- config/**/*
|
- config/**/*
|
||||||
- systemd/*
|
- systemd/*
|
||||||
|
|
||||||
# https://goreleaser.com/customization/snapshots/
|
|
||||||
snapshot:
|
snapshot:
|
||||||
name_template: '{{ incpatch .Version }}-dev'
|
name_template: '{{ incpatch .Version }}-dev'
|
||||||
|
|
||||||
# https://goreleaser.com/customization/checksum/
|
|
||||||
checksum:
|
checksum:
|
||||||
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
|
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
|
||||||
|
|
||||||
# https://goreleaser.com/customization/release/
|
|
||||||
release:
|
release:
|
||||||
prerelease: true
|
prerelease: true
|
||||||
draft: true
|
draft: true
|
||||||
|
|
||||||
# https://goreleaser.com/customization/nfpm/
|
|
||||||
nfpms:
|
nfpms:
|
||||||
-
|
- id: glider
|
||||||
id: glider
|
|
||||||
package_name: glider
|
package_name: glider
|
||||||
vendor: nadoo
|
vendor: nadoo
|
||||||
homepage: https://github.com/nadoo/glider
|
homepage: https://github.com/nadoo/glider
|
||||||
|
@ -101,7 +101,7 @@ glider -h
|
|||||||
<summary>click to see details</summary>
|
<summary>click to see details</summary>
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
glider 0.15.3 usage:
|
glider 0.16.0 usage:
|
||||||
-check string
|
-check string
|
||||||
check=tcp[://HOST:PORT]: tcp port connect check
|
check=tcp[://HOST:PORT]: tcp port connect check
|
||||||
check=http://HOST[:PORT][/URI][#expect=REGEX_MATCH_IN_RESP_LINE]
|
check=http://HOST[:PORT][/URI][#expect=REGEX_MATCH_IN_RESP_LINE]
|
||||||
@ -132,6 +132,8 @@ glider 0.15.3 usage:
|
|||||||
maximum TTL value for entries in the CACHE(seconds) (default 1800)
|
maximum TTL value for entries in the CACHE(seconds) (default 1800)
|
||||||
-dnsminttl int
|
-dnsminttl int
|
||||||
minimum TTL value for entries in the CACHE(seconds)
|
minimum TTL value for entries in the CACHE(seconds)
|
||||||
|
-dnsnoaaaa
|
||||||
|
disable AAAA query
|
||||||
-dnsrecord value
|
-dnsrecord value
|
||||||
custom dns record, format: domain/ip
|
custom dns record, format: domain/ip
|
||||||
-dnsserver value
|
-dnsserver value
|
||||||
|
@ -242,6 +242,9 @@ dnscachesize=4096
|
|||||||
# show query log of dns cache
|
# show query log of dns cache
|
||||||
dnscachelog=True
|
dnscachelog=True
|
||||||
|
|
||||||
|
# disable AAAA queries
|
||||||
|
# dnsnoaaaa=True
|
||||||
|
|
||||||
# custom records
|
# custom records
|
||||||
dnsrecord=www.example.com/1.2.3.4
|
dnsrecord=www.example.com/1.2.3.4
|
||||||
dnsrecord=www.example.com/2606:2800:220:1:248:1893:25c8:1946
|
dnsrecord=www.example.com/2606:2800:220:1:248:1893:25c8:1946
|
||||||
|
@ -26,6 +26,7 @@ dnsserver=208.67.222.222:53
|
|||||||
# - add ip/cidrs in rule files on startup
|
# - add ip/cidrs in rule files on startup
|
||||||
# - add resolved ips for domains in rule files by dns forwarding server
|
# - add resolved ips for domains in rule files by dns forwarding server
|
||||||
# Usually used in transparent proxy mode on linux
|
# Usually used in transparent proxy mode on linux
|
||||||
|
# Note: this will create 2 ipsets, glider for ipv4 and glider6 for ipv6
|
||||||
ipset=glider
|
ipset=glider
|
||||||
|
|
||||||
# DESTINATIONS
|
# DESTINATIONS
|
||||||
|
2
main.go
2
main.go
@ -18,7 +18,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
version = "0.15.3"
|
version = "0.16.0"
|
||||||
config = parseConfig()
|
config = parseConfig()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ func NewConfFromFile(ruleFile string) (*Config, error) {
|
|||||||
f.StringVar(&p.Strategy.IntFace, "interface", "", "source ip or source interface")
|
f.StringVar(&p.Strategy.IntFace, "interface", "", "source ip or source interface")
|
||||||
|
|
||||||
f.StringSliceUniqVar(&p.DNSServers, "dnsserver", nil, "remote dns server")
|
f.StringSliceUniqVar(&p.DNSServers, "dnsserver", nil, "remote dns server")
|
||||||
f.StringVar(&p.IPSet, "ipset", "", "ipset name")
|
f.StringVar(&p.IPSet, "ipset", "", "ipset NAME, will create 2 sets: NAME for ipv4 and NAME6 for ipv6")
|
||||||
|
|
||||||
f.StringSliceUniqVar(&p.Domain, "domain", nil, "domain")
|
f.StringSliceUniqVar(&p.Domain, "domain", nil, "domain")
|
||||||
f.StringSliceUniqVar(&p.IP, "ip", nil, "ip")
|
f.StringSliceUniqVar(&p.IP, "ip", nil, "ip")
|
||||||
|
Loading…
Reference in New Issue
Block a user