[DEPRECATED]
Due to the lack of time and invention of great products like Obsidian, I will no longer provide maintenance or support for this product.
Feel free to fork it or improve as you see fit.
Based on this repository but with:
- MySQL / Aurora support (instead of local SQLite) with optional SSL/TLS
strftimewas cut out along with any time-related functions- all
deleteactions explicit confirmations - support for
utfmb4(special characters likeśćźżó/ emojis etc.) - multiarch Dockerfile: amd64, arm64, arm/v6, arm/v7 - deployable to K3S/K8S
- bumped dependencies to match Snyk scans recommendations
- install prerequisites:
- Linux:
sudo apt-get install python3-dev default-libmysqlclient-dev build-essential - MacOS:
brew install mysql-client- add
PATH="/usr/local/opt/mysql-client/bin:$PATH"to .bashrc or .zshrc source .zshrc/source .bashrcor reload the terminal before next step
- Linux:
pip install -r requirements.txt- create a database with
utf8mb4charset andutf8mb4_unicode_cicollation (look at "Hacks" section) - set your MySQL credentials in
utils/functions.py - run initial schema from
schema_mysql.sql python manage.pyorgunicorn manage:app
docker build . -t notty-developmentdocker run -d -p 80:80 -e SQLALCHEMY_CONFIG='mysql://USER:PASSWORD@DATABASE_IP/DATABASE_NAME' notty-development
SQLALCHEMY_CONFIG can be put into Jenkins as build parameter to pass database credentials (though there are more secure methods).
Adjust database parameters in deployment.yaml before proceeding.
Assuming you have MetalLB configured in your cluster:
kubectl apply -f service.yamlkubectl apply -f deployment.yaml
MySQL cheat sheet:
- To create a database:
CREATE DATABASE notty CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; - To check charset and collation:
use notty;and thenSELECT @@character_set_database, @@collation_database;
Aurora with SSL/TLS:
- Enable custom parameter group with
require_secure_transportset toONand apply to your cluster - Alter service user with
ALTER USER 'encrypted_user'@'%' REQUIRE SSL; - Add
?ssl=trueat the at the end of the database endpoint definition (point it to the writer instance)
Quick development with bash helpers:
- Fill credentials in
build_and_run.shand run it to build the Dockerfile withnottyas container name stop_and_destroy.shquickly does the obvious and you can proceed with another change