BinkP feature updates#691
Merged
Merged
Conversation
Adds the remaining robustness features to the native BinkP mailer: **TLS (binkps)** - Outbound: per-node `tls: true` with trust options `tlsAllowSelfSigned`, `tlsFingerprint`, `tlsCertFile`; validated before acquiring the .bsy lock - Inbound: optional TLS server on configurable port (defaults 24555) in parallel with the plain server **ND / NDA (FTS-1028)** - Advertised in OPT during handshake; `_useND` flag set on negotiation - `_applyDisposition` respects ND — truncates instead of deleting when active **GZ compression (FTS-1029 + EXTCMD)** - Negotiated via OPT; per-file `GZ` token in M_FILE when EXTCMD is active - Skips pre-compressed extensions (.zip, .arc, arcmail bundles, etc.) - Decompresses via zlib on receive; zero-copy streaming on send **Multi-batch (onBatchEnd hook)** - `onBatchEnd(session)` option: async hook called when both sides exchange M_EOB; if it queues new files the session starts another batch - Answering side defers its M_EOB until the remote's M_EOB is received, giving async handlers time to resolve FREQ requests before EOB goes out - `holdEOB()` / `releaseEOB()` public API for async handlers that need to delay M_EOB while resolving files - `incoming-file` event fires on M_FILE receipt (before async write) so FREQ handlers can hold EOB without racing the writeStream finalization - Graceful FIN (`socket.end()`) in `_destroy(graceful=true)` ensures all buffered data (including trailing M_EOB) reaches the peer before close - `_waitingForClose` + `cleanEnd` fallback in `_onSocketClose` for the race where socket closes before `_waitingForClose` is set **FREQ (file request)** - `core/binkp/freq.js`: `FreqResolver` class — magic-name map + versioned directory search (newest file by prefix wins, e.g. NODELIST.365) - `attachFreqToSession(session, resolver, opts)`: wires `incoming-file` (holdEOB) + `file-received` (resolve + queueFile + releaseEOB) so FREQ responses go out in the same session batch as the originating mail - `readReqFileSync`: reads .req content synchronously inside the `file-received` listener, before any spool handler moves the temp file - Configured via `scannerTossers.ftn_bso.binkp.freq` (magic, dirs, maxFiles, requirePwd) **Tests** (1324 passing, 0 failing) - GZ round-trip: transfers file with compression; skips GZ for .zip - Multi-batch: second batch via onBatchEnd; clean end; hook rejection - FREQ unit: magic names, case-insensitive lookup, prefix versioning, exact match, maxFiles cap, .req file parsing with password stripping - FREQ e2e: server serves nodelist in same batch; skips when no .req sent
- config_default.js: add commented-out freq block under binkp with magic, dirs, maxFiles, requirePwd keys and inline documentation - docs/messageareas/binkp.md: add TLS, GZ, multi-batch, and FREQ to the feature list and config example; add reference sections for binkp.inbound.tls, binkp.nodes[].tls, and binkp.freq
FreqResolver now supports three resolution sources (magic → areas → dirs): - Glob magic: magic paths may contain wildcards; newest matching file returned at request time, so NODELIST.* always serves the current segment without config changes after each weekly update - File base area resolver: queries ENiGMA file base areas by areaTag, using upload_timestamp for newest-wins ordering — the right answer for TIC-imported content (nodelist arrives via TIC → immediately FREQ-serveable by pointing freq.areas at the same area tag) - dirs resolver unchanged; serves as fallback for files outside the file base maxFiles cap applies across all three resolvers combined. Add 12 new tests (glob magic × 4, area resolver × 4, existing × unchanged). Update config_default.js comments and binkp.md operator guide.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds compression, FREQ, etc.