Home

Awesome

Development on droppy has ceased because I don't have enough time or motivation to properly support it and because of its outdated technology stack, it became exceedingly boring to work.

<p align="center"> <img src="https://cdn.rawgit.com/silverwind/droppy/master/client/images/readme-logo.svg"/> </p> <p align="center"> <a href="https://www.npmjs.org/package/droppy"><img src="https://img.shields.io/npm/v/droppy.svg"></a> <a href="https://raw.githubusercontent.com/silverwind/droppy/master/LICENSE"><img src="https://img.shields.io/badge/licence-bsd-blue.svg"></a> <a href="https://www.npmjs.org/package/droppy"><img src="https://img.shields.io/npm/dm/droppy.svg"></a> </p>

droppy is a self-hosted file storage server with a web interface and capabilities to edit files and view media directly in the browser. It is particularly well-suited to be run on low-end hardware like the Raspberry Pi.

Features

General Information

Two directories will be used, one for configuration and one for the actual files:

droppy maintains an in-memory representation of the files directory. If you're on slow storage and/or serving 100k or more files, the initial indexing on startup will likely take some time.

Installation

Local Installation :package:

With Node.js >= 12.10.0 installed, run:

$ npm install -g droppy
$ droppy start -c /srv/droppy/config -f /srv/droppy/files

To make droppy run in the background, you can use the --daemon option, thought it is adviced that you install it as a persistent service in your system. For Linux, see these guides:

Docker installation :whale:

The silverwind/droppy multi-arch images supports amd64, arm64, arm/v7 and arm/v6 architectures. To pull and run, use:

$ docker run --name droppy -p 127.0.0.1:8989:8989 silverwind/droppy

This method uses automatic volumes for /config and /files which can be overridden through -v /srv/droppy/config:/config and -v /srv/droppy/files:/files. If you're using existing files, it's advisable to use -e UID=1000 -e GID=1000 to get new files written with correct ownership.

To update a docker installation, run

$ docker pull silverwind/droppy
$ docker stop droppy && docker rm droppy
$ docker run --name droppy -p 127.0.0.1:8989:8989 silverwind/droppy

docker-compose

Alternatively, you can use the example docker-compose.yml:

$ curl -O https://raw.githubusercontent.com/silverwind/droppy/master/examples/docker-compose.yml
$ docker-compose up

This example docker-compose.yml uses the subdirectories config and files of the current working directory for storing data.

Caddy

See the example Caddyfile.

Configuration

By default, the server listens on all IPv4 and IPv6 interfaces on port 8989. On first startup, a prompt to create login data for the first account will appear. Once it's created, login credentials are enforced. Additional accounts can be created in the options interface or the command line. Configuration is done in config/config.json, which is created with these defaults:

{
  "listeners" : [
    {
      "host": ["0.0.0.0", "::"],
      "port": 8989,
      "protocol": "http"
    }
  ],
  "public": false,
  "timestamps": true,
  "linkLength": 5,
  "linkExtensions": false,
  "logLevel": 2,
  "maxFileSize": 0,
  "updateInterval": 1000,
  "pollingInterval": 0,
  "keepAlive": 20000,
  "allowFrame": false,
  "readOnly": false,
  "ignorePatterns": [],
  "watch": true,
  "headers": {}
}

Options

<a name="listener-options"></a>

Listener Options

listeners defines on which network interfaces, ports and protocol(s) the server will listen. For example:

"listeners": [
  {
    "host": "::",
    "port": 80,
    "socket": "/tmp/droppy",
    "protocol": "http"
  },
  {
    "host": "0.0.0.0",
    "port": 443,
    "protocol": "https",
    "key": "~/certs/example.com.key",
    "cert": "~/certs/example.com.crt"
  }
]

The above configuration will result in:

A listener object accepts these options:

For TLS the following additional options are available. Paths can be given relative to the configuration directory and ~ is resolved as expected.

Downloading from the command line

To download shared links with curl and wget to the correct filename:

$ curl -OJ url
$ wget --content-disposition url

Development

To start a live-reloading dev server:

$ git clone https://github.com/silverwind/droppy && cd droppy
$ npm i
$ node droppy start --dev

The Makefile has a few tasks for updating dependencies, pushing docker images, see the comment above for dependencies of those tasks.

© silverwind, distributed under BSD licence.