Commit Graph

135 Commits

Author SHA1 Message Date
Shyam Sunder 978a384d9e server/tag-categories: order tag categories alphabetically when requested 2020-01-12 12:18:53 -05:00
Shyam Sunder 0c05330cfc server/tests: fix failing tests 2019-09-28 18:58:45 -04:00
rr- d85e746a65 server/tests: fix failing info api tests 2018-07-08 09:42:13 +02:00
ReAnzu 2a69f0193f server/auth: add token authentication
* Users are only authenticated against their password on login,
  and to retrieve a token
* Passwords are wiped from the GUI frontend and cookies
  after login and token retrieval
* Tokens are revoked at the end of the session/logout
* If the user chooses the "remember me" option,
  the token is stored in the cookie
* Tokens correctly delete themselves on logout
* Tokens can expire at user-specified date
* Tokens have their last usage time
* Tokens can have user defined descriptions
* Users can manage login tokens in their account settings
2018-03-25 22:23:29 +02:00
ReAnzu 7519e071e7 server/posts: deleting a post purges its artifacts
Specifically, its thumbnail and post source.
2018-03-08 23:37:37 +01:00
ReAnzu 4b3529272e server/users: let administrators add new users
* Added functionality for administrators to directly add users to the
  application
* Added permission users:create:any to handle level that users are
  allowed to create other users
* Moved old permission users:create to users:create:self
2018-03-07 21:30:24 +01:00
rr- 1c4c5c5f91 remove tags.json 2017-10-01 21:48:00 +02:00
rr- 674d6c35d7 server/posts: add posts:view:featured privilege 2017-08-24 17:17:09 +02:00
rr- 4afece8d50 server/posts: add non-guessable IDs to post URLs 2017-08-24 17:17:09 +02:00
rr- 4bc58a3c95 server: lint 2017-04-24 23:30:53 +02:00
rr- fdad08e176 server: use index-based paging (#123) 2017-02-09 22:40:00 +01:00
rr- ad842ee8a5 server: refactor + add type hinting
- Added type hinting (for now, 3.5-compatible)
- Split `db` namespace into `db` module and `model` namespace
- Changed elastic search to be created lazily for each operation
- Changed to class based approach in entity serialization to allow
  stronger typing
- Removed `required` argument from `context.get_*` family of functions;
  now it's implied if `default` argument is omitted
- Changed `unalias_dict` implementation to use less magic inputs
2017-02-05 16:34:45 +01:00
rr- abf1fc2b2d server: make linters happier 2017-02-03 22:42:14 +01:00
rr- 894cd29511 server/tests: test image hash 2017-02-03 19:53:10 +01:00
rr- 9d6a0e0173 server/posts: add post merging 2016-10-21 21:48:38 +02:00
rr- 8674c8b50e server/posts: report duplicate post ID and URL 2016-09-10 10:16:14 +02:00
rr- c516030c66 server/tests: fix info api tests 2016-09-10 10:12:43 +02:00
rr- ffb87f1650 server/posts: defer flush; save content lazily
Rather than flushing the post right away only to find out that there
were validation errors, try to postpone flushing for as long as
possible.

The previous behavior has led to too eager spending of post IDs - each
flush calls nextval(post_id_seq), and postgres sequences are not
affected by transaction rollbacks, so each erroneous post creation
discarded a post ID, which has led to gaps in post IDs.
2016-08-26 15:09:08 +02:00
rr- bb369efa99 server/general: disable autoflush 2016-08-26 14:41:05 +02:00
rr- b7e9cbd541 server/posts: allow tagless posts 2016-08-21 23:40:01 +02:00
rr- 80af79779d server/snapshots: rewrite 2016-08-16 21:51:25 +02:00
rr- 0320a0b55b server/general: improve versioning effectiveness
...by integrating it with sqlalchemy that adds WHERE conditions for each
UPDATE and DELETE statement.
2016-08-16 17:22:33 +02:00
rr- 9aea55e3d1 server/general: embrace most of PEP8
Ignored only the rules about continuing / hanging indentation.

Also, added __init__.py to tests so that pylint discovers them. (I don't
buy pytest's BS about installing your package.)
2016-08-14 16:44:03 +02:00
rr- af62f8c45a server/general: ditch falcon for in-house WSGI app
For quite some time, I hated Falcon's class maps approach that caused
more chaos than good for Szurubooru. I've taken a look at the other
frameworks (hug, flask, etc) again, but they all looked too
bloated/over-engineered. I decided to just talk to WSGI myself.

Regex-based routing may not be the fastest in the world, but I'm fine
with response time of 10 ms for cached /posts.
2016-08-14 16:43:35 +02:00
rr- c23c401c4d server/tests: add func.tags tests 2016-08-14 16:43:35 +02:00
rr- 3db4f39545 server/tag-categories: correct exception type 2016-08-14 12:31:46 +02:00
rr- 07237bc2bc server/tags: fix changing name case 2016-08-14 11:39:04 +02:00
rr- 2b3d193b7c server/tags: don't auto-create tag categories 2016-08-14 11:38:59 +02:00
rr- 8d04df38fd server/general: add entity versions 2016-08-07 09:55:51 +02:00
rr- 5092c2c587 server/posts: respect tag creating privilege 2016-08-02 12:44:38 +02:00
rr- 5e47c5c0c6 server/users: use HTTPS for Gravatar 2016-07-30 13:43:15 +02:00
rr- 298aedbc75 server/tags: sort relations like post tags 2016-07-30 13:43:15 +02:00
rr- f40e41ae8b server/tags: allow deleting used tags 2016-07-30 13:43:15 +02:00
rr- 8ef0017531 server/tags: improve tag export performance
2000 ms --> 250 ms (including overhead of unknown size).
Not bad if you ask me.
2016-07-26 23:20:15 +02:00
rr- 5800f0ebc7 server/tags: fix merging tags
It violated unique constraint on post_tag when a given post was already
tagged with the target tag.
2016-07-03 18:30:32 +02:00
rr- ac23067fdf server/general: use UTC time stamps 2016-07-03 14:46:28 +02:00
rr- 7eec347bca server/tags: add description field 2016-06-23 00:15:25 +02:00
rr- 3c3d0dbb8d server/info: expose a few config variables 2016-06-18 10:55:44 +02:00
rr- 13ca94d4da server/users: fix avatar issues when renaming user 2016-06-17 21:25:28 +02:00
rr- d0aaf8fa8f server/posts: optimize default sort order 2016-06-14 07:50:22 +02:00
rr- 162904bfc3 server/info: add serverTime field 2016-06-12 14:26:52 +02:00
rr- a67db59d99 server/comments: fix serializing cached scores 2016-06-12 14:01:38 +02:00
rr- 616854fb1b server/users: let authorized users GET themselves 2016-06-11 17:36:02 +02:00
rr- b5aa3e75c4 server/comments: fix privileges 2016-06-11 17:36:02 +02:00
rr- ded89fee5f server/posts: fix handling bad post ID 2016-06-08 22:38:35 +02:00
rr- 508cb6e7ab server/posts: allow anonymous uploads (#90) 2016-06-05 10:30:10 +02:00
rr- caecaee785 server/users: offer more stats in user entity 2016-06-03 21:46:25 +02:00
rr- 037fbc61ec server/api: add ability to select fields 2016-05-30 23:08:22 +02:00
rr- 8d1e23aa63 server/general: flatten responses 2016-05-30 22:54:33 +02:00
rr- d0314813cb server/general: move extra details to resources 2016-05-30 22:54:33 +02:00