prev. article next article

tuebix

10 Aug 2016

motivation

managing a ‘call for papers’ can be a lot of work. the tuebix cfp-software was created in the best practice of KISS.

tuebix

we held a linuxtag at the university of tübingen called tuebix and we had a talk about nixos and a workshop about nixops.

source

concept

the cfp-software backend is written in golang. the frontend was done in materializecss.

the workflow:

after the cfp is over, one can use jq to process the data for creating a schedule.

hosting

security wise it would be good to create a custom user for hosting which was not done here.

/home/joachim/cfp.sh

#!/bin/sh
source /etc/profile
cd /home/joachim/cfp
nix-shell --command "while true; do go run server.go ; done"

systemd job

systemd.services.cfp = {
  wantedBy = [ "multi-user.target" ];
    after = [ "network.target" ];
    serviceConfig = {
      #Type = "forking";
      User = "joachim";
      ExecStart = ''/home/joachim/cfp.sh'';
      ExecStop = ''
      '';
    };
};

reverse proxy

... 
# nixcloud.io (https)
{
  hostName = "nixcloud.io";
  serverAliases = [ "nixcloud.io" "www.nixcloud.io" ];

  documentRoot = "/www/nixcloud.io/";
  enableSSL = true;
  sslServerCert = "/ssl/nixcloud.io-2015.crt";
  sslServerKey = "/ssl/nixcloud.io-2015.key";
  sslServerChain = "/ssl/nixcloud.io-2015-intermediata.der";

  extraConfig = ''
    ...
    RewriteRule ^/cfp$ /cfp/ [R]
    ProxyPass /cfp/ http://127.0.0.1:3000/ retry=0
    ProxyPassReverse /cfp/ http://127.0.0.1:3000/
    ...
  '';
...

summary

using nix-shell it was easy to develop the software and to deploy it to the server. all dependencies are contained.

for further questions drop me an email: js@lastlog.de