31 Commits
Author SHA1 Message Date
bitdeals 58e3f22982 let the topology be pinned: trusted peer, outgoing switch, known nodes
Build docker image and push to registry.bitdeals.org / main-build-job (push) Successful in 1m50s
A private Bitmessage contour cannot be assembled by letting the nodes find
each other. The sybil check in connectionpool refuses a candidate whose /16 is
already among the outbound connections, and every container of a compose
project shares one /16 -- so each node keeps a single outbound connection to a
randomly chosen peer, and the contour splits into components on some runs and
not on others.

Three variables make the topology explicit instead:

  BITMESSAGE_TRUSTED_PEER    trustedpeer = host:port
  BITMESSAGE_SEND_OUTGOING   sendoutgoingconnections = True/False
  BITMESSAGE_KNOWN_NODES     host:port,... -> knownnodes.dat

With them a star is one line of config per node: the hub takes
SEND_OUTGOING=False and only accepts, the spokes take TRUSTED_PEER=<hub>:8444.

Details worth knowing:

- trustedpeer is absent from the stock keys.dat, so a substitution alone would
  be a silent no-op. The key is added the same way maxtotalconnections is,
  and it is added even when the value is empty -- that is how a node that was
  pinned before can be unpinned. Its anchors stop at "=" rather than "= ",
  because an empty value leaves no trailing space to match.
- knownnodes.dat is rewritten on every start, not only when missing. "Only
  when missing" would never have fired: the image ships one, built by the
  `pybitmessage -t` run in the Dockerfile, and a named volume inherits it.
  Seeding it is also what stops the DNS bootstrap -- deserialising any peer
  that is neither a DEFAULT_NODE nor "self" raises knownNodesActual, and
  startBootstrappers only runs while that flag is down.
- Both peer variables are validated here. PyBitmessage does check trustedpeer,
  but with a sys.exit() from a constructor in the network thread, which reads
  as a container that died for no stated reason.
2026-08-06 14:51:50 +00:00
bitdeals git user 2701c57200 cap total connections, and document the P2P port 8444
Build docker image and push to registry.bitdeals.org / main-build-job (push) Successful in 2m12s
The daemon has always listened on 8444 and nothing published it, so every
node built from this image was outbound-only. Publishing it is now a
documented choice rather than an omission -- including the two things that
are not obvious from the config: peers are told the port from `port` in
keys.dat rather than the one you mapped it to (so only 8444:8444 works),
and the node's own address is never configured at all, because every peer
replaces the hardcoded 127.0.0.1 in the version message with the IP it
sees on the socket.

An open port needs a brake, hence BITMESSAGE_MAXTOTALCONNECTIONS. It
defaults to the PyBitmessage stock 200, so nothing changes for existing
users of the image. The key is inserted when the stock config lacks it
instead of trusting the substitution: the PyBitmessage clone is unpinned,
and a silent no-op would ship a node that looks capped and is not.

The API port in the example compose moves to loopback, which is what the
README already prescribed.
2026-08-02 14:48:01 +00:00
bitdeals git user 335ee52c0d docs: Russian README, cross-linked, with the examples fixed
Build docker image and push to registry.bitdeals.org / main-build-job (push) Successful in 27s
Same pairing the bitdeals-ng repositories use: each file points at the
other under its first heading, and both examples are byte-identical across
the two so they cannot drift.

The examples were not safe to copy. They published the API on every
interface next to the default credentials it documents, carried no volume
-- so keys.dat, the node's Bitmessage identity, was lost on every image
update -- and the docker run one was missing a line continuation and did
not run at all. Ports are now on loopback, the volume is there, and the
run was checked verbatim on a host.

Also: stopresendingafterxdays is documented as 30, which is what run.sh
actually defaults to, not 60; the seed phrase is noted as regenerated per
start; and a short Notes section records what cost time to find out -- '%'
is unusable in the API password, clients have to percent-encode
credentials, and the health check waits for a network connection.
2026-08-02 13:52:05 +00:00
bitdeals git user a79d881647 escape the sed replacements, and stop the script failing silently
Build docker image and push to registry.bitdeals.org / main-build-job (push) Successful in 3m0s
The sed pass that configures the daemon punished anyone setting a strong
password: '&' in a replacement means the whole match, so a password
containing one was silently rewritten into something else, and the '|'
delimiter made sed exit with 'unknown option to s'. Every setting rode in
one invocation and the script had no set -e, so that failure applied none
of them -- not apipassword, not apienabled, not apiinterface -- and the
daemon came up on whatever it had before without saying so.

