Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BUILD_PLATFORMS=linux/amd64,linux/arm/v7,linux/arm64
VERSION=1.3.0
VERSION=1.3.1
PUID=1000
PGID=1000
MYSQL_ROOT_PASSWORD=password
Expand Down
11 changes: 10 additions & 1 deletion .github/scripts/release-image.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,22 @@ function platformName({ os, architecture, variant }) {
return `${os}/${architecture}${variant && !(architecture === 'arm64' && variant === 'v8') ? `/${variant}` : ''}`;
}

async function verifyImage({ registry, version, commit, platforms, expectedDigest }) {
async function verifyImage({ registry, version, commit, platforms, expectedDigest, expectedDescription }) {
const found = await registry.tag(version);
if (!found) {
if (expectedDigest) throw new Error('The published image tag is missing.');
return null;
}
checkDigest(found.digest);
if (expectedDigest && found.digest !== expectedDigest) throw new Error('The image digest changed after publishing.');
if (expectedDescription !== undefined) {
if (typeof expectedDescription !== 'string' || !expectedDescription.trim() || [...expectedDescription].length > 512) {
throw new Error('Image description must contain 1 to 512 characters.');
}
if (found.manifest?.annotations?.['org.opencontainers.image.description'] !== expectedDescription) {
throw new Error('Image index description is missing or differs from IMAGE_DESCRIPTION.');
}
}
const actual = [];
async function inspect(manifest, platform) {
if (manifest?.schemaVersion !== 2 || !IMAGE_TYPES.has(manifest.mediaType) || !Array.isArray(manifest.layers)) {
Expand Down Expand Up @@ -168,6 +176,7 @@ async function run({ github, context, core, env, mode }) {
const options = {
github, repo, version: env.RELEASE_VERSION, commit: env.RELEASE_COMMIT,
platforms: env.BUILD_PLATFORMS, expectedDigest: env.EXPECTED_DIGEST || undefined,
expectedDescription: env.IMAGE_DESCRIPTION,
automatic: context.eventName === 'push',
changelog: readFileSync('CHANGELOG.md', 'utf8'),
image: `ghcr.io/${repo.owner}/${repo.repo}`.toLowerCase(),
Expand Down
20 changes: 20 additions & 0 deletions .github/scripts/test_release_image.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,26 @@ test('single-platform manual images are verified too', async () => {
assert.equal(await verifyImage(f.options), DIGEST);
});

test('GHCR descriptions must be present on the image index, not just config labels', async () => {
const f = fixture();
f.options.expectedDescription = 'SOGo groupware';
for (const config of f.configs) config.config.Labels['org.opencontainers.image.description'] = 'SOGo groupware';
await assert.rejects(verifyImage(f.options), /index description is missing/);
f.index.annotations = { 'org.opencontainers.image.description': 'Another description' };
await assert.rejects(verifyImage(f.options), /differs from IMAGE_DESCRIPTION/);
f.index.annotations['org.opencontainers.image.description'] = 'SOGo groupware';
assert.equal(await verifyImage(f.options), DIGEST);
});

test('empty and oversized GHCR descriptions are rejected', async () => {
for (const description of ['', ' ', 'a'.repeat(513)]) {
const f = fixture();
f.options.expectedDescription = description;
f.index.annotations = { 'org.opencontainers.image.description': description };
await assert.rejects(verifyImage(f.options), /1 to 512 characters/);
}
});

test('BuildKit attestations do not count as runtime platforms', async () => {
const f = fixture();
const attestation = { digest: digest(99), platform: { os: 'unknown', architecture: 'unknown' }, annotations: {
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ concurrency:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
IMAGE_DESCRIPTION: >-
SOGo groupware with webmail, calendars and contacts, built from source on Debian
with SOPE, NGINX and memcached. Supports AMD64, ARMv7 and ARM64;
requires external database and mail services.
PUBLISH_IMAGE: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.publish_image) }}
BUILD_PLATFORMS: ${{ github.event_name == 'pull_request' && 'linux/amd64' || inputs.build_platforms || 'linux/amd64,linux/arm/v7,linux/arm64' }}

Expand Down Expand Up @@ -116,13 +120,21 @@ jobs:
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
env:
# GHCR reads multi-platform descriptions from the image index.
DOCKER_METADATA_ANNOTATIONS_LEVELS: index
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: latest=false
tags: type=raw,value=${{ steps.version.outputs.version }}
labels: |
org.opencontainers.image.description=${{ env.IMAGE_DESCRIPTION }}
org.opencontainers.image.documentation=https://github.com/${{ github.repository }}/blob/${{ steps.version.outputs.commit }}/README.md
org.opencontainers.image.version=${{ steps.version.outputs.version }}
org.opencontainers.image.revision=${{ steps.version.outputs.commit }}
annotations: |
org.opencontainers.image.description=${{ env.IMAGE_DESCRIPTION }}
org.opencontainers.image.documentation=https://github.com/${{ github.repository }}/blob/${{ steps.version.outputs.commit }}/README.md

- name: Set up QEMU
if: steps.prepare.outputs.build != 'false' && env.BUILD_PLATFORMS != 'linux/amd64'
Expand Down Expand Up @@ -150,6 +162,9 @@ jobs:
outputs: ${{ env.PUBLISH_IMAGE != 'true' && 'type=cacheonly' || '' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ env.PUBLISH_IMAGE == 'true' && steps.meta.outputs.annotations || '' }}
# Provenance also produces an index for single-platform publications.
provenance: mode=max
platforms: ${{ env.BUILD_PLATFORMS }}
cache-from: type=gha,scope=sogo
cache-to: type=gha,scope=sogo,mode=max
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.3.1] - 2026-10-16

### Fixed

- Publish and verify the OCI index description displayed by GHCR for multi-platform images, and link image metadata to the README at the built commit.

## [1.3.0] - 2026-10-16

### Added
Expand All @@ -16,7 +22,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Set the Compose image version to `1.3.0` in `.env`.
- Updated CodeQL Action to `v4.39.0` in the CodeQL and Codacy workflows.
- Streamlined release documentation and repository guidance.

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ If attestation or release creation fails after publication, rerun the failed job

Check publishing safeguards and the shared GHCR reader locally with `node --test .github/scripts/test_release_image.cjs .github/scripts/test_delete_old_packages.cjs`.

The workflow's `IMAGE_DESCRIPTION` supplies both the image label and the OCI index annotation used by GHCR for multi-platform package descriptions. A documentation link points to the README at the built commit. Publication verification rejects missing or mismatched index descriptions. Update metadata as part of a new release: changing an existing index also changes its digest and requires updating the release digest and provenance attestation.

### Publish locally

Create a personal access token (classic) with `write:packages` and save it in the ignored `.ghcr-token` file. For authenticated pulls only, `read:packages` is sufficient; see [GHCR authentication](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry). Replace `GITHUB_USERNAME` with your username.
Expand Down