Shorturl is a URL shortening service that is self-hosted and easy to set up. The software is written in Python and can be installed on any platform that supports Python. In this tutorial, we will explain the steps to install and configure Shorturl on NixOS Latest.
Before you begin, make sure you have the following installed on your NixOS Latest machine:
Start by cloning the Shorturl repository from the following URL:
https://git.mills.io/prologic/shorturl
You can use the git clone
command to clone the repository:
git clone https://git.mills.io/prologic/shorturl
This will create a new directory called shorturl
in your current working directory.
Navigate to the shorturl
directory and install the dependencies using pip:
cd shorturl
pip install -r requirements.txt
This will install all the dependencies required to run Shorturl.
Next, you need to configure Shorturl. To do this, copy the config.example.py
file to config.py
:
cp config.example.py config.py
Then, open the config.py
file and update the following variables according to your preferences:
DATABASE_URI
: The URI of your database.SECRET_KEY
: A secret key used for hashing.DOMAIN
: The domain name where Shorturl will be hosted.DEFAULT_REDIRECT
: The URL where Shorturl will redirect to if the shortened URL is not found.Shorturl uses a database to store the shortened URLs. You need to create the database tables before you can start using Shorturl:
python manage.py createdb
This will create the necessary tables in your database.
Finally, start the Shorturl server using the following command:
python run.py
This will start the server on http://localhost:5000/
.
Congratulations! You have successfully installed Shorturl on NixOS Latest. You can now start using Shorturl to create and manage shortened URLs on your own server.
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!