Files
sus/readme.md
2026-05-09 23:20:36 +01:00

75 lines
2.3 KiB
Markdown

# sus
sus URL shortener
## maintenance notice
for my personal use i have replaced sus with the simpler [urls-txt](https://pls.cx/urls-txt).
i likely won't be updating sus anymore,
but this program is simple so i doubt it'll stop working
and i haven't really updated it much anyway,
since it did everything i wanted.
i'll update the dependencies every now and then but i have forgotten golang in the four years
between writing it and now.
if you want to use it instead of [urls-txt](https://pls.cx/urls-txt),
go ahead.
i'll update the dependencies every now and then.
## `susmng` usage (managing shortlinks)
- creating a new shortlink at https://pls.cx/shortlink
susmng [-s pls.cx] create -l shortlink -v https://example.com
- deleting the shortlink https://pls.cx/shortlink
susmng [-s pls.cx] delete -l shortlink -v confirm
- listing all shortlinks on the server pls.cx
susmng [-s pls.cx] list
`susmng` will assume the first server in the `secrets` section of the configuration file if the `-s`
flag is not provided.
## installation
### running the server
1. generate the secret used to create and delete shortlinks
echo SECRET=`pwgen -s 64 1` >> .env
2. run the services
docker-compose up -d --build
### server environment variables
| Variable | Default | Description |
|----------------------|-----------------|----------------------------------------------------------------------------------------|
| `SECRET` | N/A | the secret used for signature verification |
| `LISTEN_ADDRESS` | `0.0.0.0:80` | the address the server is listening on |
| `INDEX_GET_REDIRECT` | `http://alv.cx` | the URL the user should be redirected to if they try to access `/` on the server |
| `MAX_AGE_MS` | 500 | how old a request can be (in milliseconds) before the server will refuse to process it |
### setting up susmng
1. install `susmng`
make install-susmng
2. create configuration files
susmng init
3. edit configuration files (`~/.config/susmng/config.json`) to add your secrets
![](sus.jpg)