Giter Site home page Giter Site logo

shortor's Introduction

ShorTor

A URL Shortener, designed for Tor

What is this?

ShorTor is a simple URL Shortener written in Python using the Flask framework. It is licensed under the MIT License and can be used and modified freely. It has been designed with Tor in mind and can be easily set up as a Hidden Service. However, this does not mean that it cannot be used as a normal service, outside of Tor. It has been tested with Tor Browser and Maximum Security Settings and words without any issues. For the link storage it uses the file system, and more specifically the links folder.

The current version of ShorTor does not support any kind of rate limiting so it is "vulnerable" to abuse, however there are plans for rate limiting in the future. It has not been incorporated in the current version for simplicity, as well as Tor compatibility (a Hidden Service cannot see any IP / set a cookie).

The API

ShorTor actually has an API built-in that can be used by anyone to shorten links automatically. It is not a proper API yet, but it works.

Shortening new links

A POST request to /new with the link parameter set and Accept: application/json in the headers will return a JSON dictionary with the following information:

{
	"success": "true",
	"id": "<ID>",
	"link": "https://<HOSTNAME>/l/<ID>",
	"private_key": "<PRIVATEKEY>"
}

If the URL supplied via the link parameter is invalid, an HTTP Status 400 will be returned.

The success variable indicates whether the action succeeded, the id variable contains the unique identifier of the shortened link, the link variable contains the publicly accessible shortened URL, and the private_key variable contains a Private Key, used solely for viewing statistics about that Link ID.

How to run ShorTor

The recommended way of running ShorTor is using virtualenv:

virtualenv .
bin/pip install Flask
./main.py

This will start the development server listening on 127.0.0.1:5000. If you're interested in running this in a production environment, a full WSGI server like Gunicorn is recommended.

shortor's People

Contributors

daknob avatar

Stargazers

Depressive Internationale avatar Konstantinos Benos avatar

Watchers

 avatar James Cloos avatar  avatar

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.