These are instructions for setting up the database, configuring the service, downloading or building the binary, and running it.
Install PostgreSQL if you haven't already, and create a database and user for the service.
-
Connect to the server as the
postgres
user (eg.psql -U postgres
). -
Create a new user:
CREATE USER shareit WITH ENCRYPTED PASSWORD 'database-password-goes-here';
. -
Create a database for the user:
CREATE DATABASE shareit WITH OWNER shareit;
The config file uses the TOML format and contains information for connecting to the database, the external URL that points to the service, and several other options.
-
Open the file. For example, you could put it in
/etc/shareit/shareit.toml
. -
Add the following to the file (replace the Discord token and Postgres password as appropriate):
upload_dir = "/srv/shareit/shares" [network] address = "0.0.0.0" host = "https://shareit.example.com" [database] pass = "database-password-goes-here"
You can see the full list of options here and an example config file showcasing many of the options here.
You can either download an executable (this step) or compile your own (the next step). You may want to compile your own for security reasons, or if there is not a pre-compiled executable for your operating system.
-
Download the executable (or click here):
wget https://github.com/pls-shareit/api/releases/latest/download/shareitd-linux -qO shareitd
-
Make the file executable:
chmod +x shareitd
-
Download the executable (or click here):
wget https://github.com/pls-shareit/api/releases/latest/download/shareitd-macos -qO shareitd
-
Make the file executable:
chmod +x shareitd
-
Download the executable with Power shell (or click here):
iwr -outf shareitd.exe https://github.com/pls-shareit/api/releases/latest/download/shareitd.exe
If you don't want to use a pre-compiled executable, you can compile one using Rust:
- Install Rust.
- Run
cargo build --release
in the same directory as this README. - Your binary will be at
target/release/shareitd
.
This is as simple as executing the binary with the path to your configuration
file as its only argument. For example, ./shareitd /etc/shareit/shareit.toml
.
You may also wish to set it up with systemd
or another process management
system.