Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
2268cb1
feat(core): adding helvetica character widths for the pdf writer
buguno Nov 26, 2026
46edfa1
feat(core): adding a dependency-free pdf writer for simple tables
buguno Nov 26, 2026
1dfcdf4
feat(core): adding the pdf download response
buguno Nov 26, 2026
e9c4057
feat(inventory): adding the shopping list pdf
buguno Nov 26, 2026
73420ad
feat(kits): adding the kit checklist pdf
buguno Nov 26, 2026
812340d
feat(inventory): downloading the shopping list as a pdf and giving th…
buguno Nov 26, 2026
790d8d0
feat(inventory): routing the shopping list pdf
buguno Nov 26, 2026
18a5b20
feat(kits): downloading the kit checklist as a pdf
buguno Nov 26, 2026
71f47e9
feat(kits): routing the kit checklist pdf
buguno Nov 26, 2026
99fa28b
feat(core): marking the current menu link with aria-current
buguno Nov 26, 2026
167839c
feat(core): linking help text and errors to their form fields
buguno Nov 26, 2026
ef02a00
feat(ui): adding focus ring, reduced motion, skip link, larger touch …
buguno Nov 26, 2026
3536785
build(css): rebuilding the tailwind css
buguno Nov 26, 2026
d1b01e1
feat(ui): making the closed drawer inert and blocking double submits
buguno Nov 26, 2026
6c37f7c
feat(ui): adding the skip link, main target and larger header controls
buguno Nov 26, 2026
b60a059
feat(ui): marking the active menu link and enlarging menu targets
buguno Nov 26, 2026
9b6be0d
feat(ui): adding required marks, error ids and an error summary to forms
buguno Nov 26, 2026
edb5fca
feat(ui): announcing error messages as alerts
buguno Nov 26, 2026
c80ec22
feat(ui): showing field errors and a stronger button on login
buguno Nov 26, 2026
a075621
feat(ui): adding the main target and a stronger button to setup
buguno Nov 26, 2026
b7afca9
feat(ui): disabling stock form buttons while a request runs
buguno Nov 26, 2026
39a5202
feat(ui): hiding decorative charts from assistive technology
buguno Nov 26, 2026
be2147a
feat(ui): hiding decorative bars from assistive technology
buguno Nov 26, 2026
e55b488
feat(ui): hiding decorative rings from assistive technology
buguno Nov 26, 2026
9d1bbce
feat(ui): replacing the print button with a pdf download and fixing m…
buguno Nov 26, 2026
1cb295f
feat(ui): replacing the print button with a pdf download and fixing m…
buguno Nov 26, 2026
bedd357
fix(ui): fixing muted text contrast and naming table columns on the a…
buguno Nov 26, 2026
3756bd5
fix(ui): fixing muted text contrast and naming table columns on the u…
buguno Nov 26, 2026
797fb3b
fix(ui): fixing muted text contrast and naming table columns on the m…
buguno Nov 26, 2026
c83a475
fix(ui): fixing muted text contrast on the kits card
buguno Nov 26, 2026
d48c8bc
fix(ui): fixing muted text contrast and naming table columns on the i…
buguno Nov 26, 2026
0970ec6
fix(ui): fixing muted text contrast and naming table columns on simpl…
buguno Nov 26, 2026
252cd60
fix(ui): fixing muted text contrast and naming table columns on the s…
buguno Nov 26, 2026
2c487e5
chore(i18n): translating the pdf button, the skip link and the error …
buguno Nov 26, 2026
6883cae
chore(i18n): compiling the pt-BR catalog
buguno Nov 26, 2026
c0d485a
build(docker): running as an unprivileged user with read-only code an…
buguno Nov 26, 2026
bf915c7
build(docker): keeping docs and the claude folder out of the image
buguno Nov 26, 2026
90da46c
chore(gunicorn): dropping an unused noqa comment
buguno Nov 26, 2026
b70c7d3
build(ruff): excluding the claude skills folder from lint
buguno Nov 26, 2026
6678101
ci(dependabot): updating github actions and docker base images weekly
buguno Nov 26, 2026
574a1e6
ci(tests): adding a reusable workflow with lint, css check and tests,…
buguno Nov 26, 2026
1c4c3a8
ci(pull-request): running only the tests on pull requests
buguno Nov 26, 2026
cb7b875
ci(publish): publishing the multi-arch image to ghcr.io from master a…
buguno Nov 26, 2026
2153643
ci(release): opening release pull requests and tagging releases with …
buguno Nov 26, 2026
d8c852f
ci(release): configuring release-please for the python project
buguno Nov 26, 2026
8533a23
ci(release): setting the version release-please starts from
buguno Nov 26, 2026
d1ce7a4
test(core): covering the pdf writer
buguno Nov 26, 2026
2856800
test(inventory): covering the shopping list pdf
buguno Nov 26, 2026
6c6e44a
test(kits): covering the kit checklist pdf
buguno Nov 26, 2026
3a98327
test(core): covering the accessibility rules
buguno Nov 26, 2026
79bc4a0
docs(docker): adding the registry-style page with run instructions an…
buguno Nov 26, 2026
ed2b576
docs(readme): documenting the pdfs, the image, the ci workflows and t…
buguno Nov 26, 2026
2b900c7
docs(claude): documenting the ui rules, the image, the ci workflows a…
buguno Nov 26, 2026
92306a0
chore(editor): using two-space indentation for html and css
buguno Nov 26, 2026
c7a4516
ci(pull-request): making the tests workflow runnable by hand on a branch
buguno Nov 26, 2026
dc2e2ba
ci(release): running the tests on the release pull request
buguno Nov 26, 2026
5177822
docs(readme): documenting the branch protection
buguno Nov 26, 2026
62fa9d6
docs(claude): documenting the branch protection
buguno Nov 26, 2026
80b2cf7
chore(git): ignoring the claude skills and local settings
buguno Nov 26, 2026
66f1502
docs(claude): making the ui skill optional and local
buguno Nov 26, 2026
3b47eab
fix(css): scanning only templates and apps so the built css is the sa…
buguno Nov 26, 2026
85da3f4
build(css): rebuilding the tailwind css without stray sources
buguno Nov 26, 2026
2ee066b
docs(claude): explaining why tailwind sources are explicit
buguno Nov 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Keep the build context small and never ship secrets or local files.
.git
.github
.claude
.gitignore
.env
.env.*
Expand All @@ -16,6 +17,7 @@ bin
staticfiles
tests
tailwind
docs
compose.yaml
Dockerfile
.dockerignore
Expand Down
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ insert_final_newline = true

