sus/readme.md

58 lines
1.4 KiB
Markdown
Raw Normal View History

2022-05-26 15:14:24 +00:00
# sus
2022-05-26 01:08:50 +00:00
2022-05-26 15:21:10 +00:00
sus URL shortener
2022-05-26 14:51:14 +00:00
2022-05-28 14:18:26 +00:00
## `susmng` usage (managing shortlinks)
2022-05-26 14:51:14 +00:00
2022-05-26 15:14:24 +00:00
- creating a new shortlink at https://pls.cx/shortlink
2022-05-26 15:03:38 +00:00
2022-05-26 15:16:21 +00:00
susmng [-s pls.cx] create -l shortlink -v https://example.com
2022-05-26 15:03:38 +00:00
2022-05-26 15:14:24 +00:00
- deleting the shortlink https://pls.cx/shortlink
2022-05-26 15:03:38 +00:00
2022-05-26 15:16:21 +00:00
susmng [-s pls.cx] delete -l shortlink -v confirm
2022-05-26 15:03:38 +00:00
2022-06-26 05:54:58 +00:00
- listing all shortlinks on the server pls.cx
susmng [-s pls.cx] list
2022-05-28 14:19:40 +00:00
`susmng` will assume the first server in the `secrets` section of the configuration file if the `-s`
flag is not provided.
2022-05-26 15:03:38 +00:00
2022-05-26 15:14:24 +00:00
## installation
2022-05-26 15:03:38 +00:00
2022-05-26 15:14:24 +00:00
### running the server
2022-05-26 14:51:14 +00:00
1. generate the secret used to create and delete shortlinks
2022-05-26 15:16:21 +00:00
echo SECRET=`pwgen -s 64 1` >> .env
2022-05-26 14:51:14 +00:00
2. run the services
2022-05-26 15:16:21 +00:00
docker-compose up -d --build
2022-05-26 14:51:14 +00:00
2022-05-26 15:14:24 +00:00
#### server environment variables
2024-04-11 18:08:34 +00:00
- `SECRET` - the secret used for signature verification
- `LISTEN_ADDRESS` - the address the server is listening on (default is `0.0.0.0:80`)
- `INDEX_GET_REDIRECT` - the URL the user should be redirected to if they try to access `/` on the
server (default is `http://alv.cx`)
2024-04-11 18:08:34 +00:00
- `MAX_AGE_MS` - how old a request can be (in milliseconds) before the server will refuse to process it (default is 500 milliseconds)
2022-05-26 15:14:24 +00:00
### setting up susmng
2022-05-26 14:51:14 +00:00
1. install `susmng`
2022-05-26 14:51:14 +00:00
2022-05-26 15:16:21 +00:00
make install-susmng
2022-05-26 14:51:14 +00:00
2. create configuration files
2022-05-26 14:51:14 +00:00
2022-05-26 15:16:21 +00:00
susmng init
2022-05-26 14:51:14 +00:00
3. edit configuration files (`~/.config/susmng/config.json`) to add your secrets
2022-05-26 15:30:41 +00:00
![](sus.jpg)