2022-08-15 18:41:06 -04:00
2022-08-15 14:31:08 -04:00
2022-08-15 14:31:36 -04:00
2022-08-15 18:24:02 -04:00
2022-08-15 18:24:42 -04:00
2022-08-15 17:29:53 -04:00
2022-08-15 18:07:17 -04:00
2022-08-15 18:24:02 -04:00
2022-08-15 14:31:36 -04:00
2022-08-15 18:41:06 -04:00
2022-08-15 18:24:02 -04:00

lisho

Minimalistic link shortener

image

Inspiration

This project is inspired by w4/bin, which is a similarly minimalistic pastebin. (Which I also hosted on bin.hydev.org)

Demo

The online demo is hosted on sh.hydev.org.

Self-Host

  1. Create a google safebrowsing API key (this is free!)
  2. Install docker
  3. Write the following in docker-compose.yml
# docker-compose.yml
version: '3.3'
services:
  lisho:
    container_name: lisho
    restart: always
    ports:
      - 'YOUR PORT HERE:8000'
    image: hykilpikonna/lisho:latest
    environment:
      - GOOGLE_API_KEY="YOUR KEY HERE"
    build: .
  1. docker-compose up -d lisho && docker-compose logs -f lisho

Self-Host under NGINX

  1. Write an NGINX config file and put it in /etc/nginx/conf.d:
# lisho.conf
server
{
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name YOUR.SUBDOMAIN.HERE;

    location ^~ /
    {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_pass http://localhost:YOUR PORT HERE/;
        proxy_redirect off;
    }
}

# Redirect HTTP to HTTPS for all servers.
server
{
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name default;
    return 301 https://$host$request_uri;
}
  1. Sign a SSL certificate with certbot (free)
S
Description
Minimalistic link shortener
Readme 93 KiB
Languages
HTML 51.9%
Python 46.4%
Dockerfile 1.7%