Browse Source

Add torrent client service

master
David Ludwig 3 years ago
parent
commit
b1311622fb
9 changed files with 1142 additions and 1 deletions
  1. +12
    -0
      docker-compose.dev.yml
  2. +24
    -1
      docker-compose.yml
  3. +6
    -0
      services/torrent-client/nodemon.json
  4. +18
    -0
      services/torrent-client/package.json
  5. +0
    -0
      services/torrent-client/src/common
  6. +11
    -0
      services/torrent-client/src/index.ts
  7. +5
    -0
      services/torrent-client/src/services/index.ts
  8. +9
    -0
      services/torrent-client/tsconfig.json
  9. +1057
    -0
      services/torrent-client/yarn.lock

+ 12
- 0
docker-compose.dev.yml View File

@ -0,0 +1,12 @@
version: "3.9"
services:
torrent_client:
build:
target: dev
volumes:
- ./api:/app/api
- ./packages:/app/packages
- ./services/torrent-client:/app/services/torrent-client
tty: true

+ 24
- 1
docker-compose.yml View File

@ -1,4 +1,4 @@
version: "3.8"
version: "3.9"
services: services:
@ -11,6 +11,29 @@ services:
secrets: secrets:
- mongo_root_password - mongo_root_password
torrent_client:
build:
context: .
args:
BASE: slim
SERVICE: torrent-client
depends_on:
- "mongo"
- "vpn"
healthcheck:
test: ["CMD", "ping", "-q", "-c1", "google.com"]
interval: 5m
timeout: 10s
retries: 3
start_period: 5m
network_mode: service:vpn
restart: unless-stopped
secrets:
- mongo_root_password
user: ${USER_ID}:${GROUP_ID}
volumes:
- var:/var/autoplex
vpn: vpn:
build: build:
context: ./submodules/vpn context: ./submodules/vpn


+ 6
- 0
services/torrent-client/nodemon.json View File

@ -0,0 +1,6 @@
{
"watch": ["src"],
"ext": "ts,json",
"ignore": ["src/**/*.spec.ts"],
"exec": "node --inspect=0.0.0.0:9229 -r ts-node/register src/index.ts"
}

+ 18
- 0
services/torrent-client/package.json View File

@ -0,0 +1,18 @@
{
"name": "@autoplex-service/torrent-client",
"version": "0.0.0",
"main": "dist/index.js",
"license": "MIT",
"scripts": {
"clean": "rimraf ./dist",
"build": "tsc",
"start": "NODE_ENV=production; node .",
"start:dev": "nodemon",
"test": "echo \"Error: no test specified\" && exit 1",
"postinstall": "patch-package"
},
"dependencies": {
"@autoplex/microservice": "^0.1.0",
"webtorrent": "^1.8.5"
}
}

+ 0
- 0
services/torrent-client/src/common View File


+ 11
- 0
services/torrent-client/src/index.ts View File

@ -0,0 +1,11 @@
import { Microservice } from "@autoplex/microservice";
import * as services from "./services";
// Create the application
let app = new Microservice();
// Install the services
app.installServices(Object.values(services));
// Execute the app
app.exec().then(process.exit);

+ 5
- 0
services/torrent-client/src/services/index.ts View File

@ -0,0 +1,5 @@
// import TorrentClient from "./TorrentClient";
export {
// TorrentClient
};

+ 9
- 0
services/torrent-client/tsconfig.json View File

@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"sourceMap": true, /* Generates corresponding '.map' file. */
"outDir": "./dist", /* Redirect output structure to the directory. */
"typeRoots": ["./src/typings"], /* List of folders to include type definitions from. */
"sourceRoot": "./src" /* Specify the location where debugger should locate TypeScript files instead of source locations. */
}
}

+ 1057
- 0
services/torrent-client/yarn.lock
File diff suppressed because it is too large
View File


Loading…
Cancel
Save