nyaa/nyaa/templates
Nicolas F a38e5d5b53 Implement range bans (#478)
* Implement range bans

People connecting from banned IP ranges are unable to upload
torrents anonymously, and need to manually have their accounts
activated.

This adds a new table "rangebans", and a command line utility,
"rangeban.py", which can be used to add, list and remove rangebans
from the command line.

As an example:

./rangeban.py ban 192.168.0.0/24

This would rangeban anything in this /24.

The temporary_tor column allows automated scripts to clean out and
re-add ever-changing sets of ranges to be banned without affecting
the other ranges.

This has only been tested for IPv4.

* Revise Rangebans

Add an id column, and change "temporary_tor" to "temp". Also
index masked_cidr and mask.

* rangebans: fix enabled and the binary op

kill me

* Add enabling/disabling bans to rangeban.py

* rangebans: fail earlier on garbage arguments

* rangebans: fix linter errors

* rangeban.py: don't shadow builtin keyword 'id'

* rangebans: change temporary ban logic, column

The 'temp' column is now a nullable time column. If the field is
null, the ban is understood to be permanent. If there is a time
in there, it's understood to be the creation time of the ban.

This allows scripts to e.g. delete all temporary bans older than
a certain amount of time.

Also, rename the '_cidr_string' column to 'cidr_string', because
reasons.

* rangeban.py: use ip_address to parse CIDR subnet

* rangebans: fixes to the mask calculation and query

Both were not bugs per-se, but just technically not needed/correct.

* De-meme apparently
2018-06-29 20:15:04 -07:00
..
bootstrap Add rel="prev"/"next" attribs on pagination (#462) 2018-03-25 16:32:03 -07:00
email [Config change] Password reset by email (#381) 2017-10-08 04:34:40 +03:00
404.html Add simple OG metadata tags to templates 2017-05-26 01:03:59 +03:00
_formhelpers.html user: clean up admin_form HTML (#400) 2018-01-03 14:28:39 -08:00
admin_bans.html Better bans (#341) 2017-08-25 18:53:35 -04:00
adminlog.html Better bans (#341) 2017-08-25 18:53:35 -04:00
edit.html Implement comment locking (#439) 2018-03-25 17:03:49 -07:00
flashes.html Initial commit. 2017-05-12 20:51:49 +02:00
help.html comments: fix editing for users with a CAPTCHA (#502) 2018-06-16 16:57:14 -07:00
home.html Words (#355) 2017-09-01 18:14:11 -04:00
layout.html Improve mobile user experience. 2018-04-24 23:19:14 -05:00
login.html Add tabindexes to login elements (#420) 2017-12-02 13:31:51 +02:00
password_reset.html [Config change] Password reset by email (#381) 2017-10-08 04:34:40 +03:00
password_reset_request.html [Config change] Password reset by email (#381) 2017-10-08 04:34:40 +03:00
profile.html fix #173 and add avatar to mod user info 2017-05-24 00:28:17 +02:00
register.html Improve and tidy up email blacklist regexes (Hotmail) (#438) 2018-01-27 01:55:35 +02:00
reports.html Undo responsive table for reports (#444) 2018-02-01 11:35:04 -08:00
rss.xml Move torrent magnet and torrent download into 'torrents' blueprint 2017-07-27 14:14:00 +03:00
rules.html Fix some text and revert a js thing 2017-10-20 22:24:36 -07:00
search_results.html minor changes 2017-08-31 14:20:34 +02:00
upload.html Implement range bans (#478) 2018-06-29 20:15:04 -07:00
user.html user page: add manual activation button for mods (#472) 2018-05-10 18:57:59 -07:00
user_comments.html Quick and dirty comment list for moderators to look at (#421) 2017-12-04 15:51:31 +02:00
view.html comments: fix editing for users with a CAPTCHA (#502) 2018-06-16 16:57:14 -07:00
waiting.html Initial commit. 2017-05-12 20:51:49 +02:00
xmlns.html Changed RSS feed to conform to RSS standards and added a namespace 2017-05-20 01:13:04 +02:00