Bookmark files in your folders to Raindrop.io.
Folderdrop is a command line tool that scans directories and create bookmarks in Raindrop.io. You can:
- Filter files using regexes (for filtering by extensions for example)
- Use files from multiple folders
- Apply tags to the created bookmarks
Currently I'm hosting a http file server that have tons of files. Unfortunatelly, it does not support tags and have a poor file searching, so I created this tool to make Raindrop my index. Maybe in future I could expand it to allow scanning files in Google Drive, or other services so I could search files in multiple places through Raindrop.
Download one of the files from Github releases or build it on your machine.
Create a api key in raindrop by following their documentation. The Test Token is enough. You'll need to export it via environment variable to folderdrop.
export RD_TOKEN='<redacted>'
Now prepare a mount and execute folderdrop. A mount is a combination of path, collection and patterns, besides other configurations. Example to upload .txt files to a collection named my-uploads.
folderdrop -m 'mount' --path ./my-uploads --collection my-uploads --patterns '.*\.txt' --tags '#from:folderdrop' --link-prefix 'https://myhomeserver.net/api/files/'
If everything works, it is a good idea to use a configuration file instead of command line args (remember that for any overlapping options the command line ones will have precedence). A configuration file the executes the same mounts:
[mount]
path=./my-uploads
collection=my-uploads
patterns=.*\.txt
tags=#from:folderdrop
link_prefix=https://myhomeserver.net/api/files/
Then simply run folderdrop
with a file named config.bs
in the same directory.
Multiple mounts may be defined with square brackets (in the configuration file) or -m
or --mount
(via command line arguments). Any options specified after them will be applied only to that mount.
folderdrop -m mount1 -p dir-1 ... \
-m mount2 -p dir-1 ...
This project uses only two depencencies, nlohmann/json and libcpr.
IIRC when building on Ubuntu, you'll need to install the following packages:
apt install libssl-dev nlohmann-json3-dev libcurl4-openssl-dev
If coming from a clean install (with no development tools) install also:
apt install pkg-config g++ cmake
Execute the following commands:
mkdir build
cmake . -B build
cmake --build build