This is the Python code and Docker configuration for a link shortening web app
This is not a functional application yet, I will make a full release when it is in a secure, production ready state
I am using this to learn:
- Docker & Web App Hosting
- Python Development
- DevSecOps Automation
-
Sign up for a free Turso account, and create database with a table called 'links' in it.
-
Create a file in the
/src
directory called.env
, with the following contents, setting the appropriate values with your own substitutions:
ENDPOINT="<your-turso-url>"
TOKEN="<your-turso-token>"
TLD=localhost
! WARNING !
Please make sure your local environment variables in your terminal do not share names with the ones in this .env
file.
If you change the names of the variables in this file, make sure to change their references in the
docker-compose.yaml
file as well.
From the root directory of this repository, run:
docker-compose up -d --build
[+] Running (2/2)
✔ Network linkshort_ls-net Created
✔ Container linkshort-app-1 Started
If succesful, app will be running at http://localhost, it will connect to your Turso database over the internet.
You can re-run this command whenever you make changes to rebuild the container.
To shut down the service, run this command:
docker-compose down
- Simple URL shortening capabilities for URLs
- Sanitises input from user for both URLs and extensions on requests
- Checks user input for URLs that begin with HTTPS only
- Checks submitted URLs for internet reputation before generating them, reject poor reputation URLs
- Frontend with good looking CSS and HTML animations and colours
- Handles errors gracefully, with 404 and 500 error pages rendered to the users
- Containerised with docker compose using secrets management for credentials
- Demonstration application set up and deployed on hosting provider
- Super Linter Code linting for all languages
- CodeQL Code security bug scanning
- Snyk Dependency vulnerability scanning and patching
- Trivy Docker image vulnerability scanning
- Renovate Automated dependency upgrades
- Conventional Commits Commit title standardisation
- Docker Push Docker image publication via a merge queue
- Commitizen Automated release management