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:
parent
2ee8473a44
commit
ae1a05c83d
11
README.md
11
README.md
@ -35,7 +35,7 @@ Edit `liteshort.ini` and `liteshort.service` as seen fit. Then edit `config.yml`
|
|||||||
|
|
||||||
Finally,
|
Finally,
|
||||||
```sh
|
```sh
|
||||||
cp liteshort.service /etc/systemd/system/
|
cp liteshort.service /usr/lib/systemd/system/
|
||||||
systemctl enable liteshort
|
systemctl enable liteshort
|
||||||
systemctl start liteshort
|
systemctl start liteshort
|
||||||
```
|
```
|
||||||
@ -55,7 +55,6 @@ Note that using admin_hashed_password is more resource-intensive than `admin_pas
|
|||||||
|
|
||||||
|
|
||||||
## API
|
## 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.
|
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.
|
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`
|
* `list` and `listshort`
|
||||||
@ -68,12 +67,12 @@ Everything other than creation of links requires BasicAuth using the username an
|
|||||||
### Example Request
|
### Example Request
|
||||||
```
|
```
|
||||||
curl -u [admin_username]:[admin_password] \
|
curl -u [admin_username]:[admin_password] \
|
||||||
-d 'format=json' \
|
-H "Accept: application/json" \
|
||||||
-d 'api=delete' \
|
-d "api=delete" \
|
||||||
-d 'short=[short]' \
|
-d "short=[short]" \
|
||||||
[url]
|
[url]
|
||||||
```
|
```
|
||||||
|
|
||||||
## Using a reverse proxy
|
## Using a reverse proxy
|
||||||
The following are barebones examples of an nginx proxy for liteshort, meaning it doesn't have SSL or anything fancy. You may also use a non-nginx webserver by making a config equivalent for it based upon the following configurations. Make sure your webserver is serving the /static/ folder. While liteshort can serve the folder, webservers are much more efficient at serving static files.
|
The following are barebones examples of an nginx proxy for liteshort, meaning it doesn't have SSL or anything fancy. You may also use a non-nginx webserver by making a config equivalent for it based upon the following configurations. Make sure your webserver is serving the /static/ folder. While liteshort can serve the folder, webservers are much more efficient at serving static files.
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ admin_username: 'admin'
|
|||||||
# String: Plaintext password to make admin API requests
|
# String: Plaintext password to make admin API requests
|
||||||
# Safe to remove if admin_hashed_password is set
|
# Safe to remove if admin_hashed_password is set
|
||||||
# Default: unset
|
# Default: unset
|
||||||
admin_password: alright
|
admin_password:
|
||||||
|
|
||||||
# String: Hashed password (bcrypt) to make admin API requests - Preferred over plaintext, use securepass.sh to generate
|
# 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
|
# 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)
|
# 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
|
# This should be a 12-16 character randomized string with letters, numbers, and symbols
|
||||||
# Default: unset (required to start application)
|
# Default: unset (required to start application)
|
||||||
secret_key: falksfjsdlkfjsdfkljsdlkjfsd
|
secret_key:
|
||||||
|
|
||||||
# String: Filename of the URL database without extension
|
# String: Filename of the URL database without extension
|
||||||
# Default: 'urls'
|
# Default: 'urls'
|
||||||
|
Loading…
Reference in New Issue
Block a user