From 0f6a7fc10573d735af220bab41458b4aab4e071e Mon Sep 17 00:00:00 2001 From: kasun Date: Mon, 23 Nov 2026 04:58:03 +0100 Subject: [PATCH 1/2] chore: replace generated gitignore with focused rules --- .gitignore | 228 +++++++---------------------------------------------- 1 file changed, 27 insertions(+), 201 deletions(-) diff --git a/.gitignore b/.gitignore index 20a9956..abeea74 100644 --- a/.gitignore +++ b/.gitignore @@ -1,208 +1,34 @@ -# ---> Ansible -*.retry - -# ---> Python -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ -cover/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -.pybuilder/ -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# UV -# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -#uv.lock - -# poetry -# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control -#poetry.lock - -# pdm -# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. -#pdm.lock -# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it -# in version control. -# https://pdm.fming.dev/latest/usage/project/#working-with-version-control -.pdm.toml -.pdm-python -.pdm-build/ - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments +# Secrets (real values stay on the ansible LXC) .env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ +.env.* +vault.yml +vault.yaml +*.vault +.vault_pass* +*.pem +*.key +id_rsa* +id_ed25519* -# Spyder project settings -.spyderproject -.spyproject +# Ansible +*.retry +.ansible/ +collections/ansible_collections/ -# Rope project settings -.ropeproject +# Python +.venv/ +__pycache__/ +*.pyc -# mkdocs documentation -/site +# Logs +*.log -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ - -# Cython debug symbols -cython_debug/ - -# PyCharm -# JetBrains specific template is maintained in a separate JetBrains.gitignore that can -# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore -# and can be added to the global gitignore or merged into this file. For a more nuclear -# option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ - -# Ruff stuff: -.ruff_cache/ - -# PyPI configuration file -.pypirc - -# ---> VisualStudioCode -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -!.vscode/*.code-snippets - -# Local History for Visual Studio Code -.history/ - -# Built Visual Studio Code Extensions -*.vsix - -# ---> Linux +# Editor and OS +.vscode/ +.idea/ +*.swp *~ +.DS_Store -# temporary files which can be created if a process still has a handle open of a deleted file -.fuse_hidden* - -# KDE directory preferences -.directory - -# Linux trash folder which might appear on any partition or disk -.Trash-* - -# .nfs files are created when an open file is removed but is still being accessed -.nfs* - +# Claude Code local settings +.claude/settings.local.json From 8532e38151c5133dd09241c0a43a2a309e3cb265 Mon Sep 17 00:00:00 2001 From: kasun Date: Mon, 23 Nov 2026 05:08:47 +0100 Subject: [PATCH 2/2] chore(ci): add secret scan and lint checks --- .ansible-lint | 5 ++++ .gitea/workflows/checks.yaml | 55 ++++++++++++++++++++++++++++++++++++ .yamllint.yml | 22 +++++++++++++++ requirements-dev.txt | 2 ++ 4 files changed, 84 insertions(+) create mode 100644 .ansible-lint create mode 100644 .gitea/workflows/checks.yaml create mode 100644 .yamllint.yml create mode 100644 requirements-dev.txt diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..98393ef --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,5 @@ +profile: production + +exclude_paths: + - .gitea/ + - stacks/ diff --git a/.gitea/workflows/checks.yaml b/.gitea/workflows/checks.yaml new file mode 100644 index 0000000..7769a3a --- /dev/null +++ b/.gitea/workflows/checks.yaml @@ -0,0 +1,55 @@ +name: Checks + +on: + workflow_dispatch: + push: + branches: + - main + pull_request: + branches: + - main + +env: + BETTERLEAKS_VERSION: "1.10.1" + BETTERLEAKS_SHA256: c174b42d7aa60caf58c0c3e555c0e4bed01fe6b0d99a412bce777b5af4ce913e + +jobs: + secret-scan: + name: Secret Scan + runs-on: ubuntu-latest + steps: + - name: Checkout Full History + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Betterleaks + run: | + curl -fsSL -o /tmp/betterleaks.tar.gz \ + "https://github.com/betterleaks/betterleaks/releases/download/v${BETTERLEAKS_VERSION}/betterleaks_${BETTERLEAKS_VERSION}_linux_x64.tar.gz" + echo "${BETTERLEAKS_SHA256} /tmp/betterleaks.tar.gz" | sha256sum -c - + tar -xzf /tmp/betterleaks.tar.gz -C /tmp betterleaks + + - name: Scan Git History + run: /tmp/betterleaks git . --redact --verbose --no-banner --no-color --log-opts="--all -m -p -U0" + + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.14" + + - name: Install Lint Tools + run: pip install -r requirements-dev.txt + + - name: Run yamllint + run: yamllint --strict . + + - name: Run ansible-lint + run: ansible-lint diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..f631cbf --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,22 @@ +extends: default + +ignore: | + .venv/ + .ansible/ + collections/ansible_collections/ + +rules: + # These four settings are the values ansible-lint requires. + braces: + max-spaces-inside: 1 + comments: + min-spaces-from-content: 1 + comments-indentation: false + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true + document-start: disable + line-length: + max: 120 + truthy: + check-keys: false diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..ce81722 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,2 @@ +ansible-lint==26.11.0 +yamllint==1.38.0