URL shortener service
Find a file
Dustin Thomas 1e950b9efc
All checks were successful
/ build (push) Successful in 4m8s
comment dockerfiles
2025-10-27 08:58:56 -05:00
.forgejo/workflows that is a lot of changes wow 2025-08-22 12:55:55 -05:00
src Add support for multiple path matching 2025-09-09 19:27:51 -05:00
templates Add support for multiple path matching 2025-09-09 19:27:51 -05: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 that is a lot of changes wow 2025-08-22 12:55:55 -05:00
Cargo.toml that is a lot of changes wow 2025-08-22 12:55:55 -05:00
CHANGELOG.md changelog!! 2025-09-09 19:28:49 -05:00
Dockerfile comment dockerfiles 2025-10-27 08:58:56 -05:00
Dockerfile.rich comment dockerfiles 2025-10-27 08:58:56 -05: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 support for multiple path matching 2025-09-09 19:27:51 -05: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/.