Subsonic with Caddy

Ok, now that there is Let's Encrypt, I thought that I shouldn’t have to do this certificate hackery all the time when Subsonic updates or the StartSSL certificate expires.

Caddyserver is the first Webserver/Proxy that I found that has most of the process automated and build in, so I’m using this. Getting started with this was pretty straightforward: Download, expand,  create a config file and before you start up, make sure that Caddy can run on port 80 without requiring to be root:

sudo setcap cap_net_bind_service=+ep ./caddy

My Caddyfile eventually ended up looking like this:

server.mydomain.de {
 proxy / localhost:4040 {
 proxy_header Host server.mydomain.de
 proxy_header Scheme https
 }

Well, it turned out to not be quite as easy. First I also had to make Subsonic stop hogging port 443. Those settings are found in /etc/default/subsonic. And while you’re at it, also edit out any certificates you may have added earlier in /usr/bin/subsonic. Oh, and make sure to note down which port non-https Subsonic runs, hopefully not 80, because Caddy needs that! I may have chosen 4040.

Restart Subsonic and make sure that you can reach it on the correct ports.

As stated, Caddy also needs to run on Port 80 for a brief moment. This is so it can do the certificate domain validation process. So edit your /etc/apache2/ports.conf to make sure not to block anything.

Restart apache2.

Now, to find out if everything works, start Caddy. If all is good, you’ll see a glorious all-ok message and can now access the server via https with a valid certificate.

But as you’ve undoubtedly noticed, Caddy isn’t running as a service yet. Thankfully Ubuntu has Upstart. So, add in a new file /etc/init/caddyservice.conf (thank you Mathias):

description "Caddy Server startup script"
author "Mathias Beke"
start on runlevel [2345]
stop on runlevel [016]
setuid runasme
setgid runasme
respawn
respawn limit 10 5
script
 cd /home/runasme/
 exec ./caddy

At this point I want to take a short moment to mention that whoever thinks that the Upstart Cookbook is an easy entry-level document is clearly out of their mind. Seriously, this „Cookbook“ has a whole chapter named „Critique of the System V init System“!

But I digress. If you don’t make the same mistake as me and confuse init with init.d, then you’re golden and now have a Caddy running as a service, forwarding requests to your Subsonic installation.

The only issue I haven’t been able to solve is that Subsonic has some stupid static URL linking going on so I have to open the settings in a new tab. But I can live with that.

Third-Party Certificate for Subsonic on Linux

This is more a reminder-post for myself, than anything else, because every year my StartSSL-Certificate expires, I need to redo this and have to look it up anew. It is based on the basically excellent writeup at fatframe.com, which has a few tiny errors and does not include the info on how to use a non-standard password. (This info I got here at konkretor. Thanks!)

  1. Get a free certificate here.
  2. Once you receive your certificate you will need to combine the private key, server cert, and intermediate certs into one file. Simply open all three in a text editor and copy/paste everything into a new text file without any blank lines. I added mine in the following order:
    Private Key (myserver.key)
    Server Certificate (myserver.ssl)
    Intermediate Certificate (sub.class1.server.ca.pem)
  3. Save this text file as subsonic.crt. Do not mess this up as I did on the first try by using cat in the wrong way, as every new part should start at a new line.
  4. Next, convert the cert from PEM to PKCS12 format using the following command. Choose any password you like. In fact, do not choose the default password of „subsonic“. Memorize that password:
    openssl pkcs12 ‑in subsonic.crt ‑export ‑out subsonic.pkcs12
  5. Use Keytool to import this new keystore:
    keytool ‑importkeystore ‑srckeystore subsonic.pkcs12 ‑destkeystore subsonic.keystore ‑srcstoretype PKCS12 ‑srcalias 1 ‑destalias subsonic
  6. use zip to import the new keystore into the subsonic jar:
    sudo zip /usr/share/subsonic/subsonic-booter-jar-with-dependencies.jar subsonic.keystore
  7. Now tell subsonic the new non-generic password:
    1. open the subsonic starter:
      sudo nano /usr/bin/subsonic
    2. insert a line with the new password and save, at line 113ish (press alt+c to see line numbers)
      -Dsubsonic.ssl.password=123456 \
  8. Restart subsonic, and enjoy your custom SSL certifcate:
    sudo service subsonic restart

That’s all Folks!

GateKeeper — first impressions

keychain-dongleEarly this year, I backed the GateKeeper — a small dongle that locks and unlocks my PC based on proximity. The general idea is that you clip a small bluetooth sender to your belt, and a dongle on your PC checks the signal strength to determine how close you are to it.

By now, the small black box has arrived, and I’ve done a bit of testing with it. The good news: It works.

The bad? It’s a bit fiddly. The USB dongle is, at least in my opinion, at the same time way too big and way too fragile looking. The dongle that you’re supposed to take with you is also not as tiny as hoped, although small enough. But my main gripe is with the usability.

Of course, the signal strength of a small bluetooth emitter will vary. If there are keys in the path between sender and receiver (likely, if you add it to your keychain), if you move, if other signals interfere — then you may suddenly find your computer locking up in the middle of your work. You can adjust the sensitivity, but then you may find that you can walk a bit too far for your liking before your computer gets locked.

usb-dongleAlso, the Android app appears to be still in quite a beta state, I didn’t find it very usable.

But this is just my first day of testing, and apart from that, things work quite nicely: My system locks when I leave it, and it unlocks when I come back, although sometimes with a slight delay. At the moment, I think it’s more of a convenience thing than a real security tool. If, for example, the USB dongle gets removed, or the software tool gets stopped, your computer won’t lock or unlock automatically anymore. And it does take a small leap of faith to just walk away from ones workstation, assuming/hoping that it’ll lock.

At roughly 50$, it sits exactly at that awkward price point where it is slightly too expensive for simple gimmickry while it is not that a security boon to those who are willing to spend that money (meaning: Big Companies).

virtualisiertes 3D

Vor einem Monat postete ich Hardware-Porn in meinem Google Plus Stream:

nvidia GRID

Diese nvidia GRID Grafikkarte besitzt keinen Grafikausgang. Nix da mit HDMI, VGA, DVI oder sonstwas. Denn sie dient einzig und allein der Bereitstellung von 3D-Grafik innerhalb einer virtuellen Maschine.

Gebraucht wird das innerhalb eines Maschinenbaubetriebes, der zumindest Teile seiner CAD-Konstruktionsarbeitsplätze virtualisieren will. Dieses beeindruckend große Stück Hardware liefert eine grob äquivalente Grafikleistung wie zwei herkömmlicher Quaddro-Grafikkarten (von denen eine zum Vergleich auf dem Bild zu sehen ist).

Zusätzlich findet sich eine Unterstützung für eine Echtzeitkomprimierung des so erzeugten Videostreams, sowie Treiber, welche die GPU komplett virtualisieren. Im Endeffekt kann also eine Karte von zwei bis 32 Anwendern verwendet werden — je nach konkreter Leistungsanforderung.

Leider ist die Karte auch dementsprechend beeindruckend teuer: Insgesamt verdoppelt die Virtualisierung den Gesamtpreis pro Arbeitsplatz, verglichen mit einer herkömmlichen 3D-Workstation mit maximaler Grafikleistung. Müsste man nicht die maximale Leistung abrufen, sähe das wohl besser aus.

Inzwischen sind nun zwei dieser Karten dennoch im Live-Betrieb und erlauben vier Konstrukteuren ein flüssiges Arbeiten über eine handelsübliche ADSL-WAN-Strecke. Bisher mussten Freiberufler, die bei einzelnen Projekten des Kunden mitarbeiten, stets aufwändig mit einer gesondert gesicherten Workstation ausgestattet werden, inkl. VPN-Tunnel über den die ziemlich großen CAD-Dateien mühsam heruntergeladen wurden.

Stattdessen brauchen sie nun nur noch einen Client auf ihrem eigenen Computer installieren und können sofort loslegen. Und zwar ohne, daß die wertvollen Konstruktionsdaten das sichere Netzwerk der Firma verlassen müssten.

Dieser Gewinn an Sicherheit und Flexibilität ist dem Kunden genug wert, um den Mehrpreis zu gerechtfertigen.