This is the Python code and Docker/Kubernetes 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 & Kubernetes
- Python web app development
- DevSecOps automation
- Create a file in the root directory called
.env
, with the following contents, customising the values between <> with your own substitutions:
REDISUSER=default
REDISMASTER=<a-super-strong-password>
REDISREPLICA=<a-different-super-strong-password>
! 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 root directory of the repository, run this command:
docker-compose up --detach --scale redis-master=1 --scale redis-replica=3
[+] Running (6/6)
✔ Container linkshort-app-1
✔ Container linkshort-redis-replica-2
✔ Container linkshort-redis-replica-3
✔ Container linkshort-redis-replica-1
✔ Container linkshort-redis-master-1
✔ Network linkshort_ls-net
If succesful, app will be running at http://localhost:5000, with a redis master database with 3 replica nodes.
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
- Kubernetes deployment configuration with database in stateful sets
- Demonstration application set up and deployed on cloud provider
- Super Linter Code linting for all languages on PRs
- Snyk Automated security scanning and vulnerability patching
- Renovate Automated dependency upgrades
- Conventional Commits Commit title standardisation
- Commitizen Automated release management