home · contact · privacy
In public server postinstall, set htwtxt binary bind capability.
[config] / jessie_postinstall.sh
index 3797c7dedf51d07a57862dcfa649e576d266a12e..939d6a4cef54a30ec78b76776180e27596faad2f 100755 (executable)
@@ -218,10 +218,12 @@ if [ "$1" = "server" ]; then
     elif [ "$2" = "public" ]; then
         # Set up twtxt environment.
         apt-get -y -t jessie-backports install golang
-        su plom -c 'git clone '\
-            'https://github.com/plomlompom/htwtxt $GOPATH/src/htwtxt'
-        su plom -c 'go get htwtxt'
-        su plom -c 'mkdir ~/htwtxt'
+        su - plom -c 'git clone '\
+'https://github.com/plomlompom/htwtxt $GOPATH/src/htwtxt'
+        su - plom -c 'go get htwtxt'
+        path=`su - plom -c 'echo $GOPATH/bin/htwtxt'`
+        setcap 'cap_net_bind_service=+ep' $path
+        su - plom -c 'mkdir ~/htwtxt'
     fi
 
 elif [ "$1" = "thinkpad" ]; then