Commit graph

346 commits

Author SHA1 Message Date
rr-
fd30675124 server/image-hash: do not depend on image-match
While I hold this library in great esteem for its excellent work on
implementing the original paper, I have several problems with it:

- as of this commit, it (again) has bug fixes unreleased on pip
- its code is badly structured
    - forces OOP and then proceeds @staticmethod everything
    - bad class design, parameters are repeated in several places
    - terrible contract of make_record() and generate_signature()
    - ambiguous parameters: path vs. image path vs. image content
    - doesn't adhere to PEP-8
- depends on cairo just to render svg images almost no one uses this
  library with
2017-02-03 21:20:52 +01:00
rr-
894cd29511 server/tests: test image hash 2017-02-03 19:53:10 +01:00
rr-
b21ffac820 server/scripts: make pytest happier 2017-02-03 19:22:33 +01:00
rr-
f828c375e6 server/posts: fix reverse search late evaluation
Uploading webms caused 'Not an image.' error to be shown, cause
generators are evaluated lazily, so the `catch` never worked.
2017-02-02 21:52:52 +01:00
rr-
accdb51c0b server/migrations: add default tag category 2017-02-02 20:26:22 +01:00
rr-
f2fd769767 server/migrations: fix imports for alembic
`alembic revision -m 'blah blah'` rightfully complained about imports
(in case of `upgrade`, that module was being populated by some other
module.)
2017-02-02 20:06:20 +01:00
rr-
e92bd2fd80 server/tags: fix getting default category name
No categories? Should have thrown an error rather than returning None.
2017-02-02 20:04:09 +01:00
rr-
cce543e0b6 server/posts: commit reverse search population 2017-02-02 19:46:35 +01:00
rr-
af6c35ed6b server/rest: rollback session on query exception
Kills complaints from sqlalchemy when an error happens during
insertion/update hook.
2017-02-02 19:46:03 +01:00
rr-
07d0b43d4c server/posts: reduce warnings from sqlalchemy
...regarding empty IN() statements
2017-02-02 19:46:03 +01:00
rr-
8be0e731a7 server/facade: run without elasticsearch
...but don't let user upload any images until they fix their
configuration
2017-02-02 19:46:03 +01:00
rr-
ec9c70ba68 server/facade: disable elasticsearch logs
Errors are covered by new safety mechanisms in image hash.
2017-02-02 19:46:03 +01:00
rr-
aa1faa3ccb server/image-hash: improve exception handling 2017-02-02 19:46:03 +01:00
rr-
f42fbbdc56 server/images: support webm with multiple streams 2017-01-25 17:13:39 +01:00
rr-
0cfc9bcafd server/posts: fix handling corrupt files
In case of a ProcessingError, the image dimensions are set to None. But
after that, they are compared with 0, which resulted in a TypeError.
2017-01-25 17:11:05 +01:00
rr-
9b27e113b3 server/search: escape backslashes in search 2017-01-21 00:22:53 +01:00
rr-
783171729f server: remove unneeded waitress wrapper 2017-01-21 00:22:53 +01:00
rr-
e5f250260d server: make gunicorn friendly 2017-01-21 00:22:53 +01:00
rr-
6b42d787a7 server: fix problems with escaping 2017-01-21 00:22:53 +01:00
rr-
7414d1f7a6 server/posts: fix getting posts around
Querying this undocumented API resulted in 500 ISE unless the client
asked only for the "id" field.
2017-01-20 22:17:26 +01:00
rr-
8d8165a0d7 server/tags: fix order of aliases in export
fixes #112
2017-01-08 22:29:05 +01:00
rr-
036fa9ee39 server/uploads: add file upload api 2017-01-08 10:25:29 +01:00
rr-
4cb613a5c9 server/posts: change reverse image search API
Add exact duplicates search; refactor to use classes over dictionaries
2017-01-07 14:07:31 +01:00
rr-
9edaaffec2 server/posts: fix post relations
Trying to relate post to itself resulted in 500 ISE.
2017-01-03 21:37:38 +01:00
rr-
627574a9c2 server: make pylint happier 2017-01-03 21:35:08 +01:00
rr-
902a0d3fe0 server/db: fix closing DB sessions
Certain exception scenarios led to small disasters. Moved database
session management directly to router, since it's that sensitive.
2017-01-03 21:29:48 +01:00
rr-
ef079121a9 server/rest: simplify error handling flow 2017-01-03 21:17:41 +01:00
rr-
f301ca9a8a server/image-hash: fix handling invalid input 2016-12-26 19:03:04 +01:00
rr-
a7a5cc8180 server/posts: expose reverse image search 2016-12-26 15:00:16 +01:00
rr-
1a59a74d63 server/image-hash: add image search engine 2016-12-26 15:00:16 +01:00
rr-
42666706d9 server/util: fix API queries for empty ?options 2016-11-20 16:02:45 +01:00
rr-
c0d484689b server: postpone circular dependency evaluation
Hopefully this improves importing with python 3.4
2016-11-07 19:28:54 +01:00
rr-
141c9fcdc9 server/tags: merge also tag relations 2016-10-22 18:02:50 +02:00
rr-
995cd4610d server: drop old style class declarations 2016-10-22 14:43:52 +02:00
rr-
e71718c50d server/posts: add replaceContent to post merging 2016-10-21 22:34:45 +02:00
rr-
9d6a0e0173 server/posts: add post merging 2016-10-21 21:48:38 +02:00
rr-
b853caf6f5 server/posts: fix relation updating
Fixes #103
2016-10-02 17:21:15 +02:00
rr-
b0c5031001 client+server/posts: reverse next/prev post role
In the post list, when we navigate to the page with ">" button, we
navigate to older posts.
In the post view, when we navigate to the page with ">" button, we
navigate to older posts as well.

