Move compose to top level

Comment out broken scrapers

Remove db init scripts and use ENABLE_SYNC env var which the code base uses to specify if Sequelize should create or alter tables on startup, meaning we dont need manual db initialization. There were missing tables anyhow :P
This commit is contained in:
iPromKnight
2024-01-18 08:54:57 +00:00
committed by GitHub
parent 2351d92885
commit da997af64a
4 changed files with 45 additions and 94 deletions

View File

@@ -4,7 +4,6 @@
## Self-hosted quickstart
```
cd addon/hosted
docker-compose up -d
```
Then open your browser to `127.0.0.1:7000`

View File

@@ -1,53 +0,0 @@
CREATE TABLE "torrents" (
"infoHash" varchar(64) PRIMARY KEY,
"provider" varchar(32) NOT NULL,
"torrentId" varchar(128),
"title" varchar(256) NOT NULL,
"size" bigint,
"type" varchar(16) NOT NULL,
"uploadDate" date NOT NULL,
"seeders" integer,
"trackers" varchar(4096),
"languages" varchar(4096),
"resolution" varchar(16),
"createdAt" date,
"updatedAt" date,
"reviewed" boolean,
"opened" boolean
);
CREATE TABLE "files" (
"id" SERIAL PRIMARY KEY,
"infoHash" varchar(64) NOT NULL,
"fileIndex" integer,
"title" varchar(256) NOT NULL,
"size" bigint,
"imdbId" varchar(32),
"imdbSeason" integer,
"imdbEpisode" integer,
"kitsuId" integer,
"kitsuEpisode" integer,
"createdAt" date,
"updatedAt" date,
FOREIGN KEY("infoHash") REFERENCES torrents("infoHash") ON DELETE CASCADE,
UNIQUE("infoHash","fileIndex")
);
CREATE TABLE "subtitles" (
"id" SERIAL PRIMARY KEY,
"infoHash" varchar(64) NOT NULL,
"fileIndex" integer NOT NULL,
"fileId" bigint,
"title" varchar(512) NOT NULL,
"size" bigint,
FOREIGN KEY("infoHash") REFERENCES torrents("infoHash") ON DELETE CASCADE,
FOREIGN KEY("fileId") REFERENCES files("id") ON DELETE SET NULL
);
CREATE TABLE "contents" (
"infoHash" varchar(64),
"fileIndex" integer,
"path" varchar(256),
"size" bigint,
FOREIGN KEY("infoHash") REFERENCES torrents("infoHash") ON DELETE CASCADE
);

View File

@@ -1,44 +1,49 @@
version: '2'
---
version: '3.9'
name: torrentio-self-host
services:
mongodb:
restart: always
restart: unless-stopped
image: docker.io/bitnami/mongodb:7.0
ports:
- "27017:27017"
volumes:
- 'mongodb_data:/bitnami/mongodb'
- mongo-data:/bitnami/mongodb
scraper:
build: ../../scraper/
restart: always
ports:
- "7001:7001"
build: ./scraper
restart: unless-stopped
environment:
- PORT=7001
- MONGODB_URI=mongodb://mongodb:27017/torrentio
- DATABASE_URI=postgres://postgres@postgres:5432/torrentio
- ENABLE_SYNC=true
torrentio:
build: ../
restart: always
build: ./addon
restart: unless-stopped
ports:
- "7000:7000"
environment:
- MONGODB_URI=mongodb://mongodb:27017/torrentio
- DATABASE_URI=postgres://postgres@postgres:5432/torrentio
- ENABLE_SYNC=true
postgres:
image: postgres:14-alpine
restart: unless-stopped
ports:
- 5432:5432
volumes:
- pg_data:/var/lib/postgresql/data
- './init:/docker-entrypoint-initdb.d'
- postgres-data:/var/lib/postgresql/data
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
- POSTGRES_USER=postgres
- POSTGRES_DB=torrentio
volumes:
mongodb_data:
driver: local
pg_data:
driver: local
mongo-data:
postgres-data:

View File

