Wiki

Clone wiki

qscollect / Configuration

Configuration of QSCollect

The configuration story is still a bit rough, but I'll explain it here a bit.

config.json

#!javascript
{
  "collectors": [
     "qscollect.collectors.omnifocus.collector.OmniFocusCollector",
     "qscollect.collectors.imap.IMAPCollector",
  ],
  "main": {
    "tick": 1
  }
}

The above is the default configuration file that comes with qscollect. It loads the OmniFocus collector, and the imap collector. There are the only two that exist currently, but more will be added as time goes on.

main.tick is how often to check for scheduled jobs. Both of the collectors are scheduled on an hourly basis, but the tick needs to check the queue to see which ones to process. This is in seconds, and could be set to a minute or longer.

Collector Configurations

Collectors store their configuration inside of the keys collection in the mongo database qs. Each collector has a provider, name pair that identifies their configuration information.

Provider is for a specific provider type. Right now, the two collectors just use file which means, do nothing special. In the future, I plan to support oauth for authorizing and authenticating via oauth.

OmniFocus Collector

The OmniFocus collector keeps track of all of the changes that occur in your task list. In order to use this, you must setup webdav syncing and have the Omnifocus.ofocus directory accessible to the server that is running qscollect. You could sync via dropbox also, but webdav is what I'm using since it allows syncing with the mobile devices.

Armed with the path to the ofocus directory, connect to mongo and do the following:

#!javascript

use qs
db.keys.save({"provider": "file", "name": "omnifocus", "ofocus_file": "/home/webdav/data/OmniFocus.ofocus"})

This will create the necessary document for the ofocus collector to work.

IMAP Collector

Thie IMAP collector current keys track of the total and the unread message counts in your INBOX folder on an IMAP server. I use this for gmail. It's a little more complicated to setup, but not too bad.

Create a file called .imap_passwd and chmod it 600 so that no one can read it but you. I store mine in my home directory.

Then connect to mongo and do the following:

#!javascript

use qs
qs.keys.save({
  "ssl": true,
  "server": "imap.gmail.com",
  "port": "993",
  "password_path": "/home/rhay/.imap_passwd",
  "username": "your_email_address@gmail.com",
  "provider": "file",
  "name": "imap"})

This will set you up.

qscollect-withings

qscollect-withings uses the new Configuration command line tool to insert the necessary keys into the database. It's easy to run:

#!bash
qsconfig withings <key> <secret>

Simple. Since it uses oauth, you need to login and create an app on withings site, and then use the key and secret from your app here.

Updated