Skip to content

Building Drop server

The Drop server is compromised of the following components, and are built with the associated tools:

ProjectTools
Frontend & APINode.js, pnpm
torrentialRust (nightly)

Then, to be run outside the Docker container, Drop needs the following:

  • NGINX, available on $PATH, as nginx
  • torrential, available in the search path
  • Node.js, or some other equivalent runtime
  • Postgresql, with migrations ran using prisma
  1. Terminal window
    git clone https://github.com/Drop-OSS/drop.git && cd drop

    Drop also packages some components as submodules, so we will need to clone those too:

    Terminal window
    git submodule update --init --recursive
  2. Terminal window
    pnpm install
  3. Terminal window
    pnpm run build

To build torrential, you only need to run in the torrential directory in your Drop repository:

Terminal window
cd torrential && cargo build --release

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 (npm comes prebundled and works fine)
  • Your copy of torrential, to somewhere in the search path
  • PostgreSQL
  1. You will need to copy the following files to your run directory:

    • prisma.config.ts from the drop repository (contains database configuration)
    • prisma folder from the drop repository (contains database migrations)
    • .output from the drop repository (the built application)
    • build/nginx.conf from the drop repository (built-in reverse proxy configuration)
  2. The example compose.yaml uses postgres://drop:drop@postgres:5432/drop as the database URL. You will need to customise this to point to your PostgreSQL installation.

  3. Use 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 requirement

    Then, with your database running:

    Terminal window
    DATABASE_URL=<your database url> npm prisma migrate deploy
  4. 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 variables
    export NGINX_CONFIG=./nginx.conf # potentially update if you've renamed the nginx.conf
    export 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
  5. Make your launch executable (chmod +x <script>), and then run in it your runtime directory. Drop should start up.

Drop searches for a torrential binary in the following order:

  1. torrential directory in working directory: Drop executes cargo run --manifest-path ./torrential/Cargo.toml.

  2. torrential file in working directory: Drop executes it.

  3. If TORRENTIAL_PATH is provided in env, Drop executes it.

  4. Drop defaults executing it normally, so on the $PATH.