URL shortener service
Find a file
Dustin Thomas 4c04aced9a
All checks were successful
/ build (push) Successful in 4m18s
/ trivy (push) Successful in 17s
I forgot to update the cargo file this whole time? lmfao
2026-01-30 13:20:11 -06:00
.forgejo/workflows point trivy at correct tags 2026-01-30 13:05:00 -06:00
src fix order of iter chain 2026-01-30 12:59:46 -06:00
templates add ability to hide individual routes 2026-01-30 12:23:19 -06:00
.dockerignore that is a lot of changes wow 2025-08-22 12:55:55 -05:00
.gitignore ignore IDE directories 2025-08-22 11:06:12 -05:00
Cargo.lock I forgot to update the cargo file this whole time? lmfao 2026-01-30 13:20:11 -06:00
Cargo.toml I forgot to update the cargo file this whole time? lmfao 2026-01-30 13:20:11 -06:00
CHANGELOG.md Release v0.1.4 2026-01-30 12:47:23 -06:00
Dockerfile oops 2026-01-30 12:48:21 -06:00
Dockerfile.rich oops 2026-01-30 12:48:21 -06:00
LICENSE.md Initial commit 2025-06-03 11:00:12 -04:00
README.md that is a lot of changes wow 2025-08-22 12:55:55 -05:00
sg1.toml add ability to hide individual routes 2026-01-30 12:23:19 -06:00

Stargate

Stargate is a minimal URL shortening service (similar to bit.ly).

Usage

You can use the prebuilt Docker image:

docker run -p 8000:8000 \
  -v sg1.toml:/etc/stargate/sg1.toml \
  forge.cptlobster.dev/cptlobster/stargate

You can compile and run the server by pulling this repository and using cargo:

cargo run

You can configure specific routes by editing sg1.toml. A sample configuration is provided in this repository. The configuration format is as follows:

# Simple text matcher
[[routes]]
from = "a"
to = "https://example.com"

# More complex regex matcher
[[routes]]
from = "bean(\\d+)"
to = "https://other.com/beans/$1"
using = "regex"

License

This program is licensed under the GNU General Public License, Version 3.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.