32 Commits
Author SHA1 Message Date
Stefan-Sanger e1c78e7358 feat: add pre-upgrade and post-upgrade DB migration hooks
Dockerfile: add postgresql-client and bake db-customization/ SQL scripts
into the image at /vnc/db-customization/.

config/migrate.sh: detection + migration script with two modes:
- pre-upgrade: runs idempotent prosody-13-new-deployment.sql on 13.0.x
  databases; skips 0.11.6 (unsafe pre-upgrade) and new deployments.
- post-upgrade: waits for Prosody table, then runs the appropriate
  scripts — full 0.11.6->13.0.6 migration (rules-triggers + migration-once
  + new-deployment) or idempotent drift correction for 13.0.x.

Helm chart: two Job templates (db-migration-pre-upgrade.yaml,
db-migration-post-upgrade.yaml) gated by dbMigration.enabled (default
true). Both reuse the Prosody image and DB credentials from existing
values. backoffLimit: 0, hook-delete-policy: hook-succeeded.

Also tracks the db-customization SQL files (previously untracked, now
referenced by the Dockerfile ADD).

Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/3>
2026-07-15 17:59:09 +02:00
Stefan-Sanger bc5b550d9c feat: make smacks_max_unacked_stanzas configurable via env var
Default to 5 (upstream default) when SMACKS_MAX_UNACKED_STANZAS is unset.

Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/3>
2026-07-15 17:58:02 +02:00
Stefan-Sanger 33d17d53cc feat: add PROSODY_DEBUG env var for debug logging
Set PROSODY_DEBUG=true to switch the prosody.log level from info to
debug. This makes stanza-too-large rejections and XML parse errors
visible — both are logged at debug level and otherwise invisible.

Usage in k8s:
  env:
  - name: PROSODY_DEBUG
    value: "true"

Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/3>
2026-07-15 17:58:02 +02:00
Stefan-Sanger d51c68c0b4 feat: add C2S/S2S_STANZA_SIZE_LIMIT env vars (default 5MB)
Add c2s_stanza_size_limit and s2s_stanza_size_limit to the config
template, backed by C2S_STANZA_SIZE_LIMIT and S2S_STANZA_SIZE_LIMIT
env vars. Both default to 5242880 (5MB) when unset, set in startup.sh.
The compose harness sets them explicitly.

Prosody 13.0.6 defaults are 256KB (c2s) and 512KB (s2s), which are too
small for large file-transfer invitations and Jitsi meet sessions.

Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/3>
2026-07-15 17:58:02 +02:00
Stefan-Sanger 26e7512b24 feat: upgrade Prosody 0.12.6 → 13.0.6 (milestone 3)
Bump Dockerfile to prosody-13.0.6; all 8 patches re-ported against 13.0.6.

Re-ported patches (3 changed, 5 applied with offset):
- hidden.lib.patch: 13.0 uses module:may() instead of um_is_admin; changed
  to 'if restrict_public then' (same intent: hide option for everyone)
- mod_muc.patch: 13.0 added restrict_pm between register and
  presence_broadcast; updated hunk 1 context
- mod_muc_unique.patch: 13.0 uses 'require "prosody.util.stanza"'
  (namespaced); updated context
- muc.lib, mod_carbons, mod_mam, mod_muc_mam, register.lib: applied
  with line offsets, no re-port needed

Config changes:
- Remove mod_posix from modules_enabled (13.0 absorbed signal handling,
  pidfile, and run_as_root check into core util/startup.lua)
- Move pubsub from modules_enabled to Component (13.0 requires pubsub
  to be loaded as a component, not a module)

Test fix:
- test_muc_fcm_push_to_offline_member: wait for count=2 captures instead
  of 1 — mod_vnc_muc_fcm pushes to ALL affiliated members (including
  sender, because it can't see main-host sessions from the MUC
  component); the test was racing on which push arrived first

Verified: prosodyctl check config passes; compose-harness testsuite
green (80 passed, 6 skipped, 0 failed).

Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/3>
2026-07-15 17:58:02 +02:00
Stefan-Sanger ca082d39fd fix: complete M1 — re-add run_as_root, fix stale patch tests, document manual tasks
Three changes to complete the repo-level work for Milestone 1 (0.11.6 →
0.12.6) plus a howto for the remaining manual/external tasks:

