47 lines
1.3 KiB
Markdown
47 lines
1.3 KiB
Markdown
# ushort
|
|
|
|
`ushort` is a compact, self-contained URL shortener written in Rust and backed
|
|
by SQLite. It serves an embedded web interface and JSON API from a single
|
|
statically linked executable.
|
|
|
|
It supports deployment at either a dedicated host such as `s.example.com` or
|
|
under a path such as `example.com/s`. Images are available for Linux AMD64 and
|
|
ARM64.
|
|
|
|
## Quick start
|
|
|
|
Requirements: Docker with the Compose plugin.
|
|
|
|
```bash
|
|
cp config.example.toml config.toml
|
|
# Set a private api_key in config.toml.
|
|
|
|
mkdir -p data
|
|
USHORT_UID="$(id -u)" USHORT_GID="$(id -g)" \
|
|
docker compose -f deploy/docker-compose.build.yml up --build -d
|
|
```
|
|
|
|
The example starts ushort at <http://localhost:18082/s/> and stores its SQLite
|
|
database in `./data/urlshort.db`.
|
|
|
|
Check it and stop it with:
|
|
|
|
```bash
|
|
curl http://localhost:18082/s/api/health
|
|
docker compose -f deploy/docker-compose.build.yml down
|
|
```
|
|
|
|
For a production server, use the published image through
|
|
`deploy/docker-compose.prod.yml`; it does not build or require a source
|
|
checkout.
|
|
|
|
## Documentation
|
|
|
|
- [Configuration](docs/configuration.md)
|
|
- [API reference](docs/api.md)
|
|
- [Embedded frontend](docs/frontend.md)
|
|
- [Data and database compatibility](docs/data.md)
|
|
- [Production deployment and rollback](docs/deployment.md)
|
|
- [Development, testing, and releases](docs/development.md)
|
|
- [Security model](docs/security.md)
|