However, in the post list, the ">" button is called "next page".
At the same time, in the post view, the ">" button was called "previous
post". Now it's called "next post".

The difference isn't visible to normal users nor even API consumers as
the "get posts around post X" request isn't documented.

The change is motivated not only by consistency, but to also improve
compatibility with Vimperator's `[[` and `]]`. Vimperator assumes the
word "next" refers to ">" and the word "previous" refers to "<".
2016-10-02 17:07:08 +02:00
rr-
049a0dc351 server/mime: fix GIF animation heuristics
Closes #100
2016-09-29 12:59:40 +02:00
rr-
e8c93cd735 server: fix constructing of HTTP errors
When I added error codes, I missed these exceptions.
2016-09-26 22:51:07 +02:00
rr-
0c61e85340 server: fix lint 2016-09-26 22:51:00 +02:00
rr-
560a7d6839 server/search: prefer arrays over ranges
(No, it doesn't work recursively.)
Also fix tests.
2016-09-26 22:48:09 +02:00
rr-
1e65622daf server/search: don't be a hardass about strings
Let range criteria (values that contain ..) that end up being used as
strings, to be used as if they were simple criteria. So let the user
search for "when_you_see_it..." and don't throw a warning.
2016-09-26 22:48:09 +02:00
rr-
1bd8af47b0 server/search: match only [a-z-]* for named tokens
Adds ability to search for *:* for example. Still not perfect, but it's
a start.
2016-09-26 22:06:18 +02:00
rr-
0e31e1fd14 server/search: fix underscores and percentages
Escape them for LIKE statements.
2016-09-26 21:58:27 +02:00
rr-
71a4ce8764 server/func: handle download errors 2016-09-25 14:52:47 +02:00
rr-
d1cad99e87 server/middleware: fix reporting auth errors 2016-09-24 08:38:15 +02:00
rr-
42b7a9b94f server/errors: fix serializing errors 2016-09-10 15:28:32 +02:00
rr-
16d04adde0 server/errors: add and document error codes 2016-09-10 11:36:01 +02:00
rr-
8674c8b50e server/posts: report duplicate post ID and URL 2016-09-10 10:16:14 +02:00