diff --git a/Makefile b/Makefile index 685891f..5b0506e 100644 --- a/Makefile +++ b/Makefile @@ -10,18 +10,18 @@ log: @journalctl -f -xeu gowebd.service enable: - su -c "systemctl enable gowebd.service" + systemctl enable gowebd.service restart: - su -c "systemctl stop gowebd.service" - su -c "systemctl start gowebd.service" + systemctl stop gowebd.service + systemctl start gowebd.service run: git pull echo "build it!" GO111MODULE=off go build -v -x ./go.wit.com - # su -c "setcap 'cap_net_bind_service=+ep' go.wit.com" + # setcap 'cap_net_bind_service=+ep' go.wit.com # allow the binary to open ports below 1024 goimports: goimports -w *.go diff --git a/postinst b/postinst index b0f6fd0..e67e381 100755 --- a/postinst +++ b/postinst @@ -3,3 +3,6 @@ set -e cd /etc/gowebd/ ln -s /usr/share/gowebd/go.wit.com . + +# allow the binary to open ports below 1024 +setcap 'cap_net_bind_service=+ep' /usr/bin/go.wit.com