docs: publish public guides, screenshots and Git-synced portal documentation
Tests / test (push) Failing after 50s

This commit is contained in:
dh
2026-10-06 14:32:05 +00:00
parent 9fbc52ee47
commit faa905ab09
29 changed files with 1973 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
import { createHash } from 'node:crypto';
// Only these reviewed screenshots can leave the source repository.
export const screenshotSources = [
'docs/public/images/symcon-objektbaum.png',
'docs/public/images/symcon-manager.png'
];
export function screenshotInfo(source, data) {
if (!screenshotSources.includes(source) || !Buffer.isBuffer(data) || data.length < 45 || data.length > 4_000_000) throw new Error('Invalid screenshot source');
if (!data.subarray(0, 8).equals(Buffer.from('89504e470d0a1a0a', 'hex')) || data.readUInt32BE(8) !== 13 || data.toString('ascii', 12, 16) !== 'IHDR' || data.toString('ascii', data.length - 8, data.length - 4) !== 'IEND') throw new Error('Expected PNG screenshot');
const width = data.readUInt32BE(16), height = data.readUInt32BE(20);
if (width < 100 || height < 100 || width > 5000 || height > 5000) throw new Error('Invalid screenshot dimensions');
const sha256 = createHash('sha256').update(data).digest('hex');
const stem = source.split('/').pop().replace(/\.png$/, '');
return { repo:'Enelix-EMS', source, output:`images/${stem}-${sha256.slice(0, 16)}.png`, width, height, sha256 };
}