Omnifocus Web Dav Nginx Configuration

How to set up your own WebDav Server for Omnifocus syncing. 

OmniFocus is an excellent app. I've got both the Desktop and iOS versions and absolutely love how full-featured yet simple it is. The app's developers tout their own hosted sync server but have left open the option for a self-hosted sync server through the WebDAV protocol. Assuming you have an Ubuntu server running Nginx, here is how to set up WebDAV for syncing your OmniFocus database:

First, make sure you have apache's utilities installed

apt-get -y install apache2-utils

Create a basic apache .htpasswd file for securing your database:

htpasswd /etc/nginx/.htpasswd username

You will be asked for a password.

Next, make a folder for Nginx to serve your OmniFocus database from:

mkdir /var/www/omni.server.tld

Now add a Nginx config to /etc/nginx/sites-enabled:

server {
  server_name omni.server.tld;
  

  location / {
    auth_basic "Seriously boring stuff here. not worth your time.";
    auth_basic_user_file /etc/nginx/.htpasswd;
    root /var/www/omni.server.tld;
    client_body_temp_path /tmp;
    dav_methods PUT DELETE MKCOL COPY MOVE;
    dav_ext_methods PROPFIND OPTIONS;
    dav_access group:rw all:r;
  }

    listen 443 ssl; # managed by Certbot
    #ssl_certificate /etc/letsencrypt/live/omni.server.tld/fullchain.pem; # managed by Certbot
    #ssl_certificate_key /etc/letsencrypt/live/omni.server.tld/privkey.pem; # managed by Certbot
    #include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    #ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
    #if ($host = omni.server.tld) {
    #    return 301 https://$host$request_uri;
    #} # managed by Certbot


  listen 80;
  server_name omni.server.tld;
    return 404; # managed by Certbot


}

Make sure you

sudo nginx -t

and

sudo service nginx restart

Set up your DNS to point to the server you now have omni.server.tld on and then just point OmniFocus to the server name with the username and password you set up with apache utils. (This example has let's encrypt directives. You will need to run certbot and generate your own. I recommend the above configuration with forced https upgrade. No reason to have your database being transmitted over HTTP.)


{{ disqus( record.title ) }}
Written by Mark on Thursday March 15, 2018
Permalink -

« Fun with CSS - Take L-theanine with Your Coffee »