fix(agent): versionnage des fichiers agent pour éviter le cache navigateur

- build.sh génère désormais des fichiers versionnés (edubox-agent-vX.Y.Z)
- dashboard et /api/download pointent vers les fichiers versionnés
- affichage de la version actuelle sur la page de téléchargement
This commit is contained in:
root
2026-06-12 21:50:14 +00:00
parent 852171cc59
commit 2feea2d063
5 changed files with 18 additions and 7 deletions
+6
View File
@@ -10,11 +10,17 @@ export PATH=$PATH:/usr/local/go/bin
GOOS=windows GOARCH=amd64 go build -ldflags "${LDFLAGS}" -o edubox-agent.exe . GOOS=windows GOARCH=amd64 go build -ldflags "${LDFLAGS}" -o edubox-agent.exe .
echo " edubox-agent.exe (Windows amd64)" echo " edubox-agent.exe (Windows amd64)"
cp edubox-agent.exe "edubox-agent-v${VERSION}.exe"
echo " edubox-agent-v${VERSION}.exe (Windows amd64)"
GOOS=linux GOARCH=amd64 go build -ldflags "${LDFLAGS}" -o edubox-agent . GOOS=linux GOARCH=amd64 go build -ldflags "${LDFLAGS}" -o edubox-agent .
echo " edubox-agent (Linux amd64)" echo " edubox-agent (Linux amd64)"
cp edubox-agent "edubox-agent-v${VERSION}"
echo " edubox-agent-v${VERSION} (Linux amd64)"
GOOS=darwin GOARCH=amd64 go build -ldflags "${LDFLAGS}" -o edubox-agent-mac . GOOS=darwin GOARCH=amd64 go build -ldflags "${LDFLAGS}" -o edubox-agent-mac .
echo " edubox-agent-mac (macOS amd64)" echo " edubox-agent-mac (macOS amd64)"
cp edubox-agent-mac "edubox-agent-v${VERSION}-mac"
echo " edubox-agent-v${VERSION}-mac (macOS amd64)"
echo "Done." echo "Done."
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+6 -3
View File
@@ -1,9 +1,12 @@
import { NextResponse } from "next/server"; import { NextResponse } from "next/server";
const AGENT_VERSION = "0.2.3";
export async function GET() { export async function GET() {
return NextResponse.json({ return NextResponse.json({
windows: "/agent/edubox-agent.exe", version: AGENT_VERSION,
linux: "/agent/edubox-agent", windows: `/edubox-agent-v${AGENT_VERSION}.exe`,
mac: "/agent/edubox-agent-mac", linux: `/edubox-agent-v${AGENT_VERSION}`,
mac: `/edubox-agent-v${AGENT_VERSION}-mac`,
}); });
} }
+6 -4
View File
@@ -1,5 +1,6 @@
import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card"; import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
const AGENT_VERSION = "0.2.3";
export const dynamic = "force-dynamic"; export const dynamic = "force-dynamic";
@@ -7,6 +8,7 @@ export default function DownloadPage() {
return ( return (
<div className="space-y-6"> <div className="space-y-6">
<h1 className="text-3xl font-bold">Téléchargements Agent</h1> <h1 className="text-3xl font-bold">Téléchargements Agent</h1>
<p className="text-sm text-muted-foreground">Version actuelle : <strong>{AGENT_VERSION}</strong></p>
<div className="grid grid-cols-1 md:grid-cols-3 gap-4"> <div className="grid grid-cols-1 md:grid-cols-3 gap-4">
<Card> <Card>
<CardHeader> <CardHeader>
@@ -14,7 +16,7 @@ export default function DownloadPage() {
</CardHeader> </CardHeader>
<CardContent> <CardContent>
<p className="text-sm text-muted-foreground mb-4">Agent EduBox pour Windows (64 bits)</p> <p className="text-sm text-muted-foreground mb-4">Agent EduBox pour Windows (64 bits)</p>
<a href="/edubox-agent.exe" download className="inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-10 px-4 py-2 w-full">Télécharger (.exe)</a> <a href={`/edubox-agent-v${AGENT_VERSION}.exe`} download className="inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-10 px-4 py-2 w-full">Télécharger (.exe)</a>
</CardContent> </CardContent>
</Card> </Card>
<Card> <Card>
@@ -23,7 +25,7 @@ export default function DownloadPage() {
</CardHeader> </CardHeader>
<CardContent> <CardContent>
<p className="text-sm text-muted-foreground mb-4">Agent EduBox pour Linux (64 bits)</p> <p className="text-sm text-muted-foreground mb-4">Agent EduBox pour Linux (64 bits)</p>
<a href="/edubox-agent" download className="inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-10 px-4 py-2 w-full">Télécharger</a> <a href={`/edubox-agent-v${AGENT_VERSION}`} download className="inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-10 px-4 py-2 w-full">Télécharger</a>
</CardContent> </CardContent>
</Card> </Card>
<Card> <Card>
@@ -32,7 +34,7 @@ export default function DownloadPage() {
</CardHeader> </CardHeader>
<CardContent> <CardContent>
<p className="text-sm text-muted-foreground mb-4">Agent EduBox pour macOS (Intel & Apple Silicon)</p> <p className="text-sm text-muted-foreground mb-4">Agent EduBox pour macOS (Intel & Apple Silicon)</p>
<a href="/edubox-agent-mac" download className="inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-10 px-4 py-2 w-full">Télécharger</a> <a href={`/edubox-agent-v${AGENT_VERSION}-mac`} download className="inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-10 px-4 py-2 w-full">Télécharger</a>
</CardContent> </CardContent>
</Card> </Card>
</div> </div>