Skip to content

A very performant and light (2mb in memory) link shortener and tracker. Written in Rust and React and uses Postgres/SQLite.

Notifications You must be signed in to change notification settings

WaveringAna/SimpleLink

Folders and files

NameName
Last commit message
Last commit date
Feb 1, 2025
Jan 28, 2025
Feb 1, 2025
Feb 20, 2025
Jan 29, 2025
Feb 3, 2025
Jan 27, 2025
Jan 30, 2025
Jan 29, 2025
Jan 26, 2025
Jan 25, 2025
Mar 7, 2025
Jan 30, 2025
Feb 2, 2025
Feb 20, 2025
Feb 1, 2025
Feb 20, 2025

Repository files navigation

SimpleLink

A very performant and light (2MB in memory) link shortener and tracker. Written in Rust and React and uses Postgres or SQLite.

MainView

StatsView

How to Run

From Docker

docker run -p 8080:8080 \
    -e JWT_SECRET=change-me-in-production \
    -e [email protected] \
    -e SIMPLELINK_PASS=your-secure-password \
    -v simplelink_data:/data \
    ghcr.io/waveringana/simplelink:v2.2

Environment Variables

  • JWT_SECRET: Required. Used for JWT token generation
  • SIMPLELINK_USER: Optional. If set along with SIMPLELINK_PASS, creates an admin user on first run
  • SIMPLELINK_PASS: Optional. Admin user password
  • DATABASE_URL: Optional. Postgres connection string. If not set, uses SQLite
  • INITIAL_LINKS: Optional. Semicolon-separated list of initial links in format "url,code;url2,code2"
  • SERVER_HOST: Optional. Default: "127.0.0.1"
  • SERVER_PORT: Optional. Default: "8080"

If SIMPLELINK_USER and SIMPLELINK_PASS are not passed, an admin-setup-token is pasted to the console and as a text file in the project root.

From Docker Compose

Edit the docker-compose.yml file. It comes included with a PostgreSQL db configuration.

Build

From Source

First configure .env.example and save it to .env

git clone https://github.com/waveringana/simplelink && cd simplelink
./build.sh
cargo run

Alternatively for a binary build:

./build.sh --binary

then check /target/release for the binary named SimpleGit

From Docker

docker build -t simplelink .
docker run -p 8080:8080 \
    -e JWT_SECRET=change-me-in-production \
    -e [email protected] \
    -e SIMPLELINK_PASS=your-secure-password \
    -v simplelink_data:/data \
    simplelink

From Docker Compose

Adjust the included docker-compose.yml to your liking; it includes a postgres config as well.

Features

  • Support for both PostgreSQL and SQLite databases
  • Initial links can be configured via environment variables
  • Admin user can be created on first run via environment variables
  • Link click tracking and statistics
  • Lightweight and performant