/ howto

installing fennel on uberspace

fennel is a lightweight carddav / caldav server. it is completely written in javascript and runs within a node.js instance. it does have some dependencies regarding javascript libraries, but all of these can be installed with the help of the npm.

fennel project on github

disclaimer

fennel is in beta state and should be handled with care. this howto is based on the most recent version by today (2015-10-26).

installation

to install fennel, create a new directory and install fennel using npm:

$ git clone https://github.com/LordEidi/fennel.git
cd ~/fennel
npm install

you can use the short wait time to grab a cup of coffee. when you come back, fennel is installed.

configure fennel

authentication

here, i use htaccess to authenticate the user. please check the project's website on github for any other authentication methods.

i use apache's apr password format to save the password hash. read more about apache's password formats here: https://httpd.apache.org/docs/2.2/misc/password_encryptions.html

example user.htaccess file:

username:$apr1$qHDFfhPC$nITSVHgYbDAK1Y0acGRnY0

never use an online service to create a new password hash – you can't trust them. instead, use your trusted command prompt:

$ openssl passwd -apr1

type in your password, press enter, then verify your password. if both passwords match, you'll get a new line like this:

$apr1$qHDFfhPC$nITSVHgYbDAK1Y0acGRnY0

copy that entire line and create a new file to store the password hash:

$ nano user.htaccess

just type in your desired username, followed by a colon : (no space) and paste your password hash. if it looks like the example above, save the file and exit nano.

open a port

please change the port variable and point it to a port, which is not already in use on your uberspace server (i.e. 61469). this is how you can check, if your port is available:

$ netstat -tulpen | grep 61469

no response = port available

edit the config.js

edit the config file and change these three lines ($ nano config.js):

port: 8888,
[…]
auth_method_htaccess_file: 'demouser.htaccess',
[…]
db_storage: 'fennel.sqlite',

to this (use your port from above, and your uberspace username):

port: 61469,
[…]
auth_method_htaccess_file: '/home/YOURUSERNAME/fennel/user.htaccess',
[…]
db_storage: '/home/YOURUSERNAME/fennel/fennel.sqlite',

save the file and exit nano.

run the server

create a deamon to run the server:

$ uberspace-setup-service fennel node ~/fennel/server.js

a few seconds later, the fennel server starts up.

access server through subdomain

let's create a subdomain (change to fit your needs) and create a new .htaccess file to bind it to your port (chosen above):

$ mkdir /var/www/virtual/YOURUSERNAME/sub.domain.tld
$ nano /var/www/virtual/YOURUSERNAME/sub.domain.tld/.htaccess

contents of .htaccess (remember to set your port correctly):

RewriteEngine on
RewriteRule (.*) http://localhost:61469/$1 [P]

setup your client

use your favorite caldav and carddav clients and configure either protocols.

main picture by banku patchara, CC0 1.0 license