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
nyaadev
57a71be7b8
minor changes
2017-08-31 14:20:34 +02:00
Anna-Maria Meriniemi
4eed4971a3
Fix banning torrents without uploader ip
...
Pretty much just for archived torrents
2017-08-26 02:52:59 +03:00
Anna-Maria Meriniemi
aa3c2ba77b
Fix banning anonymous torrents
...
We miss ye, testing
2017-08-26 02:36:38 +03:00
A nyaa developer
f8a314df4f
Better bans ( #341 )
...
* better bans
* put jinja2 template into correct file
2017-08-25 18:53:35 -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
Kfir Hadas
a758f5f078
Optimize routes (define url_prefix in Blueprints)
...
* /admin/*
* /api/*
2017-08-15 17:12:54 +03:00
nyaadev
0bcd782695
Minor improvements
2017-08-15 01:41:31 +02:00
Arylide
2cd2dbf66d
Replaced dead tracker and give mods a hammer
2017-08-14 16:02:06 -07:00
mreweilk
2e50f14fb7
Change admin routes from /adminlog and /reports to /admin/log and /admin/reports
2017-08-14 13:30:17 -04:00
nyaadev
602d35bab7
Integrate tracker API for torrent ban/unban
2017-08-06 23:55:45 +02:00
TheAMM
7a04d64f9c
Weed out last few hardcoded urls
2017-08-05 22:43:13 +03:00
A nyaa developer
e728ca1818
Expose soft delete to users and allow reuploading of deleted torrents. ( #331 )
...
Add banning torrents for moderators which disallows reuploading.
New delete UI.
2017-08-05 15:41:59 -04:00
Anna-Maria Meriniemi
95e35a10c9
Change torrent Content-Disposition back to inline
...
As per comments in #288 , Firefox forces a "what do you want to do with this"-dialog for 'attachment' even when it's set to open them immediately in another program.
2017-08-03 11:28:21 +03:00
Kfir Hadas
87dd95f1e0
Refactor into an app factory [2 of 2] ( #322 )
...
* Replace all `from nyaa import app` imports with `app = flask.current_app` (or `from flask import current_app as app` where possible)
* Add a separate config object for top-level and class statements as `nyaa.extensions.config`
Required because those codes don't have app context at the time of evaluation/execution.
* Remove `routes.py` file and register all blueprints in `nyaa/__init__.py`
* Refactor `nyaa/__init__.py` into an app factory
* Update tools
* Update tests (temporary, will be replaced)
2017-08-01 21:02:08 +03:00
Kfir Hadas
0181d6cb33
Prepare for app factory [1 of 2] ( #315 )
...
* Move db, assets, debug toolbar and fix_paginate into nyaa.extensions
* Change all `from nyaa import db` imports to `from nyaa.extensions import db`
* Move `nyaa.torrents.create_magnet_from_es_info` context processor into template-utils blueprint
* Fix tools (wrap in `with app.app_context():` where needed)
2017-07-30 20:35:16 +03:00
Kfir Hadas
b992467dad
Apply isort & flake8 ( #312 )
...
* Update isort settings
* Apply import sorting (isort) on all files in nyaa/
* Fixed Flake8 errors in nyaa/ (see PR for list)
* Add isort to lint.sh and requirements.txt
2017-07-28 20:01:19 +03:00
Kfir Hadas
2424639bf9
Refactor routes.py
2017-07-27 14:14:00 +03:00
Kfir Hadas
93f94023d1
Move delete_comment and submit_report into blueprint
2017-07-27 14:14:00 +03:00
Kfir Hadas
ef56e54521
Move torrent magnet and torrent download into 'torrents' blueprint
2017-07-27 14:14:00 +03:00
Kfir Hadas
9fef343c1b
Move torrent edit and upload into 'torrents' blueprint
...
Move supporting functions and variables into other files
* nyaa.views.torrents:
- _create_upload_category_choices
* nyaa.backend:
- get_category_id_map
2017-07-27 14:14:00 +03:00
Kfir Hadas
9acdd14e81
Move /view/<int:torrent_id> route into 'torrents' blueprint
...
and update templates.
2017-07-27 14:14:00 +03:00
Kfir Hadas
42535bbdab
Move 404 handler into 'main' blueprint
2017-07-27 14:14:00 +03:00
Kfir Hadas
4aac17ff23
Move 'before_request' into 'main' blueprint
...
Update comment in api_handler with new before_request location
2017-07-27 14:14:00 +03:00
Kfir Hadas
eccb0ebdff
Move '/' and '/rss' routes into 'main' blueprint
...
and update templates.
2017-07-27 14:14:00 +03:00
Kfir Hadas
50529920bd
Move /user/activate/<payload> route into users
...
Move supporting functions as well:
- get_serializer
- get_activation_link
2017-07-27 14:14:00 +03:00
Kfir Hadas
0887dde6fc
Move /user/<user_name> route into a blueprint
...
Move supporting functions and variables into other files
* nyaa.utils:
- cached_function
- chain_get
* nyaa.search:
- DEFAULT_MAX_SEARCH_RESULT
- DEFAULT_PER_PAGE
- SERACH_PAGINATE_DISPLAY_MSG
- _generate_query_string
2017-07-27 14:14:00 +03:00
Kfir Hadas
3913d8cea2
Move admin routes into blueprint
...
and update templates
Routes:
* /reports
* /adminlog
2017-07-27 14:14:00 +03:00
Kfir Hadas
f316353176
Move account routes into blueprint ( #292 )
...
and update templates,
and remove unused imports
Routes:
* /login
* /logout
* /register
* /profile
2017-07-27 14:14:00 +03:00
Kfir Hadas
911fbc317f
Move static routes into a blueprint
...
and update templates
Routes:
* /help
* /rules
* /xmlns/nyaa
* /about (commented out)
2017-07-27 14:14:00 +03:00