summaryrefslogtreecommitdiffstats
path: root/packages/net-misc/mozilla-sync/files
diff options
context:
space:
mode:
Diffstat (limited to 'packages/net-misc/mozilla-sync/files')
-rw-r--r--packages/net-misc/mozilla-sync/files/SyncServer.ini.example66
-rw-r--r--packages/net-misc/mozilla-sync/files/SyncServer.wsgi14
2 files changed, 80 insertions, 0 deletions
diff --git a/packages/net-misc/mozilla-sync/files/SyncServer.ini.example b/packages/net-misc/mozilla-sync/files/SyncServer.ini.example
new file mode 100644
index 0000000..9873a3b
--- /dev/null
+++ b/packages/net-misc/mozilla-sync/files/SyncServer.ini.example
@@ -0,0 +1,66 @@
+[DEFAULT]
+debug = False
+translogger = False
+profile = False
+
+[server:main]
+use = egg:Paste#http
+host = 0.0.0.0
+port = 5000
+use_threadpool = True
+threadpool_workers = 60
+
+[app:main]
+use = egg:SyncServer
+configuration = file:/etc/mozilla-sync/sync.conf
+
+#
+# logging
+#
+[loggers]
+keys = root,syncserver
+
+[handlers]
+keys = global,syncserver,syncserver_errors
+
+[formatters]
+keys = generic
+
+[logger_root]
+level = WARNING
+handlers = global
+
+[logger_syncserver]
+qualname = syncserver
+level = ERROR
+handlers = syncserver,syncserver_errors
+propagate = 0
+
+[logger_syncserver_errors]
+qualname = syncserver
+level = ERROR
+handlers = syncserver_errors
+propagate = 0
+
+
+[handler_global]
+class = StreamHandler
+args = (sys.stderr,)
+level = DEBUG
+formatter = generic
+
+[handler_syncserver]
+class = StreamHandler
+args = (sys.stderr,)
+level = INFO
+formatter = generic
+
+[handler_syncserver_errors]
+class = handlers.RotatingFileHandler
+args = ('/tmp/sync-error.log',)
+level = ERROR
+formatter = generic
+
+[formatter_generic]
+format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
+datefmt = %Y-%m-%d %H:%M:%S
diff --git a/packages/net-misc/mozilla-sync/files/SyncServer.wsgi b/packages/net-misc/mozilla-sync/files/SyncServer.wsgi
new file mode 100644
index 0000000..32beed2
--- /dev/null
+++ b/packages/net-misc/mozilla-sync/files/SyncServer.wsgi
@@ -0,0 +1,14 @@
+import os
+import sys
+import site
+from logging.config import fileConfig
+from ConfigParser import NoSectionError
+
+ini_file = os.path.join('/etc/mozilla-sync/SyncServer.ini')
+try:
+ fileConfig(ini_file)
+except NoSectionError:
+ pass
+
+from paste.deploy import loadapp
+application = loadapp('config:%s'% ini_file)