Commit Graph
29 Commits
Author SHA1 Message Date
jvoisin 4629eec774 Bump sortable.js 2022-12-27 00:18:56 +01:00
jvoisin 631496775e Minor code refactorisation of epub.py
- Reduce the amount of nested indentation
- Use proper functions instead of fragile manual parsing
2022-12-25 16:37:58 +01:00
jvoisin c5e539bbcd Bump jszip 2022-12-25 16:11:29 +01:00
jvoisin 02ec853e3b Remove a duplicate library 2022-12-25 16:09:18 +01:00
jvoisin 7d023ce741 Bump jquery's version from 3.6.0 to 3.6.3 2022-12-22 23:38:28 +01:00
jvoisin 29fef4a314 Add French articles to the title regex 2022-12-20 23:14:41 +01:00
jvoisin bc876a159e Declare variables before using them
It should fix the following stacktrace:

```
[2021-02-18 14:46:14,771] ERROR {cps:1891} Exception on / [GET]
Traceback (most recent call last):
  File "/opt/calibre/vendor/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/calibre/vendor/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/calibre/vendor/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/calibre/vendor/flask/_compat.py", line 39, in reraise
    raise value
  File "/opt/calibre/vendor/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/calibre/vendor/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/calibre/cps/usermanagement.py", line 38, in decorated_view
    return login_required(func)(*args, **kwargs)
  File "/opt/calibre/vendor/flask_login/utils.py", line 272, in decorated_view
    return func(*args, **kwargs)
  File "/opt/calibre/cps/web.py", line 719, in index
    return render_books_list("newest", sort_param, 1, page)
  File "/opt/calibre/cps/web.py", line 422, in render_books_list
    entries, random, pagination = calibre_db.fill_indexpage(page, 0, db.Books, True, order)
  File "/opt/calibre/cps/db.py", line 610, in fill_indexpage
    return self.fill_indexpage_with_archived_books(page, pagesize, database, db_filter, order, False, *join)
  File "/opt/calibre/cps/db.py", line 635, in fill_indexpage_with_archived_books
    #    book = self.order_authors(book)
UnboundLocalError: local variable 'entries' referenced before assignment
```
2021-02-18 17:02:58 +01:00
jvoisin b8ab66369e Remove some unused imports 2021-01-07 17:59:08 +01:00
jvoisin 54a78d5565 Remove duplicate id from the search form 2021-01-07 17:40:18 +01:00
jvoisin 700b0609df Don't recompute metadata for epubs 2020-11-06 21:36:49 +01:00
jvoisin 95a1a71a66 Minor refactor of comic.py 2020-10-31 22:28:24 +01:00
jvoisin 2c99e71626 Remove a superfluous space 2020-10-29 18:17:32 +01:00
jvoisin e7f7775efa Require edit permissions to edit books, even via ajax 2020-10-29 14:52:20 +01:00
jvoisin 8b60a19577 Don't leak to non-admin users the current installed version 2020-10-29 14:03:18 +01:00
jvoisin d2617322c6 Negate a condition
- removes two levels of indentation
- makes it clear that if the wrong tokens are provided nothing will happen
- remove a useless nested function
2020-10-27 19:41:05 +01:00
jvoisin fa82745f64 Put import_ldap_users behind a login 2020-10-27 19:26:04 +01:00
jvoisin 19b2a334e4 Remove unused imports 2020-10-27 11:06:43 +01:00
jvoisin e69c4cd1dc Refactor a bit cps/uploader.py 2020-05-11 13:15:30 +02:00
jvoisin dd3b562f1a Change some links from http to https 2020-05-09 17:11:56 +02:00
jvoisin 30c9aa3df9 Minor fixes to caliBlur.js
- Add alt attributes to images
- Fix a broken tag
2020-05-09 17:07:22 +02:00
jvoisin 688184e255 Bump jquery 2020-05-09 17:00:03 +02:00
jvoisin 264b4b669e Bump underscorejs version from 1.9.1 to 1.12.2 2020-05-09 16:54:21 +02:00
jvoisin bf166b757a Improve a bit the cookie's hardening
- Samesite for session cookies as well as the remember me ones
- Httponly
2020-05-09 14:42:28 +02:00
jvoisin b4165335a7 Use strong sessions protection
See https://flask-login.readthedocs.io/en/latest/#session-protection for
details
2020-05-09 14:34:14 +02:00
jvoisin 2a1bf2fa71 Generate strong random passwords 2020-05-09 14:24:20 +02:00
jvoisin 523aab2e9e Don't use an hardcoded session key
This fixes a trivial authentication bypass,
according to https://flask.palletsprojects.com/en/1.1.x/quickstart/#sessions
2020-04-29 13:59:34 +02:00
jvoisin 806a5f209f Fix two minor xss 2020-04-29 11:33:33 +02:00
jvoisin 487878819e Move a few variables around
This should prevent a couple of crashes
due to undeclared variables.
2020-04-27 12:03:54 +02:00
jvoisin d8bf540db2 Remove an undeclared and useless local variable 2020-04-24 18:04:27 +02:00