Commit Graph

27 Commits

Author SHA1 Message Date
Anna-Maria Meriniemi e545f8ae19
Introduce baked queries (#592)
SQA's baked queries prepares the queries in advance, caching yada yada.
Makes thing a bit faster.
Also bigger speedup included is a shoddy cache for the total torrent
count (only applied to baked queries currently). Caching the value for a
few dozen seconds shaves off some wasted time, as it's mostly just used
for pagination.
2020-07-12 00:14:06 -07:00
Nicolas F 72087ddaaf ratelimit: add app config examples 2020-06-23 00:49:26 +02:00
Nicolas F 5da7635164 account: add IP rate limiting for account creation
Add a configurable cooldown in seconds for which no further accounts
can be created from the same IP.
2019-08-26 10:10:11 +02:00
Nicolas F 80c9d580eb Improve cache configuration (#564)
The Flask-Caching cache can now properly be configured from the
config.py, and redis caching has experimentally been tested and
confirmed to be working in theory.

We also document that one may want to use CACHE_THRESHOLD to limit
the maximum number of items in the simple cache.
2019-08-10 18:53:57 -07:00
Nicolas F 16814d6eb7 Add trusted application functionality (#533)
* Add trusted application functionality

This lets users apply for trusted status, given certain minimum
requirements. Moderators can then review the applications, giving
a recommendation, and administrators can accept or reject them.

If an application is accepted or rejected, the user receives an
e-mail about it.

Markdown images are not rendered in applications to prevent browsers
from sending automatic requests to untrusted webservers.

Users who have had their application rejected cannot re-apply for a set
amount of days.

* minor fixes
2019-08-10 18:18:44 -07:00
Nicolas F 6608c99b90 search: allow limiting the maximum number of pages 2019-04-02 17:56:43 +02:00
Nicolas F 2782589cda config: add live.no to email blacklist 2019-03-30 16:33:08 +01:00
Anna-Maria Meriniemi 8365894268 config: add anonymous upload/registration limiting (#537) 2019-01-02 03:40:56 -08:00
Anna-Maria Meriniemi 8c892f09cc config/forms: allow blacklisting email servers by IP (#518)
Adds a new config entry (EMAIL_SERVER_BLACKLIST, tuple of IPv4 addresses
as strings) and an email validator for registering, which will query all
the MX records for the domain and reject the registration if any of the
A records for any of the MX records are found in the blacklist.
If the query fails, the blacklist is ignored; the email is accepted.
2018-08-20 11:29:30 -07:00
Anna-Maria Meriniemi 5c8b119611 config: Add Elasticsearch hosts (#492) 2018-07-09 22:26:23 -07:00
Nicolas F 56a670977e [Config Change] Various Gravatar-related changes (#467)
* Add config option to enable/disable gravatar

This is useful when running a development instance behind a firewall
or NAT, where gravatar cannot reach you to serve up the default user
avatar.

* Pregenerate Gravatar default image URLs

If possible (i.e. SERVER_NAME is set), we can pregenerate the constant
gravatar default URL once at application startup, and re-use that,
as url_for calls are surprisingly expensive.

Especially on torrent view pages with lots of comments, this cuts down
on url_for calls massively, saving on my system about 0.3 ms per call.
2018-07-09 22:20:26 -07:00
Anna-Maria Meriniemi f8a287caa0
Improve and tidy up email blacklist regexes (Hotmail) (#438)
Because reading warnings is overrated.
This does not fix people using custom domains, but it's more likely
they'll know what's up when their email is thrown into the void.

Fixes #437.
2018-01-27 01:55:35 +02:00
Anna-Maria Meriniemi 7f9dc622b1 Email blacklist (#419) 2017-11-22 17:19:47 -08:00
Shane 72c997173c [Schema+config change] Comment editing (#396)
* Comment editing
* Optional time limit for comment editing
2017-11-05 16:26:30 +02:00
Anna-Maria Meriniemi de1fd2f1bc [Config change] Upload ratelimit for non-trusted uploaders (#384)
* Implement upload ratelimit for non-trusted uploaders

Users may upload X torrents in Y minutes after which they
will have to wait Z minutes between uploads.

* Show torrent period count when ratelimited

* Only ratelimit new accounts
2017-10-09 18:41:18 -07:00
Anna-Maria Meriniemi 9e87e810af [Config change] Password reset by email (#381)
* Password reset by email

Adds endpoint, templates, email templates, forms

* Timeout password reset request in six hours
2017-10-08 04:34:40 +03:00
Anna-Maria Meriniemi 6d09920abd Update email verification, add Mailgun backend (#380)
Changes config.example.py!
2017-10-07 17:31:32 -07:00
Anna-Maria Meriniemi 1e5f61ddf7 [Config change] Require recaptcha of new uploaders (#376)
* Reorganize config.example.py, add ACCOUNT_RECAPTCHA_AGE

* Require new accounts to pass recaptcha on upload

Based on ACCOUNT_RECAPTCHA_AGE in config.
2017-10-04 16:05:35 -07:00
Anna-Maria Meriniemi c5d705210d Read-only maintenance mode setting for config.py (#356)
Disables all POSTs, optionally allowing users to log in (without updating last login date)
Blocked POSTs will redirect to the GET endpoint if possible, otherwise to referrer or in last case, home page.
API requests will get a plaintext message with 405 status code.
2017-09-04 18:16:52 -04:00
Anna-Maria Meriniemi 39fcfc0058 Add (optional) validation for minimum anonymous torrent size (#342)
MINIMUM_ANONYMOUS_TORRENT_SIZE can be used to require a minimum total
size of torrents uploaded by anonymous users (ie. without accounts).

Sets up a "framework" for post-WTForm torrent validation as well;
this can easily be extended into filename blacklists and such.
2017-08-19 20:48:08 -04:00
nyaadev 602d35bab7 Integrate tracker API for torrent ban/unban 2017-08-06 23:55:45 +02:00
snowfag 68c2c965a4 Move hardcoded urls into config. 2017-06-03 14:40:32 -04:00
TheAMM 05713892f7 Update config.example.py: remove TABLE_PREFIX, enable stat display by default 2017-05-28 02:15:39 +03:00
nyaadev 76812b0ef0 utf8mb4 for database connection 2017-05-23 00:46:26 +02:00
aldacron 899aa01473 hooked up ES... 90% done, need to figure out how to generate magnet URIs 2017-05-15 23:51:58 -07:00
TheAMM 517d3e8e32 [templates, config] Add SITE_FLAVOR for selecting nyaa/sukebei, update templates
By default TABLE_PREFIX is derived from flavor.
Added back Date column, adjusted column widths
2017-05-13 02:41:52 +03:00
nyaadev 00d65e312c Initial commit. 2017-05-12 20:51:49 +02:00