@@ -1,22 +1,22 @@
const thepiratebayScraper = require('../scrapers/thepiratebay/thepiratebay_scraper');
const thepiratebayFakeRemoval = require('../scrapers/thepiratebay/thepiratebay_fakes_removal');
// const thepiratebayScraper = require('../scrapers/thepiratebay/thepiratebay_scraper');
// const thepiratebayFakeRemoval = require('../scrapers/thepiratebay/thepiratebay_fakes_removal');
const ytsScraper = require('../scrapers/yts/yts_scraper');
const ytsFullScraper = require('../scrapers/yts/yts_full_scraper');
const eztvScraper = require('../scrapers/eztv/eztv_scraper');
const leetxScraper = require('../scrapers/1337x/1337x_scraper');
const rarbgScraper = require('../scrapers/rarbg/rarbg_scraper');
// const rarbgScraper = require('../scrapers/rarbg/rarbg_scraper');
const nyaaPantsuScraper = require('../scrapers/nyaapantsu/nyaa_pantsu_scraper');
const nyaaSiScraper = require('../scrapers/nyaasi/nyaa_si_scraper');
const erairawsScraper = require('../scrapers/erairaws/erairaws_scraper');
const torrentGalaxyScraper = require('../scrapers/torrentgalaxy/torrentgalaxy_scraper');
const rutorScraper = require('../scrapers/rutor/rutor_scraper');
const Comando = require('../scrapers/comando/comando_scraper')
const ComoEuBaixo = require('../scrapers/comoeubaixo/comoeubaixo_scraper')
const Lapumia = require('../scrapers/lapumia/lapumia_scraper')
const OndeBaixa = require('../scrapers/ondebaixa/ondebaixa_scraper');
const AnimesTorrent = require('../scrapers/animestorrent/animestorrent_scraper')
const DarkMahou = require('../scrapers/darkmahou/darkmahou_scraper')
const torrent9Scraper = require('../scrapers/torrent9/torrent9_scraper');
// const erairawsScraper = require('../scrapers/erairaws/erairaws_scraper');
// const torrentGalaxyScraper = require('../scrapers/torrentgalaxy/torrentgalaxy_scraper');
// const rutorScraper = require('../scrapers/rutor/rutor_scraper');
// const Comando = require('../scrapers/comando/comando_scraper')
// const ComoEuBaixo = require('../scrapers/comoeubaixo/comoeubaixo_scraper')
// const Lapumia = require('../scrapers/lapumia/lapumia_scraper')
// const OndeBaixa = require('../scrapers/ondebaixa/ondebaixa_scraper');
// const AnimesTorrent = require('../scrapers/animestorrent/animestorrent_scraper')
// const DarkMahou = require('../scrapers/darkmahou/darkmahou_scraper')
// const torrent9Scraper = require('../scrapers/torrent9/torrent9_scraper');
module.exports = [
{ scraper: ytsScraper, name: ytsScraper.NAME, cron: '0 0 */4 ? * *' },
@@ -24,20 +24,20 @@ module.exports = [
{ scraper: eztvScraper, name: eztvScraper.NAME, cron: '0 0 */4 ? * *' },
{ scraper: nyaaSiScraper, name: nyaaSiScraper.NAME, cron: '0 0 */4 ? * *' },
{ scraper: nyaaPantsuScraper, name: nyaaPantsuScraper.NAME, cron: '0 0 */4 ? * *' },
{ scraper: rarbgScraper, name: rarbgScraper.NAME, cron: '0 0 */1 ? * *' },
{ scraper: rutorScraper, name: rutorScraper.NAME, cron: '0 0 */4 ? * *' },
{ scraper: thepiratebayScraper, name: thepiratebayScraper.NAME, cron: '0 0 */2 ? * *' },
{ scraper: thepiratebayFakeRemoval, name: thepiratebayFakeRemoval.NAME, cron: '0 0 */12 ? * *' },
{ scraper: torrentGalaxyScraper, name: torrentGalaxyScraper.NAME, cron: '0 0 */4 ? * *' },
{ scraper: leetxScraper, name: leetxScraper.NAME, cron: '0 0 */4 ? * *' },
{ scraper: torrent9Scraper, name: torrent9Scraper.NAME, cron: '0 0 */4 ? * *' },
{ scraper: Comando, name: Comando.NAME, cron: '0 0 */4 ? * *' },
{ scraper: ComoEuBaixo, name: ComoEuBaixo.NAME, cron: '0 0 */4 ? * *' },
{ scraper: Lapumia, name: Lapumia.NAME, cron: '0 0 */4 ? * *' },
{ scraper: OndeBaixa, name: OndeBaixa.NAME, cron: '0 0 */4 ? * *' },
// { scraper: rarbgScraper, name: rarbgScraper.NAME, cron: '0 0 */1 ? * *' },
// { scraper: rutorScraper, name: rutorScraper.NAME, cron: '0 0 */4 ? * *' },
// { scraper: thepiratebayScraper, name: thepiratebayScraper.NAME, cron: '0 0 */2 ? * *' },
// { scraper: thepiratebayFakeRemoval, name: thepiratebayFakeRemoval.NAME, cron: '0 0 */12 ? * *' },
// { scraper: torrentGalaxyScraper, name: torrentGalaxyScraper.NAME, cron: '0 0 */4 ? * *' },
{ scraper: leetxScraper, name: leetxScraper.NAME, cron: '0 0 */4 ? * *' }
// { scraper: torrent9Scraper, name: torrent9Scraper.NAME, cron: '0 0 */4 ? * *' },
// { scraper: Comando, name: Comando.NAME, cron: '0 0 */4 ? * *' },
// { scraper: ComoEuBaixo, name: ComoEuBaixo.NAME, cron: '0 0 */4 ? * *' },
// { scraper: Lapumia, name: Lapumia.NAME, cron: '0 0 */4 ? * *' },
// { scraper: OndeBaixa, name: OndeBaixa.NAME, cron: '0 0 */4 ? * *' },
// { scraper: AnimesTorrent, name: AnimesTorrent.NAME, cron: '0 0 */4 ? * *' },
// { scraper: DarkMahou, name: DarkMahou.NAME, cron: '0 0 */4 ? * *' },
{ scraper: erairawsScraper, name: erairawsScraper.NAME, cron: '0 0 */4 ? * *' },
// { scraper: erairawsScraper, name: erairawsScraper.NAME, cron: '0 0 */4 ? * *' },
// { scraper: require('../scrapers/rarbg/rarbg_dump_scraper') }
// { scraper: require('../scrapers/1337x/1337x_search_scraper') }
// { scraper: require('../scrapers/rarbg/rarbg_dump_scraper') }