Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72ccb52cfa |
No files matched your search
@@ -65,7 +65,12 @@ jobs:
|
|||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
if: ${{ steps.plano.outputs.reuse != 'true' }}
|
if: ${{ steps.plano.outputs.reuse != 'true' }}
|
||||||
run: docker build --target runtime --build-arg VERSION="${{ gitea.ref_name }}" --build-arg REVISION="${{ gitea.sha }}" -t inbraille:ci .
|
# O rótulo de versão vem do CHANGELOG (primeira versão numerada), não do nome da
|
||||||
|
# branch: a mesma imagem é reaproveitada pela tag, então o rótulo precisa valer para ela.
|
||||||
|
run: |
|
||||||
|
version=$(grep -m1 -oE '^## \[[0-9]+\.[0-9]+\.[0-9]+\]' CHANGELOG.md | tr -d '#[] ')
|
||||||
|
echo "versão da imagem: $version"
|
||||||
|
docker build --target runtime --build-arg VERSION="$version" --build-arg REVISION="${{ gitea.sha }}" -t inbraille:ci .
|
||||||
|
|
||||||
- name: Trivy na imagem
|
- name: Trivy na imagem
|
||||||
if: ${{ steps.plano.outputs.reuse != 'true' }}
|
if: ${{ steps.plano.outputs.reuse != 'true' }}
|
||||||
|
|||||||
+11
-1
@@ -13,6 +13,15 @@ Everything notable in InBraille is recorded here. The format follows
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [1.3.3] - 2026-11-02
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- The image now ships `curl`, so the Coolify healthcheck (which runs `curl` inside the container)
|
||||||
|
works; it is enabled on `/`. The image `HEALTHCHECK` still uses Python.
|
||||||
|
- The `org.opencontainers.image.version` label comes from the first numbered CHANGELOG entry
|
||||||
|
instead of the branch name (it said `main` on the 1.3.2 image).
|
||||||
|
|
||||||
## [1.3.2] - 2026-11-02
|
## [1.3.2] - 2026-11-02
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
@@ -61,7 +70,8 @@ sources of the live plate preview (`public/preview.js`) and of the browser-side
|
|||||||
- Security hardening of the API and the container (see SECURITY.md).
|
- Security hardening of the API and the container (see SECURITY.md).
|
||||||
- Dependencies upgraded; all Trivy findings (critical, high and medium) resolved.
|
- Dependencies upgraded; all Trivy findings (critical, high and medium) resolved.
|
||||||
|
|
||||||
[Unreleased]: https://git.lucasrguerra.dev.br/lucasrguerra/inbraille/compare/v1.3.2...HEAD
|
[Unreleased]: https://git.lucasrguerra.dev.br/lucasrguerra/inbraille/compare/v1.3.3...HEAD
|
||||||
|
[1.3.3]: https://git.lucasrguerra.dev.br/lucasrguerra/inbraille/compare/v1.3.2...v1.3.3
|
||||||
[1.3.2]: https://git.lucasrguerra.dev.br/lucasrguerra/inbraille/compare/v1.3.1...v1.3.2
|
[1.3.2]: https://git.lucasrguerra.dev.br/lucasrguerra/inbraille/compare/v1.3.1...v1.3.2
|
||||||
[1.3.1]: https://git.lucasrguerra.dev.br/lucasrguerra/inbraille/releases/tag/v1.3.1
|
[1.3.1]: https://git.lucasrguerra.dev.br/lucasrguerra/inbraille/releases/tag/v1.3.1
|
||||||
[1.1.0]: https://git.lucasrguerra.dev.br/lucasrguerra/inbraille/releases/tag/v1.1.0
|
[1.1.0]: https://git.lucasrguerra.dev.br/lucasrguerra/inbraille/releases/tag/v1.1.0
|
||||||
|
|||||||
@@ -47,6 +47,10 @@ LABEL org.opencontainers.image.title="InBraille" \
|
|||||||
org.opencontainers.image.version="${VERSION}" \
|
org.opencontainers.image.version="${VERSION}" \
|
||||||
org.opencontainers.image.revision="${REVISION}"
|
org.opencontainers.image.revision="${REVISION}"
|
||||||
|
|
||||||
|
# curl: the Coolify healthcheck runs `curl` inside the container (the image HEALTHCHECK uses Python).
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends curl \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
# pip/setuptools (and the libraries vendored inside pip) are build tools: remove them from the runtime image.
|
# pip/setuptools (and the libraries vendored inside pip) are build tools: remove them from the runtime image.
|
||||||
RUN pip install --prefer-binary -r requirements.txt \
|
RUN pip install --prefer-binary -r requirements.txt \
|
||||||
|
|||||||
@@ -69,6 +69,13 @@ grep -qi '^x-content-type-options: nosniff' <<< "$head" || falhou "/: sem X-Cont
|
|||||||
grep -qi '^x-frame-options: DENY' <<< "$head" || falhou "/: sem X-Frame-Options"
|
grep -qi '^x-frame-options: DENY' <<< "$head" || falhou "/: sem X-Frame-Options"
|
||||||
grep -qi '^cache-control: .*no-cache' <<< "$head" || falhou "/: sem Cache-Control no-cache (as páginas precisam revalidar)"
|
grep -qi '^cache-control: .*no-cache' <<< "$head" || falhou "/: sem Cache-Control no-cache (as páginas precisam revalidar)"
|
||||||
|
|
||||||
|
# O healthcheck do Coolify roda `curl` dentro do contêiner: ele precisa existir e funcionar.
|
||||||
|
docker exec "$app" curl -fsS -o /dev/null http://127.0.0.1:3000/ || falhou "o curl dentro da imagem não alcança a aplicação (healthcheck do Coolify)"
|
||||||
|
|
||||||
|
# O rótulo de versão da imagem é um número (não o nome de uma branch).
|
||||||
|
versao=$(docker inspect -f '{{index .Config.Labels "org.opencontainers.image.version"}}' "$imagem")
|
||||||
|
[[ "$versao" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || falhou "rótulo de versão inválido: '$versao'"
|
||||||
|
|
||||||
# Roda sem privilégios.
|
# Roda sem privilégios.
|
||||||
[ "$(docker exec "$app" id -u)" = 10001 ] || falhou "o processo não roda como o usuário 10001"
|
[ "$(docker exec "$app" id -u)" = 10001 ] || falhou "o processo não roda como o usuário 10001"
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user