Simply Shorten is an open-source url-shortening service that is written in Python. In this tutorial, we'll guide you through the installation of Simply Shorten on an OpenBSD system.
Before installing Simply Shorten on OpenBSD, make sure you have the following:
Before installing Simply Shorten, you need to install the dependencies. Open the terminal and run the following command:
$ doas pkg_add python3 py3-pip postgresql-server postgresql-client
You can download Simply Shorten from the GitLab repository:
$ git clone https://gitlab.com/draganczukp/simply-shorten.git
Once the download is complete, change your working directory to the newly created simply-shorten
directory:
$ cd simply-shorten
To install the required Python packages, run the following command:
$ doas pip3 install -r requirements.txt
Create a new PostgreSQL database by running the following command:
$ doas su _postgresql -c 'initdb -D /var/postgresql/data -U _postgresql -A md5'
Setup a new user and database for Simply Shorten:
$ doas su - _postgresql
$ createuser -P simplyshorten
$ createdb -O simplyshorten simplyshorten
Copy the config/sample_config.ini
file to config/config.ini
:
$ cp config/sample_config.ini config/config.ini
Open the config.ini
file using an editor:
$ vi config/config.ini
Update the configuration settings to match your environment. Set the following parameters:
db_host
- Set this to localhost
if PostgreSQL is running on the same machine, and provide the hostname if it's running on a different machine.db_user
- Set this to the name of the PostgreSQL user created in Step 4.db_password
- Set this to the password for the PostgreSQL user created in Step 4.db_name
- Set this to the name of the PostgreSQL database created in Step 4.Start the Simply Shorten application by running the following command:
$ doas python3 simplyshorten.py
The application should now be running on port 5000. Open your web browser and go to http://localhost:5000/
to access Simply Shorten.
In this tutorial, we installed Simply Shorten on an OpenBSD system. You can now use Simply Shorten to shorten URLs and track clicks!
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!