home · contact · privacy
Add htwtxt nginx proxy prototype.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 11 Apr 2016 22:44:17 +0000 (00:44 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 11 Apr 2016 22:44:17 +0000 (00:44 +0200)
bin/start_htwtxt.sh
dotfiles/user/thinkpad/minimal/xinitrc
jessie_postinstall.sh
systemfiles/nginx.conf [new file with mode: 0644]

index f3543a387de987313c5fbff1cade424e050775a1..e5ee45afc0c37f142eecba7766a73fc1a6ebebc6 100755 (executable)
@@ -4,5 +4,5 @@ $GOPATH/bin/htwtxt \
     --mailport 587 \
     --mailserver smtp.gmail.com \
     --mailuser christian.heller@gmail.com \
-    --port 80 \
+    --port 8000 \
     --signup
index 79065aa77c85bf227edda1c892a53cb3693e563c..5aca941b07f8cfc7821db2d548a2eb741d580f1d 100644 (file)
@@ -13,5 +13,8 @@ redshift -rl 53:13 &
 # Enforce QWERTZ.
 setxkbmap de
 
+# Set up compose key.
+xmodmap ~/.Xmodmap
+
 # Launch window manager.
 i3
index dfe3643ed1e96210c99386d0d3487445f217c801..000f8e41b2a1ef37402ccad3d095b6bdb1d47303 100755 (executable)
@@ -219,18 +219,19 @@ if [ "$1" = "server" ]; then
 
     elif [ "$2" = "public" ]; then
 
-        # Set up twtxt environment.
-        apt-get -y install screen
+        # Set up htwtxt environment.
+        apt-get -y install screen nginx
         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'
         path=`su - plom -c 'echo $GOPATH/bin/htwtxt'`
-        setcap 'cap_net_bind_service=+ep' $path
+        #setcap 'cap_net_bind_service=+ep' $path
         su - plom -c 'mkdir -p ~/htwtxt'
         cp config/systemfiles/htwtxt_restart_reminder.service \
             /etc/systemd/system/htwtxt_restart_reminder.service
         systemctl enable /etc/systemd/system/htwtxt_restart_reminder.service
+        cp config/systemfiles/nginx.conf /etc/nginx/nginx.conf
 
         # Set up plomlombot.
         apt-get -y install python3 python3-venv python3-pip
diff --git a/systemfiles/nginx.conf b/systemfiles/nginx.conf
new file mode 100644 (file)
index 0000000..5b9b028
--- /dev/null
@@ -0,0 +1,42 @@
+# system integration
+user www-data;
+pid /run/nginx.pid;
+
+# is expected even if empty
+events {
+}
+
+http {
+        # define content-type headers
+        types {
+            text/html                             html htm shtml;
+            text/css                              css;
+            text/xml                              xml;
+            text/plain                            txt;
+            text/plain                            sh;
+            application/xhtml+xml                 xhtml;
+        }
+        default_type application/octet_stream;
+        charset utf-8;
+
+        # logging
+       access_log /var/log/nginx/access.log;
+       error_log /var/log/nginx/error.log;
+
+        # file server
+        server {
+                location / {
+                        autoindex on;
+                        root /data/www;
+                }
+        }
+
+        # htwtxt
+        server {
+                listen 8080;
+                #server_name htwtxt.plomlompom.com;
+                location / {
+                        proxy_pass http://127.0.0.1:8000;
+                }
+        }
+}