esc() now escapes backslash, '&' and the delimiter via printf. The
expressions are anchored to the start of the line and name their key in the
replacement instead of using \1, so no backreference is involved and
nothing in another section can match. keys.dat also holds privsigningkey
and privencryptionkey for this node's Bitmessage identities; editing in
place leaves every byte outside [bitmessagesettings] untouched, which is
why this stays a line edit rather than a parse-and-rewrite.

The clients needed the other half of this: credentials go into an XML-RPC
URL, where '@' splits the userinfo and '#' truncates the rest, so a strong
password wrote correctly and still failed to connect. Both now
percent-encode. A '%' in the password remains unusable -- it breaks
PyBitmessage's own config reader and every API call returns 500.

Also here, all found while making the above safe:
- set -eu, with the keys.dat chown guarded. A misconfiguration now stops
  the container instead of passing unnoticed.
- The seed-address retry loop used bash brace expansion under CMD ["sh"],
  where /bin/sh is dash and {1..4} is a literal, so it ran once, not four
  times.
- apt-get update shared a layer with nothing, letting a cached update feed
  install months-stale package lists.
- HEALTHCHECK gained a start period; the startup VACUUM takes tens of
  seconds on a large messages.dat and the container reported unhealthy for
  all of it.
- Removed the AppImage systemd unit, AppArmor profile and updater script.
  Nothing referenced them -- not the image, the deployment or the ansible
  roles -- and the updater fetched a binary with no signature or checksum
  check.
2026-08-02 13:13:56 +00:00
bitdeals git user 6641a452b5 raise SQL thread startup timeout to 600s
Build docker image and push to registry.bitdeals.org / main-build-job (push) Successful in 2m42s
The startup VACUUM of a large messages.dat exceeds the stock 60 s window,
and PyBitmessage then kills the daemon (os._exit). Since it dies mid-VACUUM
lastvacuumtime is never updated, so every later start repeats it and the
node stays down with its API not listening.
2026-08-02 10:46:10 +00:00
private-user a8c8861cad deterministic address fix
Build docker image and push to registry.bitdeals.org / main-build-job (push) Successful in 2m1s
2026-03-18 12:36:04 +03:00
private-user c957096762 add act_runner build job
Build docker image and push to registry.bitdeals.org / main-build-job (push) Successful in 28s
2026-03-18 11:42:32 +03:00
private-user ccac2e970a don't generate deterministic address by default 2026-03-18 11:36:27 +03:00
private-user 7761772dda add registry 2025-03-19 14:12:45 +03:00
private-user 28327d8604 add apivariant 2024-11-29 13:40:12 +03:00
private-user ed91f1ba49 add NOCACHE arg 2024-11-15 15:51:29 +03:00
private-user 1f6e63ddad dockerfile fix 2024-11-03 13:49:16 +03:00
private-user 6253ed1f5f Docker fix 2024-08-14 17:12:40 +03:00
private-user 9a88767eaf Docker fix 2024-08-14 17:08:57 +03:00
private-user 7ed94e64f3 Docker fix 2024-08-12 09:38:30 +03:00
private-user e270e0f616 Docker fix 2024-08-12 09:31:39 +03:00
private-user 604840eef9 add run.sh CMD in Dockerfile 2024-08-12 09:30:42 +03:00
private-user ef208dbc83 fix 2024-07-22 17:09:38 +03:00
private-user 88864eb0be fix 2024-07-22 16:51:34 +03:00
private-user a12f6381a1 fix 2024-07-22 16:50:34 +03:00
private-user 0ed0c76954 Docker fix 2023-08-31 14:34:14 +03:00
private-user eeb60fb09e Dockerfile fix 2023-07-31 14:15:58 +03:00
private-user c0e1647b7b Docker fix 2023-07-19 18:26:43 +03:00
private-user 88ae320519 Dockerfile fix 2023-05-05 11:16:35 +02:00
private-user 655f13f50c set stopresendingafterxdays 2023-01-31 11:09:25 +03:00
private-user c6898534b8 set ttl 2023-01-30 17:06:54 +03:00
private-user a7fc096d4f set ttl 2023-01-30 16:40:45 +03:00
private-user 90bee00bae set ttl 2023-01-30 16:31:46 +03:00
private-user f241fc66a3 add Apparmor Pybitmessage.AppImage profile 2022-12-31 13:55:36 +03:00
private-user 4a2404c4c9 Dockerfile 2022-10-19 05:09:12 -04:00
private-user 304a530df2 Dockerfile 2022-10-19 05:05:45 -04:00