diff --git a/.editorconfig b/.editorconfig index 9d6ee17..f7d82d5 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,8 +13,18 @@ trim_trailing_whitespace = true insert_final_newline = true [*.py] -max_line_length = 120 +max_line_length = 119 indent_size = 2 [*.md] max_line_length = 120 + +[*.{html,css,scss,json,yaml,yml,xml}] +indent_size = 2 + +[*.md] +indent_size = 2 + +# Makefile always use tabs for indentation +[Makefile] +indent_style = tab diff --git a/.env.template b/.env.template new file mode 100644 index 0000000..4860322 --- /dev/null +++ b/.env.template @@ -0,0 +1,11 @@ +# include these values in GitHub repository secrets +export AWS_ACCESS_KEY_ID= +export AWS_SECRET_ACCESS_KEY= +export AWS_DEFAULT_REGION= +export AWS_ACCOUNT_ID= +export STACK_NAME= +# include these values in GitHub environment secrets +export DOMAIN_NAME=app.example.com +export HOSTNAME=app.example.com +export KEY_PAIR_NAME=my-key-pair +export ZONE_NAME=example.com diff --git a/.gitignore b/.gitignore index bf7b6bc..ada1f6f 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,11 @@ wheels/ # Virtual environments .venv +# Environment variables .env # Documentation build by MkDocs site/ + +# Tools caches +.ruff_cache/ diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..a432967 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,5 @@ +{ + "default": true, + "MD041": false, + "MD013": false +} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1e41275..70dc549 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,42 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks + +exclude: "^site/|/migrations/" +default_stages: [pre-commit] + repos: -- repo: https://github.com/pre-commit/pre-commit-hooks + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - - id: check-yaml - - id: check-added-large-files + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-json + - id: check-toml + - id: check-xml + - id: check-yaml + - id: debug-statements + - id: check-builtin-literals + - id: check-added-large-files + + # Security + - id: detect-aws-credentials + args: ["--allow-missing-credentials"] + - id: detect-private-key + + # Cross platform + - id: check-case-conflict + - id: mixed-line-ending + args: [--fix=lf] + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.8.3 + hooks: + # Run the linter. + - id: ruff + # Run the formatter. + - id: ruff-format + +# sets up .pre-commit-ci.yaml to ensure pre-commit dependencies stay up to date +ci: + autoupdate_schedule: weekly + skip: [] + submodules: false diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..eec2647 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Ivan Prytula + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ab4f39f --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +help: ## Show this help (color=yes) + @grep --extended-regexp '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'