UrlhdaOpen-source URL shortener - Solution for URL shortening: nginx, postgres, json.
Includes: Website, android application, and simple bash script for url shortening.
- Strong URL - 15 symbols long uid for shorted URLs, 5 symbols by default.
- Fast copy-paste. Copy button in android app.
- Ability to share URLs.
Live example: hda.me
To use it as service
To setup it yourselfRequirementsConfiguration examples location and installation
- conf folder includes nginx.conf section example, site-enabled/sitename (vhost) example, sql file to import and debian rules file example useful for package rebuild
- script folder includes shortening bash script example
- website folder includes main url shortener website page example
- android_app includes example android application, used for hda.me url shortener website
Once you have nginx and the needed modules installed you can start nginx with the the configuration from /conf and /website folders
You also need to setup a database in your PostgreSQL-server and create separate table, don't forget set password. Use the /config/database.sql file to do it for you. After you are done adjust the settings to your environment in the nginx configuration.
Creating user and database:
CREATE USER "user" WITH PASSWORD 'password';
CREATE DATABASE databasename WITH OWNER "user";
psql -h localhost -d databasename -U user -f database.sql
How it works
Edit host, chmod 755, and copy to /usr/local/bin/
Or you can install it via PPA:
sudo apt-add-repository ppa:hda-me/urlhda
sudo apt-get update
sudo apt-get install urlhda
# 5 symbols uid (default)
# To generate Strong URL (15 symbols uid)
urlhda -s http[s]://your_long_url_here
Edit index.html to change appearance for your needs and your done
- Android app
Install app and change hostname URL in application Settings (gear icon)
You can shorten URLs with a POST-request:
curl -X POST https://website.name/add?url=http://add.me
This will give you JSON-response back with the generated 5 character UID:
With that you can go to for example to https://website.name/abcd5 and you will be redirected to http://add.meOther
Original idea: Sebastian Gräßl, forked from https://github.com/bastilian/sebas
Bitcoin donate: 1N5czHaoSLukFSTq2ZJujaWGjkmBxv2dT9