node-go

command module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2026 License: AGPL-3.0 Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Portal for Google Cloud & Docker

Your own brand portal for retailers, in one program. Retailers log in, find your products, paste a list of EANs, and download images and article data. Their shop software can fetch the same content automatically. You publish by uploading a spreadsheet and photos, or let your own systems do it for you.

Run it locally (2 minutes)

No Docker needed, only Go 1.26 or newer (it fetches the exact toolchain of go.mod itself). In a checkout of this repository:

go run . dev

This starts the portal with SQLite and files in ./data-dev, completes the first-run setup (setup code DEMO-DEMO-DEMO) and imports the demo catalog of the fictional brand Kestrel Outfitters (11 articles, 35 images). It prints:

  open:    http://localhost:8080
  login:   admin@kestrel.example / kestrel demo password

Open the address, log in, and click View as retailer to see the portal as a retailer does. E-mails are not sent but written to the output. Stop with Ctrl+C; go run . dev again continues with the same data, go run . dev --fresh starts over. Another port: PORT=9090 go run . dev. This is for trying it out only: for a real portal use serve and the setup wizard below.

This is node-go: the Go edition of an Open Brand Exchange node. It runs as a single program with no other services required, on Google Cloud Run, any Docker host, Fly.io, Railway, Render or a plain Linux server.

For What they get
You, the brand A setup wizard, your catalog, uploads and scheduled imports, retailers and access requests, invitations, API keys for retailers, automatic upload keys for your own systems, download statistics, your logo and colours.
Retailers' staff The portal: request access, search and filter, product pages with images and article data, paste EANs, select, download one image, a product, a selection or everything as a zip, and article data as CSV.
Retailers' software The standard OBX API: changes since last time, products, EAN lookup, images, bulk exports, webhooks.
Your automation The standard upload API, scheduled imports from a web address, SFTP or S3 bucket, and a command-line tool.

The interface speaks 25 European languages. Images keep their original bytes (including embedded Content Credentials); the portal makes web, square and thumbnail versions itself.

Try it in 60 seconds

With Docker:

git clone https://github.com/openbrandexchange/node-go && cd node-go
docker compose -f docker-compose.local.yml up

Or with Go 1.26 or newer (it fetches the exact toolchain of go.mod itself):

go run . serve

Open http://localhost:8080. The output shows a line like First-run setup: open http://localhost:8080 and enter this setup code: 55GX-FKYX-E5HK; enter that code in the setup wizard together with your company name and your own password (there is never a default password).

Then add the example catalog of the fictional brand Kestrel Outfitters. In the admin, go to Imports → Choose files, pick testdata/kestrel-example.zip (the spreadsheet and 35 images in one zip) and click Start import. Or, when you started with Go:

go run . import --csv testdata/spec/kestrel/products.csv \
  --assets testdata/spec/kestrel/assets.csv --images testdata/spec/kestrel/images

To see the retailer side, click View as retailer, or invite yourself under Retailers. Without an e-mail server nothing is sent: the admin shows the invitation link to copy, and the Docker try-out also writes the whole e-mail to the output (OBX_MAIL_LOG_BODIES=true).

Everything is stored in ./data with Go, or in the Docker volume obx-local-data.

A scheduled import only fetches from https:// addresses outside your own network. To try one on your own computer, against a file served from it or a local SFTP or MinIO server, start the portal with OBX_ALLOW_PRIVATE_URLS=true (for example under environment: in docker-compose.local.yml) and use http://host.docker.internal:<port>/… as the address. Never set it on a real server.

Put it online

Each option is one command; the guides explain domain names, e-mail and backups.

Where Command Guide
Hetzner Cloud, in the EU (recommended) a server in Nuremberg, Falkenstein or Helsinki, then the Docker command below docs/hosting/hetzner.md
Google Cloud Run ./deploy/cloudrun.sh (DRY_RUN=1 first to only see the commands) docs/hosting/cloud-run.md
Your own server with Docker (automatic HTTPS) DOMAIN=images.yourbrand.com ADMIN_EMAIL=you@yourbrand.com docker compose up -d docs/hosting/docker.md
Fly.io ./deploy/fly.sh your-portal docs/hosting/fly.md
Railway or Render deploy this repository (the config files are included) docs/hosting/railway-render.md
A Linux server without Docker sudo ./deploy/install-linux.sh --domain images.yourbrand.com --with-caddy docs/hosting/linux.md

Settings are environment variables with sensible defaults: see docs/configuration.md. Storage can be local disk (default), any S3-compatible bucket (Hetzner Object Storage, AWS S3, Cloudflare R2, MinIO) or Google Cloud Storage; the database SQLite (default, continuously backed up with Litestream if you like) or PostgreSQL.

Running it for real: docs/operations.md (health checks, logs, metrics, backups and restores, retention, the audit log, personal data), docs/upgrading.md, docs/security.md, docs/performance.md (tested with 10 000 products), and a privacy-notice template for your retailers.

Publish automatically

Your photos and product data probably live in a PIM, ERP, DAM or a shared folder already. Pick what fits, from no code at all to a small connector: docs/automation.md.

  • Scheduled import: in the admin, point the portal at a web address, SFTP folder or bucket with your products.csv (or products.xlsx) and images; it picks up changes hourly, daily or weekly.
  • Command line: obx push --csv products.csv --images ./images from any computer, cron job or CI pipeline (tool from obx-go), or node-go import … on the server itself.
  • n8n, Make, Zapier or your own code: plain HTTPS calls; repeating the same data changes nothing.

The spreadsheet format is one row per size, and images are named {style}_{colour}_{position}.jpg: see the import format.

Besides names, descriptions, sizes and EANs, the portal carries the article data retailers need for their labels and filters (OBX 0.3): composition per part, with qualifiers per fibre such as recycled (pre- or post-consumer), organic (or in conversion) and regenerative, and care instructions, both with their names in English, Dutch, German and French, country of origin, "contains non-textile parts of animal origin", footwear materials (upper, lining and sock, outer sole), certifications, the article kind (item_subtype, for example cabin or ankle_boot), features (shell, wheels, lock, expandable, closure, laptop compartment, water resistance, detachable and adjustable parts, fit, sleeve length, neckline) and, per size, a second size, a colour family and measurements (height, width, depth, weight, volume, handle drop, strap length, laptop size, heel and shaft height, inside leg). Each has its own column in the spreadsheet; imports warn when a label would miss what EU law asks for, without blocking anything.

For developers

go test ./...                      # unit and HTTP integration tests (SQLite), incl. the 25-language check
e2e/run.sh                         # the admin and portal in a headless browser, axe on every screen
(cd conformance && go test ./...)  # the OBX conformance suite from obx-go (needs ../obx-go)
scripts/test-docker.sh             # the Docker image, a Litestream restore and a backup restore

Everything CI runs, how to release and how to add a migration: docs/development.md. Contributions are welcome under the Developer Certificate of Origin: CONTRIBUTING.md, CODE_OF_CONDUCT.md.

  • internal/node: the node (protocol, ingest, admin + portal API, imports, jobs, exports, webhooks, statistics, e-mail, audit log, backups).
  • internal/importfmt: the canonical CSV and file-name parser and the Excel (.xlsx) conversion of import-format.md §5; internal/imaging: pure-Go renditions.
  • ui/dist: the web interface, vendored from admin-ui with scripts/update-ui.sh (BUILD=1 rebuilds admin-ui first).
  • API contracts: the OBX spec (openapi/*.yaml). Implementation decisions: NOTES.md. Changes: CHANGELOG.md.

The command line:

node-go serve                                   start the portal
node-go import --csv FILE [--assets FILE] [--images DIR|ZIP] [--package ZIP] [--mode mirror] [--dry-run]
node-go admin reset-password --email ADDRESS    prints a one-time link (or --password-stdin)
node-go admin create-ingest-token --name NAME   prints an automatic upload key
node-go admin audit-log [--limit N]             the latest admin actions
node-go admin personal-data --email ADDRESS     everything stored about a person (or --retailer ID)
node-go backup --to DIR | restore --from DIR    consistent backups (see docs/operations.md)
node-go check-config | healthcheck | version

Security problems: please report them privately to security@openbrandexchange.com or through a GitHub security advisory on this repository (SECURITY.md). Other questions: hello@openbrandexchange.com.

License

GNU Affero General Public License v3.0 (AGPL-3.0-only). You may run, change and host it freely; if you offer a changed version to others over a network, share your changes under the same licence. The embedded admin-ui is Apache-2.0; the spec fixtures in testdata/spec are CC-BY-4.0. See NOTICE.

Open Brand Exchange Foundation (in formation). The project will be transferred to the foundation, a Dutch stichting, once it is set up (governance).

Works with Open Brand Exchange

Documentation

Overview

Command node-go runs an Open Brand Exchange brand node: the retailer portal, the OBX Protocol for retailers' software and the OBX Ingest API for the brand's own automation, in one binary.

node-go serve                                   start the node
node-go dev                                     try it locally with the Kestrel demo catalog
node-go import --csv products.csv --images dir  import from local files
node-go admin reset-password --email you@example.com
node-go admin create-ingest-token --name "Nightly PIM sync"
node-go backup --to DIR | restore --from DIR    backups
node-go check-config                            validate the configuration
node-go healthcheck                             exit 0 when the node answers
node-go version

Directories

Path Synopsis
internal
blobstore
Package blobstore stores files (image originals, renditions, zips) on the local disk or in an S3-compatible bucket (AWS S3, Cloudflare R2, MinIO, Google Cloud Storage through its S3 interoperability endpoint).
Package blobstore stores files (image originals, renditions, zips) on the local disk or in an S3-compatible bucket (AWS S3, Cloudflare R2, MinIO, Google Cloud Storage through its S3 interoperability endpoint).
config
Package config reads the node's settings from the environment.
Package config reads the node's settings from the environment.
db
Package db wraps database/sql for SQLite (default, pure Go) and PostgreSQL.
Package db wraps database/sql for SQLite (default, pure Go) and PostgreSQL.
gtin
Package gtin validates and normalises GS1 trade item numbers.
Package gtin validates and normalises GS1 trade item numbers.
ids
Package ids creates opaque, time-sortable object identifiers such as "prd_01j9zk3q7t5wabcdefghjkmnpq".
Package ids creates opaque, time-sortable object identifiers such as "prd_01j9zk3q7t5wabcdefghjkmnpq".
imaging
Package imaging detects image types, reads dimensions from file headers and renders the OBX renditions (web, square, thumb) in pure Go.
Package imaging detects image types, reads dimensions from file headers and renders the OBX renditions (web, square, thumb) in pure Go.
importfmt
Package importfmt parses the OBX canonical import format (docs/import-format.md): products.csv, assets.csv, the image file name pattern, the materials grammar and care codes.
Package importfmt parses the OBX canonical import format (docs/import-format.md): products.csv, assets.csv, the image file name pattern, the materials grammar and care codes.
node
Package node implements an OBX brand node: the OBX Protocol (read side), the OBX Ingest API (write side), the Node Admin + Portal API used by the shared admin-ui, imports, renditions, exports, webhooks and statistics.
Package node implements an OBX brand node: the OBX Protocol (read side), the OBX Ingest API (write side), the Node Admin + Portal API used by the shared admin-ui, imports, renditions, exports, webhooks and statistics.
problem
Package problem implements application/problem+json (RFC 9457) errors with the OBX error codes.
Package problem implements application/problem+json (RFC 9457) errors with the OBX error codes.
safehttp
Package safehttp makes outbound requests to attacker-influenced URLs (scheduled imports, webhooks, SFTP/S3 endpoints) without reaching private networks (SSRF protection).
Package safehttp makes outbound requests to attacker-influenced URLs (scheduled imports, webhooks, SFTP/S3 endpoints) without reaching private networks (SSRF protection).
schemas
Package schemas embeds the OBX JSON Schemas (copied from the spec repository by scripts/sync-spec.sh, CC-BY-4.0) and validates documents.
Package schemas embeds the OBX JSON Schemas (copied from the spec repository by scripts/sync-spec.sh, CC-BY-4.0) and validates documents.
secure
Package secure holds the node's small cryptographic helpers: random tokens, token hashing, constant-time comparison, AES-256-GCM encryption of stored credentials and HMAC signing.
Package secure holds the node's small cryptographic helpers: random tokens, token hashing, constant-time comparison, AES-256-GCM encryption of stored credentials and HMAC signing.
vocab
Package vocab embeds the vocabularies of the OBX specification (vocabularies/*.json, copied by scripts/sync-spec.sh, CC-BY-4.0): the part, material, qualifier and care codes with their names per language and, for care, the ISO 3758 category and the GINETEX symbol code (protocol.md §5.9.1).
Package vocab embeds the vocabularies of the OBX specification (vocabularies/*.json, copied by scripts/sync-spec.sh, CC-BY-4.0): the part, material, qualifier and care codes with their names per language and, for care, the ISO 3758 category and the GINETEX symbol code (protocol.md §5.9.1).
Package ui embeds the built admin-ui (brand admin + retailer portal).
Package ui embeds the built admin-ui (brand admin + retailer portal).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL