Skip to content

Commit 1acfe4f

Browse files
gsanchietticlaude
andcommitted
feat: fetch download/install version data client-side instead of at build time
Replace the prestart/prebuild generate-version-data.mjs script with a useVersionData React hook that fetches live from the public S3 API and CDN on page load. Release tables and version-specific commands (dd, gunzip, wget, qm importdisk) now always reflect the current releases without requiring a redeploy. - Add src/hooks/useVersionData.ts (ports all fetch/parse/sort logic) - Add VersionCommand and ImageVerifyCommand exports to DownloadTable - Remove static versions.json import from download.mdx and install.mdx - Remove prebuild npm hooks and generate-version-data.mjs - Remove unused VersionFooter component (dead code since footer refactor) - Remove productVersion from docusaurus.config.ts customFields Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7c23b18 commit 1acfe4f

12 files changed

Lines changed: 813 additions & 257 deletions

File tree

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
/.docusaurus
99
.docusaurus
1010

11-
# Generated at build time by scripts/generate-version-data.mjs
12-
/src/data/versions.json
13-
1411
# Misc
1512
.DS_Store
1613
.env.local

docs/administrator-manual/installation/download.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ title: Download
33
sidebar_position: 2
44
---
55

6-
import versions from '@site/src/data/versions.json';
7-
import {StableReleases, DevReleases} from '@site/src/components/DownloadTable';
6+
import {StableReleases, DevReleases, ImageVerifyCommand} from '@site/src/components/DownloadTable';
87

98
# Download {#download-section}
109

@@ -18,7 +17,7 @@ Begin by downloading the most recent x86_64 image from the table below.
1817

1918
For verification, download also the hash file and execute the following command in a Linux shell to ensure the integrity of the downloaded image:
2019

21-
<pre><code>{`grep ${versions.image} sha256sums | sha256sum -c`}</code></pre>
20+
<ImageVerifyCommand />
2221

2322
To proceed with the installation of NethSecurity, you have two options: write the downloaded image directly to your disk or create a bootable USB stick. Refer to the [installation](./install.mdx) page for detailed instructions on both methods.
2423

docs/administrator-manual/installation/install.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Installation
33
sidebar_position: 3
44
---
55

6-
import versions from '@site/src/data/versions.json';
6+
import {VersionCommand} from '@site/src/components/DownloadTable';
77

88
# Installation {#install-section}
99

@@ -22,7 +22,7 @@ NethSecurity can be run from a USB stick or installed directly to any bootable d
2222
2. find the disk/stick/card device name, in this example the device is named `/dev/sdd`
2323
3. as `root` user, write the downloaded image to the device:
2424

25-
<pre><code>{`zcat ${versions.image} | dd of=/dev/sdd bs=1M iflag=fullblock status=progress oflag=direct`}</code></pre>
25+
<VersionCommand template={(v) => `zcat ${v.image} | dd of=/dev/sdd bs=1M iflag=fullblock status=progress oflag=direct`} />
2626

2727
4. unplug the disk/stick/card from the desktop and plug it into the server
2828
5. boot the server, select the correct device (USB, SD card or hard disk) from boot menu
@@ -64,7 +64,7 @@ You can use the downloaded image as a virtual machine disk:
6464

6565
1. extract the downloaded image:
6666

67-
<pre><code>{`gunzip ${versions.image}`}</code></pre>
67+
<VersionCommand template={(v) => `gunzip ${v.image}`} />
6868

6969
2. create a new virtual machine and select the uncompressed image as disk
7070
3. boot the virtual machine
@@ -89,15 +89,15 @@ qm create 401 --name "NethSecurity" --ostype l26 --cores 1 --memory 1024 --net0
8989

9090
Download the image:
9191

92-
<pre><code>{`wget '${versions.downloadUrl}'`}</code></pre>
92+
<VersionCommand template={(v) => `wget '${v.downloadUrl}'`} />
9393

9494
Extract the image:
9595

96-
<pre><code>{`gunzip ${versions.image}`}</code></pre>
96+
<VersionCommand template={(v) => `gunzip ${v.image}`} />
9797

9898
Import the extracted image as a virtual machine disk:
9999

100-
<pre><code>{`qm importdisk 401 ${versions.imageNoGz} local-lvm`}</code></pre>
100+
<VersionCommand template={(v) => `qm importdisk 401 ${v.imageNoGz} local-lvm`} />
101101

102102
Attach the disk to the virtual machine:
103103

0 commit comments

Comments
 (0)