libretech ab071cd222 fix(logging): write log fields without throwing and without credentials
formatLogLine wrote the fields of a log call with JSON.stringify. A
circular reference threw, so Strapi's error middleware lost the error
it was logging: the axios error of a failed PayPal token request holds
its request object, which refers to itself. An Error was written as {},
and the config.headers of an axios error carried "Authorization: Basic"
with the base64 of the PayPal client id and secret into the line.

The fields are now copied before they are written:
- a field named like a credential (authorization, cookie, password,
  secret, token, api key) is written as "[redacted]", at any depth;
- an Error is written as { name, message }, with the first line of the
  message as describeError has it, and its stack only with the stack
  option;
- an object that contains itself is written once, the reference to it
  as "[Circular]";
- an instance of a class is written as its toJSON(), or as its class
  name without one: a request object keeps its headers in _header;
- a bigint is written as its digits, an unreadable field as
  "[unreadable]".

The three todo tests of the formatter pass and are regular tests now.

Refs libretech/mp#71
Refs libretech/mp#67
2026-10-09 01:41:34 +02:00

libreshop/cms

Strapi-based content backend (catalogue, orders, customers).

Part of the libreshop toolkit. Image published at git.librete.ch/libreshop/cms on every push to main and on v* tags.

Source

This repo was extracted from mp/cms/ on 2026-04-29; mp was the first concrete adapter consuming the toolkit. mp's compose.yml now pulls git.librete.ch/libreshop/cms:<pin> instead of building locally.

Build locally

docker build -t libreshop/cms:dev .

Adapter contract

See docker-entrypoint.sh and Dockerfile for the runtime surface. Adapters configure the component via env vars and bind-mounted volumes; do not patch the running container or rely on internal paths.

S
Description
libreshop/cms — Strapi-based content backend
Readme
316 KiB
0 Stars 2 Watchers 0 Forks
Languages
TypeScript 95%
Shell 4.4%
JavaScript 0.4%
Dockerfile 0.2%