53,730 Lines
  • C++ 99.6%
  • Markdown 0.2%
  • Yaml 0.1%
  • Shell 0%
README.md

Hikup

wakatime

File Sharing Made Easy

  • File Management: Effortlessly upload, download, and remove files with just one command.

  • Secure Transfer: All data transfers between the client and server are encrypted using QUIC to ensure data integrity and privacy. (man-in-the-middle attack not possible with installed certificates)

  • File Sharing in Three Simple Steps:

    1. Upload the desired file to the server and receive a unique hash and HTTP link.
    2. Share the generated hash or link with designated recipients.
    3. Recipients can use the hash to download the file directly from the server using the hikup command or with HTTP.
  • Redundant servers: Sync between servers easily.

Note

If you append ?view=yes to the HTTP link, you can view the file directly in the browser.

Client Commands

  • hikup: Display help information about the commands.
  • hikup up <file> <server-address>[:port]: Upload a file.
  • hikup down <file> <server-address>[:port]: Download a file.
  • hikup rm <file> <server-address>[:port]: Remove a file.
  • hikup ls <user> <pass> <server-address>[:port]: List all files (requires authentication).
  • add q into first argument for quiet run: like qup, qdown, ...
  • add v to force TLS to verify server certificate
Note

When an operation with more files at once is desired, pipe space or new-line separated list of files/hashes into program and in arguments enter - in the normal place. For example: echo "file1 file2" | hikup up - hikup.example.org

Dependencies

Shared

  • cmake, OpenSSL, g++ with c++23 support

Server

  • docker, docker-compose (optional)

Client

Build

git clone https://github.com/Hikari03/hikup.git && \
cd hikup && \
cmake -B build -S . && \
cmake --build build --target hikup -j $(nproc)

Usage

in hikup/build

./hikup # for help

Server

Settings

  • All available runtime settings are in settings/settings.toml with descriptions.

Certificate use

  • All certificates are stored in auth/
  • Expected name for chain certificate is server_fullchain.pem and for private key server_key.pem.
  • When no certificate or key is present, server will generate its own CA and certificate.
  • If this happens, the hostname declared in settings will be used. You will also need to add the ca_cert.pem as your trusted CA.

Sync

  • Sync files between servers in declared periods.
  • To use this, add target in settings in [syncTargets] section.
  • If certificate verify is desired and custom CA certificate was used, place it into trusted-certs/ directory.
Warning

The declared target will be the master in one case: if you uploaded a removed file and that removal synced. Which means if you again upload this file on non-master, your master will remove it on the next sync.

Default Ports

  • Hikup protocol: 6998/udp (default)
    • Can be changed in settings/settings.toml
  • HTTP protocol: 6997 (default)
    • Can be changed in settings/settings.toml
Note

When using docker, external ports can be mapped in docker-compose.yaml

Use Docker

With scripts

You can get the docker-update-start.sh, docker-attach.sh and docker-shutdown.sh. With them, you can control the server with ease.

  • docker-update-start.sh will automatically update the image if needed and start the server
  • docker-attach.sh will attach you to server console. When you want to exit console, use CTRL + P, CTRL + Q.
  • docker-shutdown.sh will shutdown the container

Manually

  • download the docker-compose.yml
  • docker compose up -d or docker-compose up -d
  • to control the server use docker attach hikup-server
  • docker compose down or docker-compose down

From Source

Build

git clone https://github.com/Hikari03/hikup.git && \
cd hikup && \
cmake -B build -S . && \
cmake --build build --target hikup-server -j $(nproc)

Usage:

in hikup/build

  • once started type q to stop the server
./hikup-server

Static builds

Use *-staticflavours of scripts for this. Ensure that you have static library of OpenSSL.

Acknowledgements

Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover