Changed stuff for Synthoria
|
@ -1,17 +0,0 @@
|
|||
FROM ubuntu:18.04
|
||||
|
||||
ENV LANG=en_US.utf-8 LC_ALL=en_US.utf-8 DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get -y update
|
||||
|
||||
COPY ./ /nyaa/
|
||||
RUN cat /nyaa/config.example.py /nyaa/.docker/nyaa-config-partial.py > /nyaa/config.py
|
||||
|
||||
# Requirements for running the Flask app
|
||||
RUN apt-get -y install build-essential git python3 python3-pip libmysqlclient-dev curl
|
||||
# Helpful stuff for the docker entrypoint.sh script
|
||||
RUN apt-get -y install mariadb-client netcat
|
||||
|
||||
WORKDIR /nyaa
|
||||
RUN pip3 install -r requirements.txt
|
||||
|
||||
CMD ["/nyaa/.docker/entrypoint.sh"]
|
|
@ -1,48 +0,0 @@
|
|||
# Nyaa on Docker
|
||||
> [!CAUTION]
|
||||
> Docker deployment is out of date and currently unsupported in NyaaV3.
|
||||
|
||||
Docker infrastructure is provided to ease setting up a dev environment
|
||||
|
||||
## Quickstart
|
||||
|
||||
Get started by running (from the root of the project):
|
||||
|
||||
docker-compose -f .docker/full-stack.yml -p nyaa build nyaa-flask
|
||||
docker-compose -f .docker/full-stack.yml -p nyaa up -d
|
||||
|
||||
This builds the Flask app container, then starts up the project. You can then go
|
||||
to [localhost:8080](http://localhost:8080/) (note that some of the
|
||||
services are somewhat slow to start so it may not be available for 30s or so).
|
||||
|
||||
You can shut it down with:
|
||||
|
||||
docker-compose -f .docker/full-stack.yml -p nyaa down
|
||||
|
||||
## Details
|
||||
|
||||
The environment includes:
|
||||
- [nginx frontend](http://localhost:8080/) (on port 8080)
|
||||
- uwsgi running the flask app
|
||||
- the ES<>MariaDB sync process
|
||||
- MariaDB
|
||||
- ElasticSearch
|
||||
- [Kibana](http://localhost:8080/kibana/) (at /kibana/)
|
||||
|
||||
MariaDB, ElasticSearch, the sync process, and uploaded torrents will
|
||||
persistently store their data in volumes which makes future start ups faster.
|
||||
|
||||
To make it more useful to develop with, you can copy `.docker/full-stack.yml` and
|
||||
edit the copy and uncomment the `- "${NYAA_SRC_DIR}:/nyaa"` line, then
|
||||
`export NYAA_SRC_DIR=$(pwd)` and start up the environment using the new compose
|
||||
file:
|
||||
|
||||
cp -a .docker/full-stack.yml .docker/local-dev.yml
|
||||
cat config.example.py .docker/nyaa-config-partial.py > ./config.py
|
||||
$EDITOR .docker/local-dev.yml
|
||||
export NYAA_SRC_DIR=$(pwd)
|
||||
docker-compose -f .docker/local-dev.yml -p nyaa up -d
|
||||
|
||||
This will mount the local copy of the project files into the Flask container,
|
||||
which combined with live-reloading in uWSGI should let you make changes and see
|
||||
them take effect immediately (technically with a ~2 second delay).
|
|
@ -1,32 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# set +x
|
||||
|
||||
pushd /nyaa
|
||||
|
||||
echo 'Waiting for MySQL to start up'
|
||||
while ! echo HELO | nc mariadb 3306 &>/dev/null; do
|
||||
sleep 1
|
||||
done
|
||||
echo 'DONE'
|
||||
|
||||
echo 'Waiting for ES to start up'
|
||||
while ! echo HELO | nc elasticsearch 9200 &>/dev/null; do
|
||||
sleep 1
|
||||
done
|
||||
echo 'DONE'
|
||||
|
||||
echo 'Waiting for ES to be ready'
|
||||
while ! curl -s -XGET 'elasticsearch:9200/_cluster/health?pretty=true&wait_for_status=green' &>/dev/null; do
|
||||
sleep 1
|
||||
done
|
||||
echo 'DONE'
|
||||
|
||||
echo 'Waiting for sync data file to exist'
|
||||
while ! [ -f /elasticsearch-sync/pos.json ]; do
|
||||
sleep 1
|
||||
done
|
||||
echo 'DONE'
|
||||
|
||||
echo 'Starting the sync process'
|
||||
/usr/bin/python3 /nyaa/sync_es.py /nyaa/.docker/es_sync_config.json
|
|
@ -1,50 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# set +x
|
||||
|
||||
pushd /nyaa
|
||||
|
||||
echo 'Waiting for MySQL to start up'
|
||||
while ! echo HELO | nc mariadb 3306 &>/dev/null; do
|
||||
sleep 1
|
||||
done
|
||||
echo 'DONE'
|
||||
|
||||
if ! [ -f /elasticsearch-sync/flag-db_create ]; then
|
||||
python3 ./db_create.py
|
||||
touch /elasticsearch-sync/flag-db_create
|
||||
fi
|
||||
|
||||
if ! [ -f /elasticsearch-sync/flag-db_migrate ]; then
|
||||
python3 ./db_migrate.py stamp head
|
||||
touch /elasticsearch-sync/flag-db_migrate
|
||||
fi
|
||||
|
||||
echo 'Waiting for ES to start up'
|
||||
while ! echo HELO | nc elasticsearch 9200 &>/dev/null; do
|
||||
sleep 1
|
||||
done
|
||||
echo 'DONE'
|
||||
|
||||
echo 'Waiting for ES to be ready'
|
||||
while ! curl -s -XGET 'elasticsearch:9200/_cluster/health?pretty=true&wait_for_status=green' &>/dev/null; do
|
||||
sleep 1
|
||||
done
|
||||
echo 'DONE'
|
||||
|
||||
if ! [ -f /elasticsearch-sync/flag-create_es ]; then
|
||||
# @source create_es.sh
|
||||
# create indices named "nyaa" and "sukebei", these are hardcoded
|
||||
curl -v -XPUT 'elasticsearch:9200/nyaa?pretty' -H"Content-Type: application/yaml" --data-binary @es_mapping.yml
|
||||
curl -v -XPUT 'elasticsearch:9200/sukebei?pretty' -H"Content-Type: application/yaml" --data-binary @es_mapping.yml
|
||||
touch /elasticsearch-sync/flag-create_es
|
||||
fi
|
||||
|
||||
if ! [ -f /elasticsearch-sync/flag-import_to_es ]; then
|
||||
python3 ./import_to_es.py | tee /elasticsearch-sync/import.out
|
||||
grep -A1 'Save the following' /elasticsearch-sync/import.out | tail -1 > /elasticsearch-sync/pos.json
|
||||
touch /elasticsearch-sync/flag-import_to_es
|
||||
fi
|
||||
|
||||
echo 'Starting the Flask app'
|
||||
/usr/local/bin/uwsgi /nyaa/.docker/uwsgi.config.ini
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"save_loc": "/elasticsearch-sync/pos.json",
|
||||
"mysql_host": "mariadb",
|
||||
"mysql_port": 3306,
|
||||
"mysql_user": "nyaadev",
|
||||
"mysql_password": "ZmtB2oihHFvc39JaEDoF",
|
||||
"database": "nyaav3",
|
||||
"internal_queue_depth": 10000,
|
||||
"es_chunk_size": 10000,
|
||||
"flush_interval": 5
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
---
|
||||
|
||||
version: "3"
|
||||
services:
|
||||
nginx:
|
||||
image: nginx:1.15-alpine
|
||||
ports:
|
||||
- '8080:80'
|
||||
volumes:
|
||||
- './nginx.conf:/etc/nginx/nginx.conf:ro'
|
||||
- '../nyaa/static:/nyaa-static:ro'
|
||||
depends_on:
|
||||
- nyaa-flask
|
||||
- kibana
|
||||
|
||||
nyaa-flask:
|
||||
image: local/nyaa:devel
|
||||
volumes:
|
||||
- 'nyaa-torrents:/nyaa-torrents'
|
||||
- 'nyaa-sync-data:/elasticsearch-sync'
|
||||
## Uncomment this line to have to mount the local dir to the running
|
||||
## instance for live changes (after setting NYAA_SRC_DIR env var)
|
||||
# - "${NYAA_SRC_DIR}:/nyaa"
|
||||
depends_on:
|
||||
- mariadb
|
||||
- elasticsearch
|
||||
build:
|
||||
context: ../
|
||||
dockerfile: ./.docker/Dockerfile
|
||||
|
||||
nyaa-sync:
|
||||
image: local/nyaa:devel
|
||||
volumes:
|
||||
- 'nyaa-sync-data:/elasticsearch-sync'
|
||||
command: /nyaa/.docker/entrypoint-sync.sh
|
||||
depends_on:
|
||||
- mariadb
|
||||
- elasticsearch
|
||||
restart: on-failure
|
||||
|
||||
mariadb:
|
||||
image: mariadb:10.0
|
||||
volumes:
|
||||
- './mariadb-init-sql:/docker-entrypoint-initdb.d:ro'
|
||||
- '../configs/my.cnf:/etc/mysql/conf.d/50-binlog.cnf:ro'
|
||||
- 'mariadb-data:/var/lib/mysql'
|
||||
environment:
|
||||
- MYSQL_RANDOM_ROOT_PASSWORD=yes
|
||||
- MYSQL_USER=nyaadev
|
||||
- MYSQL_PASSWORD=ZmtB2oihHFvc39JaEDoF
|
||||
- MYSQL_DATABASE=nyaav3
|
||||
|
||||
elasticsearch:
|
||||
image: elasticsearch:6.5.4
|
||||
volumes:
|
||||
- elasticsearch-data:/usr/share/elasticsearch/data
|
||||
depends_on:
|
||||
- mariadb
|
||||
|
||||
kibana:
|
||||
image: kibana:6.5.4
|
||||
volumes:
|
||||
- './kibana.config.yml:/usr/share/kibana/config/kibana.yml:ro'
|
||||
depends_on:
|
||||
- elasticsearch
|
||||
|
||||
volumes:
|
||||
nyaa-torrents:
|
||||
nyaa-sync-data:
|
||||
mariadb-data:
|
||||
elasticsearch-data:
|
|
@ -1,9 +0,0 @@
|
|||
---
|
||||
|
||||
server.name: kibana
|
||||
server.host: 'kibana'
|
||||
server.basePath: /kibana
|
||||
# server.rewriteBasePath: true
|
||||
# server.defaultRoute: /kibana/app/kibana
|
||||
elasticsearch.url: http://elasticsearch:9200
|
||||
xpack.monitoring.ui.container.elasticsearch.enabled: true
|
1
.docker/mariadb-init-sql/.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
!*.sql
|
|
@ -1,3 +0,0 @@
|
|||
GRANT REPLICATION SLAVE ON *.* TO 'nyaadev'@'%';
|
||||
GRANT REPLICATION CLIENT ON *.* TO 'nyaadev'@'%';
|
||||
FLUSH PRIVILEGES;
|
|
@ -1,59 +0,0 @@
|
|||
|
||||
user nginx;
|
||||
worker_processes 1;
|
||||
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
charset utf-8;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
|
||||
keepalive_timeout 65;
|
||||
|
||||
gzip on;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost default;
|
||||
|
||||
location /static {
|
||||
alias /nyaa-static;
|
||||
}
|
||||
|
||||
# fix kibana redirecting to localhost/kibana (without the port)
|
||||
rewrite ^/kibana$ http://$http_host/kibana/ permanent;
|
||||
location /kibana/ {
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
|
||||
proxy_set_header Host 'kibana';
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
||||
proxy_pass http://kibana:5601/;
|
||||
}
|
||||
|
||||
location / {
|
||||
include /etc/nginx/uwsgi_params;
|
||||
uwsgi_pass nyaa-flask:5000;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
# This is only a partial config file that will be appended to the end of
|
||||
# config.example.py to build the full config for the docker environment
|
||||
|
||||
SITE_NAME = 'Nyaa [DEVEL]'
|
||||
GLOBAL_SITE_NAME = 'nyaa.devel'
|
||||
SQLALCHEMY_DATABASE_URI = ('mysql://nyaadev:ZmtB2oihHFvc39JaEDoF@mariadb/nyaav3?charset=utf8mb4')
|
||||
# MAIN_ANNOUNCE_URL = 'http://chihaya:6881/announce'
|
||||
# TRACKER_API_URL = 'http://chihaya:6881/api'
|
||||
BACKUP_TORRENT_FOLDER = '/nyaa-torrents'
|
||||
ES_HOSTS = ['elasticsearch:9200']
|
|
@ -1,34 +0,0 @@
|
|||
[uwsgi]
|
||||
# socket = [addr:port]
|
||||
socket = 0.0.0.0:5000
|
||||
#chmod-socket = 664
|
||||
|
||||
die-on-term = true
|
||||
|
||||
# logging
|
||||
#disable-logging = True
|
||||
#logger = file:uwsgi.log
|
||||
|
||||
# Base application directory
|
||||
chdir = /nyaa
|
||||
|
||||
# WSGI module and callable
|
||||
# module = [wsgi_module_name]:[application_callable_name]
|
||||
module = WSGI:app
|
||||
|
||||
# master = [master process (true of false)]
|
||||
master = true
|
||||
|
||||
# debugging
|
||||
catch-exceptions = true
|
||||
|
||||
# performance
|
||||
processes = 4
|
||||
buffer-size = 8192
|
||||
|
||||
loop = gevent
|
||||
socket-timeout = 10
|
||||
gevent = 1000
|
||||
gevent-monkey-patch = true
|
||||
|
||||
py-autoreload = 2
|
3
.github/issue_template.md
vendored
|
@ -1,3 +0,0 @@
|
|||
Describe your issue/feature request here (you can remove all this text). Describe well and include images if relevant.
|
||||
|
||||
Please make sure to skim through the existing issues, as your issue/request/etc. may have already been noted!
|
100
.github/workflows/codeql.yml
vendored
|
@ -1,100 +0,0 @@
|
|||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL Advanced"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
schedule:
|
||||
- cron: '37 6 * * 4'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze (${{ matrix.language }})
|
||||
# Runner size impacts CodeQL analysis time. To learn more, please see:
|
||||
# - https://gh.io/recommended-hardware-resources-for-running-codeql
|
||||
# - https://gh.io/supported-runners-and-hardware-resources
|
||||
# - https://gh.io/using-larger-runners (GitHub.com only)
|
||||
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
|
||||
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
|
||||
permissions:
|
||||
# required for all workflows
|
||||
security-events: write
|
||||
|
||||
# required to fetch internal or private CodeQL packs
|
||||
packages: read
|
||||
|
||||
# only required for workflows in private repositories
|
||||
actions: read
|
||||
contents: read
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- language: javascript-typescript
|
||||
build-mode: none
|
||||
- language: python
|
||||
build-mode: none
|
||||
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
|
||||
# Use `c-cpp` to analyze code written in C, C++ or both
|
||||
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
|
||||
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
|
||||
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
|
||||
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
|
||||
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
|
||||
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Add any setup steps before running the `github/codeql-action/init` action.
|
||||
# This includes steps like installing compilers or runtimes (`actions/setup-node`
|
||||
# or others). This is typically only required for manual builds.
|
||||
# - name: Setup runtime (example)
|
||||
# uses: actions/setup-example@v1
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
build-mode: ${{ matrix.build-mode }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
|
||||
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||
# queries: security-extended,security-and-quality
|
||||
|
||||
# If the analyze step fails for one of the languages you are analyzing with
|
||||
# "We were unable to automatically build your code", modify the matrix above
|
||||
# to set the build mode to "manual" for that language. Then modify this step
|
||||
# to build your code.
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
- if: matrix.build-mode == 'manual'
|
||||
shell: bash
|
||||
run: |
|
||||
echo 'If you are using a "manual" build mode for one or more of the' \
|
||||
'languages you are analyzing, replace this with the commands to build' \
|
||||
'your code, for example:'
|
||||
echo ' make bootstrap'
|
||||
echo ' make release'
|
||||
exit 1
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
3
.gitignore
vendored
|
@ -14,14 +14,13 @@ __pycache__
|
|||
|
||||
# Databases
|
||||
*.sql
|
||||
/test.db
|
||||
/synthoria.db
|
||||
|
||||
# Webserver
|
||||
/uwsgi.sock
|
||||
|
||||
# Application
|
||||
/install/*
|
||||
/config.py
|
||||
/es_sync_config.json
|
||||
/test_torrent_batch
|
||||
|
||||
|
|
30
.travis.yml
|
@ -1,30 +0,0 @@
|
|||
language: python
|
||||
|
||||
python: "3.13"
|
||||
|
||||
dist: jammy
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
|
||||
cache: pip
|
||||
|
||||
services:
|
||||
mysql
|
||||
|
||||
before_install:
|
||||
- mysql -u root -e 'CREATE DATABASE nyaav3 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'
|
||||
|
||||
install:
|
||||
- pip install -r requirements.txt
|
||||
- pip install pytest-cov
|
||||
- sed "s/mysql:\/\/test:test123@/mysql:\/\/root:@/" config.example.py > config.py
|
||||
- ./db_create.py
|
||||
- ./db_migrate.py stamp head
|
||||
|
||||
script:
|
||||
- ./dev.py test --cov=nyaa --cov-report=term tests
|
||||
- ./dev.py lint
|
||||
|
||||
notifications:
|
||||
email: false
|
133
README.md
|
@ -1,138 +1,19 @@
|
|||
# NyaaV3 [](https://www.python.org) 
|
||||
# Synthoria Archive [](https://www.python.org) 
|
||||
Spaghetti code based on [NyaaV3](https://github.com/sb745/NyaaV3)
|
||||
|
||||
## Setting up for development
|
||||
This project uses Python 3.13. The codebase has been updated from the original Python 3.7 version to use modern Python features and updated dependencies.
|
||||
This guide assumes you are using Linux and are somewhat capable with the commandline.
|
||||
Running Nyaa on Windows may be possible, but it's currently unsupported.
|
||||
|
||||
### Major changes from NyaaV2
|
||||
- Updated from Python 3.7 to Python 3.13
|
||||
- Updated all dependencies to their latest versions
|
||||
- Modernized code patterns for Flask 3.0 and SQLAlchemy 2.0
|
||||
- Replaced deprecated Flask-Script, orderedset and `flask.Markup` with Flask CLI, orderly-set and markupsafe
|
||||
- Implemented mail error handling
|
||||
|
||||
### Code Quality
|
||||
- Before we get any deeper, remember to follow PEP8 style guidelines and run `python dev.py lint` before committing to see a list of warnings/problems.
|
||||
- You may also use `python dev.py fix && python dev.py isort` to automatically fix some of the issues reported by the previous command.
|
||||
- Other than PEP8, try to keep your code clean and easy to understand, as well. It's only polite!
|
||||
|
||||
### Running tests
|
||||
The `tests` folder contains tests for the the `nyaa` module and the webserver. To run the tests:
|
||||
- Make sure that you are in the Python virtual environment.
|
||||
- Run `python dev.py test` while in the repository directory.
|
||||
|
||||
### Setting up Pyenv
|
||||
pyenv eases the use of different Python versions, and as not all Linux distros offer 3.13 packages, it's right up our alley.
|
||||
- Install [dependencies](https://github.com/pyenv/pyenv/wiki/Common-build-problems)
|
||||
- Install [pyenv](https://github.com/pyenv/pyenv/blob/master/README.md#installation)
|
||||
- Install [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv/blob/master/README.md)
|
||||
- Install Python 3.13 with `pyenv` and create a virtualenv for the project:
|
||||
- `pyenv install 3.13.2`
|
||||
- `pyenv virtualenv 3.13.2 nyaa`
|
||||
- `pyenv activate nyaa`
|
||||
- Install dependencies with `pip install -r requirements.txt`
|
||||
- Copy `config.example.py` into `config.py`
|
||||
- Change `SITE_FLAVOR` in your `config.py` depending on which instance you want to host
|
||||
|
||||
### Setting up MySQL/MariaDB database
|
||||
> [!WARNING]
|
||||
> You *may* use SQLite but it is currently untested and unsupported.
|
||||
- Enable `USE_MYSQL` flag in config.py
|
||||
- Install MariaDB by following instructions [here](https://downloads.mariadb.org/mariadb/repositories/)
|
||||
- Run the following commands logged in as your root db user (substitute for your own `config.py` values if desired):
|
||||
- `CREATE USER 'test'@'localhost' IDENTIFIED BY 'test123';`
|
||||
- `GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost';`
|
||||
- `FLUSH PRIVILEGES;`
|
||||
- `CREATE DATABASE nyaav3 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;`
|
||||
|
||||
### Finishing up
|
||||
- Run `python db_create.py` to create the database and import categories
|
||||
- Follow the advice of `db_create.py` and run `python db_migrate.py stamp head` to mark the database version for Alembic
|
||||
- Start the dev server with `python run.py`
|
||||
- When you are finished developing, deactivate your virtualenv with `pyenv deactivate` or `source deactivate` (or just close your shell session)
|
||||
|
||||
You're now ready for simple testing and development!
|
||||
Continue below to learn about database migrations and enabling the advanced search engine, Elasticsearch.
|
||||
|
||||
|
||||
## Database migrations
|
||||
> [!WARNING]
|
||||
> The database migration feature has been updated but will no longer be supported in NyaaV3.
|
||||
- Database migrations are done with [Flask-Migrate](https://flask-migrate.readthedocs.io/), a wrapper around [Alembic](http://alembic.zzzcomputing.com/en/latest/).
|
||||
- The migration system has been updated to use Flask CLI instead of the deprecated Flask-Script.
|
||||
- If someone has made changes in the database schema and included a new migration script:
|
||||
- If your database has never been marked by Alembic (you're on a database from before the migrations), run `python db_migrate.py db stamp head` before pulling the new migration script(s).
|
||||
- If you already have the new scripts, check the output of `python db_migrate.py db history` instead and choose a hash that matches your current database state, then run `python db_migrate.py db stamp <hash>`.
|
||||
- Update your branch (eg. `git fetch && git rebase origin/master`)
|
||||
- Run `python db_migrate.py db upgrade head` to run the migration. Done!
|
||||
- If *you* have made a change in the database schema:
|
||||
- Save your changes in `models.py` and ensure the database schema matches the previous version (ie. your new tables/columns are not added to the live database)
|
||||
- Run `python db_migrate.py db migrate -m "Short description of changes"` to automatically generate a migration script for the changes
|
||||
- Check the script (`migrations/versions/...`) and make sure it works! Alembic may not able to notice all changes.
|
||||
- Run `python db_migrate.py db upgrade` to run the migration and verify the upgrade works.
|
||||
- (Run `python db_migrate.py db downgrade` to verify the downgrade works as well, then upgrade again)
|
||||
|
||||
|
||||
## Setting up and enabling Elasticsearch
|
||||
|
||||
### Installing Elasticsearch
|
||||
- Install JDK with `sudo apt-get install openjdk-8-jdk`
|
||||
- Install Elasticsearch
|
||||
- [From packages](https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html)
|
||||
- Enable the service:
|
||||
- `sudo systemctl enable elasticsearch.service`
|
||||
- `sudo systemctl start elasticsearch.service`
|
||||
- or [simply extracting the archives and running the files](https://www.elastic.co/guide/en/elasticsearch/reference/current/_installation.html), if you don't feel like permanently installing ES
|
||||
- Run `curl -XGET 'localhost:9200'` and make sure ES is running
|
||||
- Install [Kibana](https://www.elastic.co/products/kibana) as a search debug frontend for ES (*optional*)
|
||||
|
||||
### Enabling MySQL Binlogging
|
||||
- Edit your MariaDB/MySQL server configuration and add the following under `[mariadb]`:
|
||||
```
|
||||
log-bin
|
||||
server_id=1
|
||||
log-basename=master1
|
||||
binlog-format=row
|
||||
```
|
||||
- Restart MariaDB/MySQL (`sudo service mysql restart`)
|
||||
- Copy the example configuration (`es_sync_config.example.json`) as `es_sync_config.json` and adjust options in it to your liking (verify the connection options!)
|
||||
- Connect to mysql as root
|
||||
- Verify that the result of `SHOW VARIABLES LIKE 'binlog_format';` is `ROW`
|
||||
- Execute `GRANT REPLICATION SLAVE ON *.* TO 'username'@'localhost';` to allow your configured user access to the binlog
|
||||
|
||||
### Setting up ES
|
||||
- Run `./create_es.sh` to create the indices for the torrents: `nyaa` and `sukebei`
|
||||
- The output should show `acknowledged: true` twice
|
||||
- Stop the Nyaa app if you haven't already
|
||||
- Run `python import_to_es.py` to import all the torrents (on nyaa and sukebei) into the ES indices.
|
||||
- This may take some time to run if you have plenty of torrents in your database.
|
||||
|
||||
Enable the `USE_ELASTIC_SEARCH` flag in `config.py` and (re)start the application.
|
||||
Elasticsearch should now be functional! The ES indices won't be updated "live" with the current setup, continue below for instructions on how to hook Elasticsearch up to MySQL binlog.
|
||||
|
||||
However, take note that binglog is not necessary for simple ES testing and development; you can simply run `import_to_es.py` from time to time to reindex all the torrents.
|
||||
|
||||
|
||||
### Setting up sync_es.py
|
||||
`sync_es.py` keeps the Elasticsearch indices updated by reading the binlog and pushing the changes to the ES indices.
|
||||
- Make sure `es_sync_config.json` is configured with the user you grated the `REPLICATION` permissions
|
||||
- Run `import_to_es.py` and copy the outputted JSON into the file specified by `save_loc` in your `es_sync_config.json`
|
||||
- Run `sync_es.py` as-is *or*, for actual deployment, set it up as a service and run it, preferably as the system/root
|
||||
- Make sure `sync_es.py` runs within the venv with the right dependencies!
|
||||
|
||||
You're done! The script should now be feeding updates from the database to Elasticsearch.
|
||||
Take note, however, that the specified ES index refresh interval is 30 seconds, which may feel like a long time on local development. Feel free to adjust it or [poke Elasticsearch yourself!](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-refresh.html)
|
||||
## Documentation
|
||||
> [!IMPORTANT]
|
||||
> No support will be given for running this software. For documentation and instructions please check the original [NyaaV3](https://github.com/sb745/NyaaV3) repo.
|
||||
|
||||
## License
|
||||
This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See the [LICENSE](LICENSE) file for more details.
|
||||
|
||||
## Disclaimer
|
||||
> [!CAUTION]
|
||||
> **This project was created as a learning experience, and while it's a torrent tracker, I can't control how people choose to use it.**
|
||||
> **This project was created as a learning experience, and while it's a torrent tracker, we can't control how people choose to use it.**
|
||||
|
||||
By using this software, you're agreeing to a few things:
|
||||
- I'm not responsible for any legal issues that might come up from using this tracker, especially if it's used to share copyrighted content without permission.
|
||||
- We're not responsible for any legal issues that might come up from using this tracker, especially if it's used to share copyrighted content without permission.
|
||||
- It's your responsibility to make sure you're following the laws in your area when using this software.
|
||||
|
||||
**Please use this project wisely and stay on the right side of the law.** Happy coding!
|
||||
|
|
|
@ -1,65 +1,43 @@
|
|||
import os
|
||||
import re
|
||||
|
||||
DEBUG = True
|
||||
DEBUG = False
|
||||
|
||||
######################
|
||||
## Maintenance mode ##
|
||||
######################
|
||||
|
||||
# A read-only maintenance mode, in which the database is not modified
|
||||
MAINTENANCE_MODE = False
|
||||
# A maintenance message (used in layout.html template)
|
||||
MAINTENANCE_MODE_MESSAGE = 'Site is currently in read-only maintenance mode.'
|
||||
# Allow logging in during maintenance (without updating last login date)
|
||||
MAINTENANCE_MODE_LOGINS = True
|
||||
|
||||
# Block *anonymous* uploads completely
|
||||
RAID_MODE_LIMIT_UPLOADS = False
|
||||
# Message prepended to the full error message (account.py)
|
||||
RAID_MODE_LIMIT_UPLOADS = True
|
||||
RAID_MODE_UPLOADS_MESSAGE = 'Anonymous uploads are currently disabled.'
|
||||
|
||||
# Require manual activation for newly registered accounts
|
||||
RAID_MODE_LIMIT_REGISTER = False
|
||||
RAID_MODE_LIMIT_REGISTER = True
|
||||
# Message prepended to the full error message (account.py)
|
||||
RAID_MODE_REGISTER_MESSAGE = 'Registration is currently being limited.'
|
||||
RAID_MODE_REGISTER_MESSAGE = 'Registration is currently limited.'
|
||||
|
||||
#############
|
||||
## General ##
|
||||
#############
|
||||
SITE_NAME = 'Synthoria Archive'
|
||||
GLOBAL_SITE_NAME = 'Synthoria Archive'
|
||||
|
||||
# What the site identifies itself as. This affects templates, not database stuff.
|
||||
SITE_NAME = 'Nyaa'
|
||||
# What the both sites are labeled under (used for eg. email subjects)
|
||||
GLOBAL_SITE_NAME = 'Nyaa.si'
|
||||
|
||||
# General prefix for running multiple sites, eg. most database tables are site-prefixed
|
||||
SITE_FLAVOR = 'nyaa' # 'nyaa' or 'sukebei'
|
||||
# Full external urls to both sites, used for site-change links
|
||||
EXTERNAL_URLS = {'fap':'***', 'main':'***'}
|
||||
EXTERNAL_URLS = {'fap':'***', 'main':'archive.synthoria.moe'}
|
||||
|
||||
# Secret keys for Flask
|
||||
CSRF_SESSION_KEY = '***'
|
||||
SECRET_KEY = '***'
|
||||
|
||||
# Session cookie configuration
|
||||
SESSION_COOKIE_NAME = 'nyaav3_session'
|
||||
SESSION_COOKIE_NAME = 'synthoria_session'
|
||||
SESSION_COOKIE_SECURE = True
|
||||
SESSION_COOKIE_HTTPONLY = True
|
||||
SESSION_COOKIE_SAMESITE = 'Lax'
|
||||
|
||||
# Present a recaptcha for anonymous uploaders
|
||||
USE_RECAPTCHA = False
|
||||
# Require email validation
|
||||
USE_EMAIL_VERIFICATION = False
|
||||
# Use MySQL or Sqlite3 (mostly deprecated)
|
||||
USE_MYSQL = True
|
||||
# Show seeds/peers/completions in torrent list/page
|
||||
ENABLE_SHOW_STATS = True
|
||||
|
||||
# Enable password recovery (by reset link to given email address)
|
||||
# Depends on email support!
|
||||
ALLOW_PASSWORD_RESET = True
|
||||
ALLOW_PASSWORD_RESET = False
|
||||
|
||||
# A list of strings or compiled regexes to deny registering emails by.
|
||||
# Regexes will be .search()'d against emails,
|
||||
|
@ -81,17 +59,16 @@ EMAIL_SERVER_BLACKLIST = (
|
|||
)
|
||||
|
||||
|
||||
|
||||
# Recaptcha keys (https://www.google.com/recaptcha)
|
||||
RECAPTCHA_PUBLIC_KEY = '***'
|
||||
RECAPTCHA_PRIVATE_KEY = '***'
|
||||
# RECAPTCHA_PUBLIC_KEY = '***'
|
||||
# RECAPTCHA_PRIVATE_KEY = '***'
|
||||
|
||||
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
|
||||
if USE_MYSQL:
|
||||
SQLALCHEMY_DATABASE_URI = ('mysql://test:test123@localhost/nyaav3?charset=utf8mb4')
|
||||
SQLALCHEMY_DATABASE_URI = ('mysql://synthuser:synthpass@localhost/synthoria?charset=utf8mb4')
|
||||
else:
|
||||
SQLALCHEMY_DATABASE_URI = (
|
||||
'sqlite:///' + os.path.join(BASE_DIR, 'test.db') + '?check_same_thread=False')
|
||||
'sqlite:///' + os.path.join(BASE_DIR, 'synthoria.db') + '?check_same_thread=False')
|
||||
|
||||
###########
|
||||
## EMAIL ##
|
||||
|
@ -117,12 +94,12 @@ SMTP_PASSWORD = '***'
|
|||
MAX_FILES_VIEW = 1000
|
||||
|
||||
# Verify uploaded torrents have the given tracker in them?
|
||||
ENFORCE_MAIN_ANNOUNCE_URL = False
|
||||
MAIN_ANNOUNCE_URL = 'http://127.0.0.1:6881/announce'
|
||||
ENFORCE_MAIN_ANNOUNCE_URL = True
|
||||
MAIN_ANNOUNCE_URL = 'https://tracker.synthoria.moe:6969/announce'
|
||||
|
||||
# Tracker API integration - don't mind this
|
||||
TRACKER_API_URL = 'http://127.0.0.1:6881/api'
|
||||
TRACKER_API_AUTH = 'topsecret'
|
||||
# TRACKER_API_URL = 'http://127.0.0.1:6881/api'
|
||||
# TRACKER_API_AUTH = 'topsecret'
|
||||
|
||||
#############
|
||||
## Account ##
|
||||
|
@ -147,7 +124,7 @@ ACCOUNT_RECAPTCHA_AGE = 7 * 24 * 3600 # A week
|
|||
|
||||
# Seconds after which an IP is allowed to register another account
|
||||
# (0 disables the limitation)
|
||||
PER_IP_ACCOUNT_COOLDOWN = 24 * 3600
|
||||
PER_IP_ACCOUNT_COOLDOWN = 72 * 3600
|
||||
|
||||
# Backup original .torrent uploads
|
||||
BACKUP_TORRENT_FOLDER = 'torrents'
|
||||
|
@ -192,19 +169,19 @@ EDITING_TIME_LIMIT = 0
|
|||
|
||||
# Whether to use Gravatar or just always use the default avatar
|
||||
# (Useful if run as development instance behind NAT/firewall)
|
||||
ENABLE_GRAVATAR = True
|
||||
ENABLE_GRAVATAR = False
|
||||
|
||||
##########################
|
||||
## Trusted Requirements ##
|
||||
##########################
|
||||
|
||||
# Minimum number of uploads the user needs to have in order to apply for trusted
|
||||
TRUSTED_MIN_UPLOADS = 10
|
||||
TRUSTED_MIN_UPLOADS = 3
|
||||
# Minimum number of cumulative downloads the user needs to have across their
|
||||
# torrents in order to apply for trusted
|
||||
TRUSTED_MIN_DOWNLOADS = 10000
|
||||
TRUSTED_MIN_DOWNLOADS = 0
|
||||
# Number of days an applicant needs to wait before re-applying
|
||||
TRUSTED_REAPPLY_COOLDOWN = 90
|
||||
TRUSTED_REAPPLY_COOLDOWN = 30
|
||||
|
||||
###########
|
||||
## Cache ##
|
||||
|
@ -231,3 +208,6 @@ CACHE_THRESHOLD = 8192
|
|||
# To actually make this work across multiple worker processes, use redis
|
||||
# RATELIMIT_STORAGE_URL="redis://host:port"
|
||||
RATELIMIT_KEY_PREFIX="nyaaratelimit_"
|
||||
|
||||
# Use this to show the commit hash in the footer (see layout.html)
|
||||
# COMMIT_HASH="[enter your commit hash here]";
|
12
db_create.py
|
@ -14,12 +14,14 @@ from nyaa.extensions import db
|
|||
app = create_app('config')
|
||||
|
||||
NYAA_CATEGORIES: List[Tuple[str, List[str]]] = [
|
||||
('Anime', ['Anime Music Video', 'English-translated', 'Non-English-translated', 'Raw']),
|
||||
('Audio', ['Lossless', 'Lossy']),
|
||||
('Literature', ['English-translated', 'Non-English-translated', 'Raw']),
|
||||
('Live Action', ['English-translated', 'Idol/Promotional Video', 'Non-English-translated', 'Raw']),
|
||||
('Voicebanks', ['VOCALOID', 'UTAU', 'Synthesizer V', 'CeVIO', 'Piapro Studio', 'NEUTRINO', 'Other']),
|
||||
('Software', ['Synthesizers', 'Plugins', 'Tools', 'Applications', 'Games', 'Other']),
|
||||
('Voice Sequences', ['VSQ/VSQx', 'UST', 'MIDI', 'Other']),
|
||||
('Reclists', ['Japanese', 'English', 'Chinese', 'Korean', 'Spanish', 'Other']),
|
||||
('Pictures', ['Graphics', 'Photos']),
|
||||
('Software', ['Applications', 'Games']),
|
||||
('Audio', ['Songs', 'Demos', 'Other']),
|
||||
('Video', ['Music Videos', 'Promo Videos', 'Demos', 'Other']),
|
||||
('Lyrics', ['Japanese', 'English', 'Chinese', 'Korean', 'Spanish', 'Other']),
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Database migration script for Nyaa.
|
||||
Compatible with Python 3.13 and Flask-Migrate 4.0.
|
||||
"""
|
||||
import sys
|
||||
from typing import List
|
||||
|
||||
from flask_migrate import Migrate
|
||||
from flask.cli import FlaskGroup
|
||||
|
||||
from nyaa import create_app
|
||||
from nyaa.extensions import db
|
||||
|
||||
app = create_app('config')
|
||||
migrate = Migrate(app, db)
|
||||
|
||||
def create_cli_app():
|
||||
return app
|
||||
|
||||
cli = FlaskGroup(create_app=create_cli_app)
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Patch sys.argv to default to 'db'
|
||||
if len(sys.argv) > 1 and sys.argv[1] not in ['--help', '-h']:
|
||||
if sys.argv[1] not in ['db', 'routes', 'shell', 'run']:
|
||||
args: List[str] = sys.argv.copy()
|
||||
args.insert(1, 'db')
|
||||
sys.argv = args
|
||||
|
||||
cli()
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
"""
|
||||
Bulk load torents from mysql into elasticsearch `nyaav3` index,
|
||||
Bulk load torents from mysql into elasticsearch `synthoria` index,
|
||||
which is assumed to already exist.
|
||||
This is a one-shot deal, so you'd either need to complement it
|
||||
with a cron job or some binlog-reading thing (TODO)
|
||||
|
|
40
lint.sh
|
@ -1,40 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Lint checker/fixer
|
||||
# This script is deprecated, but still works.
|
||||
|
||||
function auto_fix() {
|
||||
./dev.py fix && ./dev.py isort
|
||||
}
|
||||
|
||||
|
||||
function check_lint() {
|
||||
./dev.py lint
|
||||
}
|
||||
|
||||
# MAIN
|
||||
action=auto_fix # default action
|
||||
for arg in "$@"
|
||||
do
|
||||
case "$arg" in
|
||||
"-h" | "--help")
|
||||
echo "+ ========================= +"
|
||||
echo "+ This script is deprecated +"
|
||||
echo "+ Please use ./dev.py +"
|
||||
echo "+ ========================= +"
|
||||
echo ""
|
||||
echo "Lint checker/fixer"
|
||||
echo ""
|
||||
echo "Usage: $0 [-c|--check] [-h|--help]"
|
||||
echo " No arguments : Check and auto-fix some warnings/errors"
|
||||
echo " -c | --check : only check lint (don't auto-fix)"
|
||||
echo " -h | --help : show this help and exit"
|
||||
exit 0;
|
||||
;;
|
||||
"-c" | "--check")
|
||||
action=check_lint
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
${action} # run selected action
|
||||
if [[ $? -ne 0 ]]; then exit 1; fi
|
|
@ -1,4 +0,0 @@
|
|||
> [!WARNING]
|
||||
> No longer supported in NyaaV3.
|
||||
|
||||
Generic single-database configuration.
|
|
@ -1,45 +0,0 @@
|
|||
# A generic, single database configuration.
|
||||
|
||||
[alembic]
|
||||
# template used to generate migration files
|
||||
# file_template = %%(rev)s_%%(slug)s
|
||||
|
||||
# set to 'true' to run the environment during
|
||||
# the 'revision' command, regardless of autogenerate
|
||||
# revision_environment = false
|
||||
|
||||
|
||||
# Logging configuration
|
||||
[loggers]
|
||||
keys = root,sqlalchemy,alembic
|
||||
|
||||
[handlers]
|
||||
keys = console
|
||||
|
||||
[formatters]
|
||||
keys = generic
|
||||
|
||||
[logger_root]
|
||||
level = WARN
|
||||
handlers = console
|
||||
qualname =
|
||||
|
||||
[logger_sqlalchemy]
|
||||
level = WARN
|
||||
handlers =
|
||||
qualname = sqlalchemy.engine
|
||||
|
||||
[logger_alembic]
|
||||
level = INFO
|
||||
handlers =
|
||||
qualname = alembic
|
||||
|
||||
[handler_console]
|
||||
class = StreamHandler
|
||||
args = (sys.stderr,)
|
||||
level = NOTSET
|
||||
formatter = generic
|
||||
|
||||
[formatter_generic]
|
||||
format = %(levelname)-5.5s [%(name)s] %(message)s
|
||||
datefmt = %H:%M:%S
|
|
@ -1,87 +0,0 @@
|
|||
from __future__ import with_statement
|
||||
from alembic import context
|
||||
from sqlalchemy import engine_from_config, pool
|
||||
from logging.config import fileConfig
|
||||
import logging
|
||||
|
||||
# this is the Alembic Config object, which provides
|
||||
# access to the values within the .ini file in use.
|
||||
config = context.config
|
||||
|
||||
# Interpret the config file for Python logging.
|
||||
# This line sets up loggers basically.
|
||||
fileConfig(config.config_file_name)
|
||||
logger = logging.getLogger('alembic.env')
|
||||
|
||||
# add your model's MetaData object here
|
||||
# for 'autogenerate' support
|
||||
# from myapp import mymodel
|
||||
# target_metadata = mymodel.Base.metadata
|
||||
from flask import current_app
|
||||
config.set_main_option('sqlalchemy.url',
|
||||
current_app.config.get('SQLALCHEMY_DATABASE_URI'))
|
||||
target_metadata = current_app.extensions['migrate'].db.metadata
|
||||
|
||||
# other values from the config, defined by the needs of env.py,
|
||||
# can be acquired:
|
||||
# my_important_option = config.get_main_option("my_important_option")
|
||||
# ... etc.
|
||||
|
||||
|
||||
def run_migrations_offline():
|
||||
"""Run migrations in 'offline' mode.
|
||||
|
||||
This configures the context with just a URL
|
||||
and not an Engine, though an Engine is acceptable
|
||||
here as well. By skipping the Engine creation
|
||||
we don't even need a DBAPI to be available.
|
||||
|
||||
Calls to context.execute() here emit the given string to the
|
||||
script output.
|
||||
|
||||
"""
|
||||
url = config.get_main_option("sqlalchemy.url")
|
||||
context.configure(url=url)
|
||||
|
||||
with context.begin_transaction():
|
||||
context.run_migrations()
|
||||
|
||||
|
||||
def run_migrations_online():
|
||||
"""Run migrations in 'online' mode.
|
||||
|
||||
In this scenario we need to create an Engine
|
||||
and associate a connection with the context.
|
||||
|
||||
"""
|
||||
|
||||
# this callback is used to prevent an auto-migration from being generated
|
||||
# when there are no changes to the schema
|
||||
# reference: http://alembic.readthedocs.org/en/latest/cookbook.html
|
||||
def process_revision_directives(context, revision, directives):
|
||||
if getattr(config.cmd_opts, 'autogenerate', False):
|
||||
script = directives[0]
|
||||
if script.upgrade_ops.is_empty():
|
||||
directives[:] = []
|
||||
logger.info('No changes in schema detected.')
|
||||
|
||||
engine = engine_from_config(config.get_section(config.config_ini_section),
|
||||
prefix='sqlalchemy.',
|
||||
poolclass=pool.NullPool)
|
||||
|
||||
connection = engine.connect()
|
||||
context.configure(connection=connection,
|
||||
target_metadata=target_metadata,
|
||||
process_revision_directives=process_revision_directives,
|
||||
**current_app.extensions['migrate'].configure_args)
|
||||
|
||||
try:
|
||||
with context.begin_transaction():
|
||||
context.run_migrations()
|
||||
finally:
|
||||
connection.close()
|
||||
|
||||
if context.is_offline_mode():
|
||||
run_migrations_offline()
|
||||
else:
|
||||
run_migrations_online()
|
|
@ -1,24 +0,0 @@
|
|||
"""${message}
|
||||
|
||||
Revision ID: ${up_revision}
|
||||
Revises: ${down_revision | comma,n}
|
||||
Create Date: ${create_date}
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
${imports if imports else ""}
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = ${repr(up_revision)}
|
||||
down_revision = ${repr(down_revision)}
|
||||
branch_labels = ${repr(branch_labels)}
|
||||
depends_on = ${repr(depends_on)}
|
||||
|
||||
|
||||
def upgrade():
|
||||
${upgrades if upgrades else "pass"}
|
||||
|
||||
|
||||
def downgrade():
|
||||
${downgrades if downgrades else "pass"}
|
|
@ -1,44 +0,0 @@
|
|||
"""Admin log added
|
||||
|
||||
Revision ID: 1add911660a6
|
||||
Revises: 7f064e009cab
|
||||
Create Date: 2017-06-29 02:57:39.715965
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '1add911660a6'
|
||||
down_revision = '7f064e009cab'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('nyaa_adminlog',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('created_time', sa.DateTime(), nullable=True),
|
||||
sa.Column('log', sa.String(length=1024), nullable=False),
|
||||
sa.Column('admin_id', sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['admin_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('sukebei_adminlog',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('created_time', sa.DateTime(), nullable=True),
|
||||
sa.Column('log', sa.String(length=1024), nullable=False),
|
||||
sa.Column('admin_id', sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['admin_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('sukebei_adminlog')
|
||||
op.drop_table('nyaa_adminlog')
|
||||
# ### end Alembic commands ###
|
|
@ -1,52 +0,0 @@
|
|||
"""Add comment_count to Torrent
|
||||
|
||||
Revision ID: 2bceb2cb4d7c
|
||||
Revises: d0eeb8049623
|
||||
Create Date: 2017-05-26 15:07:21.114331
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '2bceb2cb4d7c'
|
||||
down_revision = 'd0eeb8049623'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
COMMENT_UPDATE_SQL = '''UPDATE {0}_torrents
|
||||
SET comment_count = (
|
||||
SELECT COUNT(*) FROM {0}_comments
|
||||
WHERE {0}_torrents.id = {0}_comments.torrent_id
|
||||
);'''
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('nyaa_torrents', sa.Column('comment_count', sa.Integer(), nullable=False))
|
||||
op.create_index(op.f('ix_nyaa_torrents_comment_count'), 'nyaa_torrents', ['comment_count'], unique=False)
|
||||
|
||||
op.add_column('sukebei_torrents', sa.Column('comment_count', sa.Integer(), nullable=False))
|
||||
op.create_index(op.f('ix_sukebei_torrents_comment_count'), 'sukebei_torrents', ['comment_count'], unique=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
connection = op.get_bind()
|
||||
|
||||
print('Updating comment counts on nyaa_torrents...')
|
||||
connection.execute(sa.sql.text(COMMENT_UPDATE_SQL.format('nyaa')))
|
||||
print('Done.')
|
||||
|
||||
print('Updating comment counts on sukebei_torrents...')
|
||||
connection.execute(sa.sql.text(COMMENT_UPDATE_SQL.format('sukebei')))
|
||||
print('Done.')
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(op.f('ix_nyaa_torrents_comment_count'), table_name='nyaa_torrents')
|
||||
op.drop_column('nyaa_torrents', 'comment_count')
|
||||
|
||||
op.drop_index(op.f('ix_sukebei_torrents_comment_count'), table_name='sukebei_torrents')
|
||||
op.drop_column('sukebei_torrents', 'comment_count')
|
||||
# ### end Alembic commands ###
|
|
@ -1,30 +0,0 @@
|
|||
"""Add uploader_ip column to torrents table.
|
||||
|
||||
Revision ID: 3001f79b7722
|
||||
Revises:
|
||||
Create Date: 2017-05-21 18:01:35.472717
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '3001f79b7722'
|
||||
down_revision = '97ddefed1834'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
TABLE_PREFIXES = ('nyaa', 'sukebei')
|
||||
|
||||
|
||||
def upgrade():
|
||||
|
||||
for prefix in TABLE_PREFIXES:
|
||||
op.add_column(prefix + '_torrents', sa.Column('uploader_ip', sa.Binary(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
for prefix in TABLE_PREFIXES:
|
||||
op.drop_column(prefix + '_torrents', 'uploader_ip')
|
|
@ -1,38 +0,0 @@
|
|||
"""Add bans table
|
||||
|
||||
Revision ID: 500117641608
|
||||
Revises: b79d2fcafd88
|
||||
Create Date: 2017-08-17 01:44:39.205126
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '500117641608'
|
||||
down_revision = 'b79d2fcafd88'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table('bans',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('created_time', sa.DateTime(), nullable=True),
|
||||
sa.Column('admin_id', sa.Integer(), nullable=False),
|
||||
sa.Column('user_id', sa.Integer(), nullable=True),
|
||||
sa.Column('user_ip', sa.Binary(length=16), nullable=True),
|
||||
sa.Column('reason', sa.String(length=2048), nullable=False),
|
||||
sa.ForeignKeyConstraint(['admin_id'], ['users.id'], ),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
)
|
||||
op.create_index('user_ip_16', 'bans', ['user_ip'], unique=True, mysql_length=16)
|
||||
op.create_index('user_ip_4', 'bans', ['user_ip'], unique=True, mysql_length=4)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_index('user_ip_4', table_name='bans')
|
||||
op.drop_index('user_ip_16', table_name='bans')
|
||||
op.drop_table('bans')
|
|
@ -1,47 +0,0 @@
|
|||
"""Add trusted applications
|
||||
|
||||
Revision ID: 5cbcee17bece
|
||||
Revises: 8a6a7662eb37
|
||||
Create Date: 2018-11-05 15:16:07.497898
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import sqlalchemy_utils
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '5cbcee17bece'
|
||||
down_revision = '8a6a7662eb37'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table('trusted_applications',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('submitter_id', sa.Integer(), nullable=False, index=True),
|
||||
sa.Column('created_time', sa.DateTime(), nullable=True),
|
||||
sa.Column('closed_time', sa.DateTime(), nullable=True),
|
||||
sa.Column('why_want', sa.String(length=4000), nullable=False),
|
||||
sa.Column('why_give', sa.String(length=4000), nullable=False),
|
||||
sa.Column('status', sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['submitter_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('trusted_reviews',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('reviewer_id', sa.Integer(), nullable=False),
|
||||
sa.Column('app_id', sa.Integer(), nullable=False),
|
||||
sa.Column('created_time', sa.DateTime(), nullable=True),
|
||||
sa.Column('comment', sa.String(length=4000), nullable=False),
|
||||
sa.Column('recommendation', sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['app_id'], ['trusted_applications.id'], ),
|
||||
sa.ForeignKeyConstraint(['reviewer_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('trusted_reviews')
|
||||
op.drop_table('trusted_applications')
|
|
@ -1,40 +0,0 @@
|
|||
"""Add trackerapi table
|
||||
|
||||
Revision ID: 6cc823948c5a
|
||||
Revises: b61e4f6a88cc
|
||||
Create Date: 2018-02-11 20:57:15.244171
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '6cc823948c5a'
|
||||
down_revision = 'b61e4f6a88cc'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('nyaa_trackerapi',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('info_hash', sa.BINARY(length=20), nullable=False),
|
||||
sa.Column('method', sa.String(length=255), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('sukebei_trackerapi',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('info_hash', sa.BINARY(length=20), nullable=False),
|
||||
sa.Column('method', sa.String(length=255), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('sukebei_trackerapi')
|
||||
op.drop_table('nyaa_trackerapi')
|
||||
# ### end Alembic commands ###
|
|
@ -1,56 +0,0 @@
|
|||
"""Add Report table
|
||||
|
||||
Revision ID: 7f064e009cab
|
||||
Revises: 2bceb2cb4d7c
|
||||
Create Date: 2017-05-29 16:50:28.720980
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '7f064e009cab'
|
||||
down_revision = '2bceb2cb4d7c'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('nyaa_reports',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('created_time', sa.DateTime(), nullable=True),
|
||||
sa.Column('reason', sa.String(length=255), nullable=False),
|
||||
|
||||
# sqlalchemy_utils.types.choice.ChoiceType()
|
||||
sa.Column('status', sa.Integer(), nullable=False),
|
||||
|
||||
sa.Column('torrent_id', sa.Integer(), nullable=False),
|
||||
sa.Column('user_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['torrent_id'], ['nyaa_torrents.id'], ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('sukebei_reports',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('created_time', sa.DateTime(), nullable=True),
|
||||
sa.Column('reason', sa.String(length=255), nullable=False),
|
||||
|
||||
# sqlalchemy_utils.types.choice.ChoiceType()
|
||||
sa.Column('status', sa.Integer(), nullable=False),
|
||||
|
||||
sa.Column('torrent_id', sa.Integer(), nullable=False),
|
||||
sa.Column('user_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['torrent_id'], ['sukebei_torrents.id'], ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('sukebei_reports')
|
||||
op.drop_table('nyaa_reports')
|
||||
# ### end Alembic commands ###
|
|
@ -1,39 +0,0 @@
|
|||
"""Add user preferences table
|
||||
|
||||
Revision ID: 8a6a7662eb37
|
||||
Revises: f703f911d4ae
|
||||
Create Date: 2018-11-20 17:02:26.408532
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '8a6a7662eb37'
|
||||
down_revision = 'f703f911d4ae'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('user_preferences',
|
||||
sa.Column('user_id', sa.Integer(), nullable=False),
|
||||
sa.Column('hide_comments', sa.Boolean(), server_default=sa.sql.expression.false(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('user_id')
|
||||
)
|
||||
|
||||
connection = op.get_bind()
|
||||
|
||||
print('Populating user_preferences...')
|
||||
connection.execute(sa.sql.text('INSERT INTO user_preferences (user_id) SELECT id FROM users'))
|
||||
print('Done.')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('user_preferences')
|
||||
# ### end Alembic commands ###
|
|
@ -1,166 +0,0 @@
|
|||
"""Initial database state
|
||||
|
||||
Revision ID: 97ddefed1834
|
||||
Revises:
|
||||
Create Date: 2017-05-26 18:46:14.440040
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import sqlalchemy_utils
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '97ddefed1834'
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
TABLE_PREFIXES = ('nyaa', 'sukebei')
|
||||
|
||||
def upgrade():
|
||||
# Shared tables
|
||||
op.create_table('users',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('username', sa.String(length=32, collation='ascii_general_ci'), nullable=False),
|
||||
sa.Column('email', sqlalchemy_utils.types.email.EmailType(length=255), nullable=True),
|
||||
|
||||
# These are actually PasswordType, UserStatusType and UserLevelType,
|
||||
# but database-wise binary and integers are what's being used
|
||||
sa.Column('password_hash', sa.Binary(length=255), nullable=False),
|
||||
sa.Column('status', sa.Integer(), nullable=False),
|
||||
sa.Column('level', sa.Integer(), nullable=False),
|
||||
|
||||
sa.Column('created_time', sa.DateTime(), nullable=True),
|
||||
sa.Column('last_login_date', sa.DateTime(), nullable=True),
|
||||
sa.Column('last_login_ip', sa.Binary(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('email'),
|
||||
sa.UniqueConstraint('username')
|
||||
)
|
||||
|
||||
op.create_table('trackers',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('uri', sa.String(length=255, collation='utf8_general_ci'), nullable=False),
|
||||
sa.Column('disabled', sa.Boolean(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('uri')
|
||||
)
|
||||
|
||||
# Nyaa and Sukebei
|
||||
for prefix in TABLE_PREFIXES:
|
||||
# Main categories
|
||||
op.create_table(prefix + '_main_categories',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('name', sa.String(length=64), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
# Sub categories
|
||||
op.create_table(prefix + '_sub_categories',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('main_category_id', sa.Integer(), nullable=False),
|
||||
sa.Column('name', sa.String(length=64), nullable=False),
|
||||
sa.ForeignKeyConstraint(['main_category_id'], [prefix + '_main_categories.id'], ),
|
||||
sa.PrimaryKeyConstraint('id', 'main_category_id')
|
||||
)
|
||||
# Main torrent table
|
||||
op.create_table(prefix + '_torrents',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('info_hash', sa.BINARY(length=20), nullable=False),
|
||||
sa.Column('display_name', sa.String(length=255, collation='utf8_general_ci'), nullable=False),
|
||||
sa.Column('torrent_name', sa.String(length=255), nullable=False),
|
||||
sa.Column('information', sa.String(length=255), nullable=False),
|
||||
sa.Column('description', mysql.TEXT(collation='utf8mb4_bin'), nullable=False),
|
||||
sa.Column('filesize', sa.BIGINT(), nullable=False),
|
||||
sa.Column('encoding', sa.String(length=32), nullable=False),
|
||||
sa.Column('flags', sa.Integer(), nullable=False),
|
||||
sa.Column('uploader_id', sa.Integer(), nullable=True),
|
||||
sa.Column('has_torrent', sa.Boolean(), nullable=False),
|
||||
sa.Column('created_time', sa.DateTime(), nullable=False),
|
||||
sa.Column('updated_time', sa.DateTime(), nullable=False),
|
||||
sa.Column('main_category_id', sa.Integer(), nullable=False),
|
||||
sa.Column('sub_category_id', sa.Integer(), nullable=False),
|
||||
sa.Column('redirect', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['main_category_id', 'sub_category_id'], [prefix + '_sub_categories.main_category_id', prefix + '_sub_categories.id'], ),
|
||||
sa.ForeignKeyConstraint(['main_category_id'], [prefix + '_main_categories.id'], ),
|
||||
sa.ForeignKeyConstraint(['redirect'], [prefix + '_torrents.id'], ),
|
||||
sa.ForeignKeyConstraint(['uploader_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_index(op.f('ix_' + prefix + '_torrents_display_name'), prefix + '_torrents', ['display_name'], unique=False)
|
||||
op.create_index(op.f('ix_' + prefix + '_torrents_filesize'), prefix + '_torrents', ['filesize'], unique=False)
|
||||
op.create_index(op.f('ix_' + prefix + '_torrents_flags'), prefix + '_torrents', ['flags'], unique=False)
|
||||
op.create_index(op.f('ix_' + prefix + '_torrents_info_hash'), prefix + '_torrents', ['info_hash'], unique=True)
|
||||
op.create_index(prefix + '_uploader_flag_idx', prefix + '_torrents', ['uploader_id', 'flags'], unique=False)
|
||||
|
||||
# Statistics for torrents
|
||||
op.create_table(prefix + '_statistics',
|
||||
sa.Column('torrent_id', sa.Integer(), nullable=False),
|
||||
sa.Column('seed_count', sa.Integer(), nullable=False),
|
||||
sa.Column('leech_count', sa.Integer(), nullable=False),
|
||||
sa.Column('download_count', sa.Integer(), nullable=False),
|
||||
sa.Column('last_updated', sa.DateTime(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['torrent_id'], [prefix + '_torrents.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('torrent_id')
|
||||
)
|
||||
op.create_index(op.f('ix_' + prefix + '_statistics_download_count'), prefix + '_statistics', ['download_count'], unique=False)
|
||||
op.create_index(op.f('ix_' + prefix + '_statistics_leech_count'), prefix + '_statistics', ['leech_count'], unique=False)
|
||||
op.create_index(op.f('ix_' + prefix + '_statistics_seed_count'), prefix + '_statistics', ['seed_count'], unique=False)
|
||||
|
||||
# Trackers relationships for torrents
|
||||
op.create_table(prefix + '_torrent_trackers',
|
||||
sa.Column('torrent_id', sa.Integer(), nullable=False),
|
||||
sa.Column('tracker_id', sa.Integer(), nullable=False),
|
||||
sa.Column('order', sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['torrent_id'], [prefix + '_torrents.id'], ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['tracker_id'], ['trackers.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('torrent_id', 'tracker_id')
|
||||
)
|
||||
op.create_index(op.f('ix_' + prefix + '_torrent_trackers_order'), prefix + '_torrent_trackers', ['order'], unique=False)
|
||||
|
||||
# Torrent filelists
|
||||
op.create_table(prefix + '_torrents_filelist',
|
||||
sa.Column('torrent_id', sa.Integer(), nullable=False),
|
||||
sa.Column('filelist_blob', mysql.MEDIUMBLOB(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['torrent_id'], [prefix + '_torrents.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('torrent_id'),
|
||||
mysql_row_format='COMPRESSED'
|
||||
)
|
||||
|
||||
# Torrent info_dicts
|
||||
op.create_table(prefix + '_torrents_info',
|
||||
sa.Column('torrent_id', sa.Integer(), nullable=False),
|
||||
sa.Column('info_dict', mysql.MEDIUMBLOB(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['torrent_id'], [prefix + '_torrents.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('torrent_id'),
|
||||
mysql_row_format='COMPRESSED'
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# Note: this may fail. It's better to just drop all tables instead (or reset the database)
|
||||
|
||||
# Nyaa and Sukebei
|
||||
for prefix in TABLE_PREFIXES:
|
||||
op.drop_table(prefix + '_torrents_info')
|
||||
op.drop_table(prefix + '_torrents_filelist')
|
||||
op.drop_index(op.f('ix_' + prefix + '_torrent_trackers_order'), table_name=prefix + '_torrent_trackers')
|
||||
op.drop_table(prefix + '_torrent_trackers')
|
||||
op.drop_index(op.f('ix_' + prefix + '_statistics_seed_count'), table_name=prefix + '_statistics')
|
||||
op.drop_index(op.f('ix_' + prefix + '_statistics_leech_count'), table_name=prefix + '_statistics')
|
||||
op.drop_index(op.f('ix_' + prefix + '_statistics_download_count'), table_name=prefix + '_statistics')
|
||||
op.drop_table(prefix + '_statistics')
|
||||
op.drop_table(prefix + '_torrents')
|
||||
op.drop_index(prefix + '_uploader_flag_idx', table_name=prefix + '_torrents')
|
||||
op.drop_index(op.f('ix_' + prefix + '_torrents_info_hash'), table_name=prefix + '_torrents')
|
||||
op.drop_index(op.f('ix_' + prefix + '_torrents_flags'), table_name=prefix + '_torrents')
|
||||
op.drop_index(op.f('ix_' + prefix + '_torrents_filesize'), table_name=prefix + '_torrents')
|
||||
op.drop_index(op.f('ix_' + prefix + '_torrents_display_name'), table_name=prefix + '_torrents')
|
||||
op.drop_table(prefix + '_sub_categories')
|
||||
op.drop_table(prefix + '_main_categories')
|
||||
|
||||
# Shared tables
|
||||
op.drop_table('users')
|
||||
op.drop_table('trackers')
|
||||
# ### end Alembic commands ###
|
|
@ -1,57 +0,0 @@
|
|||
"""Remove bencoded info dicts from mysql
|
||||
|
||||
Revision ID: b61e4f6a88cc
|
||||
Revises: cf7bf6d0e6bd
|
||||
Create Date: 2017-08-29 01:45:08.357936
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
import sys
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'b61e4f6a88cc'
|
||||
down_revision = 'cf7bf6d0e6bd'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
print("--- WARNING ---")
|
||||
print("This migration drops the torrent_info tables.")
|
||||
print("You will lose all of your .torrent files if you have not converted them beforehand.")
|
||||
print("Use the migration script at utils/infodict_mysql2file.py")
|
||||
print("Type OKAY and hit Enter to continue, CTRL-C to abort.")
|
||||
print("--- WARNING ---")
|
||||
try:
|
||||
if input() != "OKAY":
|
||||
sys.exit(1)
|
||||
except KeyboardInterrupt:
|
||||
sys.exit(1)
|
||||
|
||||
op.drop_table('sukebei_torrents_info')
|
||||
op.drop_table('nyaa_torrents_info')
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.create_table('nyaa_torrents_info',
|
||||
sa.Column('info_dict', mysql.MEDIUMBLOB(), nullable=True),
|
||||
sa.Column('torrent_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
|
||||
sa.ForeignKeyConstraint(['torrent_id'], ['nyaa_torrents.id'], name='nyaa_torrents_info_ibfk_1', ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('torrent_id'),
|
||||
mysql_collate='utf8_bin',
|
||||
mysql_default_charset='utf8',
|
||||
mysql_engine='InnoDB',
|
||||
mysql_row_format='COMPRESSED'
|
||||
)
|
||||
op.create_table('sukebei_torrents_info',
|
||||
sa.Column('info_dict', mysql.MEDIUMBLOB(), nullable=True),
|
||||
sa.Column('torrent_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
|
||||
sa.ForeignKeyConstraint(['torrent_id'], ['sukebei_torrents.id'], name='sukebei_torrents_info_ibfk_1', ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('torrent_id'),
|
||||
mysql_collate='utf8_bin',
|
||||
mysql_default_charset='utf8',
|
||||
mysql_engine='InnoDB',
|
||||
mysql_row_format='COMPRESSED'
|
||||
)
|
|
@ -1,33 +0,0 @@
|
|||
"""Change comment text field from VARCHAR(255) to mysql.TEXT
|
||||
|
||||
Revision ID: b79d2fcafd88
|
||||
Revises: ffd23e570f92
|
||||
Create Date: 2017-08-14 18:57:44.165168
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'b79d2fcafd88'
|
||||
down_revision = 'ffd23e570f92'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
TABLE_PREFIXES = ('nyaa', 'sukebei')
|
||||
|
||||
def upgrade():
|
||||
for prefix in TABLE_PREFIXES:
|
||||
op.alter_column(prefix + '_comments', 'text',
|
||||
existing_type=mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_bin', length=255),
|
||||
type_=mysql.TEXT(collation='utf8mb4_bin'),
|
||||
existing_nullable=False)
|
||||
|
||||
|
||||
def downgrade():
|
||||
for prefix in TABLE_PREFIXES:
|
||||
op.alter_column(prefix + '_comments', 'text',
|
||||
existing_type=mysql.TEXT(collation='utf8mb4_bin'),
|
||||
type_=mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_bin', length=255),
|
||||
existing_nullable=False)
|
|
@ -1,30 +0,0 @@
|
|||
"""Add edited_time to Comments
|
||||
|
||||
Revision ID: cf7bf6d0e6bd
|
||||
Revises: 500117641608
|
||||
Create Date: 2017-10-28 15:32:12.687378
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'cf7bf6d0e6bd'
|
||||
down_revision = '500117641608'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('nyaa_comments', sa.Column('edited_time', sa.DateTime(), nullable=True))
|
||||
op.add_column('sukebei_comments', sa.Column('edited_time', sa.DateTime(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('sukebei_comments', 'edited_time')
|
||||
op.drop_column('nyaa_comments', 'edited_time')
|
||||
# ### end Alembic commands ###
|
|
@ -1,37 +0,0 @@
|
|||
"""Add comments table.
|
||||
|
||||
Revision ID: d0eeb8049623
|
||||
Revises: 3001f79b7722
|
||||
Create Date: 2017-05-22 22:58:12.039149
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'd0eeb8049623'
|
||||
down_revision = '3001f79b7722'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
TABLE_PREFIXES = ('nyaa', 'sukebei')
|
||||
|
||||
|
||||
def upgrade():
|
||||
for prefix in TABLE_PREFIXES:
|
||||
op.create_table(prefix + '_comments',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('torrent_id', sa.Integer(), nullable=False),
|
||||
sa.Column('user_id', sa.Integer(), nullable=True),
|
||||
sa.Column('created_time', sa.DateTime(), nullable=True),
|
||||
sa.Column('text', sa.String(length=255, collation='utf8mb4_bin'), nullable=False),
|
||||
sa.ForeignKeyConstraint(['torrent_id'], [prefix + '_torrents.id'], ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
for prefix in TABLE_PREFIXES:
|
||||
op.drop_table(prefix + '_comments')
|
|
@ -1,40 +0,0 @@
|
|||
"""add rangebans
|
||||
|
||||
Revision ID: f69d7fec88d6
|
||||
Revises: 6cc823948c5a
|
||||
Create Date: 2018-06-01 14:01:49.596007
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'f69d7fec88d6'
|
||||
down_revision = '6cc823948c5a'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('rangebans',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('cidr_string', sa.String(length=18), nullable=False),
|
||||
sa.Column('masked_cidr', sa.BigInteger(), nullable=False),
|
||||
sa.Column('mask', sa.BigInteger(), nullable=False),
|
||||
sa.Column('enabled', sa.Boolean(), nullable=False),
|
||||
sa.Column('temp', sa.DateTime(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_index(op.f('ix_rangebans_mask'), 'rangebans', ['mask'], unique=False)
|
||||
op.create_index(op.f('ix_rangebans_masked_cidr'), 'rangebans', ['masked_cidr'], unique=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(op.f('ix_rangebans_masked_cidr'), table_name='rangebans')
|
||||
op.drop_index(op.f('ix_rangebans_mask'), table_name='rangebans')
|
||||
op.drop_table('rangebans')
|
||||
# ### end Alembic commands ###
|
|
@ -1,28 +0,0 @@
|
|||
"""add registration IP
|
||||
|
||||
Revision ID: f703f911d4ae
|
||||
Revises: f69d7fec88d6
|
||||
Create Date: 2018-07-09 13:04:50.652781
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'f703f911d4ae'
|
||||
down_revision = 'f69d7fec88d6'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('users', sa.Column('registration_ip', sa.Binary(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('users', 'registration_ip')
|
||||
# ### end Alembic commands ###
|
|
@ -1,24 +0,0 @@
|
|||
"""Add is_webseed to Trackers
|
||||
|
||||
Revision ID: ffd23e570f92
|
||||
Revises: 1add911660a6
|
||||
Create Date: 2017-07-29 19:03:58.244769
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'ffd23e570f92'
|
||||
down_revision = '1add911660a6'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.add_column('trackers', sa.Column('is_webseed', sa.Boolean(), nullable=False))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_column('trackers', 'is_webseed')
|
|
@ -26,7 +26,7 @@ def create_app(config: Any) -> Flask:
|
|||
app.config.from_object(config)
|
||||
|
||||
# Session cookie configuration
|
||||
app.config['SESSION_COOKIE_NAME'] = 'nyaav3_session'
|
||||
app.config['SESSION_COOKIE_NAME'] = 'synthoria_session'
|
||||
app.config['SESSION_COOKIE_SECURE'] = True
|
||||
app.config['SESSION_COOKIE_HTTPONLY'] = True
|
||||
app.config['SESSION_COOKIE_SAMESITE'] = 'Lax'
|
||||
|
|
|
@ -577,7 +577,7 @@ body.dark .panel-deleted > .panel-heading {
|
|||
|
||||
.torrent-list .hdr-date,
|
||||
.torrent-list .hdr-downloads,
|
||||
.torrent-list td: nth-of-type(5),
|
||||
.torrent-list td:nth-of-type(5),
|
||||
.torrent-list td:nth-of-type(8) {
|
||||
display: none;
|
||||
}
|
||||
|
|
Before Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.5 KiB |
BIN
nyaa/static/img/icons/nyaa/1_5.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
nyaa/static/img/icons/nyaa/1_6.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
nyaa/static/img/icons/nyaa/1_7.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 3.5 KiB |
BIN
nyaa/static/img/icons/nyaa/2_3.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
nyaa/static/img/icons/nyaa/2_4.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
nyaa/static/img/icons/nyaa/2_5.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
nyaa/static/img/icons/nyaa/2_6.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 3.5 KiB |
BIN
nyaa/static/img/icons/nyaa/3_4.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.5 KiB |
BIN
nyaa/static/img/icons/nyaa/4_5.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
nyaa/static/img/icons/nyaa/4_6.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.5 KiB |
BIN
nyaa/static/img/icons/nyaa/6_2 .png
Normal file
After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.2 KiB |
BIN
nyaa/static/img/icons/nyaa/6_3.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
nyaa/static/img/icons/nyaa/7_1.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
nyaa/static/img/icons/nyaa/7_2.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
nyaa/static/img/icons/nyaa/7_3.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
nyaa/static/img/icons/nyaa/7_4.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
nyaa/static/img/icons/nyaa/8_1.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
nyaa/static/img/icons/nyaa/8_2.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
nyaa/static/img/icons/nyaa/8_3.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
nyaa/static/img/icons/nyaa/8_4.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
nyaa/static/img/icons/nyaa/8_5.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
nyaa/static/img/icons/nyaa/8_6.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 3.4 KiB |
|
@ -1,7 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16" height="16" viewBox="0 0 16 16" version="1.1">
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
id="r"
|
||||
d="M2.80456 0.0C1.53169 0.0 0.46231 0.8395 0.11722 1.9974C0.65595 2.6291 1.917 3.6348 4.10868 2.8607C7.12099 1.7967 7.21946 1.0731 9.37026 1.3071C9.58017 1.0151 9.8039 0.7698 10.04032 0.6029C10.70196 0.1359 11.16916 0.3905 11.45037 0.7121C11.67687 0.5235 12.04906 0.231 12.43243 0.0C12.43243 0.0 2.80456 0.0 2.80456 0.0C2.80456 0.0 2.80456 0.0 2.80456 0.0M8.00586 4.1565C7.84838 4.1551 7.51975 4.218 6.90756 4.5707C6.32291 5.0887 4.71324 5.8388 3.58983 7.3761C2.65561 8.6547 0.6318 10.4905 0.0 10.8481C0.0 10.8481 0.0 13.1958 0.0 13.1958C0.0 13.8053 0.19257 14.3683 0.52035 14.8274C0.74197 14.288 1.07908 13.6922 1.57055 13.322C2.65031 12.5087 3.13704 12.5341 3.75811 12.7751C4.52415 13.0724 6.64158 13.0993 7.80801 12.9699C7.81331 12.7432 7.82472 12.5788 7.82472 12.5788C8.51884 11.8426 9.00263 11.6533 9.31288 11.648C9.41697 11.6463 9.50152 11.6652 9.56759 11.692C9.63769 11.4325 9.69719 11.1385 9.7339 10.8124C9.43319 10.0384 9.30012 9.2173 9.30012 9.2173C8.8413 10.3077 8.68011 11.1204 8.68011 11.1204C8.44154 10.4669 8.48684 9.7137 8.52662 9.367C8.52662 9.367 8.03506 8.8767 8.03506 8.8767C8.03506 8.8767 8.11451 8.2391 8.11451 8.2391C8.00137 7.4964 8.01913 6.7829 8.04368 6.377C7.99896 6.3933 7.95905 6.4025 7.92287 6.4086C7.50219 6.4787 7.64242 5.8757 7.81069 5.0764C7.85267 4.877 7.93828 4.551 8.06321 4.1604C8.04737 4.1583 8.02836 4.1567 8.00586 4.1565C8.00586 4.1565 8.00586 4.1565 8.00586 4.1565M11.18032 6.515C11.09331 6.5159 11.00225 6.5201 10.90696 6.528C10.90696 6.528 10.54514 6.5705 10.44698 6.518C10.44698 6.518 10.57608 6.6381 10.85859 6.6324C10.3529 7.6834 10.61941 8.1146 10.61941 8.1146C10.58585 7.1328 11.21659 7.0483 11.35914 7.0621C11.235 7.2101 11.12397 7.6103 11.10413 7.9867C11.066 8.7101 11.76774 8.609 11.9888 8.5101C12.20598 8.4129 12.54484 8.2304 12.58425 7.379C12.81473 7.4825 13.04872 7.8568 13.04872 7.8568C13.04872 7.8568 12.94965 6.4965 11.18032 6.515C11.18032 6.515 11.18032 6.515 11.18032 6.515M1.57573 7.7361C0.71803 8.0557 0.18167 8.127 0.0 8.1429C0.0 8.1429 0.0 9.8096 0.0 9.8096C0.26935 9.6733 1.6355 8.5429 1.57573 7.7361C1.57573 7.7361 1.57573 7.7361 1.57573 7.7361M14.05083 10.8819C13.87555 11.471 13.48992 11.5621 13.48992 11.5621C13.9667 11.7094 14.09991 11.499 14.14899 11.3939C14.19807 11.2887 14.05083 10.8819 14.05083 10.8819C14.05083 10.8819 14.05083 10.8819 14.05083 10.8819M16.0 11.826C15.53318 12.3666 14.74715 13.2132 14.30324 13.336C13.86892 13.4562 13.39197 13.5215 13.119 13.5394C13.24082 13.6817 13.53787 14.0936 13.65064 14.5111C13.87676 14.7663 14.30387 15.2545 14.59348 15.63C15.43531 15.147 16.0 14.2398 16.0 13.1958C16.0 13.1958 16.0 11.826 16.0 11.826C16.0 11.826 16.0 11.826 16.0 11.826"
|
||||
/>
|
||||
</svg>
|
Before Width: | Height: | Size: 2.8 KiB |
|
@ -1,14 +0,0 @@
|
|||
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http:/www.mozilla.org/2006/browser/search/">
|
||||
<ShortName>Sukebei (Nyaa.si)</ShortName>
|
||||
|
||||
<Description>Search torrents on Sukebei (Nyaa.si).</Description>
|
||||
<InputEncoding>UTF-8</InputEncoding>
|
||||
<Image width="32" height="32" type="image/png">data:image/png;base64,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</Image>
|
||||
<Url type="text/html" method="get" template="https://sukebei.nyaa.si/">
|
||||
<Param name="f" value="0"/>
|
||||
<Param name="c" value="0_0"/>
|
||||
<Param name="q" value="{searchTerms}"/>
|
||||
</Url>
|
||||
<Url type="application/opensearchdescription+xml" rel="self" template="https://sukebei.nyaa.si/static/search-sukebei.xml"/>
|
||||
<moz:SearchForm>https://sukebei.nyaa.si/</moz:SearchForm>
|
||||
</OpenSearchDescription>
|
|
@ -1,14 +1,14 @@
|
|||
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http:/www.mozilla.org/2006/browser/search/">
|
||||
<ShortName>Nyaa.si</ShortName>
|
||||
|
||||
<Description>Search torrents on Nyaa.si.</Description>
|
||||
<Description>Search torrents on Synthoria Archive.</Description>
|
||||
<InputEncoding>UTF-8</InputEncoding>
|
||||
<Image width="32" height="32" type="image/png">data:image/png;base64,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</Image>
|
||||
<Url type="text/html" method="get" template="https://nyaa.si/">
|
||||
<Url type="text/html" method="get" template="https://archive.synthoria.moe/">
|
||||
<Param name="f" value="0"/>
|
||||
<Param name="c" value="0_0"/>
|
||||
<Param name="q" value="{searchTerms}"/>
|
||||
</Url>
|
||||
<Url type="application/opensearchdescription+xml" rel="self" template="https://nyaa.si/static/search.xml"/>
|
||||
<moz:SearchForm>https://nyaa.si/</moz:SearchForm>
|
||||
<Url type="application/opensearchdescription+xml" rel="self" template="https://archive.synthoria.moe/static/search.xml"/>
|
||||
<moz:SearchForm>https://archive.synthoria.moe/</moz:SearchForm>
|
||||
</OpenSearchDescription>
|
|
@ -10,20 +10,20 @@
|
|||
|
||||
{{ linkable_header("Torrent Colors", "torrent-colors") }}
|
||||
<div>
|
||||
<span style="color:green; font-weight: bold;">Green</span> entries (trusted) are:
|
||||
<span style="color:green; font-weight: bold;">Green</span> (trusted) entries are:
|
||||
<ul>
|
||||
<li>Torrents uploaded by trusted users.</li>
|
||||
<li>Torrents that have been verified by the archive team or trusted users.</li>
|
||||
</ul>
|
||||
<span style="color:red; font-weight: bold;">Red</span> entries (remake) are torrents that match any of the following:
|
||||
<span style="color:red; font-weight: bold;">Red</span> (repack) entries are torrents that match any of the following:
|
||||
<ul>
|
||||
<li>Reencode of original release.</li>
|
||||
<li>Remux of another uploader's original release for hardsubbing and/or fixing purposes.</li>
|
||||
<li>Reupload of original release using non-original file names.</li>
|
||||
<li>Reupload of original release with missing and/or unrelated additional files.</li>
|
||||
<li>Repackage or recompress of original media.</li>
|
||||
<li>Unofficial edit, reencode or remaster of original media.</li>
|
||||
<li>Reupload of original media with missing and/or unrelated additional files.</li>
|
||||
</ul>
|
||||
<span style="color:orange; font-weight: bold;">Orange</span> entries are:
|
||||
<span style="color:orange; font-weight: bold;">Orange</span> (collection) entries are:
|
||||
<ul>
|
||||
<li>Batches of completed series.</li>
|
||||
<li>Torrents that represent a larger collection or bundle, such as a series of related files, a collection of works by a single author, or a curated selection of files on a specific topic.</li>
|
||||
<li>Torrents that provide supplementary materials or resources related to other files in the archive, such as documentation, tutorials, or additional data.</li>
|
||||
</ul>
|
||||
<span style="color:grey; font-weight: bold;">Grey</span> entries are:
|
||||
<ul>
|
||||
|
@ -33,7 +33,7 @@
|
|||
|
||||
{{ linkable_header("Using the Search Engine", "using-search") }}
|
||||
<div>
|
||||
Search results can be filtered by category, remake, trusted, and users.
|
||||
Search results can be filtered by category, edited, trusted, and users.
|
||||
The results can be further sorted by size, date, seeders, leechers, completed count, and comment count.
|
||||
</div>
|
||||
<div>
|
||||
|
@ -88,8 +88,9 @@
|
|||
|
||||
{{ linkable_header("Changing Your User's Avatar", "avatar") }}
|
||||
<div>
|
||||
The site uses the <a href="https://www.gravatar.com">Gravatar</a> service for user avatars.
|
||||
Check out <a href="https://www.gravatar.com/support/">Gravatar's help section</a> for more detailed instructions.
|
||||
<s>The site uses the <a href="https://www.gravatar.com">Gravatar</a> service for user avatars.
|
||||
Check out <a href="https://www.gravatar.com/support/">Gravatar's help section</a> for more detailed instructions.</s>
|
||||
Gravatar is disabled until further notice..
|
||||
</div>
|
||||
|
||||
{{ linkable_header("Deleting Your Torrent", "delete") }}
|
||||
|
@ -102,134 +103,17 @@
|
|||
|
||||
{{ linkable_header("Getting Trusted Status", "trusted") }}
|
||||
<div>
|
||||
At the moment we have no established process for granting trusted status to users
|
||||
who did not previously have it. If and when we establish such a process it will be announced.
|
||||
At the moment we have no established process for granting trusted status to users.
|
||||
Please contact the team if you'd like to apply as a trusted user.
|
||||
</div>
|
||||
|
||||
{{ linkable_header("IRC Help Channel Policies", "irchelp") }}
|
||||
<div>
|
||||
<p>Our IRC help channel is at Rizon <a>#nyaa-help</a>. A webchat link
|
||||
pre-filled with our channel is available <a>right here</a>.</p>
|
||||
|
||||
<b>Read this to avoid getting banned:</b>
|
||||
<ul>
|
||||
<li>The IRC channel is for site support <b>only</b>.</li>
|
||||
<li>XDCC, similar services, and their triggers are not allowed.</li>
|
||||
<li>Do not idle if you do not need site support unless you have voice/+ access, you may be removed otherwise</li>
|
||||
<li>We do not know when A or B will be released, if it's authentic, or anything about a particular release. Do not ask.</li>
|
||||
<li><b>Requests are not allowed.</b> We only manage the site; we do not necessarily have the material you want on hand.</li>
|
||||
<li>Use English only. Even though we aren't all from English-speaking countries, we need level ground to communicate on.</li>
|
||||
<li><b>Do NOT under any circumstances send private messages to the staff. Ask your question in the channel on joining and wait; a staff member will respond in due time.</b></li>
|
||||
</ul>
|
||||
|
||||
<b>Keep these things in mind when asking for help:</b>
|
||||
<ul>
|
||||
<li>We are not interested in your user name. Paste a link to your account if you want us to do something with it.</li>
|
||||
<li>Provide as many details as possible. If you are having trouble submitting any kind of entry, we want to know everything about you and what (except any passwords) you supply to the form in question.</li>
|
||||
</ul>
|
||||
<h2>Copyright infringement</h2>
|
||||
<p>If you are a copyright holder and believe that your work is being hosted on this platform
|
||||
without your permission, please contact us at pbagnpg@flagubevn.zbr (ROT13 encoded). We take copyright infringement seriously and will
|
||||
promptly remove any infringing content upon receipt of a valid takedown notice. Please provide us with
|
||||
sufficient information to identify the copyrighted work, such as the title, description, and URL of the infringing
|
||||
content, as well as proof of your ownership or rights to the work. We will respond to all valid takedown notices and work
|
||||
with you to resolve the issue promptly.</p>
|
||||
</div>
|
||||
|
||||
{# <div class="content">
|
||||
<h1>Help</h1>
|
||||
<p><b>The search engine</b> is located at the top right, and it allows users to search through the torrent titles available on the site. Results matching either word A or B can be included by typing a vertical bar between them (|). Results matching a certain word can be excluded by prefixing that word with a hyphen-minus (-). Phrases can be matched by surrounding them with double-quotes (). Search results can be filtered by category, remake, trusted, and/or A+ status, and then narrowed down further by age and size ranges as well as excluding specific users. Sorting can be done in ascending or descending order by date, amount of seeders/leechers/downloads, size, or name. The search engine adapts to the current view and makes it possible to search for specific torrents in a specific subcategory from a specific user.</p>
|
||||
<p><b>Blue entries:</b></p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>Torrents marked as A+ quality are blue in the torrent lists.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>These are exclusive torrents picked by us.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>They represent the best available version of this content.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>There will be no duplicates.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Only versions that we actually consider worthy of a seal of approval will be listed.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p>Uploaders are encouraged to leave a complete description of the release on the torrent information page. This is especially true for batches.<br></p>
|
||||
<p><b>Green entries:</b> Torrents uploaded by trusted users are green in the torrent lists.<br></p>
|
||||
<p><b>Orange entries:</b> Torrents must be marked as remakes if any of the following applies to the release:</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>Reencode of original release.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Remux of another uploader's original release for hardsubbing and/or fixing purposes.</p>
|
||||
</li><!--<li>Non-v2 (or non-v3, etc.) remux of original release using a similar source.</li>-->
|
||||
<li>
|
||||
<p>Reupload of original release using non-original file names.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Reupload of original release with missing and/or unrelated additional files.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p><b>Red entries:</b> Torrents containing completed series or other complete sets are red.<br></p>
|
||||
<p><b>Grey entries:</b> Hidden torrents are grey.<br></p>
|
||||
<p><b>The tools to manage your torrents</b> are located right above the torrent's details on the information page. Editable fields are the torrent's title, category, description, information link, metadata, and the alias and key fields which are explained on the page. It is also possible to hide the torrent which prevents it from being displayed in lists or even delete it altogether.<br></p>
|
||||
<p><b>Pseudo-anonymous uploads</b> are torrents that will appear to be anonymous, but you can still manage them through your account.<br></p>
|
||||
<p><b>Flagging torrents</b> points them out for moderator review. Torrents can be flagged by clicking on the link located in the upper right corner of their information pages.<br></p>
|
||||
<p><b>RSS</b> is a useful Web feed that automatically updates when a torrent is added by a user. Many programs such as popular BitTorrent clients, which can be set up for automatic downloading, can make use of RSS feeds. The RSS feed link is dynamic which means that it will - like the search function - adapt to the current view, search results included.<br></p>
|
||||
<p><b>BBCode user input</b> is parsed by the torrent descriptions, information links, and torrent comments, and they all support basic BBCode like [b], [i], [s], [u], [left], [center], [right], [code], [email], [img], [url], [color], [font], [size], [quote], and [spoiler].<br></p>
|
||||
<p><b>The upload page</b> returns various HTTP status codes in order to simplify automated uploads. The following details the custom codes used:</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>200: The ID of the uploaded torrent can be found in the Record-ID header.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>418: You're doing it wrong.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>460: You forgot to include a valid announce URL. Torrents using only DHT are not allowed, because this is most often just a mistake on behalf of the uploader.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>461: This torrent already exists in the database.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>462: The file you uploaded or linked to does not seem to be a torrent.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>463: The form is missing required data like the category and/or the checkbox which confirms that you have read the rules.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>520: Server-side error. Wait for a few minutes, and then notify Nyaa if the problem did not go away.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<h1>IRC help channel</h1><a href="irc://irc-server:port/channel?key">
|
||||
<h1>NyaaV3 IRC</h1></a>
|
||||
<p>The IRC channel is only for site support.<br></p>
|
||||
<p><b>Read this to avoid getting banned:</b></p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>Do not sit around if you do not need site support unless you have voice/+ access.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Requests are not allowed. We only manage the site; we do not necessarily have the material you want on hand.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>We do not know when A or B will be released, if it's authentic, or anything about a particular release. Do not ask.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>XDCC, similar services, and their triggers are not allowed.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Use English only. Even though we aren't all from English-speaking countries, we need level ground to communicate on.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Do not send private messages to the staff. Ask your question in the channel on joining and wait; a staff member will respond in due time.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p><b>Keep these things in mind when asking for help:</b></p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>We are not interested in your user name. Paste a link to your account if you want us to do something with it.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Provide as many details as possible. If you are having trouble submitting any kind of entry, we want to know everything about you and what (except any passwords) you supply to the form in question.</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div> #}
|
||||
{% endblock %}
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
{% if search.term %}
|
||||
<meta property="og:description" content="Search for '{{ search.term }}'">
|
||||
{% else %}
|
||||
<meta name="description" content="A BitTorrent community focused on Eastern Asian media including anime, manga, music, and more">
|
||||
<meta name="keywords" content="torrents, bittorrent, torrent, anime, manga, sukebei, download, nyaa, magnet, magnets">
|
||||
<meta property="og:description" content="{{ config.SITE_NAME }} homepage">
|
||||
<meta name="description" content="A voice synth community focused on documenting and preserving voice synthesizers and more">
|
||||
<meta name="keywords" content="torrents, bittorrent, torrent, vocaloid, voicebank, download, magnet, magnets">
|
||||
<meta property="og:description" content="{{ config.SITE_NAME }} Homepage">
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
|
|
|
@ -182,29 +182,52 @@
|
|||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% set nyaa_cats = [('1_0', 'Anime', 'Anime'),
|
||||
('1_1', '- Anime Music Video', 'Anime - AMV'),
|
||||
('1_2', '- English-translated', 'Anime - English'),
|
||||
('1_3', '- Non-English-translated', 'Anime - Non-English'),
|
||||
('1_4', '- Raw', 'Anime - Raw'),
|
||||
('2_0', 'Audio', 'Audio'),
|
||||
('2_1', '- Lossless', 'Audio - Lossless'),
|
||||
('2_2', '- Lossy', 'Audio - Lossy'),
|
||||
('3_0', 'Literature', 'Literature'),
|
||||
('3_1', '- English-translated', 'Literature - English'),
|
||||
('3_2', '- Non-English-translated', 'Literature - Non-English'),
|
||||
('3_3', '- Raw', 'Literature - Raw'),
|
||||
('4_0', 'Live Action', 'Live Action'),
|
||||
('4_1', '- English-translated', 'Live Action - English'),
|
||||
('4_2', '- Idol/Promotional Video', 'Live Action - Idol/PV'),
|
||||
('4_3', '- Non-English-translated', 'Live Action - Non-English'),
|
||||
('4_4', '- Raw', 'Live Action - Raw'),
|
||||
{% set nyaa_cats = [('1_0', 'Voicebanks', 'Voicebanks'),
|
||||
('1_1', '- VOCALOID', 'Voicebanks - VOCALOID'),
|
||||
('1_2', '- UTAU', 'Voicebanks - UTAU'),
|
||||
('1_3', '- Synthesizer V', 'Voicebanks - SynthV'),
|
||||
('1_4', '- CeVIO', 'Voicebanks - CeVIO'),
|
||||
('1_5', '- Piapro Studio', 'Voicebanks - Piapro Studio'),
|
||||
('1_6', '- NEUTRINO', 'Voicebanks - NEUTRINO'),
|
||||
('1_7', '- Other', 'Voicebanks - Other'),
|
||||
('2_0', 'Software', 'Software'),
|
||||
('2_1', '- Synthesizers', 'Software - Synthesizers'),
|
||||
('2_2', '- Plugins', 'Software - Plugins'),
|
||||
('2_3', '- Tools', 'Software - Tools'),
|
||||
('2_4', '- Applications', 'Software - Applications'),
|
||||
('2_5', '- Games', 'Software - Games'),
|
||||
('2_6', '- Other', 'Software - Other'),
|
||||
('3_0', 'Voice Sequences', 'Voice Sequences'),
|
||||
('3_1', '- VSQ/VSQx', 'Voice Sequences - VSQ/VSQx'),
|
||||
('3_2', '- UST', 'Voice Sequences - UST'),
|
||||
('3_3', '- MIDI', 'Voice Sequences - MIDI'),
|
||||
('3_4', '- Other', 'Voice Sequences - Other'),
|
||||
('4_0', 'Reclists', 'Reclists'),
|
||||
('4_1', '- Japanese', 'Reclists - Japanese'),
|
||||
('4_2', '- English', 'Reclists - English'),
|
||||
('4_3', '- Chinese', 'Reclists - Chinese'),
|
||||
('4_4', '- Korean', 'Reclists - Korean'),
|
||||
('4_5', '- Spanish', 'Reclists - Spanish'),
|
||||
('4_6', '- Other', 'Reclists - Other'),
|
||||
('5_0', 'Pictures', 'Pictures'),
|
||||
('5_1', '- Graphics', 'Pictures - Graphics'),
|
||||
('5_2', '- Photos', 'Pictures - Photos'),
|
||||
('6_0', 'Software', 'Software'),
|
||||
('6_1', '- Applications', 'Software - Apps'),
|
||||
('6_2', '- Games', 'Software - Games')]
|
||||
('6_0', 'Audio', 'Audio'),
|
||||
('6_1', '- Songs', 'Audio - Songs'),
|
||||
('6_2', '- Demos', 'Audio - Demos'),
|
||||
('6_3', '- Other', 'Audio - Other'),
|
||||
('7_0', 'Video', 'Video'),
|
||||
('7_1', '- Music Videos', 'Video - Music Videos'),
|
||||
('7_2', '- Promo Videos', 'Video - Promo Videos'),
|
||||
('7_3', '- Demos', 'Video - Demos'),
|
||||
('7_4', '- Other', 'Video - Other'),
|
||||
('8_0', 'Lyrics', 'Lyrics'),
|
||||
('8_1', '- Japanese', 'Lyrics - Japanese'),
|
||||
('8_2', '- English', 'Lyrics - English'),
|
||||
('8_3', '- Chinese', 'Lyrics - Chinese'),
|
||||
('8_4', '- Korean', 'Lyrics - Korean'),
|
||||
('8_5', '- Spanish', 'Lyrics - Spanish'),
|
||||
('8_6', '- Other', 'Lyrics - Other')]
|
||||
%}
|
||||
|
||||
{% set suke_cats = [('1_0', 'Art', 'Art'),
|
||||
|
@ -237,7 +260,7 @@
|
|||
|
||||
<select class="form-control" title="Filter" data-width="120px" name="f">
|
||||
<option value="0" title="No filter" {% if search is defined and search["quality_filter"] == "0" %}selected{% else %}selected{% endif %}>No filter</option>
|
||||
<option value="1" title="No remakes" {% if search is defined and search["quality_filter"] == "1" %}selected{% endif %}>No remakes</option>
|
||||
<option value="1" title="No repacks" {% if search is defined and search["quality_filter"] == "1" %}selected{% endif %}>No remakes</option>
|
||||
<option value="2" title="Trusted only" {% if search is defined and search["quality_filter"] == "2" %}selected{% endif %}>Trusted only</option>
|
||||
</select>
|
||||
|
||||
|
@ -271,7 +294,7 @@
|
|||
<div class="input-group-btn nav-filter" id="navFilter-criteria">
|
||||
<select class="selectpicker show-tick" title="Filter" data-width="120px" name="f">
|
||||
<option value="0" title="No filter" {% if search is defined and search["quality_filter"] == "0" %}selected{% else %}selected{% endif %}>No filter</option>
|
||||
<option value="1" title="No remakes" {% if search is defined and search["quality_filter"] == "1" %}selected{% endif %}>No remakes</option>
|
||||
<option value="1" title="No repacks" {% if search is defined and search["quality_filter"] == "1" %}selected{% endif %}>No remakes</option>
|
||||
<option value="2" title="Trusted only" {% if search is defined and search["quality_filter"] == "2" %}selected{% endif %}>Trusted only</option>
|
||||
</select>
|
||||
</div>
|
||||
|
@ -331,7 +354,7 @@
|
|||
<footer style="text-align: center;">
|
||||
<p>Dark Mode: <a href="#" id="themeToggle">Toggle</a></p>
|
||||
{% if config.COMMIT_HASH %}
|
||||
<p>Commit: <a href="https://github.com/nyaadevs/nyaa/tree/{{ config.COMMIT_HASH }}">{{ config.COMMIT_HASH[:7] }}</a></p>
|
||||
<p>Commit: <a href="https://github.com/ProjectSynthoria/SynthoraArchive/tree/{{ config.COMMIT_HASH }}">{{ config.COMMIT_HASH[:7] }}</a></p>
|
||||
{% endif %}
|
||||
</footer>
|
||||
</body>
|
||||
|
|
|
@ -4,85 +4,22 @@
|
|||
|
||||
<div class="content">
|
||||
<h1>Site Rules</h1><!-- <br> -->
|
||||
{# <b>Spoilers:</b> Your account will be banned if you repeatedly post these without using the [spoiler] tag properly. #}
|
||||
<h1>Breaking any of the rules on this page may result in being banned</h1>
|
||||
<p><b>Shitposting and Trolling:</b> Your account will be banned if you keep this up. Repeatedly making inaccurate/false reports falls under this rule as well.</p>
|
||||
<h1>Breaking any of the rules on this page may result in getting banned</h1>
|
||||
<p><b>Shitposting and trolling:</b> Your account will be banned if you keep this up. Repeatedly making inaccurate/false reports falls under this rule as well.</p>
|
||||
<p><b>Bumping:</b> Your account will be banned if you keep deleting and reposting your torrents.</p>
|
||||
<p><b>Flooding:</b> If you have five or more releases of the same type to release in one go, make a batch torrent containing all of them.</p>
|
||||
<p><b>URL redirection services:</b> These are removed on sight along with their torrents.</p>
|
||||
<p><b>Advertising:</b> No.</p>
|
||||
<p><b>Content restrictions:</b> This site is for content that originates from and/or is specific to China, Japan, and/or Korea.</p>
|
||||
<p>Other content is not allowed without exceptions and will be removed.</p><br>
|
||||
<p><a href="//{{ config.EXTERNAL_URLS['main'] }}"><b>{{ config.EXTERNAL_URLS['main'] }}</b></a> is for <b>work-safe</b> content only. The following rules apply:</p>
|
||||
<p><b>Malware:</b> No.</p>
|
||||
<p><b>Content restrictions:</b> This site is for content related to voice synthesizers. Other content is prohibited without exceptions and will be removed.</p>
|
||||
<h3>Synthoria is dedicated to hosting and preserving legal torrents only. We do not facilitate piracy in any form. This website is not a platform for pirated materials, and we encourage users to respect the intellectual property rights of creators and owners.</h3>
|
||||
<h4>This platform may host content that does not strictly adhere to the End User License Agreement (EULA) of certain voice synthesizers. While we allow such content to be shared, we emphasize that users who download and use this content do so at their own risk. By using this content, users acknowledge that they are responsible for ensuring compliance with the relevant EULA and any applicable laws. We do not condone or encourage any violation of EULAs or laws, and we disclaim any liability for any consequences arising from the use of such content.</h4>
|
||||
<p><b>Notes concerning uploading other people's work:</b></p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>No pornography of any kind.</p>
|
||||
<p>Do not upload cracked or pirated voice synthesizers or voicebanks. Only official, legal, or open-source content is allowed.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>No extreme visual content. This means no scat, gore, or any other of such things.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Troll torrents are not allowed. These will be removed on sight.</p>
|
||||
</li>
|
||||
</ul><br>
|
||||
<p><a href="//{{ config.EXTERNAL_URLS['fap'] }}"><b>{{ config.EXTERNAL_URLS['fap'] }}</b></a> is the place for <b>non-work-safe</b> content only. Still, the following rules apply:</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>No extreme real life visual content. This means no scat, gore, bestiality, or any other of such things.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Absolutely no real life child pornography of any kind.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Troll torrents are not allowed. These will be removed on sight.</p>
|
||||
</li>
|
||||
</ul><br>
|
||||
<p><b>Torrent information:</b> Text files (.txt) or info files (.nfo) for torrent or release group information are preferred.</p>
|
||||
<p>Torrents containing (.chm) or (.url) files may be removed.</p><br>
|
||||
<p><b>Upper limits on video resolution based on source:</b></p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>DVD source video is limited to 1024x576p.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Web source video is limited to 1920x1080p or source resolution, whichever is lower.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>TV source video is by default limited to 1920x1080p.<!-- The BS11, BS-NTV, NHK-BS Premium, and WOWOW channels are limited to 1920x1080p.--> SD channels, however, are limited to 480p.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Blu-ray source video is limited to 1920x1080p.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>UHD source video is limited to 3840x2160p.</p>
|
||||
</li>
|
||||
</ul><br>
|
||||
<p>Naturally, untouched sources are not bound by these limits. Leaks are also not subject to any resolution limits.</p><br>
|
||||
<p><b>Finally, a few notes concerning tagging and using other people's work:</b></p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>Do not add your own tag(s) when reuploading an original release.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Unless you are reuploading an original release, you should either avoid using tags that are not your own or make it extremely clear to everyone that you are the one responsible for the upload.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>If these policies are not obeyed, then those torrents will be removed if reported by a group or person commonly seen as the owner of the tag(s). This especially applies to remake torrents.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Although only hinted at above, we may remove troll torrents tagged with A-sucks, B-is-slow, or such if reported by A or B.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Remakes which are utterly bit rate-starved are not allowed.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Remakes which add watermarks or such are not allowed.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Remakes which reencode video to XviD or worse are not allowed.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Remakes of JPG/PNG-based releases are not allowed without exceptions since there is most often no point in making such.</p>
|
||||
<p>Do not upload voicebanks where the author has explicitly stated that redistribution is prohibited.</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -86,20 +86,20 @@
|
|||
</div>
|
||||
<div class="hidden-xl hidden-lg"><br></div>
|
||||
<div class="btn-group" data-toggle="buttons">
|
||||
<label class="btn btn-danger" title="This torrent is derived from another release">
|
||||
<label class="btn btn-danger" title="This torrent is a repack/reencode/recompress">
|
||||
{{ upload_form.is_remake }}
|
||||
<span class="glyphicon glyphicon-check"></span>
|
||||
<span class="glyphicon glyphicon-unchecked"></span>
|
||||
Remake
|
||||
</label>
|
||||
<label class="btn btn-warning" title="This torrent is a complete batch (eg. season)">
|
||||
<label class="btn btn-warning" title="This torrent is a collection">
|
||||
{{ upload_form.is_complete }}
|
||||
<span class="glyphicon glyphicon-check"></span>
|
||||
<span class="glyphicon glyphicon-unchecked"></span>
|
||||
Complete
|
||||
</label>
|
||||
{% if g.user.is_trusted %}
|
||||
<label class="btn btn-success active" title="Mark torrent trusted">
|
||||
<label class="btn btn-success active" title="Mark torrent as trusted">
|
||||
{{ upload_form.is_trusted(checked="") }}
|
||||
<span class="glyphicon glyphicon-check"></span>
|
||||
<span class="glyphicon glyphicon-unchecked"></span>
|
||||
|
|