Coder Social home page Coder Social logo

i8's Introduction

i8

A tiny, but secure, URL shortener.

Installation

Assuming you have your web roots in /var/www, and you want to keep i8 in /var/www/i8:

% # Clone the repo and install dependencies
% git clone https://github.com/u1f408/i8.git /var/www/i8
% cd /var/www/i8
% composer install

% # Edit the configuration environment variables
% cp .env.dist .env
% $EDITOR .env

Point your web server's document root to /var/www/i8/public and rewrite all requests to index.php - this will work for nginx:

server {
	server_name i8.test;
	root /var/www/i8/public;

	# Or, however you enable PHP
	include /etc/nginx/fastcgi_php.conf;

	location / {
		try_files $uri /index.php;
	}
}

Usage

i8 is an authenticated URL shortener - only users that have been granted access are able to create shortened URLs.

i8 primarily uses MagentaSSO for authenticating users - the I8_MAGENTASSO_* environment variables configure this.

Visiting https://i8.test will redirect you to the configured MagentaSSO provider, where you can log in.

After successfully authenticating, you will be presented with a page containing your API key, a button to reset that API key, and a form to shorten a URL from a web browser.

Using without MagentaSSO

You can turn off MagentaSSO authentication in i8 by setting the environment variable I8_MAGENTASSO_DISABLE=true in your .env, and in this mode you will have to manually add new API keys into the i8 database to be able to shorten URLs.

There is (or, will be) a helper script for this: tools/addApiKey.php.

API usage

% http --form https://i8.test/shorten url=https://example.com apikey=$YOUR_API_KEY
HTTP/1.1 200 OK
Content-Type: text/plain

https://i8.test/BJCV

License

i8 is licensed under the terms of the GNU Affero General Public License, version 3 (or, at your option, any later version).

See LICENSE for details.

i8's People

Contributors

u1f408 avatar

Watchers

 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.