Commit Graph

29 Commits

Author SHA1 Message Date
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
nyaadev 2e2e741d0f fix migration, add server_default for boolean 2019-01-24 12:31:48 +01:00
A nyaa developer 4fea839f51
fix user preferences from #515 (#532) 2018-12-06 15:47:08 +01:00
doge 92ca3a577f Generate database migration script 2018-11-20 13:45:31 +01:00
Nicolas F 8644472533 Add registration IP (#507)
This will keep track of which IP a user has registered from, to
prevent evading rangebans. It will only be shown to admins.
2018-07-09 22:14:45 -07:00
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
nyaadev 8f9400bb5f Revert "[Schema change] Torrents flags bitflag column to indexed columns (#471)"
This reverts commit 41a2a32f66.

Performs worse in some cases than what we had before.
2018-04-08 08:36:42 +02:00
A nyaa developer 41a2a32f66 [Schema change] Torrents flags bitflag column to indexed columns (#471)
* convert torrent table flags column from bitflag to independent indexed columns

* elasticsearch integration (untested)

* improve performance
2018-04-07 22:44:53 -07:00
A nyaa developer d7b413e4d7 site-specific changes for new tracker (#453) 2018-02-12 15:52:35 -08:00
nyaadev f2411db485 fix migration 2018-02-02 20:53:46 +01:00
nyaadev fd0a02b95c Move bencoded info dicts from mysql torrent_info table to info_dict directory. DB change!
IMPORTANT!!! Make sure to run utils/infodict_mysql2file.py before upgrading the database.
2018-02-02 20:39:02 +01: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
A nyaa developer f8a314df4f Better bans (#341)
* better bans

* put jinja2 template into correct file
2017-08-25 18:53:35 -04:00
nyaadev d5b8a3a2ae Increase maximum comment size from 255 to 1024.
DB change: Change comment text field from VARCHAR(255) to mysql.TEXT
2017-08-14 19:08:36 +02:00
Anna-Maria Meriniemi 1bc36c5a17 [Schema change] Add webseed support (BEP-19) (#317)
Store webseeds in Trackers table with is_webseed flag
Adjusts torrent creation accordingly
2017-07-30 00:00:39 +03:00
mreweilk dd8cb4757e Admin Log 2.0 (#283)
* Admin log added

* Add admin log to top bar

* Fixed some admin log bugs

* Remove comment_id column because comments die when they are killed

* Fix tabs in admin log template

* Fixed sort of admin logs to be created_time desc

* Fix navbar wrapping to a new line

when 992px <= width <= 1200px

* Put reports and admin log in "Admin" dropdown

Applied ./lint.sh fixes

Fixed long lines

* Updated log to be text instead of id based to account for future deletions

* Small fix in log message formatting
2017-07-04 23:13:59 -05:00
kyamiko 570a06bd9e API Info (#157)
Squashing 11 commits into one.
2017-06-03 23:57:53 +03:00
TheAMM 2e4b0b1f9f Add Alembic migration for report tables 2017-05-29 17:05:17 +03:00
nyaazi bea63315cd Merge branch 'master' into reports 2017-05-29 16:20:48 +03:00
TheAMM 2d04cf3525 Update comment count migration, calculate initial counts during upgrade
How fancy!
2017-05-27 22:46:35 +03:00
Anna-Maria Meriniemi d65602ee9f [DB Changes! Read PR!] Merge pull request #196 from nyaadevs/elasticsearch-comment-count
Elasticsearch comment count. Read PR #201 as well.
2017-05-27 20:12:43 +03:00
TheAMM 6f9341d3f1 Add initial database state for Alembic, update existing migrations
Existing migrations will apply changes to both Nyaa and Sukebei
(adjusted manually - in the future Alembic should be able to create operations
for both, thanks to having both models loaded)

Added a down_revision for previously-earliest revision.
2017-05-27 18:14:43 +03:00
TheAMM 6f4aad56ab Update comment count migration script for #201 2017-05-27 18:05:31 +03:00
TheAMM 6c80557e39 SCHEMA CHANGE: Add comment_count to Torrent
with a helper function on Torrent to update the count.
2017-05-26 16:08:46 +03:00
nyaazi 5332ba1a49 Merge branch 'master' into reports 2017-05-26 15:25:02 +03:00
nyaadev 8ef6e915da shameful late edit: change comment text collation to utf8mb4 2017-05-23 00:36:53 +02:00
nyaadev b7144f80f9 Make comments great again. 2017-05-22 23:38:06 +02:00
nyaadev 9af778217b DB CHANGE: Add uploader ip address to torrent column and show on torrent view page for superadmins.
Added migration script!: remove sukebei_ lines if your local db does not have those.
Show users ip address on user page for superadmins.
Rename Admin to Moderator internally.
Moderators can now change user level to trusted.
Superadmins can make users moderator.
Improve changing user level.
2017-05-21 19:12:15 +02:00
nyaadev 152e547ac5 Add flask-Migrate + alembic for automated database migrations.
Update some dependencies to their latest version.
Make executable scripts executable (chmod +x).
2017-05-21 17:47:16 +02:00