HUB
Sign inSign up

wimotek/sn

By wimotek

•Updated 1 day ago

Single-binary Go + React commercial anti-counterfeit & GS1 traceability platform

Image
0

182

wimotek/sn repository overview

⁠SN — Commercial Anti-Counterfeit & GS1 Traceability Platform

Lightweight, high-performance single-binary anti-counterfeiting and traceability server built in Go + React (go:embed), inspired by OpenEPCIS 2.0, GS1 Digital Link Resolver, GenuProof, and HiPi-Trace.

⁠Production Highlights

  • Single Static Binary: Go backend with embedded React/TypeScript/Tailwind SPA (//go:embed).
  • Dual-Mode Database: SQLite3 (WAL + write-mutex anti-deadlock) and MySQL, with scheduled automated backups and retention pruning.
  • Dual-Layer Cache: Redis primary with automatic circuit-breaker fallback to SQL Cache.
  • Cryptographic Anti-Forgery Codes: Unpredictable CSPRNG + HMAC-SHA256 Crockford Base32 codes (SN-XXXX-XXXX-XXXX-CC) with O(1) check-digit interception before DB queries.
  • 6-State Scan Verification: FIRST_GENUINE, REPEAT_SCAN, UNACTIVATED, FORGED, REVOKED, RATE_LIMITED.
  • Automated Risk Control: Flags high-risk alerts at >= 2 GeoIP regions or >= 4 distinct devices; enforces 30 req / 60s sliding-window IP rate limit.
  • First-Run Setup Wizard: Auto-triggered when /data/config.json is absent; locks atomically upon completion.
  • Integrations: Built-in OIDC Provider + Wimotek/OAuth2 adapter, REST API, MCP JSON-RPC 2.0 (/api/mcp), HMAC Webhooks, GS1 Digital Link Resolver (/01/:gtin/21/:serial).

⁠Quick Deploy (Docker)

docker compose up -d
  • Data directory: /data (writable by UID 10001)
  • Certificates directory: /certs:ro (reads fullchain.pem/privkey.pem or fullchain/prikey; auto-generates self-signed TLS cert in /data/certs if empty or unmounted)
Tag summary
Recent tags
Content type
Image
Digest
sha256:ff0f42764…
Size
9 MB
Last updated
1 day ago
docker pull wimotek/sn:latest