Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
ec2d325
chore: remove legacy v0.4.0 single-module layout
codeministry May 29, 2026
a15b860
feat(backend): v0.5.0 — multi-tenancy, auth modes, git-sync, SQLite (…
codeministry May 29, 2026
088f72c
feat(frontend): add Angular 21 admin UI
codeministry May 29, 2026
3973ac7
feat(docker): mode-specific compose stacks
codeministry May 29, 2026
804ecaa
ci: monorepo GitHub Actions workflows
codeministry May 29, 2026
96a3e31
docs: v0.5.0 documentation and project metadata
codeministry May 29, 2026
9696847
- **ci: add GitHub Actions release workflow** 🚀
codeministry May 29, 2026
c97e6ff
fix(frontend): sync package-lock.json with package.json so npm ci passes
codeministry May 29, 2026
8f4f911
chore(backend): update module name in run configuration and sync chan…
codeministry May 29, 2026
3ffb571
chore: update `.run` config to reference `frontend/package.json` inst…
codeministry May 29, 2026
94f466a
docs(docker): clarify encryption key setup and update placeholder key
codeministry May 31, 2026
2821d16
chore(backend): upgrade to Spring Boot 4 and Jackson 3, update depend…
codeministry May 31, 2026
72f787d
docs(frontend): update README images
codeministry May 31, 2026
e6b7893
docs(frontend): update README images
codeministry May 31, 2026
4107f35
docs: update Spring Boot badge version in README.md
codeministry May 31, 2026
fe61521
docs: update Spring Boot badge version in README.md
codeministry May 31, 2026
1f052bb
docs: add CLAUDE.md with architecture, commands, and conventions guide
codeministry May 31, 2026
073a908
docs: add Docker badge and update Matrix badge color in README.md
codeministry Jun 1, 2026
8e9152b
chore(backend): upgrade Gradle wrapper to 9.3 and remove redundant CL…
codeministry Jun 1, 2026
c139bba
docs: add migration guide for upgrading to version 0.5.0 in README.md
codeministry Jun 1, 2026
ed88a7d
docs: update Matrix badge color in README.md
codeministry Jun 1, 2026
581b02d
docs: refine migration instructions and improve Docker environment co…
codeministry Jun 1, 2026
f6f7887
docs(frontend): update README image file paths for consistency
codeministry Jun 1, 2026
2720448
docs: add CI/CD workflows documentation to README.md
codeministry Jun 1, 2026
e98b1b7
docs: update README for tenant configuration and Docker Compose changes
codeministry Jun 2, 2026
ba57580
Merge branch 'master' into feature/straightmail-v0.5.0
codeministry Jun 3, 2026
e37b71d
test(backend): add unit tests for FileTemplateLoader behavior and imp…
codeministry Jun 3, 2026
7420033
ci: add cleanup workflow for managing old container images on schedule
codeministry Sep 16, 2026
f50c816
feat(frontend): add i18n support for API key login component and inte…
codeministry Sep 16, 2026
0c00871
chore(backend): update Gradle to 9.7.1, Spring Boot to 4.1.1, and Jav…
codeministry Sep 16, 2026
36f7ac1
chore(frontend): upgrade Angular to 22.1.x, Node.js to 22, and Java t…
codeministry Sep 16, 2026
c7bd557
refactor(frontend): bind shared form fields via [formControl] instead…
codeministry Sep 16, 2026
53ea85f
fix(security): sandbox FreeMarker rendering and confine template paths
codeministry Sep 16, 2026
e50849c
fix(security): require the admin role to read tenant records
codeministry Sep 16, 2026
d3219cf
feat(security): send security headers and harden the deployment defaults
codeministry Sep 16, 2026
895d3f3
fix(frontend): ship the production environment and scope credentials …
codeministry Sep 16, 2026
14fa056
ci: repair the pipeline, add scanning and bring the cleanup workflow …
codeministry Sep 16, 2026
b4bf9b4
test(backend): pin the security properties that nothing covered
codeministry Sep 16, 2026
cf4fb3e
docs(ci): document all seven workflows accurately
codeministry Sep 16, 2026
25a8f82
fix(docker): make the PostgreSQL stack start and stop shipping a brok…
codeministry Sep 16, 2026
b0231d6
docs: carry the migration guide and changelogs up to what 0.5.0 actua…
codeministry Sep 16, 2026
5fba9d6
fix: address the v0.5.0 code review findings
codeministry Sep 17, 2026
5be76e7
test(backend): serve a stub SPA shell so the routing tests hold in CI
codeministry Sep 17, 2026
66a0a5d
Merge branch 'feature/straightmail-v0.5.0'
codeministry Sep 17, 2026
aacd0ac
Update CI workflows: fix broken Trivy action reference to v0.36.0
codeministry Sep 17, 2026
0608852
Add monorepo image to cleanup workflow and separate cache tags
codeministry Sep 17, 2026
0b7926a
fix(security): resolve the CodeQL findings on the v0.5.0 PR
codeministry Oct 24, 2026
65bd8c2
build: upgrade dependencies and harden the runtime image
codeministry Oct 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
35 changes: 35 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: 2

# Dependency updates for all three ecosystems in this repo. Security updates are opened by
# Dependabot regardless of the schedule; the weekly interval covers ordinary version drift,
# which is what let several pins here fall months behind before.
updates:
- package-ecosystem: gradle
directory: /backend
schedule:
interval: weekly
open-pull-requests-limit: 5
groups:
# Spring Boot's BOM moves as a unit; separate PRs per starter are noise.
spring:
patterns:
- "org.springframework*"
- "io.spring*"

- package-ecosystem: npm
directory: /frontend
schedule:
interval: weekly
open-pull-requests-limit: 5
groups:
angular:
patterns:
- "@angular*"
- "@ngx-translate*"
- "@ngxs*"

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 5
164 changes: 164 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# CI / CD Workflows

straightmail uses seven GitHub Actions workflows to cover the full development, security and
release lifecycle — from feature branch validation through to production image publishing with
supply-chain attestations and registry retention.

The repository's default branch is `master`. Workflows that watch a trunk accept both `master`
and `main`, so a rename does not silently disable CI.

## Overview

| Workflow | File | Trigger | Purpose |
|---|---|---|---|
| Feature Branch CI | [`feature.yml`](feature.yml) | push to `feature/**`, `fix/**`, `chore/**` | Validate before a PR is opened |
| Backend CI/CD | [`backend.yml`](backend.yml) | push / PR to `master` or `main` (`backend/**`) | Build, test, scan, publish backend image |
| Frontend CI | [`frontend.yml`](frontend.yml) | push / PR to `master` or `main` (`frontend/**`) | Unit tests + Playwright E2E |
| Monorepo Full Build | [`monorepo.yml`](monorepo.yml) | push to `master` or `main` | Full build + combined image |
| Release | [`release.yml`](release.yml) | push to `master` / `main`, tag `v*.*.*` | Production image with SBOM & provenance |
| CodeQL | [`codeql.yml`](codeql.yml) | push / PR to `master` or `main`, weekly cron | Static analysis (Java + TypeScript) |
| Cleanup Old Packages | [`cleanup.yml`](cleanup.yml) | weekly cron, `workflow_dispatch` | GHCR retention for the published images |

---

## Workflows

### `feature.yml` — Feature Branch CI

Runs on every push to `feature/**`, `fix/**`, or `chore/**`. Ensures that both halves build and
pass their tests before a pull request is opened. Frontend linting is best-effort (`npm run lint ||
echo …`), so a missing lint script never fails the branch. Test reports are uploaded on failure
only, for quick diagnosis.

**Jobs:** `backend` (Gradle build + test, `SKIP_FRONTEND_BUILD=true`) · `frontend` (lint + Vitest + Playwright)
**Artifacts (on failure, 3 days):** `backend-test-reports` (JUnit + JaCoCo) · `playwright-report`

---

### `backend.yml` — Backend CI/CD

Runs on push and pull requests to `master` or `main` that touch `backend/**` or the workflow file
itself. Builds the JAR with Java 25 and Gradle, runs the test suite in a separate job, and — on
direct pushes to a trunk branch — publishes a backend-only multi-arch image, scans it, and attests
its provenance. The `docker` job is skipped on pull requests.

**Jobs:** `build` (JAR artifact, 1 day) · `test` · `docker` (`needs: [build, test]`, trunk only)
**Image:** `ghcr.io/codeministry/straightmail/backend` — `linux/amd64`, `linux/arm64`
**Tags:** `latest` · short commit SHA (7 hex)
**Build cache:** registry cache at `…/backend:buildcache`
**Security:** SBOM + provenance in the build, Trivy scan (CRITICAL/HIGH, `ignore-unfixed`) uploaded
as SARIF to code scanning, plus `actions/attest-build-provenance` pushed to the registry
**Artifacts (on failure, 3 days):** `test-reports` (JUnit + JaCoCo)

---

### `frontend.yml` — Frontend CI

Runs on push and pull requests to `master` or `main` that touch `frontend/**` (push additionally
watches the workflow file). Executes Vitest unit tests and Playwright E2E tests against the `:4299`
e2e serve target on Node 22. The Playwright report is uploaded with `if: always()`, so it exists for
green runs too.

**Jobs:** `test` (Vitest unit + Playwright E2E, chromium only)
**Artifacts (always, 30 days):** `playwright-report`

---

### `monorepo.yml` — Monorepo Full Build

Runs on every push to `master` or `main`, with no path filter. Builds the full production monorepo —
Angular frontend embedded into the Spring Boot JAR via `./gradlew build` — runs backend and frontend
tests, then publishes the combined image. Note that this job pushes to the *same* image repository
and the same `latest` / short-SHA tags as `backend.yml`; on a trunk push that touches `backend/**`,
both workflows run and the later one wins.

**Jobs:** `backend` (full build + tests, `combined-jar` artifact, 7 days) · `frontend` (Vitest only) ·
`docker-combined` (`needs: [backend, frontend]`)
**Image:** `ghcr.io/codeministry/straightmail/backend` — `linux/amd64`, `linux/arm64`
**Tags:** `latest` · short commit SHA (7 hex)
**Security:** identical to `backend.yml` — SBOM, provenance, Trivy → SARIF, attestation

---

### `release.yml` — Release

Triggered on push to `master` / `main` and on semantic version tags (`v*.*.*`). Builds the
production `bootJar` with `SKIP_FRONTEND_BUILD=true` (the release image carries the backend only)
and publishes a multi-arch image with full supply-chain metadata. Only one release flow runs per
ref at a time, and a tagged release is never cancelled mid-flight.

**Job:** `build-and-push`
**Image:** `ghcr.io/codeministry/straightmail` — `linux/amd64`, `linux/arm64`
**Tags:** `latest` (default branch only) · `{{version}}` · `{{major}}.{{minor}}` · `{{major}}` from a
`v*.*.*` tag · `<branch>-<sha>` for branch builds — e.g. tag `v0.5.0` yields `0.5.0`, `0.5`, `0`
**Build cache:** GitHub Actions cache (`type=gha`)
**Security:** SBOM + provenance in the build, Trivy scan → SARIF, `actions/attest-build-provenance`
pushed to the registry
**Concurrency:** `release-${{ github.ref }}`, `cancel-in-progress: false`

---

### `codeql.yml` — CodeQL

Static analysis for both halves of the monorepo, on push and pull requests to `master` / `main` and
weekly (Mondays 03:00 UTC) so newly published queries reach existing code without waiting for a
push. The backend renders untrusted FreeMarker templates and resolves caller-supplied template
paths — injection and path traversal are exactly what the `java-kotlin` queries cover.

**Job:** `analyze` (matrix, `fail-fast: false`)
**Languages:** `java-kotlin` (`build-mode: manual`, compiled via `./gradlew compileJava`) ·
`javascript-typescript` (`build-mode: none`)
**Query suite:** `security-extended`

---

### `cleanup.yml` — Cleanup Old Packages

GHCR retention for this repository's packages, scheduled Sundays 02:00 UTC and runnable manually
via `workflow_dispatch` (input `dry-run`, default `true`). It uses `dataaxiom/ghcr-cleanup-action`
rather than a blanket "delete untagged" rule: buildx attaches provenance, so a pushed artifact is an
OCI index plus untagged child manifests, and deleting all untagged versions would break `docker pull`
on a tag that still resolves.

A shell guard step composes the action inputs and enforces two invariants: `keep-n-tagged` is never
`0` or non-numeric (the action reads `0` as "delete every tagged image"), and `latest` plus
`buildcache` are always excluded — `buildcache` is the registry cache `backend.yml` and
`monorepo.yml` write to, so dropping it turns every subsequent build cold.

**Job:** `images`
**Packages:** `straightmail`, `straightmail/backend`
**Keeps:** 15 newest tagged images; excludes `latest`, `buildcache`, `v*`, `[0-9]*.[0-9]*`
**Deletes:** untagged, ghost, partial and orphaned images (orphaned covers the `sha256-<digest>`
attestation referrer tags once their parent is gone)

> **Rollout gate:** the scheduled run is still forced into dry-run mode
> (`github.event_name == 'schedule' || inputs.dry-run`). Remove that clause — leaving
> `inputs.dry-run || false` — only after a manual dry-run has been reviewed for this repository.

---

## Required Permissions & Secrets

No repository secrets need to be configured manually.

| Requirement | Used by | Details |
|---|---|---|
| `GITHUB_TOKEN` | all `docker` / `release` / `cleanup` jobs | Auto-provided by GitHub — pushes images to `ghcr.io` and deletes package versions |
| `packages: write` | `backend.yml`, `monorepo.yml`, `release.yml`, `cleanup.yml` | Declared in each workflow's `permissions:` block |
| `security-events: write` | `backend.yml`, `monorepo.yml`, `release.yml`, `codeql.yml` | Uploading Trivy and CodeQL SARIF to code scanning |
| `id-token: write` | `backend.yml`, `monorepo.yml`, `release.yml` | OIDC tokens for SBOM and provenance attestations |
| `attestations: write` | `backend.yml`, `monorepo.yml`, `release.yml` | Required for `actions/attest-build-provenance` |

`feature.yml`, `backend.yml`, `frontend.yml`, `monorepo.yml` and `codeql.yml` set a read-only
`contents: read` default at the top level and widen permissions only on the jobs that need it.
`release.yml` and `cleanup.yml` declare their wider scopes at the top level because they each have a
single job.

## Notes for maintainers

- **Local Compose stacks do not pull these images.** The four stacks under `docker/` build from
`../backend` with `build.context`, so a published image is never required for local development.
- **Image repositories differ by purpose.** `release.yml` publishes to
`ghcr.io/codeministry/straightmail`; `backend.yml` and `monorepo.yml` publish to the nested
`…/straightmail/backend`. Deployments that track 7-hex commit tags consume the latter.
- **Java 25 / Node 22** are the pinned toolchain versions across every workflow.
88 changes: 88 additions & 0 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Backend CI

on:
push:
branches: [ "master", "main" ]
paths:
- "backend/**"
- ".github/workflows/backend.yml"
pull_request:
branches: [ "master", "main" ]
paths:
- "backend/**"
- ".github/workflows/backend.yml"

permissions:
contents: read

# Build-and-test gate only. The image for ghcr.io/<repo>/backend is published solely by
# monorepo.yml, which builds the JAR with the Angular console embedded; publishing the
# backend-only JAR under the same tags from here meant the image nondeterministically carried
# either the fresh console or a stale one.

jobs:
build:
name: Build JAR
permissions:
contents: read
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Java 25
uses: actions/setup-java@v4
with:
java-version: '25'
distribution: 'temurin'
cache: 'gradle'

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Build with Gradle (skip frontend)
run: ./gradlew build -x test
env:
SKIP_FRONTEND_BUILD: "true"

test:
name: Run Tests
permissions:
contents: read
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Java 25
uses: actions/setup-java@v4
with:
java-version: '25'
distribution: 'temurin'
cache: 'gradle'

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Run tests
run: ./gradlew test
env:
SKIP_FRONTEND_BUILD: "true"

- name: Upload test reports
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-reports
path: |
backend/build/reports/tests/test/
backend/build/reports/jacoco/
retention-days: 3
45 changes: 0 additions & 45 deletions .github/workflows/ci.yml

This file was deleted.

Loading
Loading