# sus sus URL shortener ## `susmng` usage (managing shortlinks) - creating a new shortlink at https://pls.cx/shortlink susmng [-s pls.cx] create -l shortlink -r https://example.com - creating a new shortlink at https://pls.cx/shortlink which redirects to https://example.com/a the first n times, https://example.com/b any other times susmng [-s pls.cx] create -l shortlink -r https://example.com/a \ -c hits,gt, -a https://example.com/b - creating a new shortlink at https://pls.cx/shortlink which redirects to https://example.com/before before unix timestamp n (seconds), https://example.com/after after that susmng [-s pls.cx] create -l shortlink -r https://example.com/before \ -c timestamp,gt, -a https://example.com/after - deleting the shortlink https://pls.cx/shortlink susmng [-s pls.cx] delete -l shortlink - 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 - `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`) ### 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)