chore: document updates

This commit is contained in:
nadoo 2022-01-26 22:31:56 +08:00
parent b0b043a280
commit 755a8ca565
8 changed files with 24 additions and 32 deletions

View File

@ -1,5 +1,5 @@
name: Build
on: [push]
on: [push, pull_request]
jobs:
build:
@ -10,17 +10,28 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get Go version
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
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION}}
- name: Test
run: go test -v .
- 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
uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref, 'refs/tags/')

View File

@ -11,7 +11,7 @@ on:
env:
DOCKERHUB_REPO: 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:
publish:

View File

@ -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:
hooks:
- go mod tidy
# https://goreleaser.com/customization/build/
builds:
- id: default
env:
- 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:
- windows
- linux
@ -47,7 +28,6 @@ builds:
- hardfloat
- softfloat
# https://goreleaser.com/customization/archive/
archives:
- id: default
builds:
@ -66,23 +46,18 @@ archives:
- config/**/*
- systemd/*
# https://goreleaser.com/customization/snapshots/
snapshot:
name_template: '{{ incpatch .Version }}-dev'
# https://goreleaser.com/customization/checksum/
checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
# https://goreleaser.com/customization/release/
release:
prerelease: true
draft: true
# https://goreleaser.com/customization/nfpm/
nfpms:
-
id: glider
- id: glider
package_name: glider
vendor: nadoo
homepage: https://github.com/nadoo/glider

View File

@ -101,7 +101,7 @@ glider -h
<summary>click to see details</summary>
```bash
glider 0.15.3 usage:
glider 0.16.0 usage:
-check string
check=tcp[://HOST:PORT]: tcp port connect check
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)
-dnsminttl int
minimum TTL value for entries in the CACHE(seconds)
-dnsnoaaaa
disable AAAA query
-dnsrecord value
custom dns record, format: domain/ip
-dnsserver value

View File

@ -242,6 +242,9 @@ dnscachesize=4096
# show query log of dns cache
dnscachelog=True
# disable AAAA queries
# dnsnoaaaa=True
# custom records
dnsrecord=www.example.com/1.2.3.4
dnsrecord=www.example.com/2606:2800:220:1:248:1893:25c8:1946

View File

@ -26,6 +26,7 @@ dnsserver=208.67.222.222:53
# - add ip/cidrs in rule files on startup
# - add resolved ips for domains in rule files by dns forwarding server
# Usually used in transparent proxy mode on linux
# Note: this will create 2 ipsets, glider for ipv4 and glider6 for ipv6
ipset=glider
# DESTINATIONS

View File

@ -18,7 +18,7 @@ import (
)
var (
version = "0.15.3"
version = "0.16.0"
config = parseConfig()
)

View File

@ -54,7 +54,7 @@ func NewConfFromFile(ruleFile string) (*Config, error) {
f.StringVar(&p.Strategy.IntFace, "interface", "", "source ip or source interface")
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.IP, "ip", nil, "ip")