1
0
mirror of https://git.ikl.sh/132ikl/liteshort.git synced 2023-08-10 21:13:04 +03:00

Update README

This commit is contained in:
132ikl 2020-04-04 22:19:38 -04:00
parent 2ee8473a44
commit ae1a05c83d
2 changed files with 7 additions and 8 deletions

View File

@ -35,7 +35,7 @@ Edit `liteshort.ini` and `liteshort.service` as seen fit. Then edit `config.yml`
Finally,
```sh
cp liteshort.service /etc/systemd/system/
cp liteshort.service /usr/lib/systemd/system/
systemctl enable liteshort
systemctl start liteshort
```
@ -55,7 +55,6 @@ Note that using admin_hashed_password is more resource-intensive than `admin_pas
## API
All API requests should have the POST form data `format` set to `json`.
In order to create a new short URL, simply make a POST request with the form data `long` set to your long link and, optionally, set `short` to your short link.
Everything other than creation of links requires BasicAuth using the username and password defined in the configuration file. To use the following commands, set `api` to the command in the form data of your request.
* `list` and `listshort`
@ -68,9 +67,9 @@ Everything other than creation of links requires BasicAuth using the username an
### Example Request
```
curl -u [admin_username]:[admin_password] \
-d 'format=json' \
-d 'api=delete' \
-d 'short=[short]' \
-H "Accept: application/json" \
-d "api=delete" \
-d "short=[short]" \
[url]
```

View File

@ -5,7 +5,7 @@ admin_username: 'admin'
# String: Plaintext password to make admin API requests
# Safe to remove if admin_hashed_password is set
# Default: unset
admin_password: alright
admin_password:
# String: Hashed password (bcrypt) to make admin API requests - Preferred over plaintext, use securepass.sh to generate
# Please note that authentication takes noticeably longer than using plaintext password
@ -20,7 +20,7 @@ disable_api: false
# String: Secret key used for cookies (used for storage of messages)
# This should be a 12-16 character randomized string with letters, numbers, and symbols
# Default: unset (required to start application)
secret_key: falksfjsdlkfjsdfkljsdlkjfsd
secret_key:
# String: Filename of the URL database without extension
# Default: 'urls'