Includes: Website, android application, tizen application and simple bash script for url shortening
- Strong URL (15 symbols long uid for shorted URLs, 5 symbols by default)
- Fast copy-paste. Auto selection in browser, and copy button in android app
- Ability to share URLs (Android App only) Live example: hda.me (its down due I don't have funds to run it)
sudo apt-add-repository ppa:hda-me/urlhda
sudo apt-get update
sudo apt-get install urlhda
Or copy this script to /usr/local/bin
- nginx - nginx itself
- postgres - better use repository from postgresql.org
- nginx devel kit - lua-nginx-module dependency
- nginx lua module
- nginx postgres module
- nginx json module
Note: As alternative you can setup nginx from ppa:hda-me/nginx-stable or try run setup on openresty project
- 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 url shortener website page example
- android_app android application, used for hda.me url shortener website
- tizen app tizen application, used for hda.me url shortener website
Once you have nginx and 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";
Importing:
psql -h localhost -d databasename -U user -f database.sql
Upgrading old installation (database) for Strong URLs support:
\c databasename
ALTER TABLE links ALTER COLUMN uid TYPE character varying(30);
- Script
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)
urlhda http[s]://your_long_url_here
# To generate Strong URL (15 symbols uid)
urlhda -s http[s]://your_long_url_here
- Website
Edit index.html to change appearance for your needs and your done - Android application
Install app and change hostname URL in application Settings (gear icon)
Consider making a donation, if you like what I doing. I working remotely and income is unstable, so every little bit helps.
Also it would be nice if you provide, a note on admin@hda.me
after making a donation with information what you like and what you want to improve. So, I would consider giving more time and support to particular project.
I also open to reasonable work offers, especially if offer would be close to a field or project I work with.
Donation on Yandex Money: https://money.yandex.ru/to/410015241627045)
Open https://wallet.advcash.com/pages/transfer/wallet and use mmail@sent.com
in Specify the recipient's wallet or e-mail
field
Donation with PayPal: https://paypal.me/hdadonation
Donation with Payeer: On https://payeer.com/en/account/send/ use P2865115
in Account, e-mail or phone number
field
Address is 1N5czHaoSLukFSTq2ZJujaWGjkmBxv2dT9
Address is 0xf449f8c17a056e9bfbefe39637c38806246cb2c9
Address is 0x23459a89eAc054bdAC1c13eB5cCb39F42574C26a
I could provide you with some relatively cheap "hardware" donation options directly to my PO Box, if you prefer real gifts. Ask for details on admin@hda.me
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:
[{"uid":"abcd5"}]
With that you can go to for example to https://website.name/abcd5 and you will be redirected to http://add.me
Original idea: Sebastian Gräßl, forked from https://github.com/bastilian/sebas