A very performant and light (2mb in memory) link shortener and tracker. Written in Rust and React and uses Postgres/SQLite.
Find a file
2025-05-05 01:28:25 -04:00
.github/workflows Update docker-image.yml 2025-05-05 01:28:25 -04:00
.sqlx add admin setup token i love admin setup token 2025-01-27 22:32:49 -05:00
frontend Add edit link functionality 2025-02-01 02:18:32 -05:00
migrations add migration to postgres sql to fix VARCHAR length to 32 2025-02-19 21:22:17 -05:00
readme_img readme 2025-01-29 01:29:27 -05:00
src remove limits 2025-04-11 01:56:15 -04:00
test yolo commit 2025-01-27 16:14:55 -05:00
.env.example Update .env.example 2025-01-29 19:37:53 -05:00
.gitignore add sqlite 2025-01-29 18:52:49 -05:00
.preludeignore maybe this works now 2025-01-26 01:53:14 -05:00
API.md Add auth 2025-01-25 03:16:35 -05:00
build.sh update docs 2025-01-31 19:17:07 -05:00
Cargo.lock Bump tokio from 1.43.0 to 1.43.1 2025-04-08 02:14:06 +00:00
Cargo.toml Bump tokio from 1.43.0 to 1.43.1 2025-04-08 02:14:06 +00:00
docker-compose.yml bump to v2.2 2025-02-19 21:29:25 -05:00
Dockerfile copy only package.json 2025-02-02 17:37:41 -05:00
README.md bump to v2.2 2025-02-19 21:29:25 -05:00

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 SIMPLELINK_USER=admin@example.com \
    -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 SIMPLELINK_USER=admin@example.com \
    -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