[*.{yml,yaml}]
indent_size = 2

[*.html]
indent_size = 2

[*.css]
indent_size = 2
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,13 @@ updates:
schedule:
interval: "weekly"
timezone: "America/Sao_Paulo"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
timezone: "America/Sao_Paulo"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
timezone: "America/Sao_Paulo"
122 changes: 122 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: Publish

# What reaches master (and every version tag) is tested again and, only if the
# tests pass, built for amd64 and arm64 and published to ghcr.io.
#
# Publishing is switched by the repository variable PUBLISH_IMAGE (Settings,
# Secrets and variables, Actions, Variables). Without it, for example on a fork,
# the image is still built and smoke-tested, but nothing is pushed.
on:
push:
branches: [master]
tags: ['v*']
workflow_dispatch:

concurrency:
group: publish-${{ github.ref }}
cancel-in-progress: false # never stop a publish half way

permissions:
contents: read

jobs:
tests:
uses: ./.github/workflows/tests.yaml

image:
name: 🐳 Container image
needs: tests
runs-on: ubuntu-latest
timeout-minutes: 60

permissions:
contents: read
packages: write

env:
PUBLISH: ${{ vars.PUBLISH_IMAGE == 'true' }}

steps:
- name: 📥 Checkout repository
uses: actions/checkout@v5

- name: 🧬 Set up QEMU (for the arm64 build)
uses: docker/setup-qemu-action@v3

- name: 🏗️ Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: 🔨 Build the image (amd64) for the smoke test
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64
load: true
push: false
tags: vault:ci
cache-from: type=gha
cache-to: type=gha,mode=max

- name: 🔎 Smoke test the image
run: |
set -eu
env_args="-e SECRET_KEY=ci-only -e ALLOWED_HOSTS=localhost -e DATABASE_URL=postgres://u:p@localhost/x"

echo "runs as the unprivileged user:"
test "$(docker run --rm vault:ci id -u)" = "10001"

echo "the code is read-only for the app user:"
if docker run --rm vault:ci sh -c 'touch /app/probe'; then
echo "the app user can write to /app" >&2
exit 1
fi

echo "starts with a read-only filesystem and any uid:"
docker run --rm --read-only --tmpfs /tmp --user 4242:4242 $env_args vault:ci python manage.py check

echo "encrypted backups work (gnupg) with a read-only filesystem:"
docker run --rm --read-only --tmpfs /tmp $env_args vault:ci python -c "
import django, os
os.environ['DJANGO_SETTINGS_MODULE'] = 'config.settings'
django.setup()
from apps.core import backup
assert backup.decrypt(backup.encrypt(b'ok', 'a-long-passphrase-1'), 'a-long-passphrase-1') == b'ok'"

