Giter Club home page Giter Club logo

lisho's Introduction

Lisho

A simple personal link shortener with no external dependencies in under 200 lines of Rust. The links are maintained as a simple text file on the host machine.

[jzbor@desktop-i5] ~ lisho mappings.txt
Listening on localhost:8080 (5 links)
Token requested: mars
Token requested: asdfasdf
...

Adding Link Mappings

Lisho reads mappings from a simple text file. Entries consist of the short token and redirection URL separated by a whitespace. Lines starting with a # are ignored, as are fields after the URL. It is also possible to add a redirection for the root path by adding a mapping with a leading whitespace.

Example:

cb https://codeberg.org
gh https://github.com
gl https://gitlab.com
sh https://sr.ht

Static Files

There are some files that are compiled into lisho by default:

  • /
  • /index.html
  • /style.css
  • 404.html for 404 errors

You can override these defaults by simply adding a mapping to your preferred pages, in which case lisho will redirect them as usual. Similarly you can also set a favicon by redirecting it somewhere on the internet where your favicon is hosted.

# override index page
 https://github.com/jzbor/lisho
index.html https://github.com/jzbor/lisho

# add favicon
favicon.ico https://jzbor.de/favicon.ico

Of course this approach is rather limited, but lisho's primary goal is simplicity.

Convenient Alias

To make editing aliases on a remote machine easier you can add an alias in your shell config like so:

alias lisho-edit='ssh <hostname> -t <editor> <path>'

lisho's People

Contributors

jzbor avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

jojodicus

lisho's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.