Commit Graph

56 Commits

Author SHA1 Message Date
flan
2a27d78591 Use config specified in argv[1] 2017-11-06 21:06:45 +01:00
flan
59f28faa1e Use mapping protocol access instead of legacy configparser API 2017-11-06 21:06:18 +01:00
flan
354354ca72 Make built-in server actually use the "host" config field 2017-11-06 17:36:00 +01:00
flan
ca106e6136 Clean up imports 2017-11-06 17:27:13 +01:00
flan
7d1a222501 Remove redundant except block
ValueError is handled in _decode_data() already
2017-11-06 17:06:49 +01:00
flan
e97a11edb4 Make spacing more consistent 2017-11-06 16:56:13 +01:00
flan
9ffd380e64 Make it possible to use hooks before and after every sync operation
Excluding media sync.
2017-11-05 23:34:49 +01:00
flan
65bef264be Use int instead of str for the response code 2017-11-05 22:17:37 +01:00
flan
978b1d7371 Make _check_zip_data() and _adopt_media_changes_from_zip() take a ZipFile 2017-11-04 18:42:21 +01:00
flan
0e5bbf4f9e Use more with statements 2017-11-04 18:41:56 +01:00
flan
c9c02d3253 Resolve relative paths and symlinks before opening auth/session DB 2017-11-04 04:22:06 +01:00
flan
024e76423d Explicitly convert str and bytes where needed 2017-11-04 04:11:48 +01:00
flan
3d6a2a639a Remove explicit inherits from object 2017-11-04 02:53:52 +01:00
flan
32b82d5803 Fix up some changes made by 2to3 2017-11-04 02:53:49 +01:00
flan
0cc21101d7 2to3 everything 2017-11-04 02:06:42 +01:00
flan
c08fb74d91 Enable logging 2017-11-04 01:53:44 +01:00
flan
9451d4df95 Remove redundant Response wraps 2017-11-03 02:18:28 +01:00
flan
5ec0dd7418 Remove redundant json.dumps() calls 2017-11-03 01:49:18 +01:00
flan
2ca7c596e3 Run msync handlers the same way as sync ones 2017-11-03 01:46:38 +01:00
flan
d2bbb7150c Remove unused vars 2017-11-03 01:40:39 +01:00
flan
8e13c92b6e Use less from imports 2017-11-03 00:20:24 +01:00
flan
c1b88c24f9 Make JSON check less lame 2017-11-03 00:19:52 +01:00
flan
910e557776 Rename username2dirname() to userdir() 2017-11-03 00:17:22 +01:00
flan
33868f013d Don't assume a non-SyncCollectionHandler operation is handled by SyncMediaHandler 2017-11-03 00:17:22 +01:00
flan
a52c213088 Make operation_download() and operation_hostKey() return response body
This is more consistent, as all other handlers do the same.
2017-11-03 00:17:16 +01:00
flan
6e84242cc5 Use logging.warn() instead of print() for the auth warning 2017-11-01 19:56:38 +01:00
flan
17331136ca Use print functions everywhere 2017-11-01 19:48:35 +01:00
flan
cb18fcb04a Move old_client() outside classes 2017-11-01 19:48:03 +01:00
flan
97382f3eb8 Fix check for AnkiDroid 2.3 2017-11-01 18:06:13 +01:00
flan
85c9b85c1f Make _old_client() support alphas/betas 2017-11-01 17:43:47 +01:00
flan
2dc1f28b04 Move version checks to a separate function, add test 2017-11-01 16:49:07 +01:00
flan
8195e58e3b Make parts of SyncUserSession more readable 2017-11-01 15:36:37 +01:00
flan
765cce3d74 Move hostKey handling to a separate function 2017-10-30 19:23:32 +01:00
Christoph Mack
c7d7ff3e85 Merge SyncApp's SqliteUserManager and the newly introduced UserManager and group all user managers in user_managers.py. 2017-10-28 22:45:27 +02:00
flan
99adc658d5 Remove support for legacy modules 2017-10-28 20:43:24 +02:00
Christoph Mack
2cb5871ba3 Safer handling of uploaded database files during full sync.
Before overwriting its version of a user's collection database file with one uploaded by the client, the server now performs a basic integrity check using SQLite's 'pragma integrity_check'.
2017-10-28 20:02:59 +02:00
Christoph Mack
f3788fc2c8 fix syntax error causing failure in error handler in SyncMediaHandler._remove_media_files() 2017-10-28 19:58:34 +02:00
flan
67830218eb Drop support for Anki <2.0.27 2017-10-28 19:55:50 +02:00
flan
ceb931519d Bring back authentication 2017-10-28 19:55:40 +02:00
flan
48cfa9a029 Remove unused lines 2017-10-28 18:25:23 +02:00
flan
bd2c5bdff9 Remove SSL support
If there's a need for SSL, you can always use a reverse proxy or
a more advanced WSGI server.

This reverts commit 1678890d3d.
2017-10-28 05:50:18 +02:00
jdoe0
c398ccdb89 Apply @ndl's patches
The patches fix the issue where syncing across different profiles will
always trigger a full sync if there's any change in either of the
profiles.
2016-11-03 22:32:19 +07:00
jdoe0
1678890d3d Add SSL support 2016-06-25 23:59:59 +07:00
Christoph Mack
e32bceccf3 Not only add, but also remove files when adopting changes to client media files in SyncMediaHandler.uploadChanges().
Count added and removed files as processed and increment media usn accodingly.
Refactor SyncMediaHandler.uploadChanges().
2016-04-05 23:24:12 +07:00
Christoph Mack
87ee726d25 Define skey once when creating user session, not each time when beginning media sync. 2016-04-05 23:24:00 +07:00
Christoph Mack
1b1a3d8e22 Define a random skey to return to the client when media syncing begins, so we don't send a null skey value. 2016-04-05 23:21:05 +07:00
Christoph Mack
f03aea67c1 SyncMediaHandler.begin(): return media database usn instead of collection database usn.
If the wrong usn is returned, media syncing on the client will not finish with status "noChanges" even if there have been no changes since the last media sync.
2016-01-24 01:54:35 +07:00
jdoe0
3baad9cfac Fix syncing with AnkiDroid 2015-11-29 11:53:58 +07:00
jdoe0
ab40509cb2 Add missing function _execute_handler_method_in_thread() 2015-11-27 12:17:49 +07:00
jdoe0
8066fba1fe Update for Anki >= 2.0.27
This breaks compatibility with Anki < 2.0.27
2015-11-27 12:17:49 +07:00