Building Drop server
The Drop server is compromised of the following components, and are built with the associated tools:
| Project | Tools |
|---|---|
| Frontend & API | Node.js, pnpm |
torrential | Rust (nightly) |
Then, to be run outside the Docker container, Drop needs the following:
- NGINX, available on
$PATH, asnginx torrential, available in the search path- Node.js, or some other equivalent runtime
- Postgresql, with migrations ran using
prisma
Building drop
Section titled “Building drop”-
Clone the repo and recurse submodules
Section titled “Clone the repo and recurse submodules”Terminal window git clone https://github.com/Drop-OSS/drop.git && cd dropDrop also packages some components as submodules, so we will need to clone those too:
Terminal window git submodule update --init --recursive -
Install Node.js dependencies using
Section titled “Install Node.js dependencies using pnpm”pnpmTerminal window pnpm install -
Build the application
Section titled “Build the application”Terminal window pnpm run build
Building torrential
Section titled “Building torrential”To build torrential, you only need to run in the torrential directory in your Drop repository:
cd torrential && cargo build --releaseSet up Drop runtime environment
Section titled “Set up Drop runtime environment”As mentioned above, you will need a few more things to run Drop outside the Docker container. These requirements are for the runtime server, the actual application can be built elsewhere, and then copied to your runtime server.
You will need to install:
- NGINX
- Node.js, with a package manager (
npmcomes prebundled and works fine) - Your copy of
torrential, to somewhere in the search path - PostgreSQL
-
Prepare your run directory
Section titled “Prepare your run directory”You will need to copy the following files to your run directory:
prisma.config.tsfrom thedroprepository (contains database configuration)prismafolder from thedroprepository (contains database migrations).outputfrom thedroprepository (the built application)build/nginx.conffrom thedroprepository (built-in reverse proxy configuration)
-
Figure out your
Section titled “Figure out your DATABASE_URL”DATABASE_URLThe example
compose.yamlusespostgres://drop:drop@postgres:5432/dropas the database URL. You will need to customise this to point to your PostgreSQL installation. -
Install
Section titled “Install prisma and run migrations”prismaand run migrationsUse your Node.js package manager to install prisma, either to the local directory or globally:
Terminal window npm install prisma@6.11.1 dotenv # dotenv is a requirementThen, with your database running:
Terminal window DATABASE_URL=<your database url> npm prisma migrate deploy -
Create your launch script
Section titled “Create your launch script”You will need to set several environment variables to configure Drop, both because you’re running it outside the Docker container, and it’s the intended way to configure Drop.
It’s best to create a launch script to configure them for you, like this:
Terminal window # required environment variablesexport NGINX_CONFIG=./nginx.conf # potentially update if you've renamed the nginx.confexport DATABASE_URL=<your database url>export DATA=./data # potentially update if you'd like Drop to store data somewhere else (not library)export EXTERNAL_URL=http://localhost:3000# optional variables# export TORRENTIAL_PATH=<custom torrential path> # may be required if torrential isn't in your $PATH# export READER_THREADS=4 # customise the number of threads/parallel processes used during import# ... see the rest of the document for other options ...# run application# (node can be swapped for another runtime, if wanted)node ./.output/server/index.mjs -
Run Drop
Section titled “Run Drop”Make your launch executable (
chmod +x <script>), and then run in it your runtime directory. Drop should start up.
torrential search algorithm
Section titled “torrential search algorithm”Drop searches for a torrential binary in the following order:
-
torrentialdirectory in working directory: Drop executescargo run --manifest-path ./torrential/Cargo.toml. -
torrentialfile in working directory: Drop executes it. -
If
TORRENTIAL_PATHis provided in env, Drop executes it. -
Drop defaults executing it normally, so on the
$PATH.