Commit 421a3e9c authored by Sriram Karra's avatar Sriram Karra

Adding version 8 of initial configuration

parent 4dfda01c
// -*- javascript -*-
//
// Copyright (C) 2011, 2012, 2013, 2014, 2015 Sriram Karra <karra.etc@gmail.com>
//
// This file is part of ASynK
//
// ASynK is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero GPL (GNU AGPL) as published by the
// Free Software Foundation, version 3 of the License
//
// ASynK is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
// License for more details.
//
// You should have a copy of the license in the doc/ directory of ASynK. If
// not, see <http://www.gnu.org/licenses/>.
//
// //////
//
// This file contains static configuration information for the
// application. This filei s never written to by the application, and
// is read once during startup time. Modifying this file manually is
// OK, providied you know what you are doing, of course. However the
// changes will not take effect unless you restart the application.
{
// version 5: adding support for CardDAV datastores.
// Version 6: added a carddav logging flag
// Version 7: adding support for MS Exchange datastores.
// Version 8: adding gc server logging flag
'file_version' : 8,
// This prefix is attached to all the Group names, labels
// etc. that are created on Google, field names in BBDB etc.
'label_prefix' : 'asynk',
'label_separator' : ':',
// Regular expressions that define what a sync profile name, and a
// db ID specifier can be
'profile_name_re' : '([0-9a-zA-Z]+)',
'dbid_re' : '([a-z][a-z]+)',
// If any files have to be backed up automatically, this directory
// is used. The value should be a path relative to to
// asynk_user_dir - which is not a config varailble, but defaults
// to ~/.asynk or root of asynk or specified from command line
// with --user-dir
'backup_dir' : 'backups',
// Duration in days for holding backup files. Every run will check
// for older files and delete them if any are found
'backup_hold_period' : 7,
// Logs are written to this directory. Value should be a name
// relative to asynk_user_dir - which is not a config varailble,
// but defaults to ~/.asynk or root of asynk or specified from
// command line with --user-dir
'log_dir' : 'logs',
// Duration in days for holding log files. Every run will check
// for older files and delete them if any are found
'log_hold_period' : 7,
// When a profile is created it is populated with the following
// default values.
'profile_defaults' : {
'coll_1' : {
'dbid' : null, // Two letter DB specifier like 'bb', 'gc'
'stid' : null, // Store ID (See documentation)
'foid' : null, // Folder ID
},
'coll_2' : {
'dbid' : null,
'stid' : null,
'foid' : null,
},
'last_sync_start' : "1980-01-01T00:00:00.00+00:00",
'last_sync_stop' : "1980-01-01T00:00:00.00+00:00",
// Default direction in which to perform Sync. Values can
// be one of ['SYNC1WAY' or 'SYCN2WAY'].
'sync_dir' : "SYNC2WAY",
// conflict_resolve will be initialized to the value of coll_1
// unless explicitly overridded by the user
},
// There could be some db specific configurations that we would
// like to track. For e.g. for Google Contacts we could cache the
// default username so it does not have to be specified every
// time.
'db_config' : {
'ol' : {
// The following three fields are required for storing
// custom properties for outlook contact entries. ASynK
// stores two types of custom properties in the Outlook
// Store - sync tags, and user-defined custom properties
// (or properties from other sources that cannot be
// natively supported in Outlook). You definitely don't
// want to change these values.
// We need a uuid to uniquely identify our property
// set. This is our custom version of the standard
// PSETID_Address_GUID used by Outlook
'guid' : '{a1271100-ac2e-11e0-bc8b-0025644a821c}',
// GID is used to make up the custom property tag for
// storing the sync labels. Every profile gets assigned a
// different group ID (GID), and the GIDs are partitioned
// to make it easy to lookup in the database at a later
// stage if required.
'gid_base' : {'bb' : 0x8001,
'gc' : 0x9001,
'cd' : 0xA001,
'ex' : 0xB001,
},
// BBDB and Google allow a generic user defined property
// list. Outlook allows this but there is no easy way to
// view these user defined properties on the UI. As the
// user cannot see them in Outlook anyway, we will
// minimize our pain and just define a single custom
// propery, whose value will be a fully json encoded
// string, which can be read and written with ease and
// will keep us sane.
'cus_pid' : 0x6501,
// MS Outlook contact entries contain a lot of crap. The
// same information appears multiple times against
// different property tags. It is hard to understand which
// ones are really needed to keep Outlook working, and
// which are dispensible. We could create a copy of every
// property but it would bloat up your google contacts of
// your BBDB to ridiculous sizes. The following array
// lists out the Property Tags that we are really
// interested in. Everything else is ignored.
//
// ** IMPORTANT ** For some obscure (possibly historical)
// ** reasons Outlook has three types of properites -
// ** Tagged Properties, Named Properties with Numercial
// ** Identifiers, and Named Properties with a string
// ** name. The list below only includes Tagged
// ** propertes. I have not yet figured out a generic way
// ** to make Named Properties configurable. However be
// ** assured that the following Named Properties are
// ** added by default and cannot be changed:
//
// ** Email addresses
// ** Instant Messaging IDs
// ** Business Postal Address
//
// If you wish to know more about why Outlook wants to be
// so crazy: see here:
// http://msdn.microsoft.com/en-us/library/office/cc979184.aspx
// http://msdn.microsoft.com/en-us/library/office/bb905286.aspx
"sync_fields" : [
'PR_ENTRYID', 'PR_DEPARTMENT_NAME',
'PR_GIVEN_NAME', 'PR_SURNAME',
'PR_DISPLAY_NAME', 'PR_PRIMARY_TELEPHONE_NUMBER',
'PR_MIDDLE_NAME', 'PR_GENERATION',
'PR_DISPLAY_NAME_PREFIX', 'PR_MOBILE_TELEPHONE_NUMBER',
'PR_BODY', 'PR_HOME_TELEPHONE_NUMBER',
'PR_POSTAL_ADDRESS', 'PR_HOME2_TELEPHONE_NUMBER',
'PR_COMPANY_NAME', 'PR_BUSINESS_TELEPHONE_NUMBER',
'PR_TITLE', 'PR_BUSINESS2_TELEPHONE_NUMBER',
'PR_BIRTHDAY', 'PR_HOME_FAX_NUMBER',
'PR_NICKNAME', 'PR_BUSINESS_FAX_NUMBER',
'PR_GENDER', 'PR_PRIMARY_FAX_NUMBER',
'PR_PERSONAL_HOME_PAGE', 'PR_WEDDING_ANNIVERSARY',
'PR_BUSINESS_HOME_PAGE', 'PR_OTHER_TELEPHONE_NUMBER',
'PR_LAST_MODIFICATION_TIME', 'PR_CREATION_TIME',
'PR_COUNTRY_W', 'PR_STATE_OR_PROVINCE_W',
'PR_LOCALITY_W', 'PR_STREET_ADDRESS_W',
'PR_POSTAL_CODE_W', 'PR_POST_OFFICE_BOX_W',
'PR_HOME_ADDRESS_POST_OFFICE_BOX_W',
'PR_HOME_ADDRESS_STREET_W',
'PR_HOME_ADDRESS_CITY_W',
'PR_HOME_ADDRESS_STATE_OR_PROVINCE_W',
'PR_HOME_ADDRESS_COUNTRY_W',
'PR_HOME_ADDRESS_POSTAL_CODE_W',
'PR_OTHER_ADDRESS_POST_OFFICE_BOX_W',
'PR_OTHER_ADDRESS_STREET_W',
'PR_OTHER_ADDRESS_CITY_W',
'PR_OTHER_ADDRESS_STATE_OR_PROVINCE_W',
'PR_OTHER_ADDRESS_COUNTRY_W',
'PR_OTHER_ADDRESS_POSTAL_CODE_W',
],
// Outlook does not have support for labelled email
// addresses. There is no easy way to identify an email
// address as a Work Email, or a Home email, etc. Other
// PIMDBs have such support. If we do not do address this
// situation, we will lose information when we sync from
// google to outlook and back. In the longer term there is
// a plan to store a lot of meta information inside each
// record that can be used to reconstruct all the
// information even when the sync destination does not
// support the classes. But in the interim, here is a work
// around. The following config value allows you to
// specify full email domains that fall in each of your
// buckets. Edit this to your heart's content, and ensure
// there are no overlaps - if the same domain appears in
// more than one cateogry, the results are, at best,
// unspecified. Don't complain to me, ok?
"email_domains" : {
"home" : ['hotmail.com', 'gmail.com',
'yahoo.com', 'yahoo.co.uk', 'yahoo.co.in',],
"work" : [],
"other" : [],
}, // db_config['email_domans']
}, // db_config['ol']
'bb': {
// It is not possible for ASynK (or anyone else, for that
// matter), to identify, in the general case what encoding
// your BBDB is in - AND - to be able to parse it properly
// with the libarries we have at our disposal. As a work
// around, ASynK will try to parse your files with each of
// these in turn till we succeed, or we run out of
// encoings, which ever is earlier. PLEASE NOTE: You
// cannot put any 'known' encoding here, and hope it will
// work. Only those encodings that are available to the
// standard Python codecs library are supported.
text_encodings : ['utf-8', 'latin-1', 'iso-8859-1'],
// See above in 'ol'. this is the same stuff.
"email_domains" : {
"home" : ['hotmail.com', 'gmail.com',
'yahoo.com', 'yahoo.co.uk', 'yahoo.co.in',],
"work" : [],
"other" : [],
}, // db_config['email_domains']
// Postal addresses can have custom labels, which make it
// difficult to categorize them as Home, Business, etc. In
// the dictionary below, you can configure how your labels
// need to be bucketed. The key in the dictionary is the
// class, and the value is a list of regular expressions
// to match against the key. Noe as with email_domains
// above the behaviour is undefined if a reg exp matches
// more than one category.
"postal_map" : {
"home" : 'Home', // Home could be *anywhere* in the label
"work" : 'Work', // Note these are regular expressions
"other" : 'Price',
}, // db_config['bb']['postal_map']
// The "native" fields supported by BBDB are fairly
// limited, There is no standard way to represent
// websites, Instant Messaging contacts, birthdays, etc. -
// stuff that is available as native fields in Outlook as
// well as Google. However the 'notes' field is a generic
// associative list, and is used to store anything under
// the sun. In the following config parameter, you can
// specify which notes field are to be mapped to which
// 'standard' contact field in the other databases. Any
// notes field that does not appear here will be stored as
// a custom field without any mapping.
//
// The format is 'Standard Field' : 'BBDB Notes Field'
//
// Some fields, such as websites and fax numbers, can be
// present more htan once - i.e. there can be more one
// home website. In such instances, 'BBDB Notes Field' can
// be a regexp. Not that only the fields whose standard
// names end in _re are processed as regexes, and are
// matched against the note field name in BBDB.
"notes_map" : {
'fileas' : 'fileas',
'middle_name' : 'middle-name',
'prefix' : 'prefix',
'notes' : 'notes',
'birthday' : 'birthday',
'anniv' : 'anniversary',
'itemid' : 'bbdb-id',
'web_home_re' : 'Web.*Home', // Regexp
'web_work_re' : 'Web.*Work', // Regexp
'ims' : 'im-(.*)', // Regexp brackets are important.
'dept' : 'department',
'title' : 'title',
'gender' : 'gender',
'created' : 'creation-date',
'updated' : 'timestamp',
'folder' : 'folder',
},
// Phone numbers are stored as an array of vectors in BBDB
// Each element of the array has a label and a
// value. There is no built-in classification of the phone
// numbers into 'home', 'mobile, etc. The following map
// specifies this mapping. The label is matched against
// each of these regexes and whichever matches wins. If
// there is no match against any of the
"phones_map" : {
'phone_home' : 'Home', // Regexp
'phone_work' : 'Work', // Regexp
'phone_mob' : 'Mobile', // Regexp
'fax_home' : 'Fax.*Home', // Regexp
'fax_work' : 'Fax.*Work', // Regexp
'fax_other' : 'Fax.*Other', // Regexp
'phone_other' : '.*', // Default Regexp
},
}, // db_config['bb']
'gc' : {
// See above for 'bb'
"postal_map" : {
"home" : 'Home', // Home could be *anywhere* in the label
"work" : 'Work', // Note these are regular expressions
"other" : 'Other',
}, // db_config['postal_map']
// Enables request/response logging in the Apple
// caldavclientlibrary. Useful to see comms between ASynK
// and the carddav server
'log' : false
},
'cd' : {
// Enables request/response logging in the Apple
// caldavclientlibrary. Useful to see comms between ASynK
// and the carddav server
'log' : false
},
'ex' : {
// See above in 'ol'. this is the same stuff.
// You definitely don't want to change these values.
// Note this guy is missing braces
'guid' : 'c950b7d3-ca13-43cd-9e78-be65bbdeaf37',
// 'gid_base' : {'bb' : 0x8001,
// 'gc' : 0x9001,
// 'cd' : 0xA001,
// 'ol' : 0xC001,
// },
'cus_pid' : 0x6501,
'stags_pname' : 'sync_tags',
'sync_state' : null, // base64 encoded EWS sync_state ID
// You can customize what follows
"email_domains" : {
"home" : ['hotmail.com', 'gmail.com',
'yahoo.com', 'yahoo.co.uk', 'yahoo.co.in',],
"work" : [],
"other" : [],
}, // db_config['email_domains']
},
}, // 'db_config'
}
// Some debug output I gathered to print out the numeric value
// corresponding to the tag name. Recall that MAPI uses numeric
// property tags in the data store
// DEBUG:root:PR_DISPLAY_NAME : 0x3001001f
// DEBUG:root:PR_ENTRYID : 0x fff0102
// DEBUG:root:PR_COMMENT : 0x3004001f
// DEBUG:root:PR_POSTAL_ADDRESS : 0x3a15001f
// DEBUG:root:PR_STREET_ADDRESS : 0x3a29001f
// DEBUG:root:PR_COMPANY_NAME : 0x3a16001f
// DEBUG:root:PR_TITLE : 0x3a17001f
// DEBUG:root:PR_DEPARTMENT_NAME : 0x3a18001f
// DEBUG:root:PR_OFFICE_LOCATION : 0x3a19001f
// DEBUG:root:PR_PRIMARY_TELEPHONE_NUMBER : 0x3a1a001f
// DEBUG:root:PR_MOBILE_TELEPHONE_NUMBER : 0x3a1c001f
// DEBUG:root:PR_HOME_TELEPHONE_NUMBER : 0x3a09001f
// DEBUG:root:PR_BUSINESS_TELEPHONE_NUMBER : 0x3a08001f
// DEBUG:root:PR_COUNTRY : 0x3a26001f
// DEBUG:root:PR_EMAIL_ADDRESS : 0x3003001f
// DEBUG:root:PR_EMAIL_ADDRESS_A : 0x3003001e
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment