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

Update README, fix #28

This commit is contained in:
132ikl 2023-02-24 16:26:48 -05:00
parent 94aeeba88d
commit 012bff7bfd
2 changed files with 10 additions and 9 deletions

View File

@ -1,7 +1,9 @@
# liteshort
liteshort is a link shortener designed with lightweightness, user and sysadmin-friendliness, privacy, and configurability in mind.
Click [here](https://ls.ikl.sh) for a live demo.
Click [here](https://ls.ikl.sh) for a live demo
(Unfortunately, I had to restrict creation of shortlinks due to malicious use by bad actors, but you can still see the interface.)
*Why liteshort over other URL shorteners?*
@ -10,8 +12,8 @@ liteshort is designed with the main goal of being lightweight. It does away with
liteshort focuses on being configurable. There are over 15 config options and most updates will add more. Configuration is done through the easy-to-use YAML format.
![liteshort screenshot](https://fs.ikl.sh/selif/4cgndb6e.png)
![liteshort screenshot](https://fs.ikl.sh/selif/1qu5x7sj.png)
## Installation
Liteshort's installation process is dead-simple. Check out the [installation page](https://github.com/132ikl/liteshort/wiki/How-to-Install) for info on how to install.
Liteshort's installation process is dead-simple. Check out the [installation page](https://git.ikl.sh/132ikl/liteshort/wiki/How-to-Install) for info on how to install.

View File

@ -46,11 +46,11 @@ def check_short_exist(short): # Allow to also check against a long link
def linking_to_blocklist(long):
# Removes protocol and other parts of the URL to extract the domain name
long = long.split("//")[-1].split("/")[0]
if long in current_app.config["blocklist"]:
domain = urllib.parse.urlparse(long).hostname
if domain in current_app.config["blocklist"]:
return True
if not current_app.config["selflinks"]:
return long in get_baseUrl()
return domain in get_baseUrl()
return False
@ -76,9 +76,8 @@ def delete_short(deletion):
def delete_long(long):
if "//" in long:
long = long.split("//")[-1]
long = "%" + long + "%"
parsed = urllib.parse.urlparse(long)[1:]
long = f"%{''.join(parsed)}%"
result = query_db(
"SELECT * FROM urls WHERE long LIKE ?", (long,), False, None
) # Return as tuple instead of row