parent
28e0f09a27
commit
507a8117e1
21
Makefile
21
Makefile
|
@ -1,8 +1,13 @@
|
||||||
|
.PHONY: build
|
||||||
|
|
||||||
VERSION = $(shell git describe --tags)
|
VERSION = $(shell git describe --tags)
|
||||||
|
|
||||||
all:
|
all:
|
||||||
@echo "make run # will build and run the daemon here"
|
@echo "make build # build"
|
||||||
|
@echo "make clean # clean build files"
|
||||||
|
@echo "make run # build and run on port 2233"
|
||||||
@echo "make debian # will build a debian package"
|
@echo "make debian # will build a debian package"
|
||||||
|
@echo ""
|
||||||
@echo "make restart # restart the daemon"
|
@echo "make restart # restart the daemon"
|
||||||
@echo "make enable # enable daemon on boot"
|
@echo "make enable # enable daemon on boot"
|
||||||
@echo "make log # watch the daemon log"
|
@echo "make log # watch the daemon log"
|
||||||
|
@ -18,10 +23,18 @@ restart:
|
||||||
systemctl stop gowebd.service
|
systemctl stop gowebd.service
|
||||||
systemctl start gowebd.service
|
systemctl start gowebd.service
|
||||||
|
|
||||||
run:
|
start:
|
||||||
git pull
|
systemctl start gowebd.service
|
||||||
|
|
||||||
|
stop:
|
||||||
|
systemctl stop gowebd.service
|
||||||
|
|
||||||
|
build:
|
||||||
echo "build it!"
|
echo "build it!"
|
||||||
GO111MODULE=off go build -v -x -ldflags "-X main.Version=${VERSION} -X gui.GUIVERSION=${VERSION}"
|
# 2024/11/06 14:41:29 path = /home/jcarr/go/src/go.wit.com/apps/gowebd cmd = go build -v -x -ldflags -X main.VERSION=0.22.2-3-g28e0f09-dirty -ldflags -X main.GUIVERSION=0.22.2-3-g28e0f09-dirty
|
||||||
|
GO111MODULE=off go build -v -x -ldflags "-X main.VERSION=${VERSION} -X gui.GUIVERSION=${VERSION}"
|
||||||
|
|
||||||
|
run: build
|
||||||
./gowebd --port 2233
|
./gowebd --port 2233
|
||||||
# setcap 'cap_net_bind_service=+ep' gowebd # allow the binary to open ports below 1024
|
# setcap 'cap_net_bind_service=+ep' gowebd # allow the binary to open ports below 1024
|
||||||
|
|
||||||
|
|
2
args.go
2
args.go
|
@ -18,7 +18,7 @@ type args struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (args) Version() string {
|
func (args) Version() string {
|
||||||
return "gowebd " + Version
|
return "gowebd " + VERSION
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
4
main.go
4
main.go
|
@ -11,7 +11,9 @@ import (
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
var Version string
|
// are sent via -ldflags at buildtime
|
||||||
|
var VERSION string
|
||||||
|
var GUIVERSION string
|
||||||
|
|
||||||
//go:embed resources/*
|
//go:embed resources/*
|
||||||
var resources embed.FS
|
var resources embed.FS
|
||||||
|
|
1
postinst
1
postinst
|
@ -2,7 +2,6 @@
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
cd /etc/gowebd/
|
cd /etc/gowebd/
|
||||||
ln -s /usr/share/gowebd/go.wit.com .
|
|
||||||
|
|
||||||
# allow the binary to open ports below 1024
|
# allow the binary to open ports below 1024
|
||||||
setcap 'cap_net_bind_service=+ep' /usr/bin/gowebd
|
setcap 'cap_net_bind_service=+ep' /usr/bin/gowebd
|
||||||
|
|
Loading…
Reference in New Issue