- name: 🔑 Log in to GitHub Container Registry
if: env.PUBLISH == 'true'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: 🏷️ Work out the image tags and labels
id: meta
if: env.PUBLISH == 'true'
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=edge,branch=master
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha
labels: |
org.opencontainers.image.documentation=${{ github.server_url }}/${{ github.repository }}/blob/master/DOCKER.md

- name: 🚀 Build and push (amd64 and arm64)
if: env.PUBLISH == 'true'
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
provenance: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: ⏭️ Say why nothing was published
if: env.PUBLISH != 'true'
run: echo "::notice title=Image not published::Set the repository variable PUBLISH_IMAGE to true to publish it."
22 changes: 22 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Pull request

# Pull requests are only tested: nothing is built or published from here.
#
# It can also be run by hand on a branch (release.yaml does this for the release
# pull request, which GitHub does not test by itself): the check it reports is
# the same one that master requires before a merge.
on:
pull_request:
branches: [master]
workflow_dispatch:

concurrency:
group: pull-request-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
tests:
uses: ./.github/workflows/tests.yaml
58 changes: 58 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Release

# Keeps a "release pull request" open on master: it holds the next version (in
# pyproject.toml) and the changelog, worked out from the Conventional Commits
# since the last release (feat = minor, fix = patch, "!" = major). Merging that
# pull request creates the tag vX.Y.Z and the GitHub release, and this workflow
# then starts publish.yaml for the tag.
#
# Anything created with the built-in GITHUB_TOKEN (the tag, the release pull
# request) does not trigger other workflows by itself (a GitHub rule, to avoid
# loops), so publish.yaml and the tests are started explicitly: workflow runs
# are the one exception to that rule.
on:
push:
branches: [master]

concurrency:
group: release
cancel-in-progress: false

permissions:
contents: write
issues: write
pull-requests: write
actions: write

jobs:
release-please:
name: 🔖 Release pull request
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: 🔖 Update the release pull request, or tag a release
id: release
uses: googleapis/release-please-action@v4
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json

# The release pull request is opened with the built-in token, and GitHub
# does not run pull_request workflows for those. master requires the tests
# before a merge, so run them on the release branch by hand.
- name: 🧪 Run the tests on the release pull request
if: steps.release.outputs.prs_created == 'true'
env:
GH_TOKEN: ${{ github.token }}
PR: ${{ steps.release.outputs.pr }}
run: |
branch="$(echo "$PR" | jq -r .headBranchName)"
gh workflow run pull-request.yaml --repo "$GITHUB_REPOSITORY" --ref "$branch"

- name: 🚀 Publish the image for the new tag
if: steps.release.outputs.release_created == 'true'
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ steps.release.outputs.tag_name }}
run: gh workflow run publish.yaml --repo "$GITHUB_REPOSITORY" --ref "$TAG"
54 changes: 54 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Tests

# Lint, Tailwind freshness check and the test suite. pull-request.yaml and
# publish.yaml call it, so there is one definition. It can also be run by hand
# from the Actions tab on any branch, without publishing anything.
on:
workflow_call:
workflow_dispatch:

permissions:
contents: read

env:
PYTHON_VERSION: '3.14'
TAILWIND_VERSION: '4.3.4'

jobs:
test:
name: 🧪 Lint and tests
runs-on: ubuntu-latest
timeout-minutes: 20

env:
ENVIRONMENT: development
DATABASE_URL: postgres://user:password@localhost:5432/vault
SECRET_KEY: ci-only-secret-key
ALLOWED_HOSTS: localhost

steps:
- name: 📥 Checkout repository
uses: actions/checkout@v5

- name: 🐍 Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: 📦 Install Poetry
run: |
pipx install poetry
pipx inject poetry "poethepoet[poetry_plugin]"

- name: 🔧 Install dependencies
run: poetry install

- name: 🎨 Check Tailwind CSS is up to date
run: |
mkdir -p bin
curl -sL -o bin/tailwindcss "https://github.com/tailwindlabs/tailwindcss/releases/download/v${TAILWIND_VERSION}/tailwindcss-linux-x64"
chmod +x bin/tailwindcss
poetry css-check

- name: 🧪 Run tests
run: poetry test
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -231,3 +231,8 @@ backup_*.sql

# Tailwind standalone CLI binary (dev only)
bin/

# Claude Code: the skills are local tools (their licenses are mixed or missing)
# and settings.local.json is personal, so neither is versioned.
.claude/skills/
.claude/settings.local.json
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.0.0"
}
Loading