|
|
||
|---|---|---|
| .forgejo/workflows | ||
| src | ||
| templates | ||
| .dockerignore | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CHANGELOG.md | ||
| Dockerfile | ||
| Dockerfile.rich | ||
| LICENSE.md | ||
| README.md | ||
| sg1.toml | ||
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/.