Skip to content

Commit

Permalink
Merge pull request #12 from dextercai/dev-1.5
Browse files Browse the repository at this point in the history
Dev 1.5
  • Loading branch information
dextercai authored Mar 23, 2023
2 parents 6755221 + c49a370 commit afa8c3e
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 15 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- "master"
- "dev-*"
tags:
- "v*"
pull_request:
Expand Down Expand Up @@ -39,7 +38,6 @@ jobs:
# go test ./...

- name: Build
if: startsWith(github.ref, 'refs/tags/')
env:
NAME: feeyo-adsb-golang
BINDIR: bin
Expand Down Expand Up @@ -69,8 +67,11 @@ jobs:

- name: Build and push
uses: docker/build-push-action@v4
if: startsWith(github.ref, 'refs/tags/')
with:
context: .
platforms: linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm64,linux/arm64/v8,linux/386,linux/arm/v6,linux/arm/v7,linux/s390x,linux/ppc64le
push: true
tags: dextercai/feeyo-adsb-golang:${{ github.ref_name }}
tags: |
dextercai/feeyo-adsb-golang:${{ github.ref_name }}
dextercai/feeyo-adsb-golang:latest
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,26 @@ vuIbGLhrKkjtFDC

## Docker 使用说明

TODO
docker仓库地址:https://hub.docker.com/r/dextercai/feeyo-adsb-golang

如您所见,我们为不同平台都提供了对应的docker镜像,并托管在了DockerHub仓库。

预编译架构列表:`linux/amd64,linux/arm64,linux/arm64/v8,linux/386,linux/arm/v6,linux/arm/v7,linux/s390x,linux/ppc64le`

### 使用Docker与文件配置(conf.ini)
```bash
docker run --net host \
-v /YOUR-PATH-OF/conf.ini:/app/conf.ini:rw -d \
dextercai/feeyo-adsb-golang:latest
```

### 使用Docker与命令行配置
```bash
docker run --net host \
dextercai/feeyo-adsb-golang:latest /app/feeyo-adsb-golang \
-use-file=false -feeyo-url=https://adsb.feeyo.com/adsb/ReceiveCompressADSB.php \
-ip=127.0.0.1 -port=30003 -uuid=YOUR-UUID
```

## Binary 使用说明

Expand Down
29 changes: 23 additions & 6 deletions adsb.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,37 @@ var err error
const eachPackage = 8192
const thisLogFlag = "main"

var confCheckFunc = map[string]func(tConf conf.TConf) bool{
"UUID为空": func(tConf conf.TConf) bool {
return tConf.UUID == ""
},
"UUID不满足16位标准长度": func(tConf conf.TConf) bool {
return len(tConf.UUID) != 16
},
"Dump1090地址配置为空": func(tConf conf.TConf) bool {
return tConf.IpDump1090 == ""
},
"Dump1090端口配置为空": func(tConf conf.TConf) bool {
return tConf.PortDump1090 == ""
},
"FeeyoUrl配置未空": func(tConf conf.TConf) bool {
return tConf.FeeyoUrl == ""
},
}

func main() {
fmt.Println("项目地址: https://github.com/dextercai/feeyo-adsb-golang")
fmt.Printf("当前版本:%s,编译时间:%s", constant.Version, constant.BuildTime)
fmt.Println("")
fmt.Println("敬告: 请不要尝试将相关电波数据传送至FR24, RadarBox, FA等境外平台, 这将严重违反无线电管理条例以及国家安全法!")
fmt.Println("=============================================================================================")
conf.ParseConf()
if conf.GlobalConfig.UUID == "" ||
len(conf.GlobalConfig.UUID) != 16 ||
conf.GlobalConfig.IpDump1090 == "" ||
conf.GlobalConfig.PortDump1090 == "" ||
conf.GlobalConfig.FeeyoUrl == "" {

log.Logger.Fatalf("配置中存在错误")
for item := range confCheckFunc {
fun := confCheckFunc[item]
if fun(conf.GlobalConfig) {
log.Logger.Fatalf("配置检查失败:%s", item)
}
}
for {
dump1090Conn, err := net.Dial("tcp", conf.GlobalConfig.IpDump1090+":"+conf.GlobalConfig.PortDump1090)
Expand Down
2 changes: 1 addition & 1 deletion ci/makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NAME=feeyo-adsb-golang
BINDIR=/build
VERSION=$(shell git describe --tags || echo "unknown version")
VERSION=$(shell git describe --tags || echo "unknown")
BUILDTIME=$(shell date "+%F %T %Z" -u)
GOBUILD=CGO_ENABLED=0 go build -trimpath -ldflags '-X "dextercai.com/feeyo-adsb-golang/constant.Version=$(VERSION)" \
-X "dextercai.com/feeyo-adsb-golang/constant.BuildTime=$(BUILDTIME)" \
Expand Down
4 changes: 2 additions & 2 deletions constant/version.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package constant

var (
Version = "unknown version"
BuildTime = "unknown time"
Version = "unknown"
BuildTime = "unknown"
)
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NAME=feeyo-adsb-golang
BINDIR=bin
VERSION=$(shell git describe --tags || echo "unknown version")
VERSION=$(shell git describe --tags || echo "unknown")
BUILDTIME=$(shell date "+%F %T %Z" -u)
GOBUILD=CGO_ENABLED=0 go build -trimpath -ldflags '-X "dextercai.com/feeyo-adsb-golang/constant.Version=$(VERSION)" \
-X "dextercai.com/feeyo-adsb-golang/constant.BuildTime=$(BUILDTIME)" \
Expand Down

0 comments on commit afa8c3e

Please sign in to comment.