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
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ or run `npm run eid:bridge:mock` for a virtual reader through the real bridge.
| `components/eid-reader.tsx` | Status and card data (`useEid()`) |
| `lib/eid-client.ts` | Picks the real bridge or the virtual card (`?mock=1`) |
| `lib/eid-view.ts` | Turns card data into what the page shows, with masking |
| `app/download/page.tsx` | Download page for the Windows setup (`/download`) |
| `lib/releasenotes.ts` | Release notes per version, in Dutch and French |
| `installer/eid-installer.json` | Websites baked into the setup |
| `scripts/build-exe.mjs` | Builds the eID program (`npm run build:exe`) |
| `scripts/build-installer.mjs` | Builds the Windows setup (`npm run build:installer`) |
Expand Down Expand Up @@ -76,6 +78,11 @@ Result: `public/downloads/projectx-eid-setup.exe` (+ `.sha256`). The app automat
"eID-programma installeren" button when the program is not running, pointing to this file (other
address: `NEXT_PUBLIC_EID_SETUP_URL`).

**Download page.** `/download` (e.g. https://prod.dafkedd.be/download) offers the setup with version,
size, SHA-256 and release notes, with an NL/FR language switch (also via `?lang=fr`). Version and setup
come from the same image, so QA, ACC and production each show their own version. Release notes live in
`lib/releasenotes.ts`; a test fails if the version in `package.json` is missing there in either language.

IT can deploy the setup silently: `projectx-eid-setup.exe /VERYSILENT /SUPPRESSMSGBOXES`
(see `packages/eid/docs/uitrollen.md`, in Dutch, for Intune and extra parameters).

Expand Down Expand Up @@ -138,6 +145,8 @@ Making a release:
npm run version:patch # or version:minor / version:major, on developer
```

Then add the release notes for the new version to `lib/releasenotes.ts` (Dutch and French).

Commit, PR `developer → main`, then PR `main → release`. After the merge the pipeline runs. If the tag
already exists, no release is made.

Expand Down
9 changes: 9 additions & 0 deletions README.nl.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ of start `npm run eid:bridge:mock` voor een virtuele lezer via de echte bridge.
| `components/eid-reader.tsx` | Status en kaartgegevens (`useEid()`) |
| `lib/eid-client.ts` | Kiest echte bridge of virtuele kaart (`?mock=1`) |
| `lib/eid-view.ts` | Zet kaartgegevens om naar wat de pagina toont, met afscherming |
| `app/download/page.tsx` | Downloadpagina voor de Windows-setup (`/download`) |
| `lib/releasenotes.ts` | Releasenotes per versie, in het Nederlands en het Frans |
| `installer/eid-installer.json` | Websites die in de setup worden ingebakken |
| `scripts/build-exe.mjs` | Bouwt het eID-programma (`npm run build:exe`) |
| `scripts/build-installer.mjs` | Bouwt de Windows-setup (`npm run build:installer`) |
Expand Down Expand Up @@ -76,6 +78,11 @@ Resultaat: `public/downloads/projectx-eid-setup.exe` (+ `.sha256`). De app toont
"eID-programma installeren" als het programma niet draait, en die wijst naar dit bestand (ander adres:
`NEXT_PUBLIC_EID_SETUP_URL`).

**Downloadpagina.** Op `/download` (bv. https://prod.dafkedd.be/download) staat de setup met versie,
grootte, SHA-256 en de releasenotes, met een taalwissel NL/FR (ook via `?lang=fr`). Versie en setup
komen uit hetzelfde image, dus QA, ACC en productie tonen elk hun eigen versie. De releasenotes staan
in `lib/releasenotes.ts`; een test faalt als de versie uit `package.json` er niet in beide talen in staat.

IT kan de setup stil uitrollen: `projectx-eid-setup.exe /VERYSILENT /SUPPRESSMSGBOXES`
(zie `packages/eid/docs/uitrollen.md` voor Intune en extra parameters).

Expand Down Expand Up @@ -139,6 +146,8 @@ Een release maken:
npm run version:patch # of version:minor / version:major, op developer
```

Vul daarna de releasenotes voor de nieuwe versie aan in `lib/releasenotes.ts` (Nederlands en Frans).

Commit, PR `developer → main`, daarna PR `main → release`. Na de merge loopt de straat. Bestaat de tag
al, dan wordt er geen release gemaakt.

Expand Down
29 changes: 29 additions & 0 deletions app/download/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { Metadata } from "next";
import { DownloadCard } from "@/components/download-card";
import { formatSize, setupInfo } from "@/lib/download";
import { RELEASE_NOTES } from "@/lib/releasenotes";
import pkg from "@/package.json";

export const metadata: Metadata = {
title: "ProjectX eID downloaden",
description: "Download het eID-programma voor Windows · Téléchargez le programme eID pour Windows",
};

// Bij het bouwen vastgelegd: versie, grootte en controlesom van de setup die in het image zit.
export const dynamic = "force-static";

export default function DownloadPage() {
const setup = setupInfo(pkg.version);
return (
<main>
<DownloadCard
version={pkg.version}
url={setup.url}
fileName={setup.fileName}
{...(setup.size ? { size: formatSize(setup.size) } : {})}
{...(setup.sha256 ? { sha256: setup.sha256 } : {})}
notes={RELEASE_NOTES}
/>
</main>
);
}
26 changes: 26 additions & 0 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,29 @@ a.button {
color: var(--panel);
text-decoration: none;
}

/* Downloadpagina (/download) */
.dl-page { display: flex; flex-direction: column; gap: 0; }
.dl-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.dl-brand { font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.85rem; color: var(--fg); text-decoration: none; }
.dl-lang { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); }
.dl-lang button { padding: 4px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.dl-lang button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.dl-card { max-width: 440px; width: 100%; margin: 24px auto 0; padding: 32px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dl-card h1 { margin-top: 8px; }
.dl-card p { margin: 0; }
.dl-version { display: inline-flex; align-items: center; gap: 8px; margin: 8px 0 12px !important; }
.dl-version code { font-weight: 700; font-size: 1rem; }
.dl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
a.button.dl-button { display: block; width: 100%; padding: 12px 16px; border-radius: 10px; font-weight: 600; font-size: 1.05rem; margin-bottom: 6px; }
a.button.dl-button:hover { filter: brightness(1.08); }
.dl-meta { width: 100%; margin-top: 14px; text-align: left; }
.dl-meta dt { flex: 0 0 80px; }
.dl-meta dd { min-width: 0; overflow-wrap: anywhere; }
.dl-notes { max-width: 440px; width: 100%; margin: 16px auto 0; }
.dl-notes h2 { margin: 0 0 4px; font-size: 1.1rem; }
.dl-notes h3 { margin: 12px 0 4px; font-size: 0.95rem; }
.dl-notes ul { margin: 0; padding-left: 20px; }
.dl-notes li { margin: 2px 0; }
.dl-notes summary { cursor: pointer; margin-top: 12px; color: var(--accent); }
.dl-notes code { overflow-wrap: anywhere; }
2 changes: 1 addition & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function Home() {
<h1>ProjectX eID</h1>
<p className="muted">
Steek je Belgische eID in de kaartlezer. Geen lezer bij de hand? Open <a href="/?mock=1">/?mock=1</a> voor een
virtuele kaart.
virtuele kaart. Het eID-programma voor Windows vind je op <a href="/download">/download</a>.
</p>
<EidSection />
</main>
Expand Down
129 changes: 129 additions & 0 deletions components/download-card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
"use client";

import { useEffect, useState } from "react";
import { DOWNLOAD_TEXT, LANGS, formatNoteDate, pickLang, type Lang } from "@/lib/download-text";
import type { ReleaseNote } from "@/lib/releasenotes";

export interface DownloadCardProps {
version: string;
url: string;
fileName: string;
/** Al opgemaakt, bv. "4,2 MB". */
size?: string;
sha256?: string;
notes: ReleaseNote[];
}

function Logo() {
return (
<svg className="dl-logo" viewBox="0 0 48 48" width="56" height="56" aria-hidden="true">
<rect x="4" y="10" width="40" height="28" rx="5" fill="var(--accent)" />
<rect x="9" y="17" width="10" height="13" rx="2" fill="var(--panel)" opacity="0.9" />
<rect x="23" y="18" width="16" height="3" rx="1.5" fill="var(--panel)" opacity="0.9" />
<rect x="23" y="24" width="12" height="3" rx="1.5" fill="var(--panel)" opacity="0.6" />
<rect x="23" y="30" width="14" height="3" rx="1.5" fill="var(--panel)" opacity="0.6" />
</svg>
);
}

function Notes({ note, lang }: { note: ReleaseNote; lang: Lang }) {
return (
<>
<h3>
v{note.version} <span className="muted small">{formatNoteDate(note.date, lang)}</span>
</h3>
<ul>
{note[lang].map((line) => (
<li key={line}>{line}</li>
))}
</ul>
</>
);
}

/** Downloadkaart met taalwissel NL/FR. De taal komt uit ?lang= of de browsertaal. */
export function DownloadCard({ version, url, fileName, size, sha256, notes }: DownloadCardProps) {
const [lang, setLang] = useState<Lang>("nl");

useEffect(() => {
setLang(pickLang(new URLSearchParams(window.location.search).get("lang"), navigator.language));
}, []);

useEffect(() => {
document.documentElement.lang = lang;
}, [lang]);

function choose(next: Lang) {
setLang(next);
const params = new URLSearchParams(window.location.search);
params.set("lang", next);
window.history.replaceState(null, "", `?${params}`);
}

const t = DOWNLOAD_TEXT[lang];
const current = notes.find((n) => n.version === version);
const older = notes.filter((n) => n.version !== version);

return (
<div className="dl-page">
<header className="dl-top">
<a className="dl-brand" href="/">ProjectX</a>
<div className="dl-lang" role="group" aria-label="Taal / Langue">
{LANGS.map((l) => (
<button key={l} type="button" aria-pressed={l === lang} onClick={() => choose(l)}>
{l.toUpperCase()}
</button>
))}
</div>
</header>

<section className="panel dl-card">
<Logo />
<h1>ProjectX eID</h1>
<p className="muted">{t.tagline}</p>
<p className="dl-version">
<span className="dl-dot" aria-hidden="true" />
<code>v{version}</code> <span className="muted small">{t.available}</span>
</p>
<a className="button dl-button" href={url} download={fileName}>
{t.download(version)}
</a>
<p className="muted small">{t.requirements}</p>
{(size || sha256) && (
<dl className="dl-meta small">
{size && (
<div>
<dt>{t.size}</dt>
<dd>{size}</dd>
</div>
)}
{sha256 && (
<div>
<dt>{t.checksum}</dt>
<dd>
<code>{sha256}</code>
</dd>
</div>
)}
</dl>
)}
</section>

<section className="panel dl-notes" aria-labelledby="dl-notes-title">
<h2 id="dl-notes-title">{t.notesTitle}</h2>
{current ? <Notes note={current} lang={lang} /> : <p className="muted">{t.noNotes}</p>}
{older.length > 0 && (
<details>
<summary>{t.older}</summary>
{older.map((note) => (
<Notes key={note.version} note={note} lang={lang} />
))}
</details>
)}
<p className="muted small">
{t.silent} <code>{fileName} /VERYSILENT /SUPPRESSMSGBOXES</code>
</p>
</section>
</div>
);
}
4 changes: 3 additions & 1 deletion components/eid-reader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ function Status() {
<a className="button" href={SETUP_URL} download>
{eid.phase === "bridge-outdated" ? "eID-programma bijwerken" : "eID-programma installeren"}
</a>
<span className="muted small">Windows · geen beheerdersrechten nodig · start daarna vanzelf</span>
<span className="muted small">
Windows · geen beheerdersrechten nodig · start daarna vanzelf · <a href="/download">releasenotes</a>
</span>
</p>
)}
{eid.error && (
Expand Down
62 changes: 62 additions & 0 deletions lib/download-text.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/** Teksten van de downloadpagina in het Nederlands en het Frans. */
export type Lang = "nl" | "fr";

export const LANGS: Lang[] = ["nl", "fr"];

export interface DownloadText {
title: string;
tagline: string;
available: string;
download: (version: string) => string;
requirements: string;
size: string;
checksum: string;
notesTitle: string;
older: string;
noNotes: string;
silent: string;
back: string;
}

export const DOWNLOAD_TEXT: Record<Lang, DownloadText> = {
nl: {
title: "eID-programma",
tagline: "Lees je Belgische eID in ProjectX",
available: "beschikbare versie",
download: (v) => `Download ProjectX eID ${v}`,
requirements: "Windows 10 of 11 · geen beheerdersrechten nodig · start daarna vanzelf",
size: "Grootte",
checksum: "SHA-256",
notesTitle: "Releasenotes",
older: "Vorige versies",
noNotes: "Nog geen releasenotes voor deze versie.",
silent: "Voor IT: stil installeren met",
back: "Naar ProjectX",
},
fr: {
title: "Programme eID",
tagline: "Lisez votre carte eID belge dans ProjectX",
available: "version disponible",
download: (v) => `Télécharger ProjectX eID ${v}`,
requirements: "Windows 10 ou 11 · sans droits d'administrateur · démarre ensuite automatiquement",
size: "Taille",
checksum: "SHA-256",
notesTitle: "Notes de version",
older: "Versions précédentes",
noNotes: "Pas encore de notes pour cette version.",
silent: "Pour l'IT : installation silencieuse avec",
back: "Vers ProjectX",
},
};

/** Taal uit ?lang= of de browsertaal; standaard Nederlands. */
export function pickLang(param: string | null | undefined, browser?: string): Lang {
if (param === "nl" || param === "fr") return param;
return browser?.toLowerCase().startsWith("fr") ? "fr" : "nl";
}

/** 3 december 2026 / 3 décembre 2026 */
export function formatNoteDate(date: string, lang: Lang): string {
const d = new Date(`${date}T12:00:00Z`);
return d.toLocaleDateString(lang === "fr" ? "fr-BE" : "nl-BE", { day: "numeric", month: "long", year: "numeric", timeZone: "UTC" });
}
40 changes: 40 additions & 0 deletions lib/download.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { readFileSync, statSync } from "node:fs";
import { join } from "node:path";
import { SETUP_URL } from "./eid-view";

/** Wat de downloadpagina over de Windows-setup weet. Alleen op de server gebruiken (leest bestanden). */
export interface SetupInfo {
url: string;
/** Bestandsnaam bij het opslaan, met versie: projectx-eid-setup-0.1.1.exe. */
fileName: string;
/** Grootte in bytes, als de setup in public/ staat (zoals in het Docker-image). */
size?: number;
/** SHA-256 uit het .sha256-bestand naast de setup. */
sha256?: string;
}

/** Zoekt de setup in `publicDir` als SETUP_URL een lokaal pad is; een extern adres wordt gewoon doorgegeven. */
export function setupInfo(version: string, publicDir = join(process.cwd(), "public"), url = SETUP_URL): SetupInfo {
const info: SetupInfo = { url, fileName: `projectx-eid-setup-${version}.exe` };
if (!url.startsWith("/")) return info;
// Alleen bij het bouwen (de pagina is statisch): niet laten meetracen in .next/standalone.
const file = join(/*turbopackIgnore: true*/ publicDir, ...url.split("/").filter(Boolean));
try {
info.size = statSync(file).size;
} catch {
return info;
}
try {
const hash = /^[0-9a-f]{64}/i.exec(readFileSync(`${file}.sha256`, "utf8").trim());
if (hash) info.sha256 = hash[0].toLowerCase();
} catch {
// geen .sha256: dan tonen we geen controlesom
}
return info;
}

/** 4,2 MB */
export function formatSize(bytes: number, locale = "nl-BE"): string {
const mb = bytes / (1024 * 1024);
return `${mb.toLocaleString(locale, { maximumFractionDigits: 1 })} MB`;
}
Loading
Loading