Add web/ — PTY+WebSocket server, xterm.js PWA client, Dockerfile, and PyInstaller notes

This commit is contained in:
KansaiGaijin
2026-07-07 13:21:45 +12:00
parent dee742b1e4
commit 262292228e
11 changed files with 283 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
"""Generate solid-colour placeholder PNG icons for the PWA manifest."""
import struct
import zlib
from pathlib import Path
def _chunk(chunk_type, data):
c = chunk_type + data
crc = struct.pack(">I", zlib.crc32(c) & 0xFFFFFFFF)
return struct.pack(">I", len(data)) + c + crc
def solid_png(width, height, r, g, b):
header = b"\x89PNG\r\n\x1a\n"
ihdr = _chunk(b"IHDR", struct.pack(">IIBBBBB", width, height, 8, 2, 0, 0, 0))
raw = bytearray()
for _ in range(height):
raw.append(0)
raw.extend(bytes([r, g, b]) * width)
idat = _chunk(b"IDAT", zlib.compress(bytes(raw)))
iend = _chunk(b"IEND", b"")
return header + ihdr + idat + iend
if __name__ == "__main__":
dst = Path(__file__).parent
for size in (192, 512):
path = dst / f"icon-{size}.png"
path.write_bytes(solid_png(size, size, 0x1A, 0x1A, 0x2E))
print(f"Created {path.name} ({size}x{size})")