From dac47cdcdfb37651ce5f42e93bf7a46ba3f58756 Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Thu, 21 Oct 2021 00:12:12 +0800 Subject: [PATCH] release: 0.1.0-rc --- Dockerfile | 11 +++--- Makefile | 51 +++++++++++++++++++++++++++- README.md | 6 +++- configui_0.0.1_darwin_amd64.tar.gz | Bin 0 -> 858 bytes configui_0.0.1_darwin_arm64.tar.gz | Bin 0 -> 858 bytes configui_0.0.1_linux_amd64.tar.gz | Bin 0 -> 858 bytes configui_0.0.1_windows_amd64.tar.gz | Bin 0 -> 45 bytes main.go | 2 +- 8 files changed, 63 insertions(+), 7 deletions(-) create mode 100644 configui_0.0.1_darwin_amd64.tar.gz create mode 100644 configui_0.0.1_darwin_arm64.tar.gz create mode 100644 configui_0.0.1_linux_amd64.tar.gz create mode 100644 configui_0.0.1_windows_amd64.tar.gz diff --git a/Dockerfile b/Dockerfile index ef8c2ca..c103a28 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,14 @@ FROM golang:1.17.2-alpine3.14 as builder RUN apk update && apk add --no-cache git tzdata WORKDIR /src -COPY go.mod go.sum /src/ -RUN go mod download + +# not using any libs, for now + +# COPY go.mod go.sum /src/ +# RUN go mod download COPY . . -RUN VERSION=$(git describe --tags) BUILD=$(git rev-parse --short HEAD) && \ +RUN VERSION=$(git describe --tags --abbrev=0) BUILD=$(git rev-parse --short HEAD) && \ GOOS=linux GOARCH=amd64 \ go build -ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD} -w" \ -o /go/bin/configui main.go @@ -16,4 +19,4 @@ EXPOSE 5080 ENV PATH="/go/bin:${PATH}" COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=builder /go/bin/configui /go/bin/configui -CMD ["/go/bin/configui"] \ No newline at end of file +CMD ["/go/bin/configui","-log","/var/log/configui.log","-f","/data/configui.json"] \ No newline at end of file diff --git a/Makefile b/Makefile index 3223ee5..458ffa2 100644 --- a/Makefile +++ b/Makefile @@ -5,9 +5,15 @@ HUB=hub.kumoly.io HUB_PROJECT=tools LDFLAGS=-ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD} -w" +PLATFORMS=darwin linux +ARCHITECTURES=amd64 +APPS=configui default: build +install: + npm install + clean: rm -rf dist @@ -17,4 +23,47 @@ run: build .PHONY: build build: npm run build - go build ${LDFLAGS} -o dist/${PROJ} \ No newline at end of file + go build ${LDFLAGS} -o dist/${PROJ} + + +build-unix: + $(foreach GOOS, $(PLATFORMS), $(foreach GOARCH, $(ARCHITECTURES), $(foreach APP, $(APPS),\ + $(shell export GOOS=$(GOOS); export GOARCH=$(GOARCH); go build ${LDFLAGS} -o dist/$(APP)) \ + $(shell cd dist; tar -czf ${APP}_$(VERSION)_$(GOOS)_$(GOARCH).tar.gz ${APP}) \ + $(shell rm dist/${APP}) \ + ))) + +build-win: + $(foreach APP, $(APPS), \ + $(shell export GOOS=windows; export GOARCH=amd64; go build ${LDFLAGS} -o dist/${APP}.exe) \ + $(shell cd dist; tar -czf ${APP}_$(VERSION)_windows_amd64.tar.gz ${APP}.exe) \ + $(shell rm dist/${APP}.exe) \ + ) + +build-mac-m1: + $(foreach APP, $(APPS),\ + $(shell export GOOS=darwin; export GOARCH=arm64; go build ${LDFLAGS} -o dist/$(APP)) \ + $(shell cd dist; tar -czf ${APP}_$(VERSION)_darwin_arm64.tar.gz ${APP}) \ + $(shell rm dist/${APP}) \ + ) + +.PHONY: binary +binary: build-unix build-win build-mac-m1 + +.PHONY: docker +docker: + docker build --target builder -t $(HUB)/$(HUB_PROJECT)/$(PROJ):builder . + docker build \ + -t $(HUB)/$(HUB_PROJECT)/$(PROJ):$(VERSION) \ + . + +docker-push: + docker tag $(HUB)/$(HUB_PROJECT)/$(PROJ):$(VERSION) $(HUB)/$(HUB_PROJECT)/$(PROJ):latest + docker push $(HUB)/$(HUB_PROJECT)/$(PROJ):$(VERSION) + docker push $(HUB)/$(HUB_PROJECT)/$(PROJ):latest + +docker-save: + docker save $(HUB)/$(HUB_PROJECT)/$(PROJ):$(VERSION) | gzip > dist/$(PROJ)-image-$(VERSION)-${BUILD}.tar.gz + + +release: clean binary docker docker-save \ No newline at end of file diff --git a/README.md b/README.md index de9d73d..37b5b41 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,10 @@ a web app to edit and action on update powered by [ACE](https://ace.c9.io/#nav=h ``` Usage: configui [options] + -allow string + IPs to allow, blank to allow all -bind string - address to bind (default "localhost:8000") + address to bind (default "0.0.0.0:8000") -c string cmd to apply -f string @@ -16,6 +18,8 @@ Usage: configui [options] alias of file -p string path to file, precedence over config + -static + disable config api -v show version ``` diff --git a/configui_0.0.1_darwin_amd64.tar.gz b/configui_0.0.1_darwin_amd64.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5fe1914e87658658eb05006b5fc3a57ea9020941 GIT binary patch literal 858 zcmV-g1Eu^QiwFP!000001MO8yPuoBc&ei@EQy(h3qK=a^AXVZ}K_5s!DiER)LS?bn z$+pg}Wv@#S;=gxhZ70U1sd_+F)%_0fYG!uko7W~*G8OYm3rSE8G8g;)d z2BTM_$z&33kD~D)8jU97XaLhER4{r|-VHdn> zRxUgvKR-BLi{oYDxvsv=IlRMhgi;q(tl`deJ~F)kAOX^WE8_Fo%TefExz3wRu(Gd| z3|Wve)4Rw~0!qb?MxTxU3hs^kfzs(_poB{|4dsUcySxz0ZR_WY8< zT+LMc6{rB=$@x*G`S;f1C93aTH?3q0ehM!r&j3z1OZ))*i_7a<&9}hRIiSSTkX(f) zhxqFUu9NVT7tl)2WY)?tvbhJZcR`gQc_iO{8dB}hLZn9hY!{@+$TgCjhaZu?&ZLhj zv~dcqt3r~6appSrZY!%Jpym<&=Y`PRCkv=k2QQ`SMqW6$Ag+tA;z=MOokO0Q~&x9QrokUW`HIe;OznGm5`bBF#LhO|&P0ZZJ>1>VjOF=`!y?ZAk?C>bsxW*ZzoObML}PR$MQU?DJOCW!ab`$G`o@WMN@pVPRom kVPRomVPRomVPRomVPRomVPRomVev=!0R!t8pa3WU02~pnYXATM literal 0 HcmV?d00001 diff --git a/configui_0.0.1_darwin_arm64.tar.gz b/configui_0.0.1_darwin_arm64.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5fe1914e87658658eb05006b5fc3a57ea9020941 GIT binary patch literal 858 zcmV-g1Eu^QiwFP!000001MO8yPuoBc&ei@EQy(h3qK=a^AXVZ}K_5s!DiER)LS?bn z$+pg}Wv@#S;=gxhZ70U1sd_+F)%_0fYG!uko7W~*G8OYm3rSE8G8g;)d z2BTM_$z&33kD~D)8jU97XaLhER4{r|-VHdn> zRxUgvKR-BLi{oYDxvsv=IlRMhgi;q(tl`deJ~F)kAOX^WE8_Fo%TefExz3wRu(Gd| z3|Wve)4Rw~0!qb?MxTxU3hs^kfzs(_poB{|4dsUcySxz0ZR_WY8< zT+LMc6{rB=$@x*G`S;f1C93aTH?3q0ehM!r&j3z1OZ))*i_7a<&9}hRIiSSTkX(f) zhxqFUu9NVT7tl)2WY)?tvbhJZcR`gQc_iO{8dB}hLZn9hY!{@+$TgCjhaZu?&ZLhj zv~dcqt3r~6appSrZY!%Jpym<&=Y`PRCkv=k2QQ`SMqW6$Ag+tA;z=MOokO0Q~&x9QrokUW`HIe;OznGm5`bBF#LhO|&P0ZZJ>1>VjOF=`!y?ZAk?C>bsxW*ZzoObML}PR$MQU?DJOCW!ab`$G`o@WMN@pVPRom kVPRomVPRomVPRomVPRomVPRomVev=!0R!t8pa3WU02~pnYXATM literal 0 HcmV?d00001 diff --git a/configui_0.0.1_linux_amd64.tar.gz b/configui_0.0.1_linux_amd64.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5fe1914e87658658eb05006b5fc3a57ea9020941 GIT binary patch literal 858 zcmV-g1Eu^QiwFP!000001MO8yPuoBc&ei@EQy(h3qK=a^AXVZ}K_5s!DiER)LS?bn z$+pg}Wv@#S;=gxhZ70U1sd_+F)%_0fYG!uko7W~*G8OYm3rSE8G8g;)d z2BTM_$z&33kD~D)8jU97XaLhER4{r|-VHdn> zRxUgvKR-BLi{oYDxvsv=IlRMhgi;q(tl`deJ~F)kAOX^WE8_Fo%TefExz3wRu(Gd| z3|Wve)4Rw~0!qb?MxTxU3hs^kfzs(_poB{|4dsUcySxz0ZR_WY8< zT+LMc6{rB=$@x*G`S;f1C93aTH?3q0ehM!r&j3z1OZ))*i_7a<&9}hRIiSSTkX(f) zhxqFUu9NVT7tl)2WY)?tvbhJZcR`gQc_iO{8dB}hLZn9hY!{@+$TgCjhaZu?&ZLhj zv~dcqt3r~6appSrZY!%Jpym<&=Y`PRCkv=k2QQ`SMqW6$Ag+tA;z=MOokO0Q~&x9QrokUW`HIe;OznGm5`bBF#LhO|&P0ZZJ>1>VjOF=`!y?ZAk?C>bsxW*ZzoObML}PR$MQU?DJOCW!ab`$G`o@WMN@pVPRom kVPRomVPRomVPRomVPRomVPRomVev=!0R!t8pa3WU02~pnYXATM literal 0 HcmV?d00001 diff --git a/configui_0.0.1_windows_amd64.tar.gz b/configui_0.0.1_windows_amd64.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..872c01559ea7ac2302b7d73ae653f7ad29f8981d GIT binary patch literal 45 qcmb2|=3oE==C=nKd4a4$3%>j3@|iDyhyuw5bLLt1WYrlo7#IN4*9i&$ literal 0 HcmV?d00001 diff --git a/main.go b/main.go index bd3758b..707cdf3 100644 --- a/main.go +++ b/main.go @@ -45,7 +45,7 @@ func init() { flag.StringVar(&flagAction, "c", "", "cmd to apply") flag.StringVar(&flagLogFile, "log", "", "log to file") flag.StringVar(&flagAllow, "allow", "", "IPs to allow, blank to allow all") - flag.StringVar(&flagBind, "bind", "localhost:8000", "address to bind") + flag.StringVar(&flagBind, "bind", "0.0.0.0:8000", "address to bind") flag.BoolVar(&flagNoReconfig, "static", false, "disable config api") flag.BoolVar(&flagVer, "v", false, "show version") flag.Usage = func() {