1. config/prosody.cfg.lua.template: re-add run_as_root = true. Production
   and the compose harness run as root (startup.sh writes into root-owned
   /etc/prosody/). Without it, mod_posix calls prosody.shutdown() during
   startup, which deactivates c2s (port 5222) before the shutdown itself
   errors out (prosody.main_thread is nil during module init), leaving
   Prosody running without c2s.

2. tests/test_08_image_patches.py: replace 3 stale patch-marker entries
   that checked for patches M1 intentionally dropped (moduleapi,
   mod_admin_telnet, muc.lib dumpTable) with markers that verify their
   config-based replacements (console_interfaces, http_interfaces) and
   the storagemanager.open() rewrite in mod_vnc_muc_fcm.lua.

3. upgrade-plan.md: update M1 status to reflect the post-M1 fixes
   (run_as_root, default_storage, stale tests), mark manual steps (DB
   migration, telnet console regression, external testsuite) with
   cross-references to m1-manual-tasks.md, and correct 0.12.5 → 0.12.6
   throughout.

4. m1-manual-tasks.md: new file documenting the three manual tasks that
   require external infrastructure — DB schema migration (one-way, with
   rehearse-on-copy procedure), telnet console regression test (0.12
   reimplemented the console on mod_admin_shell), and external testsuite
   run against a dev deployment.

Verified: compose-harness testsuite — 80 passed, 5 skipped, 1 pre-existing
failure (test_vcard_fallback: mod_vnc_vcard_fallback not enabled in config,
unrelated to M1).

Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/3>
2026-07-15 17:58:02 +02:00
Stefan-Sanger 32d67502a9 fix: re-add default_storage = "sql" removed in M1 upgrade
The M1 upgrade (0ea4d0a) removed default_storage = "sql" as seemingly
redundant with storage = "sql". However, the MUC component sets
storage = { muc_log = "sql" } (a table), and storagemanager.get_driver
falls back to default_storage (or "internal") for stores not listed in
the table. Without default_storage = "sql", the kick store on the MUC
component falls back to internal storage, whose archive driver requires
stanza objects — mod_vnc_track_kicks passes a plain string, causing
"unsupported-datatype" errors and kick data not being persisted.

Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/3>
2026-07-15 17:58:02 +02:00
Stefan-Sanger 2b798bf583 test(harness): add docker-compose stack, mocks, and extend suite per test-improvement plan
Implements all phases of test-improvement.md:

- docker-compose.yml: postgres + aiohttp mocks + prosody + optional tester,
  using exact template placeholder names (fixes latent fcm_api_url/del_api_url
  envsubst bug).
- tests/mocks: single aiohttp backend (auth, FCM, delfile, avatar, file-share)
  with /__requests capture API and /__fcm_error for prune tests.
- tests/Dockerfile + tests/requirements.txt: tester image.
- conftest: mock_client fixture, --mock-url; VNCXmppClient now honors
  XMPP_HOST/PORT (slixmpp was SRV-resolving the JID domain); RESTInjector
  sends Host: <domain> (prosody routes HTTP by Host header).
- test_08_image_patches: docker-exec grep of every patched upstream file.
- test_09_http_sideeffects: FCM (1:1 + MUC), delfile, vcard-avatar, receipts.
- test_10_smacks: enable/ack, resume-replay, hibernation-expiry (offline
  variant xfail until fork is replaced by upstream mod_smacks_offline).
- test_11_smokes: filter_chatstates, idlecompat, http_altconnect, webpresence,
  admin-telnet non-loopback.
- test_12_image_runtime: http_upload slot handshake, healthcheck exit-2,
  no-residual-placeholder config check.
- test_06_postgres: real kick-row assertion via unregister IQ.
- test_02_muc: vcard_muc get/set; test_03_vnctalk: muc_hook non-joined affiliate.
- startup.sh + template: SMACKS_HIBERNATION_TIME as a proper global config var
  (default 300) so SMACKS expiry tests can lower it.
- Makefile (make up/test/down/logs) and run-tests.sh updated.

