From: Christian Heller <c.heller@plomlompom.de>
Date: Mon, 11 Apr 2016 22:44:17 +0000 (+0200)
Subject: Add htwtxt nginx proxy prototype.
X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/reset_cookie?a=commitdiff_plain;h=46c2911ac60e09492b90b1aaa5be456a2aff6b44;p=config

Add htwtxt nginx proxy prototype.
---

diff --git a/bin/start_htwtxt.sh b/bin/start_htwtxt.sh
index f3543a3..e5ee45a 100755
--- a/bin/start_htwtxt.sh
+++ b/bin/start_htwtxt.sh
@@ -4,5 +4,5 @@ $GOPATH/bin/htwtxt \
     --mailport 587 \
     --mailserver smtp.gmail.com \
     --mailuser christian.heller@gmail.com \
-    --port 80 \
+    --port 8000 \
     --signup
diff --git a/dotfiles/user/thinkpad/minimal/xinitrc b/dotfiles/user/thinkpad/minimal/xinitrc
index 79065aa..5aca941 100644
--- a/dotfiles/user/thinkpad/minimal/xinitrc
+++ b/dotfiles/user/thinkpad/minimal/xinitrc
@@ -13,5 +13,8 @@ redshift -rl 53:13 &
 # Enforce QWERTZ.
 setxkbmap de
 
+# Set up compose key.
+xmodmap ~/.Xmodmap
+
 # Launch window manager.
 i3
diff --git a/jessie_postinstall.sh b/jessie_postinstall.sh
index dfe3643..000f8e4 100755
--- a/jessie_postinstall.sh
+++ b/jessie_postinstall.sh
@@ -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
index 0000000..5b9b028
--- /dev/null
+++ b/systemfiles/nginx.conf
@@ -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;
+                }
+        }
+}