Validated end-to-end against the compose stack: 81 passed, 1 xfailed,
1 pre-existing vcard_fallback failure (unrelated), 3 skipped.

Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/3>
2026-07-15 17:58:02 +02:00
Stefan-SangerandClaude Fable 5 bdb9aed9e3 feat: upgrade prosody 0.11.6 -> 0.12.6 (milestone 1)
Re-port all source patches onto 0.12.6; three are gone entirely:
moduleapi (the two vnc_muc_fcm modules call core.storagemanager
directly now), mod_admin_telnet and portmanager (replaced by
console_interfaces/http_interfaces config). The muc.lib fork keeps its
four functional changes including the externally consumed
muc-config-sub-mitted event; the operator-precedence hunk was fixed
upstream. mod_muc_mam shrinks to keep-archive-on-room-destroy since
muc_log_expires_after="never" disables cleanup upstream in 0.12.

Delete the bundled mod_smacks fork and the no-op mod_smacks_offline;
core 0.12 smacks supersedes them (options audited, dead smacks_max_old
corrected to smacks_max_old_sessions).

Config/startup: drop legacyauth, run_as_root, daemonize; bosh_ports ->
http_ports; cross_domain_* -> http_cors_override; randomize
component_secret at startup (env-overridable); export
log_slow_events_threshold fallback (latent render bug).

Found while smoke-testing: pin --idn-library=idn (0.12's ICU default
segfaults without ICU data in the image); http became a private
service in 0.12 so 5280 needs http_interfaces to stay public; the
telnet console now depends on mod_admin_socket, whose socket moves to
/var/log/prosody.

Verified: prosodyctl check config clean; boots against Postgres with
empty error log and same port bindings as 0.11; healthcheck green;
telnet console and SQL storage round-trip; 0.11->0.12 schema upgrade
rehearsed on a 0.11-created database with data intact.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/3>
2026-07-15 17:58:02 +02:00
Stefan-Sanger 54119c9ff1 fix: add dummy script to switch to new helm chart before prosody migration 2026-07-15 13:40:01 +02:00
Stefan-Sanger 6f13736a77 fix: healthcheck
Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/1>
2026-06-08 09:33:01 +02:00
Stefan-Sanger abea16205a fix: basic rootless execution, optimize container image size
Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/1>
2026-06-08 09:18:18 +02:00
Stefan-Sanger 2e592f0ad6 fix: adjust directories
Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/1>
2026-06-08 07:37:48 +02:00
Stefan-Sanger d099c664d0 fix: config changes from claude report 2026-06-05 14:44:53 +02:00
Stefan-Sanger 8797ab1ee1 fix: config template typo 2026-06-05 12:34:49 +02:00
Stefan-Sanger d9bc0e8cec fix: anon vhost 2025-06-18 07:46:13 +02:00
Stefan-Sanger 69530927ee fix: prepare cert automation 2025-06-18 07:43:18 +02:00
Stefan-Sanger 57457eb20e fix: ngx config 2025-06-16 12:46:13 +02:00
Stefan-Sanger ad0f05ee95 fix: add nginx 2025-06-16 12:00:21 +02:00
Stefan-Sanger 79c453112b fix: typo 2025-03-17 09:31:14 +01:00
Stefan-Sanger e4e25cf241 fix: add s2s keepalive for default jitsi 2025-03-17 09:23:35 +01:00
Stefan-Sanger b34b715af1 fix: re-enable muc fcm 2022-10-19 12:10:57 +02:00
Stefan-Sanger 5055031b0b fix: temp disable muc fcm 2022-10-19 11:32:02 +02:00
Stefan-Sanger c06e312fee fix: add param 2022-10-18 10:31:46 +02:00
Stefan-Sanger 35bafa9439 fix: back to default config 2022-10-15 06:14:01 +02:00
Stefan-Sanger 285256e687 fix: re-enable mam, disable fcm 2022-10-15 06:05:06 +02:00
Stefan-Sanger 81380bb783 fix: disable muc_mam for testing 2022-10-15 05:45:21 +02:00
Stefan-Sanger 73da58a94b fix: update template 2022-10-14 11:35:26 +02:00
Stefan-Sanger 743dcc61ed fix: env vars 2022-09-16 11:19:54 +02:00
Stefan-Sanger 94d16527f9 fix: logging 2022-09-15 08:13:00 +02:00
Stefan-Sanger 7e9ea9ff95 fix: env and logging 2022-09-15 07:10:03 +02:00
Stefan-Sanger 7601143bad fix: initial dockerbuild of current prosody for alpine 2022-09-05 06:50:25 +02:00