Compare commits

..
Author SHA1 Message Date
Jason Volk 64a029ee09 Bump 1.4.6
Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-06 19:34:51 +00:00
Jason Volk a3f6971579 docker: Add rust-sdk memcheck target.
docker: Separate and tweak cargo cache paths.

ci: Improve memcheck job targets.

cargo: Add missing debug syms to bench profile.

docker: Optimize layer copying.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-06 19:34:51 +00:00
Jason Volk 51681aec1b docker: Bump complement.
ci: Run complement with optimizations.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-06 17:14:45 +00:00
Jason Volk 39c84fabb4 Optimize filter fetch in syncv3 prologue.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-06 17:14:45 +00:00
Jason Volk f77bd41837 Add empty config default for rtc_transports to not generate false.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-06 17:14:45 +00:00
Jason Volk 6f34b8e9ca Fix missing pushrules evaluation on federation invite.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-06 17:14:45 +00:00
Jason Volk 5051da493a Fix pushrule evals relying on non-option RoomPowerLevels.
Add option to bypass pushrules to send everything to pushers.

Improve robustness of pushrule eval loops.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-06 17:14:45 +00:00
Jason Volk ff0e007c45 Fix readability of admin query account_data outputs.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-06 17:14:45 +00:00
Alexandru Scvorțov b85fb5ea6f Fix tests in nix and re-enable 2025-11-06 16:38:13 +00:00
dasha_uwuandJason Volk e905538269 Shuffle additional join servers. 2025-11-04 06:40:51 +00:00
Jason Volk 6f672b7304 Handle missing media dir as individual item errors w/o aborting check. (closes #213)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-04 06:40:51 +00:00
Jason Volk 4363ed6ec3 Adapt MSC4143 rtc_foci support to Ruma types. (e1f89b69ea)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-04 06:40:51 +00:00
Jason Volk dd50a4cb0b Fix ignored column descriptions; enhance preservation behavior. (7320d0a40b)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-03 23:02:42 +00:00
tototomate123andJason Volk e0a997c227 docs(reverse-proxy): restructure and add nginx guide
- Moved Caddy and Nginx configuration examples to separate files
- Added documentation for Nginx setup
- Updated generic reverse proxy section
2025-11-03 12:49:04 +00:00
tototomate123andJason Volk e1f89b69ea feat: Add Element Call / MatrixRTC support 2025-11-03 11:36:19 +00:00
dasha_uwuandJason Volk 888f72d8d0 Generalize common_prefix for AsStr inputs.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-03 11:36:19 +00:00
Jason Volk 06618eadab Re-establish federating with several Conduit endpoints.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-03 11:36:19 +00:00
Benedikt Vollmerhaus 05390d6097 Fix shared TURN secret from turn_secret_file not being used 2025-11-03 12:30:00 +01:00
Jason Volk 1f803fe3a9 Fix verification loss; workaround Nheko-Reborn/nheko#1908 (closes #146)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-03 04:45:31 +00:00
Jason Volk 1492d68e25 Additional tracing of request body.
Optimize router request parse types.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-03 04:45:31 +00:00
Jason Volk c1aa94fb91 Describe roomsynctoken_shortstatehash for deletion.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-03 02:05:35 +00:00
Jason Volk 7320d0a40b Improve config options for missing and dropping db columns.
Implement actual drop functionality.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-03 02:05:35 +00:00
Jason Volk abded2d442 Allow guests even when token required for normal registration. (closes #189)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-02 18:19:11 +00:00
Jason Volk 4afd6f347b Implement GET /_matrix/client/v3/events live room previews.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-02 08:06:32 +00:00
Jason Volk 6b8d6956a3 Fix timeline events order in /initialSync.
Implement acccount_data for response.

Ensure consistency of revealed events.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-02 08:06:32 +00:00
Jason Volk f59d62c01c Bump Ruma for CanonicalJson property name optimizations.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-02 03:57:11 +00:00
Jason Volk a14556da97 Implement encryption_enabled_by_default_for_room_type. (closes #29)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-02 00:02:49 +00:00
Jason Volk 8b1de3d8db Add update for device last_seen_ts. (closes #40)
Piggyback on presence ping for controlled device seen updates.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-02 00:02:49 +00:00
Jason Volk 240b498489 Add unwrap suite to future::OptionExt extensions.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-02 00:02:49 +00:00
Jason Volk d680a6ba53 Bump Ruma for device type optimizations.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-02 00:02:49 +00:00
Jason Volk aa3f14cd57 Optimize federation user devices response.
Modernize some error branches.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-01 23:15:37 +00:00
Jason Volk 15627bc8d0 Simplify device metadata update interface.
Add broadcast argument; reorder notify to after write.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-01 23:15:37 +00:00
Jason Volk 084facf474 Move user profile related functions to profile unit.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-01 23:15:37 +00:00
Jason Volk d24986edf1 sliding-sync: Stop propagation from room handlers.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-31 03:38:35 +00:00
Jason Volk ce1ac277a6 Refactor sync v3 leave handler.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-31 03:38:35 +00:00
Jason Volk 7aeed0a95a Fix next_batch pagination tokens in relations response.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-31 03:38:35 +00:00
Jason Volk 9265748a57 Remove legacy ruma return type on sync endpoint.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-30 16:28:27 +00:00
Jason Volk e85cfdf48a Remove errant inline. (48923b3657)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-30 14:01:57 +00:00
Jason Volk 48923b3657 Implement notifications retrieval. (closes #201)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-30 03:48:16 +00:00
Jason Volk aedaf3f0c1 Fix pushing useless notifications.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-30 03:48:16 +00:00
Jason Volk b24b59dc38 Add admin query raw command to clear table.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-30 03:48:16 +00:00
Jason Volk 738b5e3fa5 Add attempted newtype struct name to deserialization error message.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-30 03:48:16 +00:00
Jason Volk 1f0cfec5ca Use Result for last_notification_read as zero-default not appropriate.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-30 03:48:16 +00:00
Jason Volk 9c5caa3a5f Move appservice request unit from sender to appservice.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-30 03:48:16 +00:00
Jason Volk 1cf4a26ae9 docker: Use prefix match for nightly rust_toolchain settings.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-30 03:48:16 +00:00
Jason Volk 3694ffbab3 Bump Ruma w/ PushRule type optimizations.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-28 23:23:27 +00:00
Jason Volk af0e01e016 Add util to assist with Display/to_string for SmallString.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-28 23:23:27 +00:00
Jason Volk 5e89f0acae Split pusher service send/request into unit.
Refactor sender's push destination handler.

Combine remnants of service::rooms::user with pusher service.

Further split and reorg pusher service units.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-28 23:23:19 +00:00
Jason Volk 563873af77 Use signed PduCount for better bumpstamp on create and backfill.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-27 15:24:50 +00:00
Jason Volk d2072080c9 Add admin query for remote alias resolve.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-27 15:24:17 +00:00
Jason Volk e191730950 Tracing span adjustments for ret verbosity.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-27 15:15:12 +00:00
Jason Volk f660e00bb5 Implement Dehydrated Devices MSC3814 (closes #200)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-27 12:06:43 +00:00
Jason Volk f613d0c2ad Add admin command to delete a user's device.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-27 10:55:12 +00:00
Jason Volk 7596ad2019 Add rountripping test for database cbor serialization.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-27 10:41:49 +00:00
Jason Volk 384add9784 ci: Extract Nix artifacts.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-27 09:39:57 +00:00
Jason Volk a234f019b1 Advertise MSC2659 support; reorder features by MSC ascending.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-27 09:06:02 +00:00
Jason Volk e8a87bdfa3 Remove DynamicUser from systemd files (closes #207).
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-27 09:06:02 +00:00
Jason Volk 6a4aff424f Add count value to the to_device iter item.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-27 09:06:02 +00:00
Jason Volk 8959d9e2c1 Add bulk one_time_keys adder to interface.
Add device_exists to interface.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-27 09:06:02 +00:00
Jason Volk a30c043386 Support creating devices without access_tokens.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-27 09:06:02 +00:00
Jason Volk a39ef994d2 Add is_err_or to Result utils.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-27 09:06:02 +00:00
Jason Volk b714f24029 sliding-sync: Filter redacted events from bump calculation.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-27 09:06:02 +00:00
Jason Volk 2263f2e874 docker: Add dirty-runs option passed to complement.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-27 09:06:02 +00:00
Jason Volk 9abe9becd6 Split pusher/push-rule from timeline append.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-27 09:06:02 +00:00
Jason Volk 4b74c01895 Split appservice dissemination from timeline::append().
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-27 09:06:02 +00:00
Jason Volk 1223763e2b Split sliding-sync into additional units.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-27 09:06:02 +00:00
Jason Volk 9b64c1f105 Bump Nix flake. 2025-10-27 09:06:02 +00:00
Jason Volk 212a8434a8 Bump Rust 1.89
We can't upgrade to 1.90 because NixOS breaks. 🙂‍↔️

Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-27 09:06:02 +00:00
Jason Volk bfaac8b5a2 Bump dependencies.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-25 17:46:25 +00:00
Jason Volk 9af15ecbba Bump 1.4.5
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-25 13:33:32 +00:00
Jason Volk f66a83763e Persist sliding-sync state; mitigate initial-sync.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-25 13:33:32 +00:00
Jason Volk 718c3adcb2 ci: Expand the rust-sdk integration matrix.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-25 08:44:16 +00:00
Jason Volk af80482c04 Add branch in room handler for left rooms.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-25 08:34:49 +00:00
Jason Volk a20ddcd586 Recency bump on own membership event.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-25 08:08:26 +00:00
Jason Volk b483306367 Fix sliding-sync invite regression.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-25 07:52:40 +00:00
Jason Volk f5e98467be Improve sliding-sync robustness to deeper replays.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-24 18:31:48 +00:00
Jason Volk d44db45f83 Adjust the order of operations during read_marker handling.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-24 18:31:48 +00:00
Jason Volk 0397bb8237 Implement specified non-blocking semantic for sliding-sync.
Simplify sliding-sync watch loop and bounds.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-23 11:00:55 +00:00
Jason Volk 4010fc62bc Use take_while rather than filter for scanning last_receipt_count.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-23 03:37:52 +00:00
Jason Volk 0d823a2822 Revert "Involve m.fully_read for resetting notification counts."
This reverts commit 0df5e5e7ac.
2025-10-23 03:37:52 +00:00
Jason Volk 9cd175b125 Additional logging/tracing tweaks around sliding-sync.
Additional spans around receipt service interface.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-23 03:37:52 +00:00
Jason Volk 050a1a350a Add dbg profile to Cargo; default to faster builds accomodating new users. 2025-10-23 03:37:52 +00:00
Jason Volk ec0f872f8f Add tracing around db watcher notify including cf name.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-22 20:23:30 +00:00
Jason Volk 024e8eae62 Implement num_live for sliding-sync room response.
Avoid using origin_server_ts for recency stamp.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-22 09:14:41 +00:00
Jason Volk 4fd60b2605 Improve sliding-sync selector and windowing logic.
Bump Ruma; eliminate premature release compat.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-22 08:15:25 +00:00
Jason Volk e53968d9eb Improve tracing spans for notif counts and sliding-sync exts.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-22 07:05:03 +00:00
Jason Volk 7cbc2ee385 Fix the accidentally dual-keyspaced cf from conduit.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-22 07:03:10 +00:00
Jason Volk 0df5e5e7ac Involve m.fully_read for resetting notification counts.
EXA is not reliably removing its unread marker any other way. Clients
wishing to move the fully_read marker in the other direction should
file an issue to make themselves known.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-22 06:52:30 +00:00
Jason Volk 312eb69450 Add tool to get sibling connections for a device.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-21 17:48:08 +00:00
Jason Volk 5b620a2c37 Add .and_is() / .and_if() to the BoolExt smalltalk.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-21 17:41:42 +00:00
Jason Volk 3b4fbb8c1a Fix inverted debug assert message.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-21 15:48:05 +00:00
Jason Volk 158d44e1a9 docs: Remove line about other reverse proxies. (#197)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-21 15:02:36 +00:00
Jason Volk d2aab468cf Fixes for sliding-sync request replays.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-21 06:46:02 +00:00
Jason Volk aa4486dfdf Simplify types, mitigate expansion; eliminate unnecessary move.
Further simplify future::BoolExt toward type expansion mitigation.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-21 05:25:11 +00:00
Jason Volk 2a662445b6 Make account_data.last_count() upper bound argument optional.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-20 23:58:38 +00:00
Jason Volk 5b3f0fde23 Add invite rooms to sync v3 watch rooms list.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-20 23:57:52 +00:00
Jason Volk 9640afebff Join the async prologue operations in sync v3.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-20 23:55:42 +00:00
Jason Volk dd5c5c7a4a Notify watchers on delete operations in addition to inserts. 2025-10-20 20:45:38 +00:00
Jason Volk fc0f04defa Optimize watcher range collection on notify.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-20 20:44:45 +00:00
Jason Volk 7d8f7cbe5d Bump 1.4.4
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-16 01:55:43 +00:00
Jason Volk 4e0249cd2f Fix sliding-sync again by resetting after interrupted requests. (fixes #190)
This solution is not elegant but appears to be correct for fixing the issue. A
a more efficient solution might be possible without resetting the connection
which should be further investigated.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-16 01:05:16 +00:00
Jason Volk d5b39aa995 Bump 1.4.3
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-11 02:12:43 +00:00
Jason Volk 46c940b863 Refactor sliding window selector. (fixes #170)
Refactor list filtering.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-10 15:56:08 +00:00
Jason Volk ab8536d5c3 Add query to get latest account data count.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-10 12:44:23 +00:00
Jason Volk 4918868632 Add query to get last read receipt for room.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-10 12:44:23 +00:00
Jason Volk 9e00f70197 Allow nursery clippy::tuple_array_conversions.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-10 08:30:08 +00:00
Jason Volk d3aaf9e4a9 Additional FutureBoolExt; attempt to reduce type-length expansion.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-10 07:37:40 +00:00
Jason Volk 96dc56ad07 Relax clippy::rest-pat-in-fully-bound-structs.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-10 07:37:40 +00:00
Jason Volk e12b0262da Fix unnecessary async for future and/or utils.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-10 07:37:40 +00:00
Jason Volk e5bf005eaf Simplify state_cache.user_memberships() masking for callers.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-10 07:37:40 +00:00
Jason Volk 02ccb1dceb Cleanup legacy config path component.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-10 07:37:40 +00:00
Jason Volk a450eb96eb ci: Remove default-features builds from publication to registries.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-10 07:37:40 +00:00
Jason Volk 155af0fda3 Add iteration of space children; simplify space child event fetcher.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-10 07:37:40 +00:00
Jason Volk 5c61b4d4a3 Add room state accessor iterating state_keys joined by respective event_id.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-10 07:37:40 +00:00
Jason Volk 97e709492c Add is_direct() alternative query for m.room.member.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-08 03:33:12 +00:00
Jason Volk 51fc2342a4 Add is_direct() query for account_data.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-08 03:33:12 +00:00
Jason Volk 4ca68deef8 Add better interface for getting and setting room tag account data.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-08 03:33:12 +00:00
Jason Volk 4d8d64f5c7 Add missing wildcard matching for sliding-sync required state.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-08 03:33:12 +00:00
Jason Volk dff30e5924 Additional state accessor iterations for pdus of a specific type.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-08 03:33:12 +00:00
Jason Volk 7fee459b1a Add admin diagnostic query suite for sync state.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-08 03:33:12 +00:00
Jason Volk a6127fcd1a Provide sync watch rooms as argument rather than assuming all joined rooms.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-08 03:33:12 +00:00
Jason Volk 6c724bbc2f Cleanup/optimize sliding sync types and arguments.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-08 03:33:08 +00:00
Jason Volk b1ea7b101d Split sliding-sync extensions into units.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-06 15:56:49 +00:00
Jason Volk 4baa25f66f Add presence ping to sliding-sync.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-06 15:56:49 +00:00
Jason Volk 227b77e58e Refactor sliding-sync e2ee extension.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-06 15:56:49 +00:00
Jason Volk 54057da84e ci: Fix artifact extraction argument for package.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-06 15:56:49 +00:00
Jason Volk 732825a390 ci: Publish verbose logging container builds to registries. (closes #181)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-06 04:11:57 +00:00
Jason Volk 6b74425f76 ci: Add integration memcheck to test matrix.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-06 01:22:02 +00:00
Jason Volk 74a576caf7 Add option to toggle compact log format.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-06 01:19:36 +00:00
Jason Volk 2b7cf7d5d5 Add optimized iteration of all room memberships for user.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-06 01:19:36 +00:00
Jason Volk 443248965d Add more optimized iterations for user memberships room_id's.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-06 01:19:36 +00:00
Jason Volk ee777bc287 Rename user rooms iterations which have state vectors as values.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-06 01:19:36 +00:00
Jason Volk aef38b1178 Rename userroomid/roomuserid table handles to reflect counter value.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-06 01:19:36 +00:00
Jason Volk 4743a8d968 Move args and runtime back to main from core (1313eb0b64).
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-06 01:19:36 +00:00
Jason Volk 53ab6742c8 Fix shutdown signalling on startup.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-06 01:19:36 +00:00
Jason Volk 46193de7e8 Create appservice user on registration.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-06 01:19:36 +00:00
Jason Volk 9253f46c80 ci: Dedup the nix package job with the other distro package jobs.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-06 01:19:36 +00:00
Jason Volk 5c127b5abd Add is_false() to BoolExt.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-06 01:19:36 +00:00
Jason Volk 17f6f1a5a6 Device list updates for left users was previously deduplicated.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-06 01:19:36 +00:00
Jason Volk 75509d50ca Add shorteventid to pdu_id query; reorg related id query interface.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-06 01:19:36 +00:00
Jason Volk 1d14426018 Fix missing Send on generic stream and result items.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-06 01:19:36 +00:00
Jimmy Brush 2b9563be67 Fix off-by-one in sync v5
Simplified sliding sync specifies ranges to be inclusive while rust ranges are
exclusive.
2025-10-05 18:28:05 -04:00
Jason Volk 68c4f60bb3 Implement stateless sync; erase all the sync tokens.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 15:07:06 +00:00
Jason Volk d95c3f126f Fix typos
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 15:07:06 +00:00
Jason Volk f1c2548807 Add PduCount value to userroomid/roomuserid_joined; move PduCount to argument for update_membership.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:29:48 +00:00
Jason Volk eda45e445c Implement better fmt::Debug for pdu::Builder.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:29:48 +00:00
Jason Volk 049defe977 nix: Disable doChecks due to missing /etc/resolve.conf.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:29:48 +00:00
Jason Volk 3c073110b8 Update nix flake.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:29:48 +00:00
Jason Volk 8d6bfde5a0 Use insta and criterion for main integration test and benches respectively.
docker/ci: Separate integration and unit tests and benches jobs.

Add directives to remove db before/after integration tests are performed.

Split start/run/stop phases; add more granular smoketests.

Split main integration tests into units for isolation.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:29:48 +00:00
dasha_uwuandJason Volk 43f0882d83 clear destination and overrides cache on request failure. (#186) 2025-10-02 05:29:48 +00:00
Jason Volk fed52d24e4 Implement additional Matches for RoomFilter and Filter.
Apply filter for rooms/not_rooms; sender filter for presence.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:29:48 +00:00
Jason Volk e6c85c97c6 Fix names and types misrepresenting PduCount as ShortEventId.
Add get_shorteventid_from_pdu_id() conversion.

Fix prev/next nearest-state interface (dev branch 642086ecfcfa).

Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:29:48 +00:00
Jason Volk 368ead20a6 Add then_none() to BoolExt; move unsorted then_ utils.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:29:48 +00:00
Jason Volk a803b84b27 Add missing reverse query for shortroomid => room_id.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:29:48 +00:00
Jason Volk 1058fbe9a7 Use specific key,val buffer sizes for append_to_state (no change to correctness).
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:29:48 +00:00
Jason Volk ae4aad3641 Add set difference for sorted streams util.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:29:48 +00:00
Jason Volk 95435ffe98 Fix unconnected inspect_log traits in Result utils.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:29:48 +00:00
Jason Volk 63e2cfa21b Rename core integration test directory for state_res.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:29:48 +00:00
Jason Volk 9383922d09 Use trace log level for multi-line table factory options on rocksdb startup.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:29:48 +00:00
Jason Volk ae52676e33 Add back the default database path.
Allow default server_name when testing.

Default to smoke test vector when testing.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:29:45 +00:00
Jason Volk 292b601755 Fix possibly dependent conditions for server shutdown in config worker.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:29:00 +00:00
Jason Volk 1313eb0b64 Reorganize main crate for testability.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:28:58 +00:00
Jason Volk ba12773a5a Optimize force_state query pattern.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:27:48 +00:00
Jason Volk 83afe81f60 Move shortstatehash queries from state_accessor to state service.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:27:48 +00:00
Jason Volk f2740822e2 De-indent rooms state service definitions.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:27:48 +00:00
Jason Volk 2417764771 Fix redundant prefix in admin query raw command suite.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:27:48 +00:00
Jason Volk 41ff81f843 Add handler_prefix to admin_command_dispatch for method dedup purposes.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:27:48 +00:00
Jason Volk fbcf4ba4f3 ci: Support job masking directives in commit message. [ci only it]
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:27:48 +00:00
Jason VolkandHashbrown777 af3cdf9263 Add script to docs for available optimization levels.
Co-authored-by: Hashbrown777 <hashbrown777@gmail.com>
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:27:48 +00:00
Jason Volk 9d9ace1452 Add timeline interface to get next or prev pdu nearest to a pduid.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:27:48 +00:00
Jason Volk 83d64e0879 Implement Deserialize for RawPduId for database convenience.
Add room equality convenience on RawPduId.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:27:48 +00:00
Jason Volk 4cae17e83d Fix missing Send bound for Future.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:27:48 +00:00
Jason Volk 1c6992ccd4 Add option to bypass dropped column erasure.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:27:48 +00:00
Jason Volk 89be6dc097 Switch to Criterion for benchtests.
ci: Add benches to workflow.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:27:48 +00:00
Jason Volk a47f8f8a82 Rename complement test results file.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:27:48 +00:00
Jason Volk aac5006bf5 ci: Add nix build w/ smoketest. (closes #111)
docker: Add target for nix build. (#111)

Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-25 14:38:23 +00:00
Jason Volk 6d3ed09a2b ci: Add matrix-rust-sdk integration testing.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-25 14:38:23 +00:00
Jason Volk 377b7166f0 Bump Ruma.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-25 12:25:08 +00:00
Jason Volk 85b3de055d Broadcast send_join concurrent to other operations; pre-gather state concurrently.
Broadcast send_knock concurrently.

Concurrent access check for fed event.

Concurrent gather for state responses.

Populate room_version for format_pdu to elide repeated queries.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-25 02:32:45 +00:00
Jason Volk b9c790326a docker: Consolidate distro package fetches in base builder image.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-24 08:20:54 +00:00
Jason Volk 4e5910471b Require stronger ordering to sample final counter values on shutdown.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-24 08:20:54 +00:00
Jason Volk c3bc8c14f7 Make hickory system_conf error more useful. (resolves #179)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-23 21:02:37 +00:00
Jason Volk ac3ceb1b95 Modernize federation profile query route.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-23 19:48:07 +00:00
Jason Volk aa37e32471 Optimize Pdu prev_events and auth_events containers.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-23 18:16:24 +00:00
Jason Volk 887a22dabd Fix docs regarding optimized builds; replace haswell with v1/v2/v3 etc. (fixes #175)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-23 18:16:24 +00:00
Jason Volk 6dca02860c Allow clippy::needless-update.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-23 11:53:39 +00:00
Jason Volkanddasha_uwu 86103183b3 Remove unused utils.
Co-authored-by: dasha_uwu <dasha@linuxping.win>
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-23 09:02:35 +00:00
Jason Volk 8f4cc87051 Query rooms in server_sees_user() concurrently.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-23 08:49:09 +00:00
Jason Volk 14721c90c9 Fetch presence avatar_url and displayname concurrently.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-23 08:49:09 +00:00
Jason Volk 6d3b2d864f Simplify keys_changed iteration using room_keys_changed() upper-bound.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-23 08:49:09 +00:00
Jason Volk 7cf246eb73 Support dot paths for -O/--option command-line args. (fixes #162) (fixes #167)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-23 05:16:29 +00:00
Jason Volk bffb7f89c8 Provide better generated config defaults for ldap section.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-23 05:16:29 +00:00
Jason Volk 5467c9e486 Add option to redirect logging to stderr. (resolves #154)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-23 05:16:29 +00:00
dasha_uwuandJason Volk 89a67af607 pull stuff out of globals 2025-09-23 05:16:29 +00:00
dasha_uwuandJason Volk 6bb101ac51 add local alias check 2025-09-23 05:16:29 +00:00
dasha_uwuandJason Volk 1c0b4e94ac fix spec violation and slight alias resolution refactor 2025-09-23 05:16:29 +00:00
dasha_uwuandJason Volk 9c4d376bec pass args by ref 2025-09-23 05:16:29 +00:00
dasha_uwuandJason Volk d6e95c51c0 current_exe changes
remove unsafe

remove incorrect doc
2025-09-23 05:16:29 +00:00
dasha_uwuandJason Volk d5ce4b316f remove unnecessary as_ref 2025-09-23 05:16:29 +00:00
dasha_uwuandJason Volk 8f07a6c60f remove unused macros 2025-09-23 05:16:29 +00:00
dasha_uwuandJason Volk b882e7efdb rename db to engine 2025-09-23 05:16:29 +00:00
dasha_uwuandJason Volk e0169e3dca presence refactor 2025-09-23 05:16:29 +00:00
Jason Volk fe46755418 Remove declaration for Room V1 until support is confirmed complete. (#12)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-23 05:15:10 +00:00
Jason Volk bbac80d2e6 ci: Fix pages deployment. (#165)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-23 05:15:10 +00:00
Jason Volk a31c9b0c62 Fix documented examples of delegation. (fixes #165)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-23 05:15:10 +00:00
Jason Volk cf4e65c607 Fix alternative resolver minimum TTL configuration. (fixes #176)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-23 05:15:10 +00:00
Jason Volk f32b6ae17d Abstract and simplify serde_json round-trip to Ruma Raw.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-23 05:15:10 +00:00
Jason Volk 27222f23d2 Macroize several legacy errors.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-23 05:15:10 +00:00
Jason Volk ed324d5972 Update device_signing/upload UIAA (fixes #169).
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-23 05:15:10 +00:00
Jason Volk 69075b166f Add config option to toggle dns case randomization.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-23 05:15:10 +00:00
Jason Volk e3a711482a Update assertion for serde crate reorg to serde_core.
Show the deserialize_any type which fails the assertion.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-23 05:15:10 +00:00
Jason Volk 6759187b37 Bump dependencies.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-22 20:44:25 +00:00
Guido GüntherandJason Volk 83ed29eb65 example config: Document support items
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-09-22 20:44:25 +00:00
Guido Günther 6a685b7ee9 packaging: Move unit alias to install section
Otherwise there will be

  systemd[1]: /usr/lib/systemd/system/tuwunel.service:5: Unknown key 'Alias' in section [Unit], ignoring.

on startup. See `systemd.unit(5)`.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-09-15 19:53:05 +02:00
Jason Volk fb4dfafe2d Bump 1.4.2
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-12 04:13:34 +00:00
Jason Volk 8dbea51968 Slightly decrease the default OTK limit.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-12 04:13:34 +00:00
Jason Volk 7b5905bbca Remove inapposite readme sections on versioning.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-12 04:13:34 +00:00
Jason Volk 42d143c013 Allow matching for passthru resolver on all resolution paths. (#158)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-12 04:13:27 +00:00
Jason Volk 10fb1cd192 Purge room synctokens during deletion.
Purge last notification read counts.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-11 08:56:38 +00:00
Jason Volk 1322ba1b00 Send unmaintained hardened_malloc-rs to valhalla.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-11 08:56:38 +00:00
Jason Volk d73b4332bf Fix deletion of local leave state to allow sync for clients.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-11 06:20:41 +00:00
Jason Volk 11eeca7e01 Prune one time keys based on reasonable configured limit.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-11 04:27:33 +00:00
Jason Volk 19dc5fafd4 Fix missing device_one_time_keys_count in empty timeout responses.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-10 21:29:04 +00:00
Jason Volk 54b347b855 Abstract and dedup the general UIAA pattern into api::router.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-10 10:35:49 +00:00
Jason Volk 8ed61aecb0 Split api::router::auth server/appservice units.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-10 05:41:44 +00:00
Jason Volk bf8aa57d03 Add config option for dns passthru for appservices. (#158)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-10 01:17:40 +00:00
Jason Volk a9f1926654 Use dns_resolver2 per reqwest client builder deprecation notice.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-10 00:59:50 +00:00
Jason Volk 248d778290 Add alternative resolver path with passthru cache-characteristics. (resolves #158)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-10 00:01:26 +00:00
Jason Volk 2e13e87e43 docs: Update the Helm Chart link for Kubernetes.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-09 22:47:33 +00:00
Jason Volk ba19d407d0 Add config to control m.federate in room create events. (fixes #151)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-09 04:46:19 +00:00
Jason Volk de7c5dcbc8 Make iss and aud args optional to debug create-jwt command.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-09 03:03:53 +00:00
dasha_uwuandJason Volk adadafa88f Fix alias resolution logic; element-web v1.11.111 compat
element-hq/element-web#30641
element-hq/element-web#30611

Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-09 02:28:19 +00:00
Jason Volk deda746222 Support JWT authentication on deactivate route.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-09 02:28:19 +00:00
Jason Volk 29c2c8a333 Branch based on config to note sync for push suppression.
Minor if-let condition and scope reduction; formatting.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-08 22:25:00 +00:00
tototomate123andJason Volk 296018f0cc mark notification suppression as experimental 2025-09-08 22:25:00 +00:00
tototomate123andJason Volk 6295ca135a feature marked as experimental and executed rustfmt 2025-09-08 22:25:00 +00:00
tototomate123andJason Volk b5a9884194 feat(presence,push) optionally suppress push notifications for active users 2025-09-08 22:25:00 +00:00
Jason Volk 1be7fd9247 Fix cfg condition for debug logging (996a5488be)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-08 22:25:00 +00:00
Jason Volk be1264965a Refactor sliding-sync.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-08 00:07:59 +00:00
Jason Volk f6d2ce2f22 Greenlight hydra backports.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-08 00:07:59 +00:00
Jason Volk 3cbe1e25cd Cleanup Resolver construction/configuration.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-08 00:07:59 +00:00
Jason Volk 897322964c Fix dns_min_ttl config doc.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-08 00:07:59 +00:00
Jason Volk 996a5488be ci: Add build for release-logging, optimized build with debug logging.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-08 00:07:59 +00:00
Jason Volk 0ed4bd1e07 Only ping presence for public read receipts.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-07 21:39:20 +00:00
Jason Volk da79de5381 Add cfg to preclude log elision without requiring debug_assertions.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-07 21:39:20 +00:00
Jason Volk 1bcf3ae19a Soften the Docker troubleshooting note.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-07 20:50:14 +00:00
Jason Volk 91e500efe3 Further tweak troubleshooting formatting.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-05 22:11:42 +00:00
Jason Volk 35b1ebaf3b Bump dependencies.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-05 07:45:04 +00:00
Jason Volk ea5deb7e85 Generate CoC HTML inside book directory. (closes #155)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-05 07:45:04 +00:00
Jason Volk 542cc51047 ci: Add docs test step.
docker: Add docs test target.

docker: Add mising color args to rustfmt.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-05 06:49:45 +00:00
Jason Volk 3225db0ddd Add external repair tool step to db repair troubleshooting.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-05 05:45:41 +00:00
Jason Volk a164da8b58 Fix and extend the apply! util macro.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-05 05:45:41 +00:00
Jason Volk 7221d466ce Ignore canonical_alias with removed alias for directory results.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-05 05:45:41 +00:00
Jason Volk f6c88e3a16 Add query for alias existing; tweak tracing spans.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-05 05:45:41 +00:00
Jason Volk 3deebeab78 Fix sliding-sync room_avatar conditions.
Eliminate jsOption from non-sliding-sync avatar related codepaths.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-05 05:45:41 +00:00
Jason Volk 1d2818de58 Round upward for events_after in /context limit.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-05 05:45:41 +00:00
Jason Volk 86781522b6 Allow state visibility for once-joined users when history_visibility=shared.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-05 05:45:41 +00:00
Jason Volk 4b49aaad53 Fix spec compliance limiting /joined_rooms to current members only.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-05 05:45:41 +00:00
Jason Volk 3a78ba2b16 Support v1/v2 conditions for join/leave, creation and other operations. (#12)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-05 05:45:41 +00:00
Jason Volk 685946faed Cleanup validate/verify suite room version related; optimize event_id insert. (#12)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-05 05:45:41 +00:00
Jason Volk 13c9385ef7 Add v1/v2 support to gen_event_id() scheme. (#12)
Add v1/v2 and improve reference and content hashing suite. (#12)

Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-05 05:45:41 +00:00
Jason Volk 6a583a359e Support v1/v2 prev_events/auth_events outgoing federation format. (#12)
Support v1/v2 prev_events/auth_events when handling outlier pdu. (#12)

Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-05 05:45:41 +00:00
Jason Volk eec6e45358 Improve error messages for missing auth event and invalid join validations.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-05 05:45:41 +00:00
Alexandru ScvorțovandJason Volk 804257eb52 Fix broken doctest in src/core/utils/debug.rs 2025-09-04 22:21:14 +00:00
Jason Volk a1677f05d3 Bump 1.4.1
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-02 09:43:50 +00:00
Jason Volk 1f77200299 Mark MSC4297 compliance as flake.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-02 06:29:40 +00:00
Jason Volk 888b93df91 Fix /joined_members results. (regression a3666fe672) (fixes #147)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-02 05:34:37 +00:00
Jason Volk a127724eaa Bump 1.4.0
Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-01 11:34:08 +00:00
Jason Volk 00102c4276 ci: Skip unnecessary amd64 -v2 and -v3 builds in test-profile mode.
docker: Use env override for git_checkout.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-09-01 02:33:00 +00:00
dasha_uwu b59af0530c Deprioritize joins through configured servers 2025-08-31 12:30:27 +05:00
dasha_uwu 44af849ed0 Dedup base join servers 2025-08-31 11:30:10 +05:00
Jason Volk 26e7a8e962 Bump 1.4.0 Preview
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-30 20:27:39 +00:00
Jason Volk aa413ae601 Implement room purge after last local user leaves. (resolves #83)
Consume a state_lock for room delete call.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-30 11:45:32 +00:00
Jason Volk 7c19d1e1ff Fix unnecessary backfill requests after reaching m.room.create.
Cleanup condition.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-30 11:45:32 +00:00
Jason Volk 616f20f273 Fix unused lifetims.
Fix unused pub(crate).

Allow implicit hasher.

Fix unused self.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-30 11:13:14 +00:00
Jason Volk 91efcf8a8e Bump and unpatch tracing-subscriber.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-30 10:51:55 +00:00
Jason Volk 8708e98478 ci: Tweak docker cache sizes.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-30 10:16:43 +00:00
Jason Volk 4bdc260015 Update the troubleshooting for easier rocksdb recovery/repair.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-30 10:16:43 +00:00
Jason Volk 7bc47e58d0 Add state_cache iteration for local pending invitees to room.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-30 10:04:24 +00:00
Jason Volk 6172b9c8ec Replace legacy federation proto-event formatter.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-30 10:04:24 +00:00
k0tlin 9dc16eeab7 Adjust generic docs
Match readme instruction with doc
2025-08-30 00:45:41 +03:00
k0tlin 402f7a2157 Update example caddy config 2025-08-30 00:35:38 +03:00
Jason Volk 9c6e0e3350 Stabilize room version 12. (#126)
Bless complement.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-29 07:49:36 +00:00
Jason Volk 12bdfe3b66 Optimize backfill_if_required conditions.
Optimize backfill_pdu.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-29 06:49:04 +00:00
dasha_uwuandJason Volk 54ce221e88 Add active request assert on tls listener shutdown 2025-08-29 06:49:04 +00:00
dasha_uwuandJason Volk 33a16f4831 Make /sync respond early on server shutdown 2025-08-29 06:49:04 +00:00
Jason Volk d8e6d95f4b Fix device verification crutch (regression 628597c318); cleanup. (fixes #134)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-29 06:49:04 +00:00
Jason Volk 9c290bc513 Fix latest key backup determination.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-29 06:49:04 +00:00
Jason Volk a4520424bd Adjust several log levels; cleanup unformatted log call.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-29 06:49:04 +00:00
Jason Volk 280d7733fc Update capability for MSC4133 profile fields.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-29 06:49:04 +00:00
Jason Volk 79e3c898ac Fix /send_join response event format. Optimize.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-29 06:49:04 +00:00
Jason Volk 757d38e891 Optimize expected auth types checking.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-29 06:49:04 +00:00
Jason Volk 4b66911886 Eliminate redundant duplicate auth and matching room check.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-29 06:49:04 +00:00
Jade EllisandJason Volk 9db3e35f41 Fix incorrect command descriptions. [ci skip] 2025-08-29 02:17:46 +00:00
Jason Volk 7977512d5d Fix additional cases for room_id.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-29 02:17:46 +00:00
Jason Volk e354be6830 Simplify Pdu from_id_val constructions.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-29 02:17:46 +00:00
Jason Volk f58081838e Log error for send_join auth_check failure.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-29 02:17:46 +00:00
dasha_uwuandJason Volk 526a138021 Force promotion (closes #136) 2025-08-29 02:17:46 +00:00
dasha_uwuandJason Volk 7fa6894334 Remove excessive doc on admin command 2025-08-29 02:17:46 +00:00
dasha_uwuandJason Volk 33d0ad1be2 Remove dead link in readme 2025-08-29 02:17:46 +00:00
Jason Volkanddasha_uwu fbc3892904 ci: Disable lychee for now due to excessive build time issue during install.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-28 23:28:20 +05:00
Jason Volkanddasha_uwu ce6212b161 Add room_version argument and reorg convert_outgoing_federation_event.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-28 23:28:20 +05:00
Jason Volkanddasha_uwu 0aea56f02a Optimize OnceServices; simplify init.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-28 23:28:20 +05:00
dasha_uwu d05d3f710f Room deletion (fixes #43) 2025-08-28 23:28:20 +05:00
Jason Volkanddasha_uwu 7a3496869b Remove associated pushers on device delete. (fixes #120)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-28 23:28:20 +05:00
dasha_uwu 146b72265d Skip serialization for appservice id 2025-08-28 23:28:20 +05:00
dasha_uwu 120a43cceb Fix joining restricted rooms with invite 2025-08-28 23:28:20 +05:00
dasha_uwu c40671bfb0 Remove api crate dependency from admin crate 2025-08-28 23:28:20 +05:00
dasha_uwu 8e9c6661b2 Membership refactor
Introduce deactivate, membership services

Move membership and user deactivation functions from api crate into those services
2025-08-28 23:28:20 +05:00
dasha_uwu 6810604629 banned_room_check: pull out common part 2025-08-28 23:28:20 +05:00
dasha_uwu 3dd984eff9 clippy: add must_use attribute 2025-08-28 23:28:20 +05:00
dasha_uwu bcd4f80149 Move server user presence handling to presence service 2025-08-28 23:28:20 +05:00
dasha_uwu f51a7b12b5 Make Service.interrupt async 2025-08-28 23:28:20 +05:00
dasha_uwu 3a1649bcaf Add config option for creating admin room non-federated (closes #118) 2025-08-28 23:28:20 +05:00
dasha_uwu d4421422b2 Remove explicit unstable thirdparty/protocols route
Already handled by the other ruma route
2025-08-28 23:28:20 +05:00
dasha_uwu 4884c55be7 Split disable_room, ban_room functions 2025-08-28 23:28:13 +05:00
Jason Volkanddasha_uwu a4f589f475 Remove unnecessary recursion_limit.
Reduce type_length_limits.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-28 23:20:44 +05:00
dasha_uwu b5890b9664 Services refactor
Replace structs of Dep<Service> with OnceServices, so each service has a Services reference

Remove service name => Service map

Flatten Services.rooms

Make reqwest Clients lazy initialized (client service)
2025-08-28 23:15:59 +05:00
Jason Volk 26b3a84b88 Fix updated serde type expected by database deserialize_any.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-27 00:41:13 +00:00
Jason Volk 3430d4ac86 Improved solution to current_shortstatehash > next_batch. (59b62b1)
`current_shortstatehash` is now calculated from timeline which is already
upper-bound by the `next_batch` snapshot. Previously `current_shortstatehash`
was truly current and had to be disallowed from exceeding `next_batch` by
ignoring the room during sync until a future pass when these values finally
met that condition.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-27 00:41:12 +00:00
Jason Volk 3e2f2fbffa Bump Ruma post-hydra.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-27 00:41:12 +00:00
Jason Volk 74deb14ca0 Bump Complement post-hydra.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-27 00:41:12 +00:00
Jason Volk acd930b9ca Replace clippy::string_to_string with clippy::implicit_clone
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-26 08:49:26 +00:00
Jason Volk e2db2029c5 Add note directing users to docker deployment docs.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-26 02:40:25 +00:00
Jason Volk 4bb83a1972 Fix version 12 outgoing federation format.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-26 02:40:25 +00:00
Jason Volk 751aa27859 Bump dependencies for yanked slab.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-14 02:25:54 +00:00
Jason Volk 628597c318 State-reset and security mitigations.
Upgrade Ruma to present.

The following are intentionally benign for activation in a later commit:

- Hydra backports not default.
- Room version 12 not default.
- Room version 12 not listed as stable.

Do not enable them manually or you can brick your database.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-11 18:45:28 +00:00
Jason Volk 2c6dd78502 Reduce log level on router::args returned error.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-11 11:32:53 +00:00
Jason Volk cdb0e31b21 Allow clippy::default_trait_access.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-11 11:32:53 +00:00
dasha_uwuandJason Volk 6a6f77a100 Simplify feature condition.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-11 10:24:40 +00:00
Jason Volk a3666fe672 Use member profile rather than global profile for joined_members (fixes #121)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-10 23:52:03 +00:00
Jason Volk 0c8df52d18 Bump dependencies.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-07 04:52:46 +00:00
Jason Volk d7e5c0ccf3 Optimize spaces pageload; pipeline outer loop.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-07 03:16:32 +00:00
Jason Volk e106e50ed0 Update the since token to skip empty range from prior iteration.
Log and discard presence ping errors without preventing sync.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-06 08:06:39 +00:00
Jason Volk 00f11a9e8f Additional instrumentation around global counter events. 2025-08-06 06:45:43 +00:00
Jason Volk bf48c7b1b4 Move active and finished request counters out of span field.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-06 00:11:26 +00:00
Jason Volk 8a8a5d598e Fix sync loop watcher ABA.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-05 10:51:56 +00:00
Jason Volk fa84a7e6c2 Bump 1.3.0
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-05 07:02:31 +00:00
Jason Volk 2bdeca0ed3 ci: Fix missing condition for Push Branch. (#103)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-05 07:02:31 +00:00
Jason Volk c337ea1864 Fixes for sync v3 protocol compliance.
Add sync v3 filter support.

Fix events duplicated between state and timeline; cleanup some lets.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-04 18:55:37 +00:00
Jason Volk b00361d274 Add specific shorteventid to shortstatehash query function.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-04 18:55:37 +00:00
Jason Volk fb17aa19bf Add configs for creating the admin room and granting first user.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-04 18:55:37 +00:00
Jason Volk fc28e8e1dd Update flakes list; unflake several packages as fail.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-04 18:55:37 +00:00
Jason Volk cea25c6580 docker: Make the complement defaults more accessible.
commit newly uncovered tests.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-04 05:13:06 +00:00
Jason Volk a0dc37e024 Fetch prev_events concurrently.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-04 05:13:06 +00:00
Jason Volk 003257693b Fetch outlier and auth chains concurrently.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-04 00:48:30 +00:00
Jason Volk bc898efcce Uncomment generated-config's global section header, comment all others. (#116)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-03 21:55:36 +00:00
Jason Volk fa8ad1d629 Update the router log truncator for new axum syntax.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-03 00:53:53 +00:00
Jason Volk 44b60050b3 Reorder auth match cases; add todo for AppserviceTokenOptional.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-02 22:02:26 +00:00
Jason Volk 4b84e7c31a Flatten and dedup append_incoming branch in upgrade_outlier.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-02 18:00:20 +00:00
Jason Volk 4237f21903 Renames for several event_handler service files, fn's and args.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-02 18:00:20 +00:00
Jason Volk 4ac61fd87b Remove federation_handletime for now.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-02 18:00:20 +00:00
Jason Volk d217927000 Split fetch_outlier; abstract backoff stanzas into fn.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-02 18:00:20 +00:00
Jason Volk 4b9b85f671 ABI encapsulations; generate leaf code in pub fn's rather than inling them.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-02 18:00:20 +00:00
Jason Volk fa3b72947a Eliminate rooms outlier service, duplicate subset of timeline service.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-02 18:00:20 +00:00
Jason Volk 5d963abda6 Combine rooms timeline service data unit into mod; eliminate wrappers.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-02 18:00:20 +00:00
ObiomaAtWanaguandJason Volk a91380ac17 Change from the error 'No more rooms.' to the output 'No rooms are published.' if there are no rooms.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-02 18:00:20 +00:00
Jason Volk 1664a2c225 Implement refresh-tokens. (resolves #50)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-01 09:14:58 +00:00
Jason Volk 0d7eeb7766 Extend the append count guards over subsequent operations.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-01 09:14:58 +00:00
Jason Volk 16447f7383 Handle defaulting trailing elements in truncated database records.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-01 05:30:40 +00:00
Jason Volk 3612b04890 Add timepoint_from_epoch to time utils.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-08-01 03:40:27 +00:00
Jason Volk e6f1b98d6a Improve tracing of request error responses.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-31 14:31:28 +00:00
Jason Volk 6742e1d206 Sort misc cargo list entries, database maps.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-31 07:02:59 +00:00
Jason Volk dc0976a2e5 Respond with 403 instead of 404 for non-existing user.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-31 07:02:59 +00:00
Jason Volk f3f23ee7ee Fix missing counter retirements (51931de94c).
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-30 23:34:21 +00:00
Jason Volk 0b15ab2006 Ensure unwind safety in dispatch sequence.
Ensure await safety/efficiency in retirement sequence.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-30 23:34:21 +00:00
Jason Volk bd0c3e33e2 Loop syncv3 for robust response without re-request overhead.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-30 23:34:21 +00:00
Jason Volk 1bb16c8b73 Additional span logging of counter state; trace logging of contents.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-30 23:34:21 +00:00
Jason Volk 59b62b1453 Fix partial v3 syncs on post-timeout pass; fix partial state on room join.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-30 23:34:21 +00:00
Jason Volk 2e0b156de0 Fix missing user account data sync watcher.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-30 19:28:16 +00:00
Jason Volk 3593b8ebf7 Implement Debug for RawPduId.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-30 19:09:46 +00:00
Jason Volk 80015a6a30 Fix missed rustfmt let due to comment in chain.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-30 19:09:46 +00:00
Jason Volk 95e49d3cb8 Fix map_or calling function.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-30 19:09:46 +00:00
Jason Volk 25164e030d Hide own user from user directory search results.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-30 19:09:46 +00:00
Jason Volk f04924d6be docker: Extract complement logs on failure.
docker: Sort config options used during complement.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-29 14:34:42 +00:00
Jason Volk df7cd58618 Support matching room_id as publicrooms search term.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-29 04:18:21 +00:00
Jason Volk bf12e05dae Add meta iteration for public rooms.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-29 04:18:21 +00:00
Jason Volk e53366a492 Fix missing sync watcher not added for knocking feature.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-29 04:18:21 +00:00
Jason Volk ce25d79e66 Flatten authorised-join check queries.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-29 04:18:21 +00:00
Jason Volk 71ef093edc Unbox and pin various either-or futures.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-29 04:18:21 +00:00
Jason Volk 066097a83d Optimize user and appservice token queries.
Split/cleanup api::router auth delegator.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-29 04:18:20 +00:00
Jason Volk 1c24ed09fa Fix misuse of try_select in logical-or future util.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-29 04:18:20 +00:00
Jason Volk d3dbe09380 Add SystemTimeError to core error enum.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-27 13:09:30 +00:00
Jason Volk e9d0baa32e Add granular timeout configs for sync longpolling.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-27 11:34:15 +00:00
Jason Volk 7dd10ebc6c docs: Add note to configuration doc.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-27 11:03:12 +00:00
Jason Volk 29ac62ec27 Fix zero since-token value not used as initial sync condition.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-27 11:03:12 +00:00
Jason Volk 8c8985e8f2 Add user_id to v3 sync span; add span for sync token association.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-27 11:03:12 +00:00
Jason Volk 730920b571 Collect v5 typing events concurrent with other extensions.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-27 07:04:10 +00:00
Jason Volk 66334bdd53 Move syncv3 typings event for user.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-27 07:04:10 +00:00
Jason Volk 6b7bf80de5 Disable legacy media request fallbacks by default.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-27 07:04:09 +00:00
Jason Volk 4c35bfbda4 Fix M_UNKNOWN error which should be M_BAD_ALIAS.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-26 07:29:30 +00:00
Jason Volk ba51748ad3 Add missing upper-bounded calls; improve snake-sync windowing.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-26 05:52:30 +00:00
Jason Volk 63dfe8f7e3 Add upper-bound for presence_since().
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-26 05:36:19 +00:00
Jason Volk c6836e51b2 Add upper-bound to readreceipts_since() and callsites.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-26 04:44:09 +00:00
Jason Volk 33a9fce828 dedup room directory banned server check.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-26 02:26:09 +00:00
Jason Volk 267fd4de5b Enable additional complement parallel tests.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-25 22:52:29 +00:00
Jason Volk ce30f83052 Optimize sync watchers and key serializations.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-25 21:55:37 +00:00
Jason Volk e09a2c0e0f Window sync ranges below any partially completed writes.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-25 21:55:37 +00:00
Jason Volk 992abfab8f Separate cached body from request body in snake-sync; cleanup.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-25 21:55:37 +00:00
Jason Volk 51931de94c Add release-sequence for counter retirements.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-25 21:55:37 +00:00
Jason Volk 85a84f93c7 Fix misinterpretation of filter.room.include_leave in sync v3.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-25 21:55:37 +00:00
Jason Volk e58ef326d4 Refactor legacy database watcher system.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-25 20:07:21 +00:00
Jason Volk 0d439188e8 Fix sequence windowing for sync v3 invite/leave/knock rooms.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-25 20:07:21 +00:00
Jason Volk 22ef704ac6 Fix bug from roomuserid_knockedcount vs. roomid_knockedcount.
The use of "count" instead of "sequence" leads to confusion with
i.e. counting the elements of a set e.g. Iterator::count().

Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-25 20:07:21 +00:00
Jason Volk 7bdd4065c8 Split database::Map put/del from insert.rs and remove.rs
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-25 20:07:18 +00:00
Jason Volk 0fcb072239 Refactor counter increment sites for TwoPhaseCounter.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-25 10:32:52 +00:00
Jason Volk 05bb1f4ac7 Add TwoPhaseCounter to core utils.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-25 10:32:52 +00:00
Jason Volk 89e3a8c182 Add common editor temps to gitignore.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-25 10:32:52 +00:00
Jason Volk f0576f8d7d Remove unused deprecated sliding sync service code.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 23:13:01 +00:00
Jason Volk 11f77defc7 Handle AuthData::FallbackAcknowledgement; mute error for now.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 23:13:01 +00:00
Jason Volk 23c75855ba Split api/client/register from api/client/account suite.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 23:13:01 +00:00
Jason Volk 5253a8d36a Inline and apply must_use to remaining services globals wrappers.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 22:31:11 +00:00
Jason Volk c9adee86f5 Unify calculate_state_changes in syncv3
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 22:17:30 +00:00
Jason Volk 3c47516c85 Pipeline private read receipt fetch; cleanup tuples syncv3.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 22:17:30 +00:00
Jason Volk 299d3230a1 Optimize typing event collection.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 22:17:30 +00:00
9ea8fbc482 Add typing indicators to sync v5.
Co-authored-by: Jade Ellis <jade@ellis.link>
2025-07-24 22:17:30 +00:00
Jason Volk f7877d122b List #tuwunel:matrix.org; simplify readme.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:28 +00:00
Jason Volk 17119670c0 Add admin debug command to manually resync with primary. (#35)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:28 +00:00
Jason Volk 535fcab4b5 ci: Create multi-arch manifest for each release tag (fixes #103).
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:28 +00:00
Jason Volk cbe34affa3 Add unique id counter to request tracing span. (fixes #112)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:28 +00:00
Jason Volk ed0b3c764e Parallelize state_at_incoming sstatehash/prev_event fetches.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:28 +00:00
Jason Volk 190269f616 Simplify Pdu Hashes struct.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:28 +00:00
Jason Volk 3ea8c82ef0 Follow-up to admin channel change (7d2d42542c).
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:28 +00:00
Jason Volk 2a627baa96 Fix excessive nesting.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:27 +00:00
Jason Volk 50de6277b8 Split/cleanup backfill stream stanza.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:27 +00:00
Jason Volk 4429323e11 Flatten threads_until().
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:27 +00:00
Jason Volk 18f8d6c65c Rebox future segmentations.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:27 +00:00
Jason Volk aac49b09c7 Improve mutable state in sender closure captures.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:27 +00:00
Jason Volk c8d35cca57 Refactor to async closures.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:27 +00:00
Jason Volk cca0f20148 Replace several expects with error coercions.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:27 +00:00
Jason Volk 23d188f612 Spacing/formatting adjustments.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:27 +00:00
Jason Volk ae707ab465 Simplify default Result generics.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:27 +00:00
Jason Volk 8244d78cb2 Make Event trait Send+Sync.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:27 +00:00
Jason Volk b0315da3d7 Fix branches sharing code.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:27 +00:00
Jason Volk eca01cfb3f Fix useless if let seq.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:27 +00:00
Jason Volk cf13f5afc1 Allow clippy::map_unwrap_or.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:27 +00:00
Jason Volk c944f1124a Additional BoolExt utils.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:27 +00:00
Jason Volk 70fc95e800 Fix same generic used for separate closures in BoolExt.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:27 +00:00
Jason Volk 507bd1edc7 Update complement; mask new tests.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-24 04:07:27 +00:00
coolGiandJason Volk ee0e594aef Fixed nix cached shasum for rust-toolchain.toml 2025-07-21 21:05:36 -07:00
ObiomaAtWanaguandJason Volk fd080914c2 Enhanced docu for configuration
Include that more than one config file can be named.
Describe the relevance of ordering for setting the value.
2025-07-09 20:38:27 +00:00
dasha_uwuandJason Volk 9dd2b28605 Add base64 output for admin query command.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-08 23:49:18 +00:00
Jade EllisandJason Volk 34abe1cce4 fix: Allow joining via invite for knock_restricted rooms 2025-07-08 23:38:18 +00:00
Tyler MayoffandJason Volk a340e6786d use room names first and only fallback to heroes if not available 2025-07-07 07:36:51 +00:00
June StrawberryandJason Volk c37ee97351 allow nightly unstable_name_collisions lint due to BoolExt conflict
Signed-off-by: June Strawberry <june@basednetworking.com>
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-07 07:36:51 +00:00
Jason Volk 7d2d42542c Simplify admin channel type.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-07 07:09:49 +00:00
Jason Volk fd0082fd2c Add ready_try_skip_while() to stream utils.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-07 07:09:49 +00:00
Jason Volk ca8f3ae057 Add gitignores for -Zself-profile output.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-07 07:09:49 +00:00
Jason Volk 8a748e02df Fix into_recv_seek lifetime flow to match into_recv_get.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-07 07:09:49 +00:00
Jason Volk 79ee7838e7 Rename elided_named_lifetimes to mismatched_lifetime_syntaxes.
Reapply is_multiple_of().

Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-07 07:09:49 +00:00
Jason Volk e9a441fb6e Bump tokio to 1.46
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-07 02:44:18 +00:00
Jason Volk 93f5557232 Bump rust to 1.88.0
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-07 02:23:25 +00:00
Jason Volk 3d88767977 Bump 1.2.0
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-04 02:00:07 +00:00
Jason Volk b68cff3b2f Fix clippy::manual-is-multiple-of.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-04 01:49:57 +00:00
Jason Volk 36c3845ff6 Comment section headers in generated example config. (fixes #96)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-04 00:31:09 +00:00
Jason Volk 7f1c7b964e Add missing display/default attributes to appservice example config.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-04 00:13:30 +00:00
Jason Volk 1cbcd3fc88 Add Result traits map_ref()/and_then_ref().
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-03 22:18:44 +00:00
Jason Volk ad9ddd91cd Add broad_find_map() to stream utils.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-03 22:18:44 +00:00
Jason Volk a2b4c07cf7 Additional internal pdu getters.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-07-03 22:18:44 +00:00
orhtej2andJason Volk 2ead282bec Dedup entries returned by LDAP 2025-06-29 04:02:41 +00:00
Jason Volk 9496d05cd2 ci: Pass package build condition as workflow arg.
ci: Add defaults for init matrix; branch conditions for pulls.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-29 04:02:41 +00:00
Jason Volk c8ab1713c3 Fix errant ldap3 dependency in src/core.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-29 04:02:41 +00:00
orhtej2 84acdccb93 Other typo 2025-06-29 01:20:02 +02:00
orhtej2 6164f62395 Fix optional admin config 2025-06-29 01:16:51 +02:00
Jason Volk b36ad9cfef docker: use OCI media types for registry images. (fixes #79)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-26 01:01:56 +00:00
Jason Volk d557f0f456 README: soften warning to tip. [ci skip]
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-26 01:01:56 +00:00
Jason Volk d858c5c1f4 docker: Add Instruction Set Architectures to build matrix.
ci: Publish multi-arch images for both branch and tag refs.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-25 17:21:55 +00:00
Jason Volk 972201da60 Add warning when listening=false. (fixes #81)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-25 01:04:18 +00:00
Jason Volk 56d9c9a8b5 Handle empty std::env::args() for FreeBSD. (fixes #75)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-25 01:04:18 +00:00
Jason Volk 84ce3e0d0e Change default emoji due to inconsistent support. (closes #80)
Move config item to more prominent location.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-25 01:04:18 +00:00
Jason Volk 578cf9d2d7 Fix missing lz4 and bz2; tweak feature projection. (closes #78)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-25 01:04:18 +00:00
Jason Volk ca69af97c1 docker: Re-relax cargo cache expectations. (#53)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-24 23:45:08 +00:00
Jason Volk ac26193ffe Check appservice registrations for unique as_token. (#72)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-20 18:08:19 +00:00
Jason Volk a84e559640 Implement declarative appservices. (closes #67)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-20 18:08:19 +00:00
Jason Volk 2e559a0d3e docker: Use zstd for all compressions.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-20 13:51:35 +00:00
Jason Volk 2634fed2d4 Tweak readme wording.
Fix actual typo.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-20 13:04:02 +00:00
Jason Volk 31a3676cd8 ci: Publish multi-arch manifest. (fixes #74)
ci: Toggle package install checks via vars.

docker: Disable provenance attestations which auto-generate manifests.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-20 10:52:35 +00:00
Jason Volk aa1609d611 Fix RELEASE notes formatting for GH.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-20 01:21:07 +00:00
Jason Volk 8e13f07d2a ci: Fix distro package generation for tags.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-19 13:05:49 +00:00
Jason Volk ab6da09c02 Bump 1.1.0
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-19 09:03:17 +00:00
Jason Volk 18b9d7bc1f Add org.matrix.login.jwt support.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-18 11:53:25 +00:00
Jason Volk b5dc933880 Additional epoch time convenience utils.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-18 09:50:22 +00:00
Jason Volk f68038a826 Restrict password login to accounts of type 'password' or legacy untyped.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-18 09:50:22 +00:00
Jason Volk b3a47566ff Move and rename 'token' to 'access_token' where applicable.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-18 01:02:22 +00:00
Jason Volk 61cbd38284 Fix unrecognized prof_active jemalloc_conf on aarch64.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-18 01:02:22 +00:00
Jason Volk 6cc251796e ci: Remove unnecessary/unused condition.
docker: Fix readme typo; link.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-17 22:05:07 +00:00
Jason Volk 7e8c4c8883 Fix password reset regression. (78a02edbbf) (fixes #70)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-17 03:41:27 +00:00
Jason Volk 73c179b20a docker: Adjust rpm and deb packaging for multi-platform.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-17 03:41:27 +00:00
Jason Volk cd8648dce5 Auth related cleanups.
Cleanup; additional error macros.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-17 03:41:27 +00:00
Jason Volk 83ceda808c ci: Add multi-runner/multi-arch to matrices. (closes #55)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-17 03:41:27 +00:00
Jason Volk fc3fcf4526 docker: Determine nproc for darwin. (closes #52)
docker: Further separate apt and rust cache mounts.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-17 00:22:50 +00:00
Jason Volk f4e6807a3c Fix hard-coded well-known IP address.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-16 22:43:47 +00:00
Jason Volk 13e0113587 Fix nightly coerce-container-to-any.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-16 22:43:47 +00:00
Jason Volk 51778b9354 ci: Remove the deps workflow.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-16 04:25:58 +00:00
Jason Volk 8fef40a37e docker: Add assertion for dynamic or static executable upon install.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-16 04:25:58 +00:00
Jason Volk ee6524b803 docker: Fix erroneous sys_ variable names. (#52)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-16 04:25:53 +00:00
Jason Volk 1645518859 Add link to nixpkgs request. [ci skip]
docker: Add apt command for getting-started section. [ci skip]
2025-06-15 02:36:07 +00:00
Jason Volk 6088d0e295 Update nix flake. (closes #64)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-14 23:28:54 +00:00
Jason Volk 5a717266b8 Add new sentry endpoint. (closes #66)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-14 22:48:49 +00:00
Wojciech KordalskiandJason Volk f2c5314296 Fix building RocksDB on Nix 2025-06-14 22:48:49 +00:00
Jason Volk 814d3b903e Update NixOS related. [ci skip]
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-14 22:48:49 +00:00
Jason Volk a114ab3ab6 Fix use of inherent_str_constructors (#64 #65)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-14 22:18:21 +00:00
Jason Volk b01c5d5ef1 docker: Use specific msrv for stable toolchain.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-14 22:10:00 +00:00
Jason Volk 21c0e4176b Add security disclosure policy. [ci skip]
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-14 09:52:30 +00:00
Jason Volk f1f31eff17 Detailed version string. (closes #62)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-13 01:27:28 +00:00
Jason Volk b0b441d534 Add macro to get rustc version. (#62)
Add macro to query git-describe. (#62)

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-13 01:27:28 +00:00
Jason Volk 5799059196 Abstract get_crate_name() into macro utils. 2025-06-12 21:31:44 +00:00
Jason Volk 026d756ef4 Adjust SmallVec buffer sizes to account for overhead.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-12 11:08:29 +00:00
Jason Volk 37afdb0e90 docker: Fix typo. [ci skip]
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-12 02:39:02 +00:00
Jason Volk 2a2486182a Split login case bodies into handlers.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-11 01:21:11 +00:00
Jason Volk 3056b60159 Bundle systemd service and post-install script for RPM package. (#59 #60)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-11 01:21:11 +00:00
Jason Volk 000b876dcb Updates for Arch package related.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-11 00:50:49 +00:00
Jason Volk fcd51ef30e docker: Simplify target names for distro packages.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-11 00:50:49 +00:00
Jason Volk 7edbe11eb8 docker: Dedup cargo and chef dockerfiles.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-10 20:32:58 +00:00
Jason Volk 0f256d7191 Split api::client::session into units.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-08 20:02:53 +00:00
Jason Volk 72c231c613 Bump various additional dependencies.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-08 19:34:21 +00:00
Jason Volk 66b36563b6 docker: Reformat cargo build rustflags.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-08 09:22:43 +00:00
Jason Volk e6d782c701 Bump rocksdb.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-08 06:03:23 +00:00
Jason Volk f63cc84c98 Bump opentelemetry.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-08 03:39:24 +00:00
Jason Volk 83fe14c522 Bump core_affinity.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-08 03:08:57 +00:00
Jason Volk 46ce426b87 Bump rebased rustyline-async.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-08 03:08:57 +00:00
9a975c0304 chore: Migrate to axum 0.8
Co-authored-by: dasha_uwu
Co-authored-by: Jason Volk <jason@zemos.net>
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-08 03:08:57 +00:00
Jason Volk dc8bab9bcd Disable tokio-console for Axum dependency conflicts.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-08 03:08:57 +00:00
Jason Volk ceb0f8f933 Bump trivial dependencies; rebase hyper-util.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-08 03:08:57 +00:00
Jason Volk 53f2ea8e58 ci: Rename NEWS.md to RELEASE.md.
ci: Build fewer packages in non-main branch.

ci: Add lint phase for rust-check.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-08 03:08:57 +00:00
Jason Volk 8a83c23537 Split tuwunel_service::users into units.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-06 22:41:01 +00:00
Jason Volk b0048fec6d Add target platform to artifact names.
Use better gzip input name which is preserved by metadata.

Add chmod for input file and use for executables.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-06 19:27:18 +00:00
Jason Volk 9bad2fa1eb ci: Use fatter layer caching; make script output consistent.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-06 19:27:18 +00:00
Jason Volk 06f37e9e8a Use all-features for special-tag preview and latest images.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-06 17:03:23 +00:00
Jason Volk 73884a21ed Tuwunel One
(closes #10)

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-06 15:33:12 +00:00
Jason Volk 78410304b8 ci: Upload release assets. (closes #54)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-06 14:22:26 +00:00
Jason Volk 33db10141d ci: Conditions for version tag event.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-06 09:46:19 +00:00
Jason Volk 5a58c623e1 ci: Smoketest valgrind.
docker: Dedup complement-tester-valgrind.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-06 07:20:27 +00:00
Jason Volk 73a690430e docker: Fix rebuilding for image targets.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-06 06:58:42 +00:00
Jason Volk 936893e6c6 Conditions for special tags published to container registries.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-06 02:33:10 +00:00
Jason Volk 7e55f8b3d7 Update README.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-06 02:33:10 +00:00
Jason Volk 2b77f2c435 ci: Deploy pages.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-06 02:10:04 +00:00
Jason Volk 499991e530 Rename build profile release-max-perf to release-native.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-06 02:10:04 +00:00
Jason Volk 0aa7285233 Mark TestRoomState/Parallel/GET_/publicRooms_lists_newly-created_room as flake
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-05 13:30:35 +00:00
Jason Volk 43107de57b docker: Allow leaf stages to replenish caches after evictions. (closes #53)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-05 12:50:09 +00:00
Jason Volk ea802c7ec4 docker: Refactor feat_set out of base layers.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-05 12:50:09 +00:00
Jason Volk d7ae49101a docker: Default no flags for fallback condition.
docker: Fix/cleanup environment profile overrides.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-05 12:37:19 +00:00
Jason Volk e332d395f9 ci: Add oci image to pipeline.
ci: Tweak package targets; elim max-perf for containers.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-05 12:37:19 +00:00
Jason Volk c9a6f97174 ci: Upload artifact from runner workdir.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-05 12:37:19 +00:00
Jason Volk 8ce0ab5bf7 ci: Add release-debuginfo to pipeline.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-04 03:44:21 +00:00
Jason Volk 8f2517c97f docker: Cache builds for target-hashed subdirs.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-04 03:44:21 +00:00
Jason Volk 55c35fc840 docker: Simplify build/install; dedup cargo commands; enable gc.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-04 03:44:21 +00:00
Jason Volk 71748c3db9 docker: Tweak cargo build verbosities.
docker: Fix unused instructions; format/tabs.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-03 06:03:41 +00:00
everypizza1andJason Volk cb0a624f85 feat: Add sample file for Podman systemd. 2025-06-02 16:55:16 +00:00
Jason Volk e9f27bbee5 docker: Add mdbook to pipeline.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-02 16:14:44 +00:00
Jason Volk a09f63a13f Mark TestThreadReceiptsInSyncMSC4102 as parallel flake.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-02 16:14:44 +00:00
Jason Volk d290bcbca9 docker: Increase caching; explicit serialization to force convergence.
docker: Adjust profile overrides

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-02 16:14:44 +00:00
Jason Volk 1a6cfe72b9 ci: Prevent cancellation on push to branch.
ci: Use wildcard to preserve any artifact directory structure. (970cea5c2b)

ci: Mask out debug smoketest on toolchain stable

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-02 16:14:44 +00:00
Jason Volk d06ad8d788 docker: Fix standalone entrypoint.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-02 06:43:26 +00:00
Jason Volk d4d3ebe40b docker: Add options for compression level.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-02 03:49:02 +00:00
Jason Volk 379f3eea25 docker: Partially fix dirtied package checks.
docker: Move standalone target closer to test tree.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-02 03:49:02 +00:00
Jason Volk 9507ce9d03 docker: Fix target mount cache paths; relax locks on cargo home.
docker: Persist lychee cache.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-02 02:49:14 +00:00
Jason Volk 8d8fcb588b Fix docs url.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-01 22:07:01 +00:00
Jason Volk 873cac5731 ci: Workaround multi-line if-condition github bug; cleanup.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-01 21:13:26 +00:00
Jason Volk 841253692d ci: Add artifact upload for baked images.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-01 20:16:53 +00:00
Jason Volk 970cea5c2b ci: zip artifact into eponymous directory.
ci: Fix condition to skip publish

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-01 00:55:13 +00:00
Jason Volk 05e7d4c6dd ci: Activate RPM artifact self-test. (closes #36)
Fix rpm /bin/sh requirement (centos 10)

Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-31 10:36:39 +00:00
Jason Volk 3c02faa532 docker: Share the target deps and build caches globally.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-31 10:36:39 +00:00
Jason Volk c1c4ce9679 docker: limit types of unit tests on stable toolchain.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-31 10:36:39 +00:00
Jason Volk d3233ce8b6 docker: Add build-overrides for custom external rocksdb.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-31 10:36:39 +00:00
Jason Volk 2be61de70f docker: Reduce more copies.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-31 10:36:39 +00:00
Jason Volk 288c49c436 ci: Add argument for failing the underlying bake matrix slower.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-31 10:02:46 +00:00
Jason Volk 112e43d753 ci: build standalone for all feature-sets.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-31 10:02:46 +00:00
Jason Volk b86d414f28 docker: Propagate arguments into the image environment.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-31 10:02:46 +00:00
Jason Volk b7d26c0fbf ci: Consolidate base excludes; allow event inputs.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-31 08:16:21 +00:00
Jason Volk d992333f2e ci: Add some sanity conditions for skips; formatting
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-31 08:16:21 +00:00
Jason Volk a86bb8b8c7 Start a README in the github workflow directory.
Tweaks to docker readme.

Tweaks to main readme.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-31 08:16:21 +00:00
Jason Volk c30c370115 Add a README to the docker directory.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-29 20:16:06 +00:00
Jason Volk 8d209be5c4 ci: comment-out deps job (see github.com/orgs/community/discussions/18001)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-29 20:16:06 +00:00
Jason Volk 864ac84679 ci: Abstract artifact uploads for every bake target.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-29 20:16:06 +00:00
Jason Volk 87d258b83c ci: yaml formatting.
ci: Isolate builder by actor.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-29 20:16:06 +00:00
Jason Volk 2167335c57 Improve README formatting. [ci skip]
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-29 20:16:06 +00:00
Jason Volk b59277e5a9 docker: Fix a few too many copies (3ffc238799).
docker: Additional tweaks.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-29 18:46:11 +00:00
Jason Volk 47f7e33a28 docker: Cache shared target deps and build directories.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-29 18:46:11 +00:00
Jason Volk 640332c48f docker: Fix hardcoded docker directory path.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-29 18:45:53 +00:00
Jason Volk 4e0a7fdfa7 docker: fix rocksdb static linkage related options.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-29 18:45:53 +00:00
Jason Volk 484a9cb9d2 docker: Remove the bare-branch tag for now.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-29 18:45:53 +00:00
Jason Volk 4326b490a9 docker: Combine and simplify bench and test targets.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-29 18:45:53 +00:00
Jason Volk c6984afd7e Add upgrade guide to README (fixes #8)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-28 08:50:00 +00:00
Jason Volk 83b6042d54 Update README (fixes #28).
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-28 08:50:00 +00:00
Jason Volk d5df12fd5e Update additional docs and legacy references.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-28 08:50:00 +00:00
Jason Volk 2308bf3151 docker: Only publish :latest for tag refs
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-28 08:50:00 +00:00
Jason Volk 3ffc238799 docker: Further optimize multi-layered build.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-28 08:50:00 +00:00
Jason Volk 98bbf58121 Mitigate clippy::doc_link_with_quotes.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-28 00:03:41 +00:00
Jason Volk cbfc75101b docker: Optimize multi-layered build.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-22 08:03:28 +00:00
Jason Volk fb4c90931f Mitigate clippy::collapsible-if nightly vs stable.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-22 08:03:28 +00:00
Jason Volk 05627b67ac Fix clippy::unnecessary-unwrap.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-22 08:03:28 +00:00
Jason Volk 332d84b1ca docker: Build rocksdb native for release-max-perf.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-22 08:03:28 +00:00
Jason Volk 5d115ddd6f Fix clippy::missing-const-for-thread-local
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-14 13:06:38 +00:00
Jason Volk e248bb05d9 docker: use verbose build for ci.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-14 12:35:31 +00:00
RatCornuandJason Volk 71ebf1e71a feat: add admin support for LDAP login 2025-05-14 07:14:20 +00:00
Jason Volk 824b962b60 Add revoke_admin to service.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-14 07:14:20 +00:00
Jason Volk f9b7c1e0b9 Create ldap user only after successful login attempt.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-14 07:14:20 +00:00
Jason Volk f2a45d4408 ci: Supply defaults in initial job.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-14 07:14:20 +00:00
Jason Volk a60d26e478 Apply typos changes.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-14 05:39:44 +00:00
Jason Volk 6d926f0413 Add typos lint to workflow.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-14 05:39:44 +00:00
Jason Volk 2b67de9fc3 docker: Move rustup and cargo component lists into vars.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-14 05:39:44 +00:00
Jason Volk 0463b962fd Migrate additional names in src/
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-14 03:18:13 +00:00
Jason Volk 75e92a01c7 Mask TestLogin/parallel/.. as flake.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-14 02:43:52 +00:00
Jason Volk 9a1fdf390e complement feature vector; upload artifacts
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-14 02:43:52 +00:00
Jason Volk aa45bfe8d5 Revert "Mask complement failures."
This reverts commit c68d5c075f.
2025-05-14 02:41:02 +00:00
Jason Volk 69288fef30 Fix regression 75aadd5c6a
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-14 02:41:02 +00:00
Jason Volk 56df738a5a Update release-max-perf rustflags.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-13 20:15:47 +00:00
Jason Volk 020a7d318f Add release-debuginfo to pipeline.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 09:09:03 +00:00
Jason Volk 93eef724fc Split state_cache service.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk 94f74c66f2 Outdent state_compressor service.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk a479382974 Split timeline service.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk af7dfb31bc Abstract Pdu filter matching into trait Event.
Abstract Pdu unsigned accessors into trait Event.

Abstract Pdu relation related into trait Event.

Abstract PDU content into trait Event.

Move event_id utils from pdu to event.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk 222e89f6fe Post-formatting aesthetic and spacing corrections
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk 1b70ef5dea Split api/client/membership.rs into directory
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk 778fbfdcb5 Cleanup/improve other async queries in some client handlers.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk 57c519bbb8 Toward abstracting Pdu into trait Event.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk 28354db9df Dedup and parallelize current key backup count and etag fetching.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk 72fd072026 Macroize various remaining Error constructions.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk 130f61d409 Simplify api to send notices to admin room
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk ea4eee4bae Use integrated error instead of panic on some legacy codepaths
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk a08dfb1402 Mitigate large futures
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk 6e6c84855c Remove sync/v4 to reduce maintenance/refactor burden.
Thank you for serving us well 🫡

Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk c59037cd75 Disable legacy media now by default.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason VolkandJacob Taylor 258e2e3ce8 Remove deprecated _matrix._tcp SRV query.
Co-authored-by: Jacob Taylor <jacob@explodie.org>
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
8386cbbb96 Don't serialize the x-key before storing it
Co-authored-by: dasha <admin@dimensionproject.net>
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jade EllisandJason Volk 10e63c5153 fix: Do not panic on invalid membership event content
Co-authored-by: Jason Volk <jason@zemos.net>
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
c7cabae867 fix: Do not panic when sender_device is None in /messages route
The device ID is not always present when the appservice is the client.
This was causing 500 errors for some users, as appservices can lazy
load from `/messages`.

Co-authored-by: Jade Ellis <jade@ellis.link>
Co-authored-by: Jason Volk <jason@zemos.net>
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk 0f7c1543ce Support optional device_id's in lazy-loading context.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk ea42606b4b Modernize various sender_user/sender_device lets.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk b1998dec9a Eliminate associated Id type from trait Event.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk 30c6ea4e64 Eliminate explicit parallel_fetches argument.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk 2ac94d9ce7 Remove unused Pdu::into_any_event().
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk b01423040d Join jemalloc background threads prior to exit.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk 4430f71bfd Add conditions to skip container publish
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-11 07:02:14 +00:00
Jason Volk df55b42d29 Add publish to pipeline.
Update deployment docs.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-10 21:39:38 +00:00
Jason Volk c68d5c075f Mask complement failures.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-10 04:28:49 +00:00
Jason Volk aa27ab855b Add rpm package to workflow.
Improve workflows.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-09 22:26:47 +00:00
Jason Volk 8bfe63d45f Add package workflow.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-09 22:26:47 +00:00
Jason Volk de1e37f5ae docs: Update deploying/docker
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-09 22:26:47 +00:00
Jason Volk 481b67f1f9 Combine Base and Deps workflows.
Add workflow arguments for verbosity.

Add missing ldap to full features.

Superpose --all-features as backstop for unlisted features.

Fix hardened_malloc requiring gcc

Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-07 23:03:46 +00:00
Jason Volk 09680fc86b Restore the bin/ contents under nix/ (for now) [ci skip]
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-07 23:03:46 +00:00
Jason Volk 98d16a2f6c Add cargo audit, lychee to workflow.
Rename / tweak some workflow jobs.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-03 00:16:28 +00:00
Jason Volk 77426c0d7a Update arch directory.
Update debian directory.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-03 00:16:28 +00:00
Jason Volk 58a0d92820 Update some docs.
Remove legacy docs CoC (the new one is in the root).

Remove legacy assets. (fixes #34)

Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-03 00:16:28 +00:00
Jason Volk 61649610ef Remove bin/ dir.
Remove github-ci for now.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-02 23:19:42 +00:00
Jason Volk 91f5107d3d Fork ldap3 for GHSA-4p46-pwfr-66x6; bump dependencies.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-02 03:00:39 +00:00
Jason Volk 3dde48f503 Add rustfmt check to workflow.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-01 13:05:38 +00:00
Jason Volk 268af403d6 Add rustdoc target to workflow.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-01 12:53:07 +00:00
Jason Volk a2940548bb Add defaults to complement script for easier local invoke.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-01 10:21:36 +00:00
Jason Volk 123f130a87 Docker Complement
Split and reorganize workflows

Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-01 09:30:26 +00:00
Jason VolkandNineko c5de46e3e1 Docker Bake Harness
Co-authored-by: Nineko <cnotsomark@gmail.com>
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-01 07:03:51 +00:00
Jason Volk d32bc5ed2a Fix lints.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-01 06:46:37 +00:00
Jason Volk 918af06eb1 remove legacy workflow
Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-01 06:03:43 +00:00
Jason Volk f242ebdb04 Fix LDAP configuration default semantics. (fixes #30)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-28 22:44:16 +00:00
Jason Volk 7665d47e59 Add feature-gate for ldap.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-28 07:23:57 +00:00
RatCornuandJason Volk 6160f90b8c Add direct bind support 2025-04-28 07:23:57 +00:00
Jason Volk c11c5e61c9 bypass emergency-password feature when ldap enabled
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-28 07:23:57 +00:00
RatCornuandJason Volk 448ac63a21 feat: add ldap config
feat: add LDAP login and user creation

feat: add diagnostic commands

Co-authored-by: Jason Volk <jason@zemos.net>
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-28 07:23:15 +00:00
RatCornuandJason Volk 78a02edbbf feat: add userid_origin field in the database 2025-04-24 11:52:59 +00:00
Jason Volk bc9cf85807 Add note about branch policy. [ci skip]
Fix contributing doc reference.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-24 02:24:23 +00:00
Jason Volk 5bcf3550ab attr_fn_like_width to 60
note the default is documented as 70 but this was not being honored by rustfmt

Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-24 02:00:00 +00:00
Jason Volk 76509830e6 chain_width to 50
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-22 04:42:34 +00:00
Jason Volk 9b658d86b2 Rename crates.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-22 04:37:49 +00:00
Peter GervaiandJason Volk 0024354345 Replace various contact data; dependency migration. (#25)
Co-authored-by: Jason Volk <jason@zemos.net>
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-22 02:32:18 +00:00
Jason Volk 793820a7f0 Fix formatting (937c5fc86a).
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-22 00:14:43 +00:00
Jacob TaylorandJason Volk eb2949d6d7 Fix spaces rooms list load error.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-16 20:58:48 -07:00
Jacob TaylorandJason Volk de7842b470 Fix spaces limit/max_depth bug in response.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-16 20:58:48 -07:00
Peter GervaiandJason Volk 937c5fc86a config: rocksdb_compaction help was inverted
probably old remnnant of an inverted option.
2025-04-15 08:09:21 -07:00
Jason Volk 79268bda1e Remove the default sentry endpoint.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-13 07:28:14 +00:00
Jason Volk edb245a2ba Remove the updates service.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-13 07:19:16 +00:00
Jason Volk ae2abab4c9 Remove some workflows.
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-13 07:18:26 +00:00
Jason Volk b9fd88b65a Update README [ci skip]
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-13 06:56:16 +00:00
Jason Volk 4094cd52ee reduce large stack frames 2025-04-13 05:13:00 +00:00
Jason Volk aa80e952d1 mitigate additional debuginfo expansions
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-13 05:13:00 +00:00
Jason Volk b0203818db add missing feature-projections between intra-workspace crates
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-13 05:13:00 +00:00
Jason Volk 1fd881bda5 eliminate Arc impl for trait Event
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-13 05:13:00 +00:00
Jason Volk 5b322561ce simplify database backup interface related
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-13 05:13:00 +00:00
Jason Volk 54fb48a983 replace admin command branches returning RoomMessageEventContent
rename admin Command back to Context

Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-13 05:13:00 +00:00
Jason Volk d82f00c31c misc async optimizations; macro reformatting
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-13 05:13:00 +00:00
Jason Volk cd4e6b61a9 improve appservice service async interfaces
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-13 05:13:00 +00:00
Jason Volk 04d7f7f626 remove box ids from admin room command arguments
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-13 05:13:00 +00:00
Jason Volk d9616c625d propagate better message from RustlsConfig load error. (#734)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-13 05:13:00 +00:00
Jason Volk 75aadd5c6a slightly optimize user directory search loop
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-13 05:13:00 +00:00
Jason Volk e0508958b7 increase snake sync asynchronicity
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-13 05:12:52 +00:00
Jason Volk ccf10c6b47 modest cleanup of snake sync service related
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-09 03:40:44 +00:00
Jason Volk fd33f9aa79 modernize state_res w/ stream extensions
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-09 03:40:44 +00:00
Jason Volk 7c9d3f7e07 add ReadyEq future extension
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-09 03:40:44 +00:00
Jason Volk 7cf61b5b7b add ready_find() stream extension
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-09 03:40:44 +00:00
Jason Volk ce6e5e48de relax Send requirement on some drier stream extensions
Signed-off-by: Jason Volk <jason@zemos.net>
2025-04-09 03:40:44 +00:00
767 changed files with 50582 additions and 45517 deletions
+2 -2
View File
@@ -1,2 +1,2 @@
[alias]
xtask = "run --package xtask --"
[env]
RUMA_UNSTABLE_EXHAUSTIVE_TYPES = "true"
+4 -4
View File
@@ -18,7 +18,7 @@ run () {
fi
}
conduwuit () {
tuwunel () {
UWU_OPTS=$@
rm -rf /tmp/uwu_smoketest.db
echo -e "[global]\nserver_name = \"localhost\"\ndatabase_path = \"/tmp/uwu_smoketest.db\"" > /tmp/uwu_smoketest.toml
@@ -38,8 +38,8 @@ element () {
run cargo "$TOOLCHAIN" build $ELEMENT_OPTS --all-targets
run cargo "$TOOLCHAIN" test $ELEMENT_OPTS --all-targets
run cargo "$TOOLCHAIN" bench $ELEMENT_OPTS --all-targets
run cargo "$TOOLCHAIN" run $ELEMENT_OPTS --bin conduwuit -- -V
run conduwuit "$TOOLCHAIN" run $ELEMENT_OPTS --bin conduwuit
run cargo "$TOOLCHAIN" run $ELEMENT_OPTS --bin tuwunel -- -V
run tuwunel "$TOOLCHAIN" run $ELEMENT_OPTS --bin tuwunel
fi
}
@@ -48,7 +48,7 @@ vector () {
VECTOR_OPTS=$@
element "$TOOLCHAIN" $VECTOR_OPTS --no-default-features
element "$TOOLCHAIN" $VECTOR_OPTS --features=default
element "$TOOLCHAIN" $VECTOR_OPTS --features full
element "$TOOLCHAIN" $VECTOR_OPTS --all-features
}
matrix () {
+10 -7
View File
@@ -1,5 +1,6 @@
# Local build and dev artifacts
target/
#tests
# Docker files
Dockerfile*
@@ -10,19 +11,21 @@ docker/
.idea
*.iml
.
# Git folder
# .git
.gitea
.gitlab
.github
.forgejo
#.git
#.gitea
#.gitlab
#.github
# Dot files
.env
.gitignore
#.gitignore
# Toml files
rustfmt.toml
#rustfmt.toml
# Documentation
#*.md
*.hcl
-8
View File
@@ -22,11 +22,3 @@ indent_size = 2
[*.rs]
indent_style = tab
max_line_length = 98
[*.yml]
indent_size = 2
indent_style = space
[*.json]
indent_size = 4
indent_style = space
+1 -3
View File
@@ -2,8 +2,6 @@
dotenv_if_exists
if [ -f /etc/os-release ] && grep -q '^ID=nixos' /etc/os-release; then
use flake ".#${DIRENV_DEVSHELL:-default}"
fi
use flake ".#${DIRENV_DEVSHELL:-default}"
PATH_add bin
@@ -1,110 +0,0 @@
name: create-manifest
description: |
Create and push a multi-platform Docker manifest from individual platform digests.
Handles downloading digests, creating manifest lists, and pushing to registry.
inputs:
digest_pattern:
description: Glob pattern to match digest artifacts (e.g. "digests-linux-{amd64,arm64}")
required: true
tag_suffix:
description: Suffix to add to all Docker tags (e.g. "-maxperf")
required: false
default: ""
images:
description: Container registry images (newline-separated)
required: true
registry_user:
description: Registry username for authentication
required: false
registry_password:
description: Registry password for authentication
required: false
outputs:
version:
description: The version tag created for the manifest
value: ${{ steps.meta.outputs.version }}
tags:
description: All tags created for the manifest
value: ${{ steps.meta.outputs.tags }}
runs:
using: composite
steps:
- run: mkdir -p digests
shell: bash
- name: Download digests
if: ${{ env.BUILTIN_REGISTRY_ENABLED == 'true' }}
uses: forgejo/download-artifact@v4
with:
path: digests
pattern: ${{ inputs.digest_pattern }}
merge-multiple: true
- name: Login to builtin registry
if: ${{ env.BUILTIN_REGISTRY_ENABLED == 'true' }}
uses: docker/login-action@v3
with:
registry: ${{ env.BUILTIN_REGISTRY }}
username: ${{ inputs.registry_user }}
password: ${{ inputs.registry_password }}
- name: Set up Docker Buildx
if: ${{ env.BUILTIN_REGISTRY_ENABLED == 'true' }}
uses: docker/setup-buildx-action@v3
with:
# Use persistent BuildKit if BUILDKIT_ENDPOINT is set (e.g. tcp://buildkit:8125)
driver: ${{ env.BUILDKIT_ENDPOINT != '' && 'remote' || 'docker-container' }}
endpoint: ${{ env.BUILDKIT_ENDPOINT || '' }}
- name: Extract metadata (tags) for Docker
if: ${{ env.BUILTIN_REGISTRY_ENABLED == 'true' }}
id: meta
uses: docker/metadata-action@v5
with:
flavor: |
latest=auto
suffix=${{ inputs.tag_suffix }},onlatest=true
tags: |
type=semver,pattern={{version}},prefix=v
type=semver,pattern={{major}}.{{minor}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.0.') }},prefix=v
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }},prefix=v
type=ref,event=branch,prefix=${{ format('refs/heads/{0}', github.event.repository.default_branch) != github.ref && 'branch-' || '' }},
type=ref,event=pr
type=sha,format=short
images: ${{ inputs.images }}
# default labels & annotations: https://github.com/docker/metadata-action/blob/master/src/meta.ts#L509
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: index
- name: Create manifest list and push
if: ${{ env.BUILTIN_REGISTRY_ENABLED == 'true' }}
working-directory: digests
shell: bash
env:
IMAGES: ${{ inputs.images }}
run: |
set -o xtrace
IFS=$'\n'
IMAGES_LIST=($IMAGES)
ANNOTATIONS_LIST=($DOCKER_METADATA_OUTPUT_ANNOTATIONS)
TAGS_LIST=($DOCKER_METADATA_OUTPUT_TAGS)
for REPO in "${IMAGES_LIST[@]}"; do
docker buildx imagetools create \
$(for tag in "${TAGS_LIST[@]}"; do echo "--tag"; echo "$tag"; done) \
$(for annotation in "${ANNOTATIONS_LIST[@]}"; do echo "--annotation"; echo "$annotation"; done) \
$(for reference in *; do printf "$REPO@sha256:%s\n" $reference; done)
done
- name: Inspect image
if: ${{ env.BUILTIN_REGISTRY_ENABLED == 'true' }}
shell: bash
env:
IMAGES: ${{ inputs.images }}
run: |
set -o xtrace
IMAGES_LIST=($IMAGES)
for REPO in "${IMAGES_LIST[@]}"; do
docker buildx imagetools inspect $REPO:${{ steps.meta.outputs.version }}
done
@@ -1,169 +0,0 @@
name: prepare-docker-build
description: |
Prepare the Docker build environment for Continuwuity builds.
Sets up Rust toolchain, Docker Buildx, caching, and extracts metadata for Docker builds.
inputs:
platform:
description: Target platform (e.g. linux/amd64, linux/arm64)
required: true
slug:
description: Platform slug for artifact naming (e.g. linux-amd64, linux-arm64)
required: true
target_cpu:
description: Target CPU architecture (e.g. haswell, empty for base)
required: false
default: ""
profile:
description: Cargo build profile (release or release-max-perf)
required: true
images:
description: Container registry images (newline-separated)
required: true
registry_user:
description: Registry username for authentication
required: false
registry_password:
description: Registry password for authentication
required: false
outputs:
cpu_suffix:
description: CPU suffix for artifact naming
value: ${{ steps.cpu-suffix.outputs.suffix }}
metadata_labels:
description: Docker labels for the image
value: ${{ steps.meta.outputs.labels }}
metadata_annotations:
description: Docker annotations for the image
value: ${{ steps.meta.outputs.annotations }}
runs:
using: composite
steps:
- name: Set CPU suffix variable
id: cpu-suffix
shell: bash
run: |
if [[ -n "${{ inputs.target_cpu }}" ]]; then
echo "suffix=-${{ inputs.target_cpu }}" >> $GITHUB_OUTPUT
echo "CPU_SUFFIX=-${{ inputs.target_cpu }}" >> $GITHUB_ENV
else
echo "suffix=" >> $GITHUB_OUTPUT
echo "CPU_SUFFIX=" >> $GITHUB_ENV
fi
- name: Echo matrix configuration
shell: bash
run: |
echo "Platform: ${{ inputs.platform }}"
echo "Slug: ${{ inputs.slug }}"
echo "Target CPU: ${{ inputs.target_cpu }}"
echo "Profile: ${{ inputs.profile }}"
- name: Install rust
if: ${{ env.BUILDKIT_ENDPOINT == '' }}
id: rust-toolchain
uses: ./.forgejo/actions/rust-toolchain
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
# Use persistent BuildKit if BUILDKIT_ENDPOINT is set (e.g. tcp://buildkit:8125)
driver: ${{ env.BUILDKIT_ENDPOINT != '' && 'remote' || 'docker-container' }}
endpoint: ${{ env.BUILDKIT_ENDPOINT || '' }}
- name: Set up QEMU
if: ${{ env.BUILDKIT_ENDPOINT == '' }}
uses: docker/setup-qemu-action@v3
- name: Login to builtin registry
if: ${{ env.BUILTIN_REGISTRY_ENABLED == 'true' }}
uses: docker/login-action@v3
with:
registry: ${{ env.BUILTIN_REGISTRY }}
username: ${{ inputs.registry_user }}
password: ${{ inputs.registry_password }}
- name: Extract metadata (labels, annotations) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ inputs.images }}
# default labels & annotations: https://github.com/docker/metadata-action/blob/master/src/meta.ts#L509
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
- name: Get short git commit SHA
id: sha
shell: bash
run: |
calculatedSha=$(git rev-parse --short ${{ github.sha }})
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
echo "Short SHA: $calculatedSha"
- name: Get Git commit timestamps
shell: bash
run: |
timestamp=$(git log -1 --pretty=%ct)
echo "TIMESTAMP=$timestamp" >> $GITHUB_ENV
echo "Commit timestamp: $timestamp"
- uses: ./.forgejo/actions/timelord
id: timelord
- name: Cache Rust registry
if: ${{ env.BUILDKIT_ENDPOINT == '' }}
uses: actions/cache@v3
with:
path: |
.cargo/git
.cargo/git/checkouts
.cargo/registry
.cargo/registry/src
key: continuwuity-rust-registry-image-${{hashFiles('**/Cargo.lock') }}
- name: Cache cargo target
if: ${{ env.BUILDKIT_ENDPOINT == '' }}
id: cache-cargo-target
uses: actions/cache@v3
with:
path: |
cargo-target${{ env.CPU_SUFFIX }}-${{ inputs.slug }}-${{ inputs.profile }}
key: continuwuity-cargo-target${{ env.CPU_SUFFIX }}-${{ inputs.slug }}-${{ inputs.profile }}-${{hashFiles('**/Cargo.lock') }}-${{steps.rust-toolchain.outputs.rustc_version}}
- name: Cache apt cache
if: ${{ env.BUILDKIT_ENDPOINT == '' }}
id: cache-apt
uses: actions/cache@v3
with:
path: |
var-cache-apt-${{ inputs.slug }}
key: continuwuity-var-cache-apt-${{ inputs.slug }}
- name: Cache apt lib
if: ${{ env.BUILDKIT_ENDPOINT == '' }}
id: cache-apt-lib
uses: actions/cache@v3
with:
path: |
var-lib-apt-${{ inputs.slug }}
key: continuwuity-var-lib-apt-${{ inputs.slug }}
- name: inject cache into docker
if: ${{ env.BUILDKIT_ENDPOINT == '' }}
uses: https://github.com/reproducible-containers/buildkit-cache-dance@v3.3.0
with:
cache-map: |
{
".cargo/registry": "/usr/local/cargo/registry",
".cargo/git/db": "/usr/local/cargo/git/db",
"cargo-target${{ env.CPU_SUFFIX }}-${{ inputs.slug }}-${{ inputs.profile }}": {
"target": "/app/target",
"id": "cargo-target${{ env.CPU_SUFFIX }}-${{ inputs.slug }}-${{ inputs.profile }}"
},
"var-cache-apt-${{ inputs.slug }}": "/var/cache/apt",
"var-lib-apt-${{ inputs.slug }}": "/var/lib/apt",
"${{ steps.timelord.outputs.database-path }}":"/timelord"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
@@ -1,63 +0,0 @@
name: rust-toolchain
description: |
Install a Rust toolchain using rustup.
See https://rust-lang.github.io/rustup/concepts/toolchains.html#toolchain-specification
for more information about toolchains.
inputs:
toolchain:
description: |
Rust toolchain name.
See https://rust-lang.github.io/rustup/concepts/toolchains.html#toolchain-specification
required: false
target:
description: Target triple to install for this toolchain
required: false
components:
description: Space-separated list of components to be additionally installed for a new toolchain
required: false
outputs:
rustc_version:
description: The rustc version installed
value: ${{ steps.rustc-version.outputs.version }}
rustup_version:
description: The rustup version installed
value: ${{ steps.rustup-version.outputs.version }}
runs:
using: composite
steps:
- name: Check if rustup is already installed
shell: bash
id: rustup-version
run: |
echo "version=$(rustup --version)" >> $GITHUB_OUTPUT
- name: Cache rustup toolchains
if: steps.rustup-version.outputs.version == ''
uses: actions/cache@v3
with:
path: |
~/.rustup
!~/.rustup/tmp
!~/.rustup/downloads
# Requires repo to be cloned if toolchain is not specified
key: continuwuity-${{ runner.os }}-rustup-${{ inputs.toolchain || hashFiles('**/rust-toolchain.toml') }}
- name: Install Rust toolchain
if: steps.rustup-version.outputs.version == ''
shell: bash
run: |
if ! command -v rustup &> /dev/null ; then
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
fi
- shell: bash
run: |
set -x
${{ inputs.toolchain && format('rustup override set {0}', inputs.toolchain) }}
${{ inputs.target && format('rustup target add {0}', inputs.target) }}
${{ inputs.components && format('rustup component add {0}', inputs.components) }}
cargo --version
rustc --version
- id: rustc-version
shell: bash
run: |
echo "version=$(rustc --version)" >> $GITHUB_OUTPUT
-23
View File
@@ -1,23 +0,0 @@
name: sccache
description: |
Install sccache for caching builds in GitHub Actions.
runs:
using: composite
steps:
- name: Install sccache
uses: https://git.tomfos.tr/tom/sccache-action@v1
- name: Configure sccache
uses: https://github.com/actions/github-script@v8
with:
script: |
core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- shell: bash
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV
echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV
echo "CMAKE_CUDA_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV
@@ -1,167 +0,0 @@
name: setup-llvm-with-apt
description: |
Set up LLVM toolchain with APT package management and smart caching.
Supports cross-compilation architectures and additional package installation.
Creates symlinks in /usr/bin: clang, clang++, lld, llvm-ar, llvm-ranlib
inputs:
dpkg-arch:
description: 'Debian architecture for cross-compilation (e.g. arm64)'
required: false
default: ''
extra-packages:
description: 'Additional APT packages to install (space-separated)'
required: false
default: ''
llvm-version:
description: 'LLVM version to install'
required: false
default: '20'
outputs:
llvm-version:
description: 'Installed LLVM version'
value: ${{ steps.configure.outputs.version }}
runs:
using: composite
steps:
- name: Detect runner OS
id: runner-os
uses: https://git.tomfos.tr/actions/detect-versions@v1
- name: Configure cross-compilation architecture
if: inputs.dpkg-arch != ''
shell: bash
run: |
echo "🏗️ Adding ${{ inputs.dpkg-arch }} architecture"
sudo dpkg --add-architecture ${{ inputs.dpkg-arch }}
# Restrict default sources to amd64
sudo sed -i 's/^deb http/deb [arch=amd64] http/g' /etc/apt/sources.list
sudo sed -i 's/^deb https/deb [arch=amd64] https/g' /etc/apt/sources.list
# Add ports sources for foreign architecture
sudo tee /etc/apt/sources.list.d/${{ inputs.dpkg-arch }}.list > /dev/null <<EOF
deb [arch=${{ inputs.dpkg-arch }}] http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe multiverse
deb [arch=${{ inputs.dpkg-arch }}] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe multiverse
deb [arch=${{ inputs.dpkg-arch }}] http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse
EOF
echo "✅ Architecture ${{ inputs.dpkg-arch }} configured"
- name: Start LLVM cache group
shell: bash
run: echo "::group::📦 Restoring LLVM cache"
- name: Check for LLVM cache
id: cache
uses: actions/cache@v4
with:
path: |
/usr/bin/clang-*
/usr/bin/clang++-*
/usr/bin/lld-*
/usr/bin/llvm-*
/usr/lib/llvm-*/
/usr/lib/x86_64-linux-gnu/libLLVM*.so*
/usr/lib/x86_64-linux-gnu/libclang*.so*
/etc/apt/sources.list.d/archive_uri-*
/etc/apt/trusted.gpg.d/apt.llvm.org.asc
key: continuwuity-llvm-${{ steps.runner-os.outputs.slug }}-${{ steps.runner-os.outputs.arch }}-v${{ inputs.llvm-version }}-${{ hashFiles('**/Cargo.lock', 'rust-toolchain.toml') }}
- name: End LLVM cache group
shell: bash
run: echo "::endgroup::"
- name: Check and install LLVM if needed
id: llvm-setup
shell: bash
run: |
echo "🔍 Checking for LLVM ${{ inputs.llvm-version }}..."
# Check both binaries and libraries exist
if [ -f "/usr/bin/clang-${{ inputs.llvm-version }}" ] && \
[ -f "/usr/bin/clang++-${{ inputs.llvm-version }}" ] && \
[ -f "/usr/bin/lld-${{ inputs.llvm-version }}" ] && \
([ -f "/usr/lib/x86_64-linux-gnu/libLLVM.so.${{ inputs.llvm-version }}.1" ] || \
[ -f "/usr/lib/x86_64-linux-gnu/libLLVM-${{ inputs.llvm-version }}.so.1" ] || \
[ -f "/usr/lib/llvm-${{ inputs.llvm-version }}/lib/libLLVM.so" ]); then
echo "✅ LLVM ${{ inputs.llvm-version }} found and verified"
echo "needs-install=false" >> $GITHUB_OUTPUT
else
echo "📦 LLVM ${{ inputs.llvm-version }} not found or incomplete - installing..."
echo "::group::🔧 Installing LLVM ${{ inputs.llvm-version }}"
wget -O - https://apt.llvm.org/llvm.sh | bash -s -- ${{ inputs.llvm-version }}
echo "::endgroup::"
if [ ! -f "/usr/bin/clang-${{ inputs.llvm-version }}" ]; then
echo "❌ Failed to install LLVM ${{ inputs.llvm-version }}"
exit 1
fi
echo "✅ Installed LLVM ${{ inputs.llvm-version }}"
echo "needs-install=true" >> $GITHUB_OUTPUT
fi
- name: Prepare for additional packages
if: inputs.extra-packages != ''
shell: bash
run: |
# Update APT if LLVM was cached (installer script already does apt-get update)
if [[ "${{ steps.llvm-setup.outputs.needs-install }}" != "true" ]]; then
echo "::group::📦 Running apt-get update (LLVM cached, extra packages needed)"
sudo apt-get update
echo "::endgroup::"
fi
echo "::group::📦 Installing additional packages"
- name: Install additional packages
if: inputs.extra-packages != ''
uses: https://github.com/awalsh128/cache-apt-pkgs-action@latest
with:
packages: ${{ inputs.extra-packages }}
version: 1.0
- name: End package installation group
if: inputs.extra-packages != ''
shell: bash
run: echo "::endgroup::"
- name: Configure LLVM environment
id: configure
shell: bash
run: |
echo "::group::🔧 Configuring LLVM ${{ inputs.llvm-version }} environment"
# Create symlinks
sudo ln -sf "/usr/bin/clang-${{ inputs.llvm-version }}" /usr/bin/clang
sudo ln -sf "/usr/bin/clang++-${{ inputs.llvm-version }}" /usr/bin/clang++
sudo ln -sf "/usr/bin/lld-${{ inputs.llvm-version }}" /usr/bin/lld
sudo ln -sf "/usr/bin/llvm-ar-${{ inputs.llvm-version }}" /usr/bin/llvm-ar
sudo ln -sf "/usr/bin/llvm-ranlib-${{ inputs.llvm-version }}" /usr/bin/llvm-ranlib
echo " ✓ Created symlinks"
# Setup library paths
LLVM_LIB_PATH="/usr/lib/llvm-${{ inputs.llvm-version }}/lib"
if [ -d "$LLVM_LIB_PATH" ]; then
echo "LD_LIBRARY_PATH=${LLVM_LIB_PATH}:${LD_LIBRARY_PATH:-}" >> $GITHUB_ENV
echo "LIBCLANG_PATH=${LLVM_LIB_PATH}" >> $GITHUB_ENV
echo "$LLVM_LIB_PATH" | sudo tee "/etc/ld.so.conf.d/llvm-${{ inputs.llvm-version }}.conf" > /dev/null
sudo ldconfig
echo " ✓ Configured library paths"
else
# Fallback to standard library location
if [ -d "/usr/lib/x86_64-linux-gnu" ]; then
echo "LIBCLANG_PATH=/usr/lib/x86_64-linux-gnu" >> $GITHUB_ENV
echo " ✓ Using fallback library path"
fi
fi
# Set output
echo "version=${{ inputs.llvm-version }}" >> $GITHUB_OUTPUT
echo "::endgroup::"
echo "✅ LLVM ready: $(clang --version | head -1)"
-247
View File
@@ -1,247 +0,0 @@
name: setup-rust
description: |
Set up Rust toolchain with sccache for compilation caching.
Respects rust-toolchain.toml by default or accepts explicit version override.
inputs:
cache-key-suffix:
description: 'Optional suffix for cache keys (e.g. platform identifier)'
required: false
default: ''
rust-components:
description: 'Additional Rust components to install (space-separated)'
required: false
default: ''
rust-target:
description: 'Rust target triple (e.g. x86_64-unknown-linux-gnu)'
required: false
default: ''
rust-version:
description: 'Rust version to install (e.g. nightly). Defaults to the version specified in rust-toolchain.toml'
required: false
default: ''
sccache-cache-limit:
description: 'Maximum size limit for sccache local cache (e.g. 2G, 500M)'
required: false
default: '2G'
github-token:
description: 'GitHub token for downloading sccache from GitHub releases'
required: false
default: ''
outputs:
rust-version:
description: 'Installed Rust version'
value: ${{ steps.rust-setup.outputs.version }}
runs:
using: composite
steps:
- name: Detect runner OS
id: runner-os
uses: https://git.tomfos.tr/actions/detect-versions@v1
- name: Configure Cargo environment
shell: bash
run: |
# Use workspace-relative paths for better control and consistency
echo "CARGO_HOME=${{ github.workspace }}/.cargo" >> $GITHUB_ENV
echo "CARGO_TARGET_DIR=${{ github.workspace }}/target" >> $GITHUB_ENV
echo "SCCACHE_DIR=${{ github.workspace }}/.sccache" >> $GITHUB_ENV
echo "RUSTUP_HOME=${{ github.workspace }}/.rustup" >> $GITHUB_ENV
# Limit binstall resolution timeout to avoid GitHub rate limit delays
echo "BINSTALL_MAXIMUM_RESOLUTION_TIMEOUT=10" >> $GITHUB_ENV
# Ensure directories exist for first run
mkdir -p "${{ github.workspace }}/.cargo"
mkdir -p "${{ github.workspace }}/.sccache"
mkdir -p "${{ github.workspace }}/target"
mkdir -p "${{ github.workspace }}/.rustup"
- name: Start registry/toolchain restore group
shell: bash
run: echo "::group::📦 Restoring registry and toolchain caches"
- name: Cache toolchain binaries
id: toolchain-cache
uses: actions/cache@v4
with:
path: |
.cargo/bin
.rustup/toolchains
.rustup/update-hashes
# Shared toolchain cache across all Rust versions
key: continuwuity-toolchain-${{ steps.runner-os.outputs.slug }}-${{ steps.runner-os.outputs.arch }}
- name: Cache Cargo registry and git
id: registry-cache
uses: actions/cache@v4
with:
path: |
.cargo/registry/index
.cargo/registry/cache
.cargo/git/db
# Registry cache saved per workflow, restored from any workflow's cache
# Each workflow maintains its own registry that accumulates its needed crates
key: continuwuity-cargo-registry-${{ steps.runner-os.outputs.slug }}-${{ steps.runner-os.outputs.arch }}-${{ github.workflow }}
restore-keys: |
continuwuity-cargo-registry-${{ steps.runner-os.outputs.slug }}-${{ steps.runner-os.outputs.arch }}-
- name: End registry/toolchain restore group
shell: bash
run: echo "::endgroup::"
- name: Setup Rust toolchain
shell: bash
id: rust-setup
run: |
# Install rustup if not already cached
if ! command -v rustup &> /dev/null; then
echo "::group::📦 Installing rustup"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain none
source "$CARGO_HOME/env"
echo "::endgroup::"
else
echo "✅ rustup already available"
fi
# Setup the appropriate Rust version
if [[ -n "${{ inputs.rust-version }}" ]]; then
echo "::group::📦 Setting up Rust ${{ inputs.rust-version }}"
# Set override first to prevent rust-toolchain.toml from auto-installing
rustup override set ${{ inputs.rust-version }} 2>/dev/null || true
# Check if we need to install/update the toolchain
if rustup toolchain list | grep -q "^${{ inputs.rust-version }}-"; then
rustup update ${{ inputs.rust-version }}
else
rustup toolchain install ${{ inputs.rust-version }} --profile minimal -c cargo,clippy,rustfmt
fi
else
echo "::group::📦 Setting up Rust from rust-toolchain.toml"
rustup show
fi
RUST_VERSION=$(rustc --version | cut -d' ' -f2)
echo "version=$RUST_VERSION" >> $GITHUB_OUTPUT
echo "::endgroup::"
- name: Install Rust components
if: inputs.rust-components != ''
shell: bash
run: |
echo "📦 Installing components: ${{ inputs.rust-components }}"
rustup component add ${{ inputs.rust-components }}
- name: Install Rust target
if: inputs.rust-target != ''
shell: bash
run: |
echo "📦 Installing target: ${{ inputs.rust-target }}"
rustup target add ${{ inputs.rust-target }}
- name: Start build cache restore group
shell: bash
run: echo "::group::📦 Restoring build cache"
- name: Setup sccache
uses: https://git.tomfos.tr/tom/sccache-action@v1
- name: Cache dependencies
id: deps-cache
uses: actions/cache@v4
with:
path: |
target/**/.fingerprint
target/**/deps
target/**/*.d
target/**/.cargo-lock
target/**/CACHEDIR.TAG
target/**/.rustc_info.json
/timelord/
# Dependencies cache - based on Cargo.lock, survives source code changes
key: >-
continuwuity-deps-${{ steps.runner-os.outputs.slug }}-${{ steps.runner-os.outputs.arch }}-${{ steps.rust-setup.outputs.version }}${{ inputs.cache-key-suffix && format('-{0}', inputs.cache-key-suffix) || '' }}-${{ hashFiles('rust-toolchain.toml', '**/Cargo.lock') }}
restore-keys: |
continuwuity-deps-${{ steps.runner-os.outputs.slug }}-${{ steps.runner-os.outputs.arch }}-${{ steps.rust-setup.outputs.version }}${{ inputs.cache-key-suffix && format('-{0}', inputs.cache-key-suffix) || '' }}-
- name: Cache incremental compilation
id: incremental-cache
uses: actions/cache@v4
with:
path: |
target/**/incremental
# Incremental cache - based on source code changes
key: >-
continuwuity-incremental-${{ steps.runner-os.outputs.slug }}-${{ steps.runner-os.outputs.arch }}-${{ steps.rust-setup.outputs.version }}${{ inputs.cache-key-suffix && format('-{0}', inputs.cache-key-suffix) || '' }}-${{ hashFiles('rust-toolchain.toml', '**/Cargo.lock') }}-${{ hashFiles('**/*.rs', '**/Cargo.toml') }}
restore-keys: |
continuwuity-incremental-${{ steps.runner-os.outputs.slug }}-${{ steps.runner-os.outputs.arch }}-${{ steps.rust-setup.outputs.version }}${{ inputs.cache-key-suffix && format('-{0}', inputs.cache-key-suffix) || '' }}-${{ hashFiles('rust-toolchain.toml', '**/Cargo.lock') }}-
continuwuity-incremental-${{ steps.runner-os.outputs.slug }}-${{ steps.runner-os.outputs.arch }}-${{ steps.rust-setup.outputs.version }}${{ inputs.cache-key-suffix && format('-{0}', inputs.cache-key-suffix) || '' }}-
- name: End build cache restore group
shell: bash
run: echo "::endgroup::"
- name: Configure PATH and install tools
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
run: |
# Add .cargo/bin to PATH permanently for all subsequent steps
echo "${{ github.workspace }}/.cargo/bin" >> $GITHUB_PATH
# For this step only, we need to add it to PATH since GITHUB_PATH takes effect in the next step
export PATH="${{ github.workspace }}/.cargo/bin:$PATH"
# Install cargo-binstall for fast binary installations
if command -v cargo-binstall &> /dev/null; then
echo "✅ cargo-binstall already available"
else
echo "::group::📦 Installing cargo-binstall"
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
echo "::endgroup::"
fi
if command -v prek &> /dev/null; then
echo "✅ prek already available"
else
echo "::group::📦 Installing prek"
# prek isn't regularly published to crates.io, so we use git source
cargo-binstall -y --no-symlinks --git https://github.com/j178/prek prek
echo "::endgroup::"
fi
if command -v timelord &> /dev/null; then
echo "✅ timelord already available"
else
echo "::group::📦 Installing timelord"
cargo-binstall -y --no-symlinks timelord-cli
echo "::endgroup::"
fi
- name: Configure sccache environment
shell: bash
run: |
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV
echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV
echo "CMAKE_CUDA_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
# Configure incremental compilation GC
# If we restored from old cache (partial hit), clean up aggressively
if [[ "${{ steps.build-cache.outputs.cache-hit }}" != "true" ]]; then
echo "♻️ Partial cache hit - enabling cache cleanup"
echo "CARGO_INCREMENTAL_GC_THRESHOLD=5" >> $GITHUB_ENV
fi
- name: Output version and summary
shell: bash
run: |
echo "📋 Setup complete:"
echo " Rust: $(rustc --version)"
echo " Cargo: $(cargo --version)"
echo " prek: $(prek --version 2>/dev/null || echo 'installed')"
echo " timelord: $(timelord --version 2>/dev/null || echo 'installed')"
-120
View File
@@ -1,120 +0,0 @@
name: timelord
description: |
Use timelord to set file timestamps with git-warp-time fallback for cache misses
inputs:
key:
description: |
The key to use for caching the timelord data.
required: false
default: ''
path:
description: |
The path to the directory to be timestamped.
required: false
default: ''
outputs:
database-path:
description: Path to timelord database
value: '${{ env.TIMELORD_CACHE_PATH }}'
runs:
using: composite
steps:
- name: Set defaults
shell: bash
run: |
echo "TIMELORD_KEY=${{ inputs.key || format('timelord-v1-{0}-{1}', github.repository, hashFiles('**/*.rs', '**/Cargo.toml', '**/Cargo.lock')) }}" >> $GITHUB_ENV
echo "TIMELORD_PATH=${{ inputs.path || '.' }}" >> $GITHUB_ENV
echo "TIMELORD_CACHE_PATH=$HOME/.cache/timelord" >> $GITHUB_ENV
echo "PATH=$HOME/.cargo/bin:/usr/share/rust/.cargo/bin:$PATH" >> $GITHUB_ENV
- name: Restore binary cache
id: binary-cache
uses: actions/cache/restore@v4
with:
path: |
/usr/share/rust/.cargo/bin
~/.cargo/bin
key: continuwuity-timelord-binaries
- name: Check if binaries need installation
shell: bash
id: check-binaries
run: |
NEED_INSTALL=false
# Ensure ~/.cargo/bin exists
mkdir -p ~/.cargo/bin
# Check and move timelord if needed
if [ -f /usr/share/rust/.cargo/bin/timelord ] && [ ! -f ~/.cargo/bin/timelord ]; then
echo "Moving timelord from /usr/share/rust/.cargo/bin to ~/.cargo/bin"
mv /usr/share/rust/.cargo/bin/timelord ~/.cargo/bin/
fi
if [ ! -f ~/.cargo/bin/timelord ]; then
echo "timelord-cli not found, needs installation"
NEED_INSTALL=true
fi
# Check and move git-warp-time if needed
if [ -f /usr/share/rust/.cargo/bin/git-warp-time ] && [ ! -f ~/.cargo/bin/git-warp-time ]; then
echo "Moving git-warp-time from /usr/share/rust/.cargo/bin to ~/.cargo/bin"
mv /usr/share/rust/.cargo/bin/git-warp-time ~/.cargo/bin/
fi
if [ ! -f ~/.cargo/bin/git-warp-time ]; then
echo "git-warp-time not found, needs installation"
NEED_INSTALL=true
fi
echo "need-install=$NEED_INSTALL" >> $GITHUB_OUTPUT
- name: Install timelord-cli and git-warp-time
if: steps.check-binaries.outputs.need-install == 'true'
uses: https://github.com/taiki-e/install-action@v2
with:
tool: git-warp-time,timelord-cli@3.0.1
- name: Save binary cache
if: steps.check-binaries.outputs.need-install == 'true'
uses: actions/cache/save@v4
with:
path: |
/usr/share/rust/.cargo/bin
~/.cargo/bin
key: continuwuity-timelord-binaries
- name: Restore timelord cache with fallbacks
id: timelord-restore
uses: actions/cache/restore@v4
with:
path: ${{ env.TIMELORD_CACHE_PATH }}
key: ${{ env.TIMELORD_KEY }}
restore-keys: |
continuwuity-timelord-${{ github.repository }}-
- name: Initialize timestamps on complete cache miss
if: steps.timelord-restore.outputs.cache-hit != 'true'
shell: bash
run: |
echo "Complete timelord cache miss - running git-warp-time"
git fetch --unshallow
if [ "${{ env.TIMELORD_PATH }}" = "." ]; then
git-warp-time --quiet
else
git-warp-time --quiet ${{ env.TIMELORD_PATH }}
fi
echo "Git timestamps restored"
- name: Run timelord sync
shell: bash
run: |
mkdir -p ${{ env.TIMELORD_CACHE_PATH }}
timelord sync --source-dir ${{ env.TIMELORD_PATH }} --cache-dir ${{ env.TIMELORD_CACHE_PATH }}
- name: Save updated timelord cache immediately
uses: actions/cache/save@v4
with:
path: ${{ env.TIMELORD_CACHE_PATH }}
key: ${{ env.TIMELORD_KEY }}
@@ -1,70 +0,0 @@
name: upload-docker-artifacts
description: |
Upload Docker build artifacts including binary and digest files.
Handles artifact naming and conditional digest uploads for registry publishing.
inputs:
slug:
description: Platform slug for artifact naming (e.g. linux-amd64, linux-arm64)
required: true
cpu_suffix:
description: CPU suffix for artifact naming (e.g. -haswell)
required: false
default: ""
artifact_suffix:
description: Suffix for binary artifacts (e.g. -maxperf)
required: false
default: ""
digest_suffix:
description: Suffix for digest artifacts (e.g. -maxperf)
required: false
default: ""
digest:
description: The digest of the built Docker image
required: true
outputs:
binary_artifact_name:
description: The name of the uploaded binary artifact
value: conduwuit${{ inputs.cpu_suffix }}-${{ inputs.slug }}${{ inputs.artifact_suffix }}
runs:
using: composite
steps:
- name: Export digest
if: ${{ env.BUILTIN_REGISTRY_ENABLED == 'true' }}
shell: bash
run: |
mkdir -p /tmp/digests
digest="${{ inputs.digest }}"
echo "🔍 Build step digest output: '$digest'"
if [[ -z "$digest" ]]; then
echo "❌ ERROR: No digest found from build step"
exit 1
fi
digest_file="/tmp/digests/${digest#sha256:}"
echo "📁 Creating digest file: $digest_file"
touch "$digest_file"
echo "✅ Digest file created successfully"
echo "📋 Contents of /tmp/digests:"
ls -la /tmp/digests/
- name: Rename extracted binary
shell: bash
run: mv /tmp/binaries/sbin/conduwuit /tmp/binaries/conduwuit${{ inputs.cpu_suffix }}-${{ inputs.slug }}${{ inputs.artifact_suffix }}
- name: Upload binary artifact
uses: forgejo/upload-artifact@v4
with:
name: conduwuit${{ inputs.cpu_suffix }}-${{ inputs.slug }}${{ inputs.artifact_suffix }}
path: /tmp/binaries/conduwuit${{ inputs.cpu_suffix }}-${{ inputs.slug }}${{ inputs.artifact_suffix }}
if-no-files-found: error
- name: Upload digest
if: ${{ env.BUILTIN_REGISTRY_ENABLED == 'true' }}
uses: forgejo/upload-artifact@v4
with:
name: digests${{ inputs.digest_suffix }}-${{ inputs.slug }}${{ inputs.cpu_suffix }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 5
-82
View File
@@ -1,82 +0,0 @@
---
name: 'New pull request'
about: 'Open a new pull request to contribute to continuwuity'
ref: 'main'
---
<!--
In order to help reviewers know what your pull request does at a glance, you should ensure that
1. Your PR title is a short, single sentence describing what you changed
2. You have described in more detail what you have changed, why you have changed it, what the
intended effect is, and why you think this will be beneficial to the project.
If you have made any potentially strange/questionable design choices, but didn't feel they'd benefit
from code comments, please don't mention them here - after opening your pull request,
go to "files changed", and click on the "+" symbol in the line number gutter,
and attach comments to the lines that you think would benefit from some clarification.
-->
This pull request...
<!-- Example:
This pull request allows us to warp through time and space ten times faster than before by
double-inverting the warp drive with hyperheated jump fluid, both making the drive faster and more
efficient. This resolves the common issue where we have to wait more than 10 milliseconds to
engage, use, and disengage the warp drive when travelling between galaxies.
-->
<!-- Closes: #... -->
<!-- Fixes: #... -->
<!-- Uncomment the above line(s) if your pull request fixes an issue or closes another pull request
by superseding it. Replace `#...` with the issue/pr number, such as `#123`. -->
**Pull request checklist:**
<!-- You need to complete these before your PR can be considered.
If you aren't sure about some, feel free to ask for clarification in #dev:continuwuity.org. -->
- [ ] This pull request targets the `main` branch, and the branch is named something other than
`main`.
- [ ] I have written an appropriate pull request title and my description is clear.
- [ ] I understand I am responsible for the contents of this pull request.
- I have followed the [contributing guidelines][c1]:
- [ ] My contribution follows the [code style][c2], if applicable.
- [ ] I ran [pre-commit checks][c1pc] before opening/drafting this pull request.
- [ ] I have [tested my contribution][c1t] (or proof-read it for documentation-only changes)
myself, if applicable. This includes ensuring code compiles.
- [ ] My commit messages follow the [commit message format][c1cm] and are descriptive.
- [ ] I have written a [news fragment][n1] for this PR, if applicable<!--(can be done after hitting open!)-->.
<!--
Notes on these requirements:
- While not required, we encourage you to sign your commits with GPG or SSH to attest the
authenticity of your changes.
- While we allow LLM-assisted contributions, we do not appreciate contributions that are
low quality, which is typical of machine-generated contributions that have not had a lot of love
and care from a human. Please do not open a PR if all you have done is asked ChatGPT to tidy up
the codebase with a +-100,000 diff.
- In the case of code style violations, reviewers may leave review comments/change requests
indicating what the ideal change would look like. For example, a reviewer may suggest you lower
a log level, or use `match` instead of `if/else` etc.
- In the case of code style violations, pre-commit check failures, minor things like typos/spelling
errors, and in some cases commit format violations, reviewers may modify your branch directly,
typically by making changes and adding a commit. Particularly in the latter case, a reviewer may
rebase your commits to squash "spammy" ones (like "fix", "fix", "actually fix"), and reword
commit messages that don't satisfy the format.
- Pull requests MUST pass the `Checks` CI workflows to be capable of being merged. This can only be
bypassed in exceptional circumstances.
If your CI flakes, let us know in matrix:r/dev:continuwuity.org.
- Pull requests have to be based on the latest `main` commit before being merged. If the main branch
changes while you're making your changes, you should make sure you rebase on main before
opening a PR. Your branch will be rebased on main before it is merged if it has fallen behind.
- We typically only do fast-forward merges, so your entire commit log will be included. Once in
main, it's difficult to get out cleanly, so put on your best dress, smile for the cameras!
-->
[c1]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md
[c2]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/docs/development/code_style.mdx
[c1pc]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#pre-commit-checks
[c1t]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#running-tests-locally
[c1cm]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#commit-messages
[n1]: https://towncrier.readthedocs.io/en/stable/tutorial.html#creating-news-fragments
-76
View File
@@ -1,76 +0,0 @@
version: 1
x-source: &source forgejo.ellis.link/continuwuation/continuwuity
x-tags:
releases: &tags-releases
tags:
allow:
- "latest"
- "v[0-9]+\\.[0-9]+\\.[0-9]+(-[a-z0-9\\.]+)?"
- "v[0-9]+\\.[0-9]+"
- "v[0-9]+"
main: &tags-main
tags:
allow:
- "latest"
- "v[0-9]+\\.[0-9]+\\.[0-9]+(-[a-z0-9\\.]+)?"
- "v[0-9]+\\.[0-9]+"
- "v[0-9]+"
- "main"
commits: &tags-commits
tags:
allow:
- "latest"
- "v[0-9]+\\.[0-9]+\\.[0-9]+(-[a-z0-9\\.]+)?"
- "v[0-9]+\\.[0-9]+"
- "v[0-9]+"
- "main"
- "sha-[a-f0-9]+"
all: &tags-all
tags:
allow:
- ".*"
# Registry credentials
creds:
- registry: forgejo.ellis.link
user: "{{env \"BUILTIN_REGISTRY_USER\"}}"
pass: "{{env \"BUILTIN_REGISTRY_PASSWORD\"}}"
- registry: registry.gitlab.com
user: "{{env \"GITLAB_USERNAME\"}}"
pass: "{{env \"GITLAB_TOKEN\"}}"
- registry: git.nexy7574.co.uk
user: "{{env \"N7574_GIT_USERNAME\"}}"
pass: "{{env \"N7574_GIT_TOKEN\"}}"
- registry: ghcr.io
user: "{{env \"GH_PACKAGES_USER\"}}"
pass: "{{env \"GH_PACKAGES_TOKEN\"}}"
- registry: docker.io
user: "{{env \"DOCKER_MIRROR_USER\"}}"
pass: "{{env \"DOCKER_MIRROR_TOKEN\"}}"
# Global defaults
defaults:
parallel: 3
interval: 2h
digestTags: true
# Sync configuration - each registry gets different image sets
sync:
- source: *source
target: registry.gitlab.com/continuwuity/continuwuity
type: repository
<<: *tags-main
- source: *source
target: git.nexy7574.co.uk/mirrored/continuwuity
type: repository
<<: *tags-releases
- source: *source
target: ghcr.io/continuwuity/continuwuity
type: repository
<<: *tags-main
- source: *source
target: docker.io/jadedblueeyes/continuwuity
type: repository
<<: *tags-main
-148
View File
@@ -1,148 +0,0 @@
name: Build / Debian DEB
concurrency:
group: "build-debian-${{ forge.ref }}"
cancel-in-progress: true
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
schedule:
- cron: '30 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
container: ["ubuntu-latest", "ubuntu-previous", "debian-latest", "debian-oldstable"]
container:
image: "ghcr.io/tcpipuk/act-runner:${{ matrix.container }}"
steps:
- name: Get Debian version
id: debian-version
run: |
VERSION=$(cat /etc/debian_version)
DISTRIBUTION=$(lsb_release -sc 2>/dev/null)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "distribution=$DISTRIBUTION" >> $GITHUB_OUTPUT
echo "Debian distribution: $DISTRIBUTION ($VERSION)"
- name: Checkout repository with full history
uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: cargo-debian-${{ steps.debian-version.outputs.distribution }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-debian-${{ steps.debian-version.outputs.distribution }}-
- name: Setup sccache
uses: https://git.tomfos.tr/tom/sccache-action@v1
- name: Configure sccache environment
run: |
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV
echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV
echo "SCCACHE_CACHE_SIZE=10G" >> $GITHUB_ENV
# Aggressive GC since cache restores don't increment counter
echo "CARGO_INCREMENTAL_GC_TRIGGER=5" >> $GITHUB_ENV
- name: Setup Rust
uses: ./.forgejo/actions/setup-rust
with:
github-token: ${{ secrets.GH_PUBLIC_RO }}
- name: Get package version and component
id: package-meta
run: |
BASE_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r ".packages[] | select(.name == \"conduwuit\").version" | sed 's/[^a-zA-Z0-9.+]/~/g')
# VERSION is the package version, COMPONENT is used in
# apt's repository config like a git repo branch
if [[ "${{ forge.ref }}" == "refs/tags/"* ]]; then
# Use the "stable" component for tagged releases
COMPONENT="stable"
VERSION=$BASE_VERSION
else
# Use the "dev" component for development builds
SHA=$(echo "${{ forge.sha }}" | cut -c1-7)
DATE=$(date +%Y%m%d)
if [ "${{ forge.ref_name }}" = "main" ]; then
COMPONENT="dev"
else
# Use the sanitized ref name as the component for feature branches
COMPONENT="dev-$(echo '${{ forge.ref_name }}' | sed 's/[^a-zA-Z0-9.+]/-/g' | tr '[:upper:]' '[:lower:]' | cut -c1-30)"
fi
CLEAN_COMPONENT=$(echo $COMPONENT | sed 's/[^a-zA-Z0-9.+]/~/g')
VERSION="$BASE_VERSION~git$DATE.$SHA-$CLEAN_COMPONENT"
fi
echo "component=$COMPONENT" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Component: $COMPONENT"
echo "Version: $VERSION"
- name: Install cargo-deb
run: |
if command -v cargo-deb &> /dev/null; then
echo "cargo-deb already available"
else
echo "Installing cargo-deb"
cargo-binstall -y --no-symlinks cargo-deb
fi
- name: Install build dependencies
run: |
apt-get update -y
# Build dependencies for rocksdb
apt-get install -y clang liburing-dev
- name: Run cargo-deb
id: cargo-deb
run: |
DEB_PATH=$(cargo deb --deb-version ${{ steps.package-meta.outputs.version }})
echo "path=$DEB_PATH" >> $GITHUB_OUTPUT
- name: Test deb installation
run: |
echo "Installing: ${{ steps.cargo-deb.outputs.path }}"
apt-get install -y ${{ steps.cargo-deb.outputs.path }}
dpkg -s continuwuity
[ -f /usr/bin/conduwuit ] && echo "✅ Binary installed successfully"
[ -f /usr/lib/systemd/system/conduwuit.service ] && echo "✅ Systemd service installed"
[ -f /etc/conduwuit/conduwuit.toml ] && echo "✅ Config file installed"
- name: Upload deb artifact
uses: forgejo/upload-artifact@v4
with:
name: continuwuity-${{ steps.debian-version.outputs.distribution }}
path: ${{ steps.cargo-deb.outputs.path }}
- name: Publish to Forgejo package registry
if: ${{ forge.event_name == 'push' || forge.event_name == 'workflow_dispatch' || forge.event_name == 'schedule' }}
run: |
OWNER="continuwuation"
DISTRIBUTION=${{ steps.debian-version.outputs.distribution }}
COMPONENT=${{ steps.package-meta.outputs.component }}
DEB=${{ steps.cargo-deb.outputs.path }}
echo "Publishing: $DEB in component $COMPONENT for distribution $DISTRIBUTION"
curl --fail-with-body \
-X PUT \
-H "Authorization: token ${{ secrets.BUILTIN_REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}" \
--upload-file "$DEB" \
"${{ forge.server_url }}/api/packages/$OWNER/debian/pool/$DISTRIBUTION/$COMPONENT/upload"
-390
View File
@@ -1,390 +0,0 @@
name: Build / Fedora RPM
concurrency:
group: "build-fedora-${{ github.ref }}"
cancel-in-progress: true
on:
push:
tags:
- "v*.*.*"
# paths:
# - 'pkg/fedora/**'
# - 'src/**'
# - 'Cargo.toml'
# - 'Cargo.lock'
# - '.forgejo/workflows/build-fedora.yml'
workflow_dispatch:
schedule:
- cron: '30 0 * * *'
jobs:
build:
runs-on: fedora-latest
steps:
- name: Detect Fedora version
id: fedora
run: |
VERSION=$(rpm -E %fedora)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Fedora version: $VERSION"
- name: Checkout repository with full history
uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
- name: Cache DNF packages
uses: actions/cache@v4
with:
path: |
/var/cache/dnf
/var/cache/yum
key: dnf-fedora${{ steps.fedora.outputs.version }}-${{ hashFiles('pkg/fedora/continuwuity.spec.rpkg') }}-v1
restore-keys: |
dnf-fedora${{ steps.fedora.outputs.version }}-
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: cargo-fedora${{ steps.fedora.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-fedora${{ steps.fedora.outputs.version }}-
- name: Cache Rust build dependencies
uses: actions/cache@v4
with:
path: |
~/rpmbuild/BUILD/*/target/release/deps
~/rpmbuild/BUILD/*/target/release/build
~/rpmbuild/BUILD/*/target/release/.fingerprint
~/rpmbuild/BUILD/*/target/release/incremental
key: rust-deps-fedora${{ steps.fedora.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
rust-deps-fedora${{ steps.fedora.outputs.version }}-
- name: Setup sccache
uses: https://git.tomfos.tr/tom/sccache-action@v1
- name: Configure sccache environment
run: |
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV
echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV
echo "SCCACHE_CACHE_SIZE=10G" >> $GITHUB_ENV
# Aggressive GC since cache restores don't increment counter
echo "CARGO_INCREMENTAL_GC_TRIGGER=5" >> $GITHUB_ENV
- name: Install base RPM tools
run: |
dnf install -y --setopt=keepcache=1 \
fedora-packager \
python3-pip \
rpm-sign \
rpkg \
wget
- name: Setup build environment and build SRPM
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --global user.email "ci@continuwuity.org"
git config --global user.name "Continuwuity"
rpmdev-setuptree
cd "$GITHUB_WORKSPACE"
# Determine release suffix and version based on ref type and branch
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
# Tags get clean version numbers for stable releases
RELEASE_SUFFIX=""
TAG_NAME="${{ github.ref_name }}"
# Extract version from tag (remove v prefix if present)
TAG_VERSION=$(echo "$TAG_NAME" | sed 's/^v//')
# Create spec file with tag version
sed -e "s/^Version:.*$/Version: $TAG_VERSION/" \
-e "s/^Release:.*$/Release: 1%{?dist}/" \
pkg/fedora/continuwuity.spec.rpkg > continuwuity.spec.rpkg
elif [ "${{ github.ref_name }}" = "main" ]; then
# Main branch gets .dev suffix
RELEASE_SUFFIX=".dev"
# Replace the Release line to include our suffix
sed "s/^Release:.*$/Release: 1${RELEASE_SUFFIX}%{?dist}/" \
pkg/fedora/continuwuity.spec.rpkg > continuwuity.spec.rpkg
else
# Other branches get sanitized branch name as suffix
SAFE_BRANCH=$(echo "${{ github.ref_name }}" | sed 's/[^a-zA-Z0-9]/_/g' | cut -c1-20)
RELEASE_SUFFIX=".${SAFE_BRANCH}"
# Replace the Release line to include our suffix
sed "s/^Release:.*$/Release: 1${RELEASE_SUFFIX}%{?dist}/" \
pkg/fedora/continuwuity.spec.rpkg > continuwuity.spec.rpkg
fi
rpkg srpm --outdir "$HOME/rpmbuild/SRPMS"
ls -la $HOME/rpmbuild/SRPMS/
- name: Install build dependencies from SRPM
run: |
SRPM=$(find "$HOME/rpmbuild/SRPMS" -name "*.src.rpm" | head -1)
if [ -z "$SRPM" ]; then
echo "Error: No SRPM file found"
exit 1
fi
echo "Installing build dependencies from: $(basename $SRPM)"
dnf builddep -y "$SRPM"
- name: Build RPM from SRPM
run: |
SRPM=$(find "$HOME/rpmbuild/SRPMS" -name "*.src.rpm" | head -1)
if [ -z "$SRPM" ]; then
echo "Error: No SRPM file found"
exit 1
fi
echo "Building from SRPM: $SRPM"
rpmbuild --rebuild "$SRPM" \
--define "_topdir $HOME/rpmbuild" \
--define "_sourcedir $GITHUB_WORKSPACE" \
--nocheck # Skip %check section to avoid test dependencies
- name: Test RPM installation
run: |
# Find the main binary RPM (exclude debug and source RPMs)
RPM=$(find "$HOME/rpmbuild/RPMS" -name "continuwuity-*.rpm" \
! -name "*debuginfo*" \
! -name "*debugsource*" \
! -name "*.src.rpm" | head -1)
if [ -z "$RPM" ]; then
echo "Error: No binary RPM file found"
exit 1
fi
echo "Testing installation of: $RPM"
# Dry run first
rpm -qpi "$RPM"
echo ""
rpm -qpl "$RPM"
# Actually install it
dnf install -y "$RPM"
# Verify installation
rpm -qa | grep continuwuity
# Check that the binary exists
[ -f /usr/bin/conduwuit ] && echo "✅ Binary installed successfully"
[ -f /usr/lib/systemd/system/conduwuit.service ] && echo "✅ Systemd service installed"
[ -f /etc/conduwuit/conduwuit.toml ] && echo "✅ Config file installed"
- name: List built packages
run: |
echo "Binary RPMs:"
find "$HOME/rpmbuild/RPMS" -name "*.rpm" -type f -exec ls -la {} \;
echo ""
echo "Source RPMs:"
find "$HOME/rpmbuild/SRPMS" -name "*.rpm" -type f -exec ls -la {} \;
- name: Collect artifacts
run: |
mkdir -p artifacts
find "$HOME/rpmbuild/RPMS" -name "*.rpm" -type f -exec cp {} artifacts/ \;
find "$HOME/rpmbuild/SRPMS" -name "*.rpm" -type f -exec cp {} artifacts/ \;
cd artifacts
echo "Build Information:" > BUILD_INFO.txt
echo "==================" >> BUILD_INFO.txt
echo "Git commit: ${{ github.sha }}" >> BUILD_INFO.txt
echo "Git branch: ${{ github.ref_name }}" >> BUILD_INFO.txt
echo "Build date: $(date -u +%Y-%m-%d_%H:%M:%S_UTC)" >> BUILD_INFO.txt
echo "" >> BUILD_INFO.txt
echo "Package contents:" >> BUILD_INFO.txt
echo "-----------------" >> BUILD_INFO.txt
for rpm in *.rpm; do
echo "" >> BUILD_INFO.txt
echo "File: $rpm" >> BUILD_INFO.txt
rpm -qpi "$rpm" 2>/dev/null | grep -E "^(Name|Version|Release|Architecture|Size)" >> BUILD_INFO.txt
done
ls -la
- name: Upload binary RPM artifact
run: |
# Find the main binary RPM (exclude debug and source RPMs)
BIN_RPM=$(find artifacts -name "continuwuity-*.rpm" \
! -name "*debuginfo*" \
! -name "*debugsource*" \
! -name "*.src.rpm" \
-type f)
mkdir -p upload-bin
cp $BIN_RPM upload-bin/
- name: Upload binary RPM
uses: forgejo/upload-artifact@v4
with:
name: continuwuity
path: upload-bin/
- name: Upload debug RPM artifact
uses: forgejo/upload-artifact@v4
with:
name: continuwuity-debug
path: artifacts/*debuginfo*.rpm
- name: Publish to RPM Package Registry
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }}
run: |
# Find the main binary RPM (exclude debug and source RPMs)
RPM=$(find artifacts -name "continuwuity-*.rpm" \
! -name "*debuginfo*" \
! -name "*debugsource*" \
! -name "*.src.rpm" \
-type f | head -1)
if [ -z "$RPM" ]; then
echo "No binary RPM found to publish"
exit 0
fi
RPM_BASENAME=$(basename "$RPM")
echo "Publishing: $RPM_BASENAME"
# Determine the group based on ref type and branch
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
GROUP="stable"
# For tags, extract the tag name for version info
TAG_NAME="${{ github.ref_name }}"
elif [ "${{ github.ref_name }}" = "main" ]; then
GROUP="dev"
else
# Use sanitized branch name as group for feature branches
GROUP=$(echo "${{ github.ref_name }}" | sed 's/[^a-zA-Z0-9]/-/g' | tr '[:upper:]' '[:lower:]' | cut -c1-30)
fi
PACKAGE_INFO=$(rpm -qpi "$RPM" 2>/dev/null)
PACKAGE_NAME=$(echo "$PACKAGE_INFO" | grep "^Name" | awk '{print $3}')
PACKAGE_VERSION=$(echo "$PACKAGE_INFO" | grep "^Version" | awk '{print $3}')
PACKAGE_RELEASE=$(echo "$PACKAGE_INFO" | grep "^Release" | awk '{print $3}')
PACKAGE_ARCH=$(echo "$PACKAGE_INFO" | grep "^Architecture" | awk '{print $2}')
# Full version includes release
FULL_VERSION="${PACKAGE_VERSION}-${PACKAGE_RELEASE}"
# Forgejo's RPM registry cannot overwrite existing packages, so we must delete first
# 404 is OK if package doesn't exist yet
echo "Removing any existing package: $PACKAGE_NAME-$FULL_VERSION.$PACKAGE_ARCH"
RESPONSE=$(curl -s -w "\n%{http_code}" -X DELETE \
-H "Authorization: token ${{ secrets.BUILTIN_REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}" \
"https://forgejo.ellis.link/api/packages/continuwuation/rpm/$GROUP/package/$PACKAGE_NAME/$FULL_VERSION/$PACKAGE_ARCH")
HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
if [ "$HTTP_CODE" != "204" ] && [ "$HTTP_CODE" != "404" ]; then
echo "ERROR: Failed to delete package (HTTP $HTTP_CODE)"
echo "$RESPONSE" | head -n -1
exit 1
fi
curl --fail-with-body \
-X PUT \
-H "Authorization: token ${{ secrets.BUILTIN_REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/x-rpm" \
-T "$RPM" \
"https://forgejo.ellis.link/api/packages/continuwuation/rpm/$GROUP/upload?sign=true"
echo ""
echo "✅ Published binary RPM to: https://forgejo.ellis.link/continuwuation/-/packages/rpm/continuwuity/"
echo "Group: $GROUP"
# Upload debug RPMs to separate group
DEBUG_RPMS=$(find artifacts -name "*debuginfo*.rpm")
if [ -n "$DEBUG_RPMS" ]; then
echo ""
echo "Publishing debug RPMs to group: ${GROUP}-debug"
for DEBUG_RPM in $DEBUG_RPMS; do
echo "Publishing: $(basename "$DEBUG_RPM")"
DEBUG_INFO=$(rpm -qpi "$DEBUG_RPM" 2>/dev/null)
DEBUG_NAME=$(echo "$DEBUG_INFO" | grep "^Name" | awk '{print $3}')
DEBUG_VERSION=$(echo "$DEBUG_INFO" | grep "^Version" | awk '{print $3}')
DEBUG_RELEASE=$(echo "$DEBUG_INFO" | grep "^Release" | awk '{print $3}')
DEBUG_ARCH=$(echo "$DEBUG_INFO" | grep "^Architecture" | awk '{print $2}')
DEBUG_FULL_VERSION="${DEBUG_VERSION}-${DEBUG_RELEASE}"
# Must delete existing package first (Forgejo limitation)
RESPONSE=$(curl -s -w "\n%{http_code}" -X DELETE \
-H "Authorization: token ${{ secrets.BUILTIN_REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}" \
"https://forgejo.ellis.link/api/packages/continuwuation/rpm/${GROUP}-debug/package/$DEBUG_NAME/$DEBUG_FULL_VERSION/$DEBUG_ARCH")
HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
if [ "$HTTP_CODE" != "204" ] && [ "$HTTP_CODE" != "404" ]; then
echo "ERROR: Failed to delete debug package (HTTP $HTTP_CODE)"
echo "$RESPONSE" | head -n -1
exit 1
fi
curl --fail-with-body \
-X PUT \
-H "Authorization: token ${{ secrets.BUILTIN_REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/x-rpm" \
-T "$DEBUG_RPM" \
"https://forgejo.ellis.link/api/packages/continuwuation/rpm/${GROUP}-debug/upload?sign=true"
done
echo "✅ Published debug RPMs to group: ${GROUP}-debug"
fi
# Also upload the SRPM to separate group
SRPM=$(find artifacts -name "*.src.rpm" | head -1)
if [ -n "$SRPM" ]; then
echo ""
echo "Publishing source RPM: $(basename "$SRPM")"
echo "Publishing to group: ${GROUP}-src"
SRPM_INFO=$(rpm -qpi "$SRPM" 2>/dev/null)
SRPM_NAME=$(echo "$SRPM_INFO" | grep "^Name" | awk '{print $3}')
SRPM_VERSION=$(echo "$SRPM_INFO" | grep "^Version" | awk '{print $3}')
SRPM_RELEASE=$(echo "$SRPM_INFO" | grep "^Release" | awk '{print $3}')
SRPM_FULL_VERSION="${SRPM_VERSION}-${SRPM_RELEASE}"
# Must delete existing SRPM first (Forgejo limitation)
echo "Removing any existing SRPM: $SRPM_NAME-$SRPM_FULL_VERSION.src"
RESPONSE=$(curl -s -w "\n%{http_code}" -X DELETE \
-H "Authorization: token ${{ secrets.BUILTIN_REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}" \
"https://forgejo.ellis.link/api/packages/continuwuation/rpm/${GROUP}-src/package/$SRPM_NAME/$SRPM_FULL_VERSION/src")
HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
if [ "$HTTP_CODE" != "204" ] && [ "$HTTP_CODE" != "404" ]; then
echo "ERROR: Failed to delete SRPM (HTTP $HTTP_CODE)"
echo "$RESPONSE" | head -n -1
exit 1
fi
curl --fail-with-body \
-X PUT \
-H "Authorization: token ${{ secrets.BUILTIN_REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/x-rpm" \
-T "$SRPM" \
"https://forgejo.ellis.link/api/packages/continuwuation/rpm/${GROUP}-src/upload?sign=true"
echo "✅ Published source RPM to group: ${GROUP}-src"
fi
-71
View File
@@ -1,71 +0,0 @@
name: Documentation
on:
pull_request:
push:
branches:
- main
tags:
- "v*"
workflow_dispatch:
concurrency:
group: "pages-${{ github.ref }}"
cancel-in-progress: true
jobs:
docs:
name: Build and Deploy Documentation
runs-on: ubuntu-latest
if: secrets.CLOUDFLARE_API_TOKEN != ''
steps:
- name: Sync repository
uses: actions/checkout@v6
with:
persist-credentials: false
fetch-depth: 0
- name: Detect runner environment
id: runner-env
uses: https://git.tomfos.tr/actions/detect-versions@v1
- name: Setup Node.js
if: steps.runner-env.outputs.node_major == '' || steps.runner-env.outputs.node_major < '20'
uses: https://github.com/actions/setup-node@v6
with:
node-version: 22
- name: Cache npm dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: continuwuity-rspress-${{ steps.runner-env.outputs.slug }}-${{ steps.runner-env.outputs.arch }}-node-${{ steps.runner-env.outputs.node_version }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
continuwuity-rspress-${{ steps.runner-env.outputs.slug }}-${{ steps.runner-env.outputs.arch }}-node-${{ steps.runner-env.outputs.node_version }}-
continuwuity-rspress-${{ steps.runner-env.outputs.slug }}-${{ steps.runner-env.outputs.arch }}-node-
- name: Install dependencies
run: npm ci
- name: Build Rspress documentation
run: npm run docs:build
- name: Install Wrangler
run: npm install --save-dev wrangler@latest
- name: Deploy to Cloudflare Pages (Production)
if: github.ref == 'refs/heads/main' && vars.CLOUDFLARE_PROJECT_NAME != ''
uses: https://github.com/cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: pages deploy ./doc_build --branch="main" --commit-dirty=true --project-name="${{ vars.CLOUDFLARE_PROJECT_NAME }}"
- name: Deploy to Cloudflare Pages (Preview)
if: github.ref != 'refs/heads/main' && vars.CLOUDFLARE_PROJECT_NAME != ''
uses: https://github.com/cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: pages deploy ./doc_build --branch="${{ github.head_ref || github.ref_name }}" --commit-dirty=true --project-name="${{ vars.CLOUDFLARE_PROJECT_NAME }}"
-132
View File
@@ -1,132 +0,0 @@
name: Deploy Element Web
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
pull_request:
paths:
- ".forgejo/workflows/element.yml"
push:
branches:
- main
paths:
- ".forgejo/workflows/element.yml"
concurrency:
group: "element-${{ github.ref }}"
cancel-in-progress: true
jobs:
build-and-deploy:
name: 🏗️ Build and Deploy
runs-on: ubuntu-latest
steps:
- name: 📦 Setup Node.js
uses: https://github.com/actions/setup-node@v6
with:
node-version: "22"
- name: 🔨 Clone, setup, and build Element Web
run: |
echo "Cloning Element Web..."
git clone https://github.com/maunium/element-web
cd element-web
git checkout develop
git pull
echo "Cloning matrix-js-sdk..."
git clone https://github.com/matrix-org/matrix-js-sdk.git
echo "Installing Yarn..."
npm install -g yarn
echo "Installing dependencies..."
yarn install
echo "Preparing build environment..."
mkdir -p .home
echo "Cleaning up specific node_modules paths..."
rm -rf node_modules/@types/eslint-scope/ matrix-*-sdk/node_modules/@types/eslint-scope || echo "Cleanup paths not found, continuing."
echo "Getting matrix-js-sdk commit hash..."
cd matrix-js-sdk
jsver=$(git rev-parse HEAD)
jsver=${jsver:0:12}
cd ..
echo "matrix-js-sdk version hash: $jsver"
echo "Getting element-web commit hash..."
ver=$(git rev-parse HEAD)
ver=${ver:0:12}
echo "element-web version hash: $ver"
chmod +x ./build-sh
export VERSION="$ver-js-$jsver"
echo "Building Element Web version: $VERSION"
./build-sh
echo "Checking for build output..."
ls -la webapp/
- name: ⚙️ Create config.json
run: |
cat <<EOF > ./element-web/webapp/config.json
{
"default_server_name": "continuwuity.org",
"default_server_config": {
"m.homeserver": {
"base_url": "https://matrix.continuwuity.org"
}
},
"default_country_code": "GB",
"default_theme": "dark",
"mobile_guide_toast": false,
"show_labs_settings": true,
"room_directory": [
"continuwuity.org",
"matrixrooms.info"
],
"settings_defaults": {
"UIFeature.urlPreviews": true,
"UIFeature.feedback": false,
"UIFeature.voip": false,
"UIFeature.shareQrCode": false,
"UIFeature.shareSocial": false,
"UIFeature.locationSharing": false,
"enableSyntaxHighlightLanguageDetection": true
},
"features": {
"feature_pinning": true,
"feature_custom_themes": true
}
}
EOF
echo "Created ./element-web/webapp/config.json"
cat ./element-web/webapp/config.json
- name: 📤 Upload Artifact
uses: forgejo/upload-artifact@v4
with:
name: element-web
path: ./element-web/webapp/
retention-days: 14
- name: 🛠️ Install Wrangler
run: npm install --save-dev wrangler@latest
- name: 🚀 Deploy to Cloudflare Pages
if: vars.CLOUDFLARE_PROJECT_NAME != ''
id: deploy
uses: https://github.com/cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: >-
pages deploy ./element-web/webapp
--branch="${{ github.ref == 'refs/heads/main' && 'main' || github.head_ref || github.ref_name }}"
--commit-dirty=true
--project-name="${{ vars.CLOUDFLARE_PROJECT_NAME }}-element"
-68
View File
@@ -1,68 +0,0 @@
name: Mirror Container Images
on:
schedule:
# Run every 2 hours
- cron: "0 */2 * * *"
workflow_dispatch:
inputs:
dry_run:
description: 'Dry run (check only, no actual mirroring)'
required: false
default: false
type: boolean
push:
branches:
- main
paths:
# Re-run when config changes
- '.forgejo/regsync/regsync.yml'
- '.forgejo/workflows/mirror-images.yml'
concurrency:
group: "mirror-images"
cancel-in-progress: true
jobs:
mirror-images:
runs-on: ubuntu-latest
env:
BUILTIN_REGISTRY_USER: ${{ vars.BUILTIN_REGISTRY_USER }}
BUILTIN_REGISTRY_PASSWORD: ${{ secrets.BUILTIN_REGISTRY_PASSWORD }}
GITLAB_USERNAME: ${{ vars.GITLAB_USERNAME }}
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
N7574_GIT_USERNAME: ${{ vars.N7574_GIT_USERNAME }}
N7574_GIT_TOKEN: ${{ secrets.N7574_GIT_TOKEN }}
GH_PACKAGES_USER: ${{ vars.GH_PACKAGES_USER }}
GH_PACKAGES_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}
DOCKER_MIRROR_USER: ${{ vars.DOCKER_MIRROR_USER }}
DOCKER_MIRROR_TOKEN: ${{ secrets.DOCKER_MIRROR_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: false
# - uses: https://github.com/actions/create-github-app-token@v2
# id: app-token
# with:
# app-id: ${{ vars.GH_APP_ID }}
# private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
# github-api-url: https://api.github.com
# owner: continuwuity
# repositories: continuwuity
- name: Install regctl
uses: https://forgejo.ellis.link/continuwuation/regclient-actions/regctl-installer@main
with:
binary: regsync
- name: Check what images need mirroring
run: |
echo "Checking images that need mirroring..."
regsync check -c .forgejo/regsync/regsync.yml -v info
- name: Mirror images
if: ${{ !inputs.dry_run }}
run: |
echo "Starting image mirroring..."
regsync once -c .forgejo/regsync/regsync.yml -v info
-83
View File
@@ -1,83 +0,0 @@
name: Checks / Prek
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
fast-checks:
name: Pre-commit & Formatting
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup Rust nightly
uses: ./.forgejo/actions/setup-rust
with:
rust-version: nightly
github-token: ${{ secrets.GH_PUBLIC_RO }}
- name: Run prek
run: |
prek run \
--all-files \
--hook-stage manual \
--show-diff-on-failure \
--color=always \
-v
- name: Check Rust formatting
run: |
cargo +nightly fmt --all -- --check && \
echo "✅ Formatting check passed" || \
exit 1
clippy-and-tests:
name: Clippy and Cargo Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup LLVM
uses: ./.forgejo/actions/setup-llvm-with-apt
with:
extra-packages: liburing-dev liburing2
- name: Setup Rust with caching
uses: ./.forgejo/actions/setup-rust
with:
github-token: ${{ secrets.GH_PUBLIC_RO }}
- name: Run Clippy lints
run: |
cargo clippy \
--workspace \
--features full \
--locked \
--no-deps \
--profile test \
-- \
-D warnings
- name: Run Cargo tests
run: |
cargo test \
--workspace \
--features full \
--locked \
--profile test \
--all-targets \
--no-fail-fast
-197
View File
@@ -1,197 +0,0 @@
name: Release Docker Image
concurrency:
group: "release-image-${{ github.ref }}"
on:
push:
branches:
- main
paths-ignore:
- "*.md"
- "**/*.md"
- ".gitlab-ci.yml"
- ".gitignore"
- "renovate.json"
- "pkg/**"
- "docs/**"
tags:
- "v*.*.*"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
BUILTIN_REGISTRY: forgejo.ellis.link
BUILTIN_REGISTRY_ENABLED: "${{ ((vars.BUILTIN_REGISTRY_USER && secrets.BUILTIN_REGISTRY_PASSWORD) || (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)) && 'true' || 'false' }}"
IMAGE_PATH: forgejo.ellis.link/continuwuation/continuwuity
jobs:
build-release:
name: "Build ${{ matrix.slug }} (release)"
runs-on: dind
permissions:
contents: read
packages: write
attestations: write
id-token: write
strategy:
matrix:
include:
- platform: "linux/amd64"
slug: "linux-amd64"
- platform: "linux/arm64"
slug: "linux-arm64"
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Prepare Docker build environment
id: prepare
uses: ./.forgejo/actions/prepare-docker-build
with:
platform: ${{ matrix.platform }}
slug: ${{ matrix.slug }}
target_cpu: ""
profile: "release"
images: ${{ env.IMAGE_PATH }}
registry_user: ${{ vars.BUILTIN_REGISTRY_USER || github.actor }}
registry_password: ${{ secrets.BUILTIN_REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}
- name: Build and push Docker image by digest
id: build
uses: docker/build-push-action@v6
with:
context: .
file: "docker/Dockerfile"
build-args: |
GIT_COMMIT_HASH=${{ github.sha }}
GIT_COMMIT_HASH_SHORT=${{ env.COMMIT_SHORT_SHA }}
GIT_REMOTE_URL=${{github.event.repository.html_url }}
GIT_REMOTE_COMMIT_URL=${{github.event.head_commit.url }}
CARGO_INCREMENTAL=${{ env.BUILDKIT_ENDPOINT != '' && '1' || '0' }}
TARGET_CPU=
RUST_PROFILE=release
platforms: ${{ matrix.platform }}
labels: ${{ steps.prepare.outputs.metadata_labels }}
annotations: ${{ steps.prepare.outputs.metadata_annotations }}
cache-from: type=gha
# cache-to: type=gha,mode=max
sbom: true
outputs: |
${{ env.BUILTIN_REGISTRY_ENABLED == 'true' && format('type=image,"name={0}",push-by-digest=true,name-canonical=true,push=true', env.IMAGE_PATH) || format('type=image,"name={0}",push=false', env.IMAGE_PATH) }}
type=local,dest=/tmp/binaries
env:
SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }}
- name: Upload Docker artifacts
uses: ./.forgejo/actions/upload-docker-artifacts
with:
slug: ${{ matrix.slug }}
cpu_suffix: ${{ steps.prepare.outputs.cpu_suffix }}
artifact_suffix: ""
digest_suffix: ""
digest: ${{ steps.build.outputs.digest }}
merge-release:
name: "Create Multi-arch Release Manifest"
runs-on: dind
needs: build-release
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Create multi-platform manifest
uses: ./.forgejo/actions/create-docker-manifest
with:
digest_pattern: "digests-linux-{amd64,arm64}"
tag_suffix: ""
images: ${{ env.IMAGE_PATH }}
registry_user: ${{ vars.BUILTIN_REGISTRY_USER || github.actor }}
registry_password: ${{ secrets.BUILTIN_REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}
build-maxperf:
name: "Build ${{ matrix.slug }} (max-perf)"
runs-on: dind
needs: build-release
permissions:
contents: read
packages: write
attestations: write
id-token: write
strategy:
matrix:
include:
- platform: "linux/amd64"
slug: "linux-amd64"
target_cpu: "haswell"
- platform: "linux/arm64"
slug: "linux-arm64"
target_cpu: ""
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Prepare max-perf Docker build environment
id: prepare
uses: ./.forgejo/actions/prepare-docker-build
with:
platform: ${{ matrix.platform }}
slug: ${{ matrix.slug }}
target_cpu: ${{ matrix.target_cpu }}
profile: "release-max-perf"
images: ${{ env.IMAGE_PATH }}
registry_user: ${{ vars.BUILTIN_REGISTRY_USER || github.actor }}
registry_password: ${{ secrets.BUILTIN_REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}
- name: Build and push max-perf Docker image by digest
id: build
uses: docker/build-push-action@v6
with:
context: .
file: "docker/Dockerfile"
build-args: |
GIT_COMMIT_HASH=${{ github.sha }}
GIT_COMMIT_HASH_SHORT=${{ env.COMMIT_SHORT_SHA }}
GIT_REMOTE_URL=${{github.event.repository.html_url }}
GIT_REMOTE_COMMIT_URL=${{github.event.head_commit.url }}
CARGO_INCREMENTAL=${{ env.BUILDKIT_ENDPOINT != '' && '1' || '0' }}
TARGET_CPU=${{ matrix.target_cpu }}
RUST_PROFILE=release-max-perf
platforms: ${{ matrix.platform }}
labels: ${{ steps.prepare.outputs.metadata_labels }}
annotations: ${{ steps.prepare.outputs.metadata_annotations }}
cache-from: type=gha
# cache-to: type=gha,mode=max
sbom: true
outputs: |
${{ env.BUILTIN_REGISTRY_ENABLED == 'true' && format('type=image,"name={0}",push-by-digest=true,name-canonical=true,push=true', env.IMAGE_PATH) || format('type=image,"name={0}",push=false', env.IMAGE_PATH) }}
type=local,dest=/tmp/binaries
env:
SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }}
- name: Upload max-perf Docker artifacts
uses: ./.forgejo/actions/upload-docker-artifacts
with:
slug: ${{ matrix.slug }}
cpu_suffix: ${{ steps.prepare.outputs.cpu_suffix }}
artifact_suffix: "-maxperf"
digest_suffix: "-maxperf"
digest: ${{ steps.build.outputs.digest }}
merge-maxperf:
name: "Create Max-Perf Manifest"
runs-on: dind
needs: build-maxperf
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Create max-perf manifest
uses: ./.forgejo/actions/create-docker-manifest
with:
digest_pattern: "digests-maxperf-linux-{amd64-haswell,arm64}"
tag_suffix: "-maxperf"
images: ${{ env.IMAGE_PATH }}
registry_user: ${{ vars.BUILTIN_REGISTRY_USER || github.actor }}
registry_password: ${{ secrets.BUILTIN_REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}
-132
View File
@@ -1,132 +0,0 @@
name: Maintenance / Renovate
enable-email-notifications: true
on:
schedule:
# Run at 5am UTC daily to avoid late-night dev
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
dryRun:
description: 'Dry run mode'
required: false
default: ''
type: choice
options:
- ''
- 'extract'
- 'lookup'
- 'full'
logLevel:
description: 'Log level'
required: false
default: 'info'
type: choice
options:
- 'debug'
- 'info'
- 'warning'
- 'critical'
push:
branches:
- main
paths:
# Re-run when config changes
- '.forgejo/workflows/renovate.yml'
- 'renovate.json'
jobs:
renovate:
name: Renovate
runs-on: ubuntu-latest
container:
image: ghcr.io/renovatebot/renovate:42.70.2@sha256:3c2ac1b94fa92ef2fa4d1a0493f2c3ba564454720a32fdbcac2db2846ff1ee47
options: --tmpfs /tmp:exec
steps:
- name: Checkout
uses: actions/checkout@v6
with:
show-progress: false
- name: print node heap
run: /usr/local/renovate/node -e 'console.log(`node heap limit = ${require("v8").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`)'
- name: Restore renovate repo cache
uses: actions/cache/restore@v4
with:
path: |
/tmp/renovate/cache/renovate/repository
key: renovate-repo-cache-${{ github.run_id }}
restore-keys: |
renovate-repo-cache-
- name: Restore renovate package cache
uses: actions/cache/restore@v4
with:
path: |
/tmp/renovate/cache/renovate/renovate-cache-sqlite
key: renovate-package-cache-${{ github.run_id }}
restore-keys: |
renovate-package-cache-
- name: Restore renovate OSV cache
uses: actions/cache/restore@v4
with:
path: |
/tmp/osv
key: renovate-osv-cache-${{ github.run_id }}
restore-keys: |
renovate-osv-cache-
- name: Self-hosted Renovate
run: renovate
env:
LOG_LEVEL: ${{ inputs.logLevel || 'info' }}
RENOVATE_DRY_RUN: ${{ inputs.dryRun || 'false' }}
RENOVATE_PLATFORM: forgejo
RENOVATE_ENDPOINT: ${{ github.server_url }}
RENOVATE_AUTODISCOVER: 'false'
RENOVATE_REPOSITORIES: '["${{ github.repository }}"]'
RENOVATE_GIT_TIMEOUT: 60000
RENOVATE_REQUIRE_CONFIG: 'required'
RENOVATE_ONBOARDING: 'false'
RENOVATE_INHERIT_CONFIG: 'true'
RENOVATE_GITHUB_TOKEN_WARN: 'false'
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
GITHUB_COM_TOKEN: ${{ secrets.GH_PUBLIC_RO || secrets.GH_TOKEN }}
RENOVATE_REPOSITORY_CACHE: 'enabled'
RENOVATE_X_SQLITE_PACKAGE_CACHE: 'true'
OSV_OFFLINE_ROOT_DIR: /tmp/osv
- name: Save renovate repo cache
if: always()
uses:
actions/cache/save@v4
with:
path: |
/tmp/renovate/cache/renovate/repository
key: renovate-repo-cache-${{ github.run_id }}
- name: Save renovate package cache
if: always()
uses: actions/cache/save@v4
with:
path: |
/tmp/renovate/cache/renovate/renovate-cache-sqlite
key: renovate-package-cache-${{ github.run_id }}
- name: Save renovate OSV cache
if: always()
uses: actions/cache/save@v4
with:
path: |
/tmp/osv
key: renovate-osv-cache-${{ github.run_id }}
-121
View File
@@ -1,121 +0,0 @@
name: Update flake hashes
on:
workflow_dispatch:
pull_request:
paths:
- "Cargo.lock"
- "Cargo.toml"
- "rust-toolchain.toml"
- "nix/**/*"
- ".forgejo/workflows/update-flake-hashes.yml"
jobs:
update-flake-hashes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: false
fetch-single-branch: true
submodules: false
persist-credentials: true
token: ${{ secrets.FORGEJO_TOKEN }}
- uses: https://github.com/cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
with:
nix_path: nixpkgs=channel:nixos-unstable
# We can skip getting a toolchain hash if this was ran as a dispatch with the intent
# to update just the rocksdb hash. If this was ran as a dispatch and the toolchain
# files are changed, we still update them, as well as the rocksdb import.
- name: Detect changed files
id: changes
run: |
git fetch origin ${{ github.base_ref }} --depth=1 || true
if [ -n "${{ github.event.pull_request.base.sha }}" ]; then
base=${{ github.event.pull_request.base.sha }}
else
base=$(git rev-parse HEAD~1)
fi
echo "Base: $base"
echo "HEAD: $(git rev-parse HEAD)"
git diff --name-only $base HEAD > changed_files.txt
echo "detected changes in $(cat changed_files.txt)"
# Join files with commas
files=$(paste -sd, changed_files.txt)
echo "files=$files" >> $FORGEJO_OUTPUT
- name: Debug output
run: |
echo "State of output"
echo "Changed files: ${{ steps.changes.outputs.files }}"
- name: Get new toolchain hash
if: contains(steps.changes.outputs.files, 'Cargo.toml') || contains(steps.changes.outputs.files, 'Cargo.lock') || contains(steps.changes.outputs.files, 'rust-toolchain.toml')
run: |
# Set the current sha256 to an empty hash to make `nix build` calculate a new one
awk '/fromToolchainFile *\{/{found=1; print; next} found && /sha256 =/{sub(/sha256 = .*/, "sha256 = lib.fakeSha256;"); found=0} 1' nix/packages/rust.nix > temp.nix
mv temp.nix nix/packages/rust.nix
# Build continuwuity and filter for the new hash
# We do `|| true` because we want this to fail without stopping the workflow
nix build .#default 2>&1 | tee >(grep 'got:' | awk '{print $2}' > new_toolchain_hash.txt) || true
# Place the new hash in place of the empty hash
new_hash=$(cat new_toolchain_hash.txt)
sed -i "s|lib.fakeSha256|\"$new_hash\"|" nix/packages/rust.nix
echo "New hash:"
awk -F'"' '/fromToolchainFile/{found=1; next} found && /sha256 =/{print $2; found=0}' nix/packages/rust.nix
echo "Expected new hash:"
cat new_toolchain_hash.txt
rm new_toolchain_hash.txt
- name: Get new rocksdb hash
if: contains(steps.changes.outputs.files, '.nix') || contains(steps.changes.outputs.files, 'flake.lock')
run: |
# Set the current sha256 to an empty hash to make `nix build` calculate a new one
awk '/repo = "rocksdb";/{found=1; print; next} found && /sha256 =/{sub(/sha256 = .*/, "sha256 = lib.fakeSha256;"); found=0} 1' nix/packages/rocksdb/package.nix > temp.nix
mv temp.nix nix/packages/rocksdb/package.nix
# Build continuwuity and filter for the new hash
# We do `|| true` because we want this to fail without stopping the workflow
nix build .#default 2>&1 | tee >(grep 'got:' | awk '{print $2}' > new_rocksdb_hash.txt) || true
# Place the new hash in place of the empty hash
new_hash=$(cat new_rocksdb_hash.txt)
sed -i "s|lib.fakeSha256|\"$new_hash\"|" nix/packages/rocksdb/package.nix
echo "New hash:"
awk -F'"' '/repo = "rocksdb";/{found=1; next} found && /sha256 =/{print $2; found=0}' nix/packages/rocksdb/package.nix
echo "Expected new hash:"
cat new_rocksdb_hash.txt
rm new_rocksdb_hash.txt
- name: Show diff
run: git diff flake.nix nix
- name: Push changes
run: |
set -euo pipefail
if git diff --quiet --exit-code; then
echo "No changes to commit."
exit 0
fi
git config user.email "renovate@mail.ellis.link"
git config user.name "renovate"
REF="${{ github.head_ref }}"
git fetch origin "$REF"
git checkout "$REF"
git commit -a -m "chore(Nix): Updated flake hashes"
git push origin HEAD:refs/heads/"$REF"
-2
View File
@@ -5,5 +5,3 @@ f419c64aca300a338096b4e0db4c73ace54f23d0
# use chain_width 60
162948313c212193965dece50b816ef0903172ba
5998a0d883d31b866f7c8c46433a8857eae51a89
# trailing whitespace and newlines
46c193e74b2ce86c48ce802333a0aabce37fd6e9
+1 -1
View File
@@ -84,4 +84,4 @@ Cargo.lock text
*.zst binary
# Text files where line endings should be preserved
*.patch -text
*.patch -text
-4
View File
@@ -1,4 +0,0 @@
github: [JadedBlueEyes, nexy7574]
custom:
- https://ko-fi.com/nexy7574
- https://ko-fi.com/JadedBlueEyes
+13
View File
@@ -0,0 +1,13 @@
## Overview
The release pipeline `Main` (main.yml) and its subroutines defined in the other yamls form a high-level
description for the underlying self-hosted build system in `/docker`. In other words, this is a sort of
terminal, a "thin-client" with a display and a keyboard for our docker mainframe. We minimize
vendor-lockin and duplication with other services by limiting everything here to only what is
essential for driving the docker builder.
Though we slightly relax the above by specifying details of the actual CI pipeline, the
control-flow logic to go from some input event to some output or release here. This gives us
better integration with github, like granular progress indications by breaking up operations
as individual jobs and workflows within the pipeline. This means we'll have duplicate logic
with other services, but only as it relates to high-level control flow.
+252
View File
@@ -0,0 +1,252 @@
name: Bakery
on:
workflow_call:
inputs:
bake_targets:
type: string
description: Bake Matrix
cargo_profiles:
type: string
description: Cargo profiles
feat_sets:
type: string
description: Cargo feature groups
rust_targets:
type: string
description: Rust targets
rust_toolchains:
type: string
description: Rust toolchains
sys_names:
type: string
description: System names
sys_targets:
type: string
description: System targets
sys_versions:
type: string
description: System versions
machines:
type: string
description: Hardware platforms
runner:
type: string
description: Runner mask
default: 'self-hosted'
excludes:
type: string
default: '[]'
description: Matrix exclusions
includes:
type: string
default: '[]'
description: Matrix inclusions
max-parallel:
type: number
default: 128
description: Limit number of concurrent jobs.
verbose_env:
type: string
default: ${{vars.CI_VERBOSE_ENV || false}}
description: Print the bake environment.
silent_bake:
type: string
default: ${{vars.CI_SILENT_BAKE || false}}
description: Print as little as possible.
print_bake:
type: string
default: ${{vars.CI_PRINT_BAKE || false}}
description: Print the computed receipe.
fail_fast:
type: boolean
default: false
description: Fail-fast for the underlying matrix.
release_url:
type: string
description: Upload url for created release.
artifact:
type: string
default: '{}'
description: >
Map of targets to artifact files to upload. Key is bake target (image prefix),
value is a JSON object containing keys 'src' and 'dst'. dst is the artifact name,
src is optional path inside image, defaulting to dst.
jobs:
bake:
if: >
!failure() && !cancelled()
&& inputs.machines
&& fromJSON(inputs.machines)[0] != null
&& fromJSON(inputs.bake_targets)[0] != null
name: >
${{matrix.bake_target}}
${{matrix.cargo_profile}}
${{matrix.rust_toolchain}}
${{matrix.feat_set}}
${{matrix.sys_name}}
${{matrix.sys_version}}
${{matrix.sys_target}}
runs-on: ["${{matrix.machine}}", "${{inputs.runner}}"]
strategy:
fail-fast: ${{inputs.fail_fast}}
max-parallel: ${{inputs.max-parallel}}
matrix:
exclude: ${{fromJSON(inputs.excludes)}}
include: ${{fromJSON(inputs.includes)}}
bake_target: ${{fromJSON(inputs.bake_targets)}}
cargo_profile: ${{fromJSON(inputs.cargo_profiles)}}
feat_set: ${{fromJSON(inputs.feat_sets)}}
rust_toolchain: ${{fromJSON(inputs.rust_toolchains)}}
sys_name: ${{fromJSON(inputs.sys_names)}}
sys_version: ${{fromJSON(inputs.sys_versions)}}
rust_target: ${{fromJSON(inputs.rust_targets)}}
sys_target: ${{fromJSON(inputs.sys_targets)}}
machine: ${{fromJSON(inputs.machines)}}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
# Call docker
- name: Bake ${{matrix.bake_target}}
env:
bake_target: ${{matrix.bake_target}}
cargo_profile: ${{matrix.cargo_profile}}
rust_toolchain: ${{matrix.rust_toolchain}}
rust_target: ${{matrix.rust_target}}
feat_set: ${{matrix.feat_set}}
sys_name: ${{matrix.sys_name}}
sys_version: ${{matrix.sys_version}}
sys_target: ${{matrix.sys_target}}
machine: ${{matrix.machine}}
acct: ${{github.actor}}
repo: ${{github.repository}}
CI_VERBOSE_ENV: ${{inputs.verbose_env}}
CI_SILENT_BAKE: ${{inputs.silent_bake}}
CI_PRINT_BAKE: ${{inputs.print_bake}}
run: |
docker/bake.sh "${{matrix.bake_target}}"
# Optionally extract an inner artifact
- name: Extract Inner Artifact
if: >
!failure() && !cancelled()
&& fromJSON(inputs.artifact)[matrix.bake_target].dst
&& fromJSON(inputs.artifact)[matrix.bake_target].img == null
&& fromJSON(inputs.artifact)[matrix.bake_target].runner != true
env:
iid: ${{matrix.bake_target}}--${{matrix.cargo_profile}}--${{matrix.rust_toolchain}}--${{matrix.rust_target}}--${{matrix.feat_set}}--${{matrix.sys_name}}--${{matrix.sys_version}}--${{matrix.sys_target}}
dst: ${{ fromJSON(inputs.artifact)[matrix.bake_target].dst }}
src: ${{ fromJSON(inputs.artifact)[matrix.bake_target].src || fromJSON(inputs.artifact)[matrix.bake_target].dst }}
mod: ${{ fromJSON(inputs.artifact)[matrix.bake_target].chmod || 'u+r' }}
run: |
cid=$(docker create "$iid" /)
rm -rf _artifact
mkdir -p "_artifact"
docker cp "$cid:$src" "_artifact/$dst"
chmod "$mod" "_artifact/$dst"
# Optionally extract the image itself as an artifact.
- name: Extract Image Artifact
if: >
!failure() && !cancelled()
&& fromJSON(inputs.artifact)[matrix.bake_target].dst
&& fromJSON(inputs.artifact)[matrix.bake_target].img != null
env:
iid: ${{matrix.bake_target}}--${{matrix.cargo_profile}}--${{matrix.rust_toolchain}}--${{matrix.rust_target}}--${{matrix.feat_set}}--${{matrix.sys_name}}--${{matrix.sys_version}}--${{matrix.sys_target}}
dst: ${{ fromJSON(inputs.artifact)[matrix.bake_target].dst }}
run: |
rm -rf _artifact
mkdir -p "_artifact"
docker save -o "_artifact/$dst" "$iid"
# Optionally extract a runner artifact
- name: Extract Outer Artifact
if: >
!failure() && !cancelled()
&& fromJSON(inputs.artifact)[matrix.bake_target].dst
&& fromJSON(inputs.artifact)[matrix.bake_target].runner == true
env:
dst: ${{ fromJSON(inputs.artifact)[matrix.bake_target].dst }}
src: ${{ fromJSON(inputs.artifact)[matrix.bake_target].src || fromJSON(inputs.artifact)[matrix.bake_target].dst }}
mod: ${{ fromJSON(inputs.artifact)[matrix.bake_target].chmod || 'u+r' }}
run: |
rm -rf _artifact
mkdir -p "_artifact"
mv "$src" "_artifact/$dst"
chmod "$mod" "_artifact/$dst"
# Optionally compress extracted artifact
- name: Compress Artifact
if: >
!failure() && !cancelled()
&& fromJSON(inputs.artifact)[matrix.bake_target].dst
&& (fromJSON(inputs.artifact)[matrix.bake_target].gzip || fromJSON(inputs.artifact)[matrix.bake_target].zstd)
env:
dst: ${{ fromJSON(inputs.artifact)[matrix.bake_target].dst }}
gzlev: ${{ fromJSON(inputs.artifact)[matrix.bake_target].gzip }}
zstlev: ${{ fromJSON(inputs.artifact)[matrix.bake_target].zstd }}
run: |
if test -n "$gzlev"; then
mv "_artifact/$dst" "_artifact/$dst.artifact"
gzip "-$gzlev" "_artifact/$dst.artifact"
mv "_artifact/$dst.artifact.gz" "_artifact/$dst"
elif test -n "$zstlev"; then
zstd "-$zstlev" "_artifact/$dst"
mv "_artifact/$dst.zst" "_artifact/$dst"
fi
# Upload either artifact
- name: Upload Artifact
if: >
!failure() && !cancelled()
&& fromJSON(inputs.artifact)[matrix.bake_target].dst
uses: actions/upload-artifact@v4
with:
path: _artifact/*
name: ${{matrix.cargo_profile}}-${{matrix.feat_set}}-${{matrix.sys_target}}-${{fromJSON(inputs.artifact)[matrix.bake_target].dst}}
# Optionally upload artifact as pages-artifact
- name: Upload Pages Artifact
if: >
!failure() && !cancelled()
&& fromJSON(inputs.artifact)[matrix.bake_target].dst
&& fromJSON(inputs.artifact)[matrix.bake_target].pages == true
uses: actions/upload-pages-artifact@v3
with:
path: _artifact/${{fromJSON(inputs.artifact)[matrix.bake_target].dst}}
name: github-pages
# Optionally upload artifact as release-artifact
- name: Upload Release Artifact
if: >
!failure() && !cancelled()
&& fromJSON(inputs.artifact)[matrix.bake_target].dst
&& fromJSON(inputs.artifact)[matrix.bake_target].mime
&& contains(github.ref, 'refs/tags/v')
&& inputs.release_url
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
upload_url: ${{inputs.release_url}}
asset_path: _artifact/${{fromJSON(inputs.artifact)[matrix.bake_target].dst}}
asset_name: ${{github.ref_name}}-${{matrix.cargo_profile}}-${{matrix.feat_set}}-${{matrix.sys_target}}-${{fromJSON(inputs.artifact)[matrix.bake_target].dst}}
asset_content_type: ${{fromJSON(inputs.artifact)[matrix.bake_target].mime || 'application/octet-stream'}}
+175
View File
@@ -0,0 +1,175 @@
name: Linting
on:
workflow_call:
inputs:
cargo_profiles:
type: string
description: Cargo profiles
feat_sets:
type: string
description: Cargo feature groups
rust_toolchains:
type: string
description: Rust toolchains
sys_names:
type: string
description: System names
sys_versions:
type: string
description: System versions
rust_targets:
type: string
description: Rust targets
sys_targets:
type: string
description: System targets
machines:
type: string
description: Hardware platform vector
excludes:
type: string
default: '[]'
description: Matrix exclusions
includes:
type: string
default: '[]'
description: Matrix inclusions
jobs:
fmt:
if: >
!failure() && !cancelled()
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
&& contains(fromJSON(inputs.sys_targets), fromJSON('["x86_64-v1-linux-gnu"]')[0])
name: Format
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["fmt"]'
cargo_profiles: '["test"]'
feat_sets: '["all"]'
rust_toolchains: '["nightly"]'
rust_targets: ${{inputs.rust_targets}}
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
sys_targets: '["x86_64-v1-linux-gnu"]'
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
typos:
if: >
!failure() && !cancelled()
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
&& contains(fromJSON(inputs.sys_targets), fromJSON('["x86_64-v1-linux-gnu"]')[0])
name: Typos
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["typos"]'
cargo_profiles: '["test"]'
feat_sets: '["all"]'
rust_toolchains: '["nightly"]'
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: '["x86_64-v1-linux-gnu"]'
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
audit:
if: >
!failure() && !cancelled()
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
&& contains(fromJSON(inputs.sys_targets), fromJSON('["x86_64-v1-linux-gnu"]')[0])
name: Audit
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["audit"]'
cargo_profiles: '["test"]'
feat_sets: '["all"]'
rust_toolchains: '["nightly"]'
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: '["x86_64-v1-linux-gnu"]'
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
# disabled due to excessive build time issue installing cargo lychee
lychee:
if: >
!failure() && !cancelled()
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
&& contains(fromJSON(inputs.sys_targets), fromJSON('["x86_64-v1-linux-gnu"]')[0])
&& false
name: Lychee
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["lychee"]'
cargo_profiles: '["test"]'
feat_sets: '["all"]'
rust_toolchains: '["nightly"]'
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: '["x86_64-v1-linux-gnu"]'
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
check:
if: >
!failure() && !cancelled()
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
&& contains(fromJSON(inputs.sys_targets), fromJSON('["x86_64-v1-linux-gnu"]')[0])
name: Check
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["check"]'
cargo_profiles: '["test"]'
feat_sets: '["all"]'
rust_toolchains: '["nightly"]'
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: '["x86_64-v1-linux-gnu"]'
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
clippy:
if: >
!failure() && !cancelled()
&& inputs.cargo_profiles
name: Clippy
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["clippy"]'
cargo_profiles: ${{inputs.cargo_profiles}}
feat_sets: ${{inputs.feat_sets}}
rust_toolchains: ${{inputs.rust_toolchains}}
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: ${{inputs.sys_targets}}
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
+337
View File
@@ -0,0 +1,337 @@
name: Main
on:
push:
branches:
- "**"
tags:
- "v*"
pull_request:
branches:
- "**"
workflow_dispatch:
concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: false
jobs:
init:
name: Init
runs-on: ${{matrix.runner}}
env:
default_cargo_profiles: '["test", "bench", "release"]'
default_feat_sets: '["none", "default", "all"]'
default_rust_toolchains: '["nightly", "stable"]'
default_sys_names: '["debian"]'
default_sys_versions: '["testing-slim"]'
default_rust_targets: '["x86_64-unknown-linux-gnu"]'
default_sys_targets: '["x86_64-v1-linux-gnu", "x86_64-v3-linux-gnu"]'
default_machines: '["X64"]'
outputs:
cargo_profiles: ${{vars.CARGO_PROFILES || env.default_cargo_profiles}}
feat_sets: ${{vars.FEAT_SETS || env.default_feat_sets}}
rust_toolchains: ${{vars.RUST_TOOLCHAINS || env.default_rust_toolchains}}
rust_targets: ${{vars.RUST_TARGETS || env.default_rust_targets}}
sys_names: ${{vars.SYS_NAMES || env.default_sys_names}}
sys_targets: ${{vars.SYS_TARGETS || env.default_sys_targets}}
sys_versions: ${{vars.SYS_VERSIONS || env.default_sys_versions}}
machines: ${{vars.MACHINES || env.default_machines}}
package: ${{vars.PACKAGE != 'false'}}
publish: ${{vars.PUBLISH != 'false'}}
build_nix: ${{vars.BUILD_NIX != 'false'}}
build_pkgs: ${{vars.BUILD_PKGS || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/test' || contains(github.ref, 'tags/v')}}
check_pkgs: ${{vars.CHECK_PKGS || 'false'}}
complement: ${{vars.COMPLEMENT != 'false'}}
complement_runner: 'het'
docker_repo: ${{vars.DOCKER_REPO}}
release_url: ${{steps.release.outputs.upload_url}}
pages_url: 'https://matrix-construct.github.io/tuwunel/'
rust_sdk_integ: ${{vars.RUST_SDK_INTEGRATION != 'false'}}
head_msg: ${{github.event.head_commit.message || github.event.workflow_run.head_commit.message}}
strategy:
fail-fast: true
matrix:
runner: ${{fromJSON(vars.RUNNERS || '["het"]')}}
machine: ${{fromJSON(vars.MACHINES || '["X64"]')}}
exclude: ${{fromJSON(vars.RUNNERS_EXCLUDES || '[]')}}
steps:
- name: Initialize Builder
env:
runner: ${{matrix.runner}}
reserved_space: '{"het": "192GB", "aws": "48GB", "gcp": "160GB"}'
max_used_space: '{"het": "384GB", "aws": "64GB", "gcp": "192GB"}'
run: |
set +e
docker buildx inspect "${GITHUB_ACTOR}"
if test x"$?" = x"0"; then
exit 0
fi
set -eux
reserved_space=$(echo -n "$reserved_space" | jq -r ".$runner")
max_used_space=$(echo -n "$max_used_space" | jq -r ".$runner")
cat <<EOF > ./buildkitd.toml
[system]
platformsCacheMaxAge = "504h"
[worker.oci]
enabled = true
rootless = false
gc = true
reservedSpace = "${reserved_space}"
maxUsedSpace = "${max_used_space}"
[[worker.oci.gcpolicy]]
reservedSpace = "${reserved_space}"
maxUsedSpace = "${max_used_space}"
filters = ["label!=cache==pin"]
all = true
EOF
docker buildx create \
--bootstrap \
--driver docker-container \
--buildkitd-config ./buildkitd.toml \
--name "${GITHUB_ACTOR}" \
--buildkitd-flags "--allow-insecure-entitlement network.host"
- if: >
!failure() && !cancelled()
&& contains(github.ref, 'refs/tags/v')
&& matrix.runner == 'het'
id: release
name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
release_name: Release ${{github.ref_name}}
tag_name: ${{github.ref}}
body_path: RELEASE.md
draft: ${{ contains(github.ref, '-draft') }}
prerelease: ${{ contains(github.ref, '-rc') }}
lint:
if: >
!failure() && !cancelled()
&& !contains(github.ref, 'refs/tags/v')
&& !contains(needs.init.outputs.head_msg, '[ci no lint]')
&& !contains(needs.init.outputs.head_msg, '[ci only it]')
name: Lint
needs: [init] #needs: [init, deps]
uses: ./.github/workflows/lint.yml
with:
cargo_profiles: ${{needs.init.outputs.cargo_profiles}}
feat_sets: ${{needs.init.outputs.feat_sets}}
rust_toolchains: ${{needs.init.outputs.rust_toolchains}}
rust_targets: ${{needs.init.outputs.rust_targets}}
sys_names: ${{needs.init.outputs.sys_names}}
sys_targets: ${{needs.init.outputs.sys_targets}}
sys_versions: ${{needs.init.outputs.sys_versions}}
machines: ${{needs.init.outputs.machines}}
excludes: >
[
{"cargo_profile": "test", "feat_set": "logging"},
{"cargo_profile": "test", "rust_toolchain": "stable", "feat_set": "none"},
{"cargo_profile": "test", "rust_target": "aarch64-unknown-linux-gnu"},
{"cargo_profile": "bench"},
{"cargo_profile": "release", "rust_toolchain": "nightly", "feat_set": "none"},
{"cargo_profile": "release", "rust_toolchain": "nightly", "feat_set": "default"},
{"cargo_profile": "release", "rust_toolchain": "nightly", "feat_set": "logging"},
{"cargo_profile": "release-debuginfo"},
{"cargo_profile": "release-native", "feat_set": "none"},
{"cargo_profile": "release-native", "feat_set": "default"},
{"cargo_profile": "release-native", "feat_set": "logging"},
{"cargo_profile": "release-native", "rust_toolchain": "stable"},
{"cargo_profile": "release-native", "rust_target": "aarch64-unknown-linux-gnu"},
{"rust_target": "aarch64-unknown-linux-gnu", "feat_set": "none"},
{"rust_target": "aarch64-unknown-linux-gnu", "feat_set": "default"},
{"rust_target": "aarch64-unknown-linux-gnu", "feat_set": "logging"},
{"rust_target": "aarch64-unknown-linux-gnu", "rust_toolchain": "nightly"},
{"rust_target": "aarch64-unknown-linux-gnu", "sys_target": "x86_64-v1-linux-gnu"},
{"rust_target": "aarch64-unknown-linux-gnu", "sys_target": "x86_64-v2-linux-gnu"},
{"rust_target": "aarch64-unknown-linux-gnu", "sys_target": "x86_64-v3-linux-gnu"},
{"rust_target": "aarch64-unknown-linux-gnu", "sys_target": "x86_64-v4-linux-gnu"},
{"rust_target": "x86_64-unknown-linux-gnu", "sys_target": "aarch64-v8-linux-gnu"},
{"sys_target": "aarch64-v8-linux-gnu", "machine": "X64"},
{"sys_target": "x86_64-v1-linux-gnu", "machine": "ARM64"},
{"sys_target": "x86_64-v2-linux-gnu"},
{"sys_target": "x86_64-v3-linux-gnu"},
{"sys_target": "x86_64-v4-linux-gnu"},
]
test:
if: >
!failure() && !cancelled()
&& !contains(github.ref, 'refs/tags/v')
&& !contains(needs.init.outputs.head_msg, '[ci no test]')
name: Test
needs: [init, lint]
uses: ./.github/workflows/test.yml
with:
head_msg: ${{needs.init.outputs.head_msg}}
build_nix: ${{fromJSON(needs.init.outputs.build_nix)}}
rust_sdk_integ: ${{fromJSON(needs.init.outputs.rust_sdk_integ)}}
complement: ${{fromJSON(needs.init.outputs.complement)}}
complement_runner: ${{needs.init.outputs.complement_runner}}
cargo_profiles: ${{needs.init.outputs.cargo_profiles}}
feat_sets: ${{needs.init.outputs.feat_sets}}
rust_toolchains: ${{needs.init.outputs.rust_toolchains}}
rust_targets: ${{needs.init.outputs.rust_targets}}
sys_names: ${{needs.init.outputs.sys_names}}
sys_targets: ${{needs.init.outputs.sys_targets}}
sys_versions: ${{needs.init.outputs.sys_versions}}
machines: ${{needs.init.outputs.machines}}
excludes: >
[
{"cargo_profile": "test", "rust_toolchain": "stable", "feat_set": "none"},
{"cargo_profile": "test", "rust_target": "aarch64-unknown-linux-gnu"},
{"cargo_profile": "release-debuginfo"},
{"cargo_profile": "release-native", "feat_set": "none"},
{"cargo_profile": "release-native", "feat_set": "default"},
{"cargo_profile": "release-native", "rust_toolchain": "stable"},
{"cargo_profile": "release-native", "rust_target": "aarch64-unknown-linux-gnu"},
{"rust_target": "aarch64-unknown-linux-gnu", "feat_set": "none"},
{"rust_target": "aarch64-unknown-linux-gnu", "feat_set": "default"},
{"rust_target": "aarch64-unknown-linux-gnu", "feat_set": "logging"},
{"rust_target": "aarch64-unknown-linux-gnu", "rust_toolchain": "nightly"},
{"rust_target": "aarch64-unknown-linux-gnu", "sys_target": "x86_64-v1-linux-gnu"},
{"rust_target": "aarch64-unknown-linux-gnu", "sys_target": "x86_64-v2-linux-gnu"},
{"rust_target": "aarch64-unknown-linux-gnu", "sys_target": "x86_64-v3-linux-gnu"},
{"rust_target": "aarch64-unknown-linux-gnu", "sys_target": "x86_64-v4-linux-gnu"},
{"rust_target": "x86_64-unknown-linux-gnu", "sys_target": "aarch64-v8-linux-gnu"},
{"sys_target": "aarch64-v8-linux-gnu", "machine": "X64"},
{"sys_target": "x86_64-v1-linux-gnu", "machine": "ARM64"},
{"sys_target": "x86_64-v2-linux-gnu", "machine": "ARM64"},
{"sys_target": "x86_64-v2-linux-gnu", "feat_set": "none"},
{"sys_target": "x86_64-v2-linux-gnu", "feat_set": "default"},
{"sys_target": "x86_64-v3-linux-gnu", "machine": "ARM64"},
{"sys_target": "x86_64-v3-linux-gnu", "feat_set": "none"},
{"sys_target": "x86_64-v3-linux-gnu", "feat_set": "default"},
{"sys_target": "x86_64-v4-linux-gnu", "machine": "ARM64"},
{"sys_target": "x86_64-v4-linux-gnu", "feat_set": "none"},
{"sys_target": "x86_64-v4-linux-gnu", "feat_set": "default"},
]
package:
if: >
!failure() && !cancelled()
&& needs.init.outputs.package
&& !contains(github.ref, 'refs/pull')
&& !contains(needs.init.outputs.head_msg, '[ci only it]')
&& !contains(needs.init.outputs.head_msg, '[ci no build]')
&& !contains(needs.init.outputs.head_msg, '[ci no package]')
name: Package
needs: [init, test]
uses: ./.github/workflows/package.yml
with:
release_url: ${{needs.init.outputs.release_url}}
check_pkgs: ${{needs.init.outputs.check_pkgs}}
build_pkgs: ${{needs.init.outputs.build_pkgs}}
build_nix: ${{fromJSON(needs.init.outputs.build_nix)}}
cargo_profiles: ${{needs.init.outputs.cargo_profiles}}
feat_sets: ${{needs.init.outputs.feat_sets}}
rust_toolchains: ${{needs.init.outputs.rust_toolchains}}
rust_targets: ${{needs.init.outputs.rust_targets}}
sys_names: ${{needs.init.outputs.sys_names}}
sys_targets: ${{needs.init.outputs.sys_targets}}
sys_versions: ${{needs.init.outputs.sys_versions}}
machines: ${{needs.init.outputs.machines}}
excludes: >
[
{"feat_set": "none"},
{"cargo_profile": "test"},
{"cargo_profile": "bench"},
{"cargo_profile": "release-native"},
{"cargo_profile": "release-debuginfo", "feat_set": "default"},
{"cargo_profile": "release-debuginfo", "feat_set": "logging"},
{"cargo_profile": "release-debuginfo", "rust_toolchain": "nightly"},
{"cargo_profile": "release-debuginfo", "bake_target": "oci"},
{"cargo_profile": "release-debuginfo", "rust_target": "aarch64-unknown-linux-gnu"},
{"cargo_profile": "release-debuginfo", "sys_target": "x86_64-v2-linux-gnu"},
{"cargo_profile": "release-debuginfo", "sys_target": "x86_64-v3-linux-gnu"},
{"cargo_profile": "release-debuginfo", "sys_target": "x86_64-v4-linux-gnu"},
{"cargo_profile": "release", "rust_toolchain": "nightly"},
{"rust_target": "aarch64-unknown-linux-gnu", "feat_set": "default"},
{"rust_target": "aarch64-unknown-linux-gnu", "feat_set": "logging"},
{"rust_target": "aarch64-unknown-linux-gnu", "bake_target": "nix"},
{"rust_target": "aarch64-unknown-linux-gnu", "sys_target": "x86_64-v1-linux-gnu"},
{"rust_target": "aarch64-unknown-linux-gnu", "sys_target": "x86_64-v2-linux-gnu"},
{"rust_target": "aarch64-unknown-linux-gnu", "sys_target": "x86_64-v3-linux-gnu"},
{"rust_target": "aarch64-unknown-linux-gnu", "sys_target": "x86_64-v4-linux-gnu"},
{"rust_target": "x86_64-unknown-linux-gnu", "sys_target": "aarch64-v8-linux-gnu"},
{"sys_target": "aarch64-v8-linux-gnu", "machine": "X64"},
{"sys_target": "x86_64-v1-linux-gnu", "machine": "ARM64"},
{"sys_target": "x86_64-v2-linux-gnu", "machine": "ARM64"},
{"sys_target": "x86_64-v2-linux-gnu", "feat_set": "default"},
{"sys_target": "x86_64-v2-linux-gnu", "feat_set": "logging"},
{"sys_target": "x86_64-v2-linux-gnu", "bake_target": "nix"},
{"sys_target": "x86_64-v3-linux-gnu", "machine": "ARM64"},
{"sys_target": "x86_64-v3-linux-gnu", "feat_set": "default"},
{"sys_target": "x86_64-v3-linux-gnu", "feat_set": "logging"},
{"sys_target": "x86_64-v3-linux-gnu", "bake_target": "nix"},
{"sys_target": "x86_64-v4-linux-gnu", "machine": "ARM64"},
{"sys_target": "x86_64-v4-linux-gnu", "feat_set": "default"},
{"sys_target": "x86_64-v4-linux-gnu", "feat_set": "logging"},
{"sys_target": "x86_64-v4-linux-gnu", "bake_target": "nix"},
]
publish:
if: >
!failure() && !cancelled()
&& needs.init.outputs.publish
&& !contains(github.ref, 'refs/pull')
&& !contains(needs.init.outputs.head_msg, '[ci only it]')
&& !contains(needs.init.outputs.head_msg, '[ci no build]')
&& !contains(needs.init.outputs.head_msg, '[ci no package]')
&& !contains(needs.init.outputs.head_msg, '[ci no publish]')
name: Publish
needs: [init, test, package]
uses: ./.github/workflows/publish.yml
with:
docker_repo: ${{needs.init.outputs.docker_repo}}
release_url: ${{needs.init.outputs.release_url}}
pages_url: ${{needs.init.outputs.pages_url}}
cargo_profiles: ${{needs.init.outputs.cargo_profiles}}
feat_sets: ${{needs.init.outputs.feat_sets}}
rust_toolchains: ${{needs.init.outputs.rust_toolchains}}
rust_targets: ${{needs.init.outputs.rust_targets}}
sys_names: ${{needs.init.outputs.sys_names}}
sys_targets: ${{needs.init.outputs.sys_targets}}
sys_versions: ${{needs.init.outputs.sys_versions}}
machines: ${{needs.init.outputs.machines}}
excludes: >
[
{"feat_set": "none"},
{"feat_set": "default"},
{"cargo_profile": "test"},
{"cargo_profile": "bench"},
{"cargo_profile": "release-debuginfo"},
{"cargo_profile": "release-native"},
{"rust_toolchain": "nightly"},
{"rust_target": "aarch64-unknown-linux-gnu", "feat_set": "logging"},
{"rust_target": "aarch64-unknown-linux-gnu", "sys_target": "x86_64-v1-linux-gnu"},
{"rust_target": "aarch64-unknown-linux-gnu", "sys_target": "x86_64-v2-linux-gnu"},
{"rust_target": "aarch64-unknown-linux-gnu", "sys_target": "x86_64-v3-linux-gnu"},
{"rust_target": "aarch64-unknown-linux-gnu", "sys_target": "x86_64-v4-linux-gnu"},
{"rust_target": "x86_64-unknown-linux-gnu", "sys_target": "aarch64-v8-linux-gnu"},
{"sys_target": "aarch64-v8-linux-gnu", "machine": "X64"},
{"sys_target": "x86_64-v1-linux-gnu", "machine": "ARM64"},
{"sys_target": "x86_64-v2-linux-gnu", "machine": "ARM64"},
{"sys_target": "x86_64-v2-linux-gnu", "feat_set": "logging"},
{"sys_target": "x86_64-v3-linux-gnu", "machine": "ARM64"},
{"sys_target": "x86_64-v3-linux-gnu", "feat_set": "logging"},
{"sys_target": "x86_64-v4-linux-gnu", "machine": "ARM64"},
{"sys_target": "x86_64-v4-linux-gnu", "feat_set": "logging"},
]
secrets:
ghcr_token: ${{ secrets.GHCR_TOKEN }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
+213
View File
@@ -0,0 +1,213 @@
name: Package
on:
workflow_call:
inputs:
cargo_profiles:
type: string
description: Cargo profiles
feat_sets:
type: string
description: Cargo feature groups
rust_toolchains:
type: string
description: Rust toolchains
sys_names:
type: string
description: System names
sys_versions:
type: string
description: System versions
rust_targets:
type: string
description: Rust targets
sys_targets:
type: string
description: System targets
machines:
type: string
description: Hardware platform vector
excludes:
type: string
default: '[]'
description: Matrix exclusions
includes:
type: string
default: '[]'
description: Matrix inclusions
release_url:
type: string
description: For release assets
build_pkgs:
type: string
default: 'true'
check_pkgs:
type: string
default: 'false'
build_nix:
type: string
default: 'true'
jobs:
book:
if: >
!failure() && !cancelled()
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["release"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["default"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["stable"]')[0])
&& contains(fromJSON(inputs.sys_targets), fromJSON('["x86_64-v1-linux-gnu"]')[0])
name: Book
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["book"]'
cargo_profiles: '["release"]'
feat_sets: '["default"]'
rust_toolchains: '["stable"]'
rust_targets: ${{inputs.rust_targets}}
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
sys_targets: '["x86_64-v1-linux-gnu"]'
machines: ${{inputs.machines}}
runner: 'het'
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
release_url: ${{inputs.release_url}}
artifact: >
{
"book": {
"dst": "book",
"src": "/book",
"pages": true
}
}
binary:
if: >
!failure() && !cancelled()
name: Binaries
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["static"]'
cargo_profiles: ${{inputs.cargo_profiles}}
feat_sets: ${{inputs.feat_sets}}
rust_toolchains: ${{inputs.rust_toolchains}}
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: ${{inputs.sys_targets}}
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
release_url: ${{inputs.release_url}}
artifact: >
{
"static": {
"dst": "tuwunel.zst",
"src": "/usr/bin/tuwunel",
"mime": "application/zstd",
"zstd": 11,
"chmod": "a+x"
}
}
container:
if: >
!failure() && !cancelled()
name: Containers
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["docker", "oci"]'
cargo_profiles: ${{inputs.cargo_profiles}}
feat_sets: ${{inputs.feat_sets}}
rust_toolchains: ${{inputs.rust_toolchains}}
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: ${{inputs.sys_targets}}
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
release_url: ${{inputs.release_url}}
artifact: >
{
"docker": {
"dst": "tuwunel-docker.tar.gz",
"img": true,
"mime": "application/gzip",
"gzip": 7
},
"oci": {
"dst": "tuwunel-oci.tar.zst",
"runner": true,
"mime": "application/zstd",
"zstd": 11
}
}
pkgs:
if: >
!failure() && !cancelled()
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["release"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["stable"]')[0])
&& fromJSON(inputs.build_pkgs)
name: Distro Packages
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["deb", "rpm", "nix"]'
cargo_profiles: '["release"]'
feat_sets: '["all"]'
rust_toolchains: '["stable"]'
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: ${{inputs.sys_targets}}
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
release_url: ${{inputs.release_url}}
artifact: >
{
"deb": {
"dst": "tuwunel.deb",
"mime": "application/vnd.debian.binary-package"
},
"rpm": {
"dst": "tuwunel.rpm",
"mime": "application/x-rpm"
},
"nix": {
"dst": "tuwunel.nix.tar.zst",
"src": "/opt/tuwunel.nix.tar",
"mime": "application/zstd",
"zstd": 11
}
}
check_pkgs:
if: >
!failure() && !cancelled()
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["release"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["stable"]')[0])
&& fromJSON(inputs.check_pkgs)
name: Check Packages
needs: [pkgs]
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["deb-install", "rpm-install"]'
cargo_profiles: '["release"]'
feat_sets: '["all"]'
rust_toolchains: '["stable"]'
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: ${{inputs.sys_targets}}
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
+328
View File
@@ -0,0 +1,328 @@
name: Publish
on:
workflow_call:
secrets:
ghcr_token:
dockerhub_token:
inputs:
cargo_profiles:
type: string
description: Cargo profiles
feat_sets:
type: string
description: Cargo feature groups
rust_toolchains:
type: string
description: Rust toolchains
sys_names:
type: string
description: System names
sys_versions:
type: string
description: System versions
rust_targets:
type: string
description: Rust targets
sys_targets:
type: string
description: System targets
machines:
type: string
description: Hardware platform vector
excludes:
type: string
default: '[]'
description: Matrix exclusions
includes:
type: string
default: '[]'
description: Matrix inclusions
docker_repo:
type: string
description: DockerHub Repository
release_url:
type: string
description: For release assets
pages_url:
type: string
description: For pages deployment
jobs:
documents:
if: >
!failure() && !cancelled()
&& (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/v'))
&& !contains(github.ref, '-draft')
name: Documents
runs-on: ['X64', 'het']
permissions:
contents: read
id-token: write
pages: write
environment:
name: github-pages
url: ${{inputs.pages_url}}
steps:
- id: book
name: Book
uses: actions/deploy-pages@v4
containers:
if: >
!failure() && !cancelled()
&& inputs.machines
&& inputs.docker_repo != ''
&& (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/v'))
name: Containers
runs-on: ${{matrix.machine}}
permissions: write-all
strategy:
fail-fast: true
matrix:
bake_target: ${{fromJSON('["docker_io", "ghcr_io"]')}}
cargo_profile: ${{fromJSON(inputs.cargo_profiles)}}
rust_toolchain: ${{fromJSON(inputs.rust_toolchains)}}
feat_set: ${{fromJSON(inputs.feat_sets)}}
sys_name: ${{fromJSON(inputs.sys_names)}}
sys_version: ${{fromJSON(inputs.sys_versions)}}
rust_target: ${{fromJSON(inputs.rust_targets)}}
sys_target: ${{fromJSON(inputs.sys_targets)}}
machine: ${{fromJSON(inputs.machines)}}
exclude: ${{fromJSON(inputs.excludes)}}
include: ${{fromJSON(inputs.includes)}}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: GitHub Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.ghcr_token }}
- name: DockerHub Login
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ github.actor }}
password: ${{ secrets.dockerhub_token }}
- name: Bake
env:
bake_target: ${{matrix.bake_target}}
cargo_profile: ${{matrix.cargo_profile}}
rust_toolchain: ${{matrix.rust_toolchain}}
rust_target: ${{matrix.rust_target}}
feat_set: ${{matrix.feat_set}}
sys_name: ${{matrix.sys_name}}
sys_version: ${{matrix.sys_version}}
sys_target: ${{matrix.sys_target}}
machine: ${{matrix.machine}}
acct: ${{github.actor}}
repo: ${{github.repository}}
docker_repo: ${{inputs.docker_repo}}
run: |
docker/bake.sh "${{matrix.bake_target}}"
bundles:
if: >
!failure() && !cancelled()
&& inputs.machines
&& inputs.docker_repo != ''
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["release"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["stable"]')[0])
&& (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/v'))
name: Bundles
needs: [containers]
runs-on: 'het'
permissions: write-all
strategy:
fail-fast: true
matrix:
bake_target: ${{fromJSON('["docker_io", "ghcr_io"]')}}
cargo_profile: ${{fromJSON('["release"]')}}
feat_set: ${{fromJSON('["all"]')}}
rust_toolchain: ${{fromJSON('["stable"]')}}
sys_name: ${{fromJSON(inputs.sys_names)}}
sys_version: ${{fromJSON(inputs.sys_versions)}}
rust_target: ${{fromJSON(inputs.rust_targets)}}
sys_target: ${{fromJSON(inputs.sys_targets)}}
machine: ${{fromJSON(inputs.machines)}}
exclude: ${{fromJSON(inputs.excludes)}}
include: ${{fromJSON(inputs.includes)}}
steps:
- name: GitHub Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.ghcr_token }}
- name: DockerHub Login
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ github.actor }}
password: ${{ secrets.dockerhub_token }}
- name: Release Branch
if: >
!failure() && !cancelled()
&& (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/v'))
env:
acct: ${{github.actor}}
ghcr_repo: ${{github.repository}}
docker_repo: ${{inputs.docker_repo}}
registry: ${{matrix.bake_target}}
cargo_profile: ${{matrix.cargo_profile}}
feat_set: ${{matrix.feat_set}}
sys_target: ${{matrix.sys_target}}
ref_name: ${{github.ref_name}}
run: |
registry="$(echo -n $registry | sed s/_/./)"
if test "$registry" = "ghcr.io"; then
repo="$ghcr_repo"
else
repo="$docker_repo"
fi
docker manifest create "${registry}/${repo}:${ref_name}" \
--amend "${registry}/${repo}:${ref_name}-${cargo_profile}-${feat_set}-${sys_target}"
- name: Release Preview
if: >
!failure() && !cancelled()
&& contains(github.ref, 'refs/tags/v')
&& !contains(github.ref, '-draft')
env:
acct: ${{github.actor}}
ghcr_repo: ${{github.repository}}
docker_repo: ${{inputs.docker_repo}}
registry: ${{matrix.bake_target}}
cargo_profile: ${{matrix.cargo_profile}}
feat_set: ${{matrix.feat_set}}
sys_target: ${{matrix.sys_target}}
ref_name: ${{github.ref_name}}
run: |
registry="$(echo -n $registry | sed s/_/./)"
if test "$registry" = "ghcr.io"; then
repo="$ghcr_repo"
else
repo="$docker_repo"
fi
docker manifest create "${registry}/${repo}:preview" \
--amend "${registry}/${repo}:${ref_name}-${cargo_profile}-${feat_set}-${sys_target}"
- name: Release Latest
if: >
!failure() && !cancelled()
&& contains(github.ref, 'refs/tags/v')
&& !contains(github.ref, '-draft')
&& !contains(github.ref, '-rc')
env:
acct: ${{github.actor}}
ghcr_repo: ${{github.repository}}
docker_repo: ${{inputs.docker_repo}}
registry: ${{matrix.bake_target}}
cargo_profile: ${{matrix.cargo_profile}}
feat_set: ${{matrix.feat_set}}
sys_target: ${{matrix.sys_target}}
ref_name: ${{github.ref_name}}
run: |
registry="$(echo -n $registry | sed s/_/./)"
if test "$registry" = "ghcr.io"; then
repo="$ghcr_repo"
else
repo="$docker_repo"
fi
docker manifest create "${registry}/${repo}:latest" \
--amend "${registry}/${repo}:${ref_name}-${cargo_profile}-${feat_set}-${sys_target}"
delivery:
if: >
!failure() && !cancelled()
&& inputs.machines
&& inputs.docker_repo != ''
&& (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/v'))
name: Delivery
needs: [bundles, documents]
runs-on: 'het'
permissions: write-all
steps:
- name: GitHub Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.ghcr_token }}
- name: DockerHub Login
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ github.actor }}
password: ${{ secrets.dockerhub_token }}
- name: Push Branch
if: >
!failure() && !cancelled()
&& (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/v'))
env:
ref_name: ${{github.ref_name}}
ghcr_repo: ${{github.repository}}
docker_repo: ${{inputs.docker_repo}}
run: |
docker manifest push -p "ghcr.io/${ghcr_repo}:${ref_name}"
docker manifest push -p "docker.io/${docker_repo}:${ref_name}"
- name: Push Preview
if: >
!failure() && !cancelled()
&& contains(github.ref, 'refs/tags/v')
&& !contains(github.ref, '-draft')
env:
ghcr_repo: ${{github.repository}}
docker_repo: ${{inputs.docker_repo}}
run: |
docker manifest push -p "ghcr.io/${ghcr_repo}:preview"
docker manifest push -p "docker.io/${docker_repo}:preview"
- name: Push Latest
if: >
!failure() && !cancelled()
&& contains(github.ref, 'refs/tags/v')
&& !contains(github.ref, '-draft')
&& !contains(github.ref, '-rc')
env:
ghcr_repo: ${{github.repository}}
docker_repo: ${{inputs.docker_repo}}
run: |
docker manifest push -p "ghcr.io/${ghcr_repo}:latest"
docker manifest push -p "docker.io/${docker_repo}:latest"
+404
View File
@@ -0,0 +1,404 @@
name: Testing
on:
workflow_call:
inputs:
cargo_profiles:
type: string
description: Cargo profiles
feat_sets:
type: string
description: Cargo feature groups
rust_toolchains:
type: string
description: Rust toolchains
sys_names:
type: string
description: System names
sys_versions:
type: string
description: System versions
rust_targets:
type: string
description: Rust targets
sys_targets:
type: string
description: System targets
machines:
type: string
description: Hardware platform vector
excludes:
type: string
default: '[]'
description: Matrix exclusions
includes:
type: string
default: '[]'
description: Matrix inclusions
complement:
type: boolean
default: true
complement_runner:
type: string
rust_sdk_integ:
type: boolean
default: true
build_nix:
type: boolean
default: true
head_msg:
type: string
jobs:
docs:
if: >
!contains(inputs.head_msg, '[ci only it]')
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
&& contains(fromJSON(inputs.sys_targets), fromJSON('["x86_64-v1-linux-gnu"]')[0])
name: Docs
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["docs"]'
cargo_profiles: '["test"]'
feat_sets: '["all"]'
rust_toolchains: '["nightly"]'
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: '["x86_64-v1-linux-gnu"]'
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
unit:
if: >
!contains(inputs.head_msg, '[ci only it]')
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
&& contains(fromJSON(inputs.sys_targets), fromJSON('["x86_64-v1-linux-gnu"]')[0])
name: Module
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["unit", "integ"]'
cargo_profiles: '["test"]'
feat_sets: '["all"]'
rust_toolchains: ${{inputs.rust_toolchains}}
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: '["x86_64-v1-linux-gnu"]'
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
bench:
if: >
!contains(inputs.head_msg, '[ci only it]')
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["bench"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
&& contains(fromJSON(inputs.sys_targets), fromJSON('["x86_64-v3-linux-gnu"]')[0])
name: Bench
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["unit", "integ"]'
cargo_profiles: '["bench"]'
feat_sets: '["all"]'
rust_toolchains: '["nightly"]'
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: '["x86_64-v3-linux-gnu"]'
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
memcheck:
if: >
!contains(inputs.head_msg, '[ci only it]')
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["bench"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
&& contains(fromJSON(inputs.sys_targets), fromJSON('["x86_64-v3-linux-gnu"]')[0])
name: Memcheck
uses: ./.github/workflows/bake.yml
with:
#bake_targets: '["unit-valgrind", "integ-valgrind"]'
bake_targets: '["integ-valgrind"]'
cargo_profiles: '["bench"]' # use bench not release for debug syms
feat_sets: '["all"]'
rust_toolchains: '["nightly"]'
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: '["x86_64-v3-linux-gnu"]'
machines: ${{inputs.machines}}
includes: ${{inputs.includes}}
excludes: ${{inputs.excludes}}
smoke:
if: >
!failure() && !cancelled()
&& !contains(inputs.head_msg, '[ci only it]')
&& !contains(inputs.head_msg, '[ci no build]')
&& inputs.cargo_profiles
&& inputs.machines
name: Smoke
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["smoke", "smoke-valgrind"]'
cargo_profiles: ${{inputs.cargo_profiles}}
feat_sets: ${{inputs.feat_sets}}
rust_toolchains: ${{inputs.rust_toolchains}}
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: ${{inputs.sys_targets}}
machines: ${{inputs.machines}}
includes: ${{inputs.includes}}
excludes: >
[
{"cargo_profile": "test", "feat_set": "default"},
{"cargo_profile": "test", "feat_set": "logging"},
{"cargo_profile": "test", "feat_set": "none", "bake_target": "smoke-valgrind"},
{"cargo_profile": "test", "rust_toolchain": "stable"},
{"cargo_profile": "test", "rust_target": "aarch64-unknown-linux-gnu"},
{"cargo_profile": "test", "sys_target": "x86_64-v2-linux-gnu"},
{"cargo_profile": "test", "sys_target": "x86_64-v3-linux-gnu"},
{"cargo_profile": "test", "bake_target": "smoke-valgrind"},
{"cargo_profile": "bench"},
{"cargo_profile": "release", "rust_toolchain": "nightly"},
{"cargo_profile": "release", "rust_toolchain": "stable", "feat_set": "none"},
{"cargo_profile": "release", "bake_target": "smoke-valgrind"},
{"cargo_profile": "release-debuginfo", "feat_set": "logging"},
{"cargo_profile": "release-debuginfo", "rust_toolchain": "nightly"},
{"cargo_profile": "release-debuginfo", "rust_toolchain": "stable", "feat_set": "none"},
{"cargo_profile": "release-debuginfo", "bake_target": "smoke"},
{"cargo_profile": "release-debuginfo", "rust_target": "aarch64-unknown-linux-gnu"},
{"cargo_profile": "release-native", "rust_toolchain": "stable"},
{"cargo_profile": "release-native", "feat_set": "none"},
{"cargo_profile": "release-native", "feat_set": "default"},
{"cargo_profile": "release-native", "feat_set": "logging"},
{"cargo_profile": "release-native", "bake_target": "smoke-valgrind"},
{"cargo_profile": "release-native", "rust_target": "aarch64-unknown-linux-gnu"},
{"cargo_profile": "release-native", "sys_target": "x86_64-v2-linux-gnu"},
{"cargo_profile": "release-native", "sys_target": "x86_64-v3-linux-gnu"},
{"cargo_profile": "release-native", "sys_target": "x86_64-v4-linux-gnu"},
{"rust_target": "aarch64-unknown-linux-gnu", "feat_set": "none"},
{"rust_target": "aarch64-unknown-linux-gnu", "feat_set": "default"},
{"rust_target": "aarch64-unknown-linux-gnu", "feat_set": "logging"},
{"rust_target": "aarch64-unknown-linux-gnu", "sys_target": "x86_64-v1-linux-gnu"},
{"rust_target": "aarch64-unknown-linux-gnu", "sys_target": "x86_64-v2-linux-gnu"},
{"rust_target": "aarch64-unknown-linux-gnu", "sys_target": "x86_64-v3-linux-gnu"},
{"rust_target": "aarch64-unknown-linux-gnu", "sys_target": "x86_64-v4-linux-gnu"},
{"rust_target": "x86_64-unknown-linux-gnu", "sys_target": "aarch64-v8-linux-gnu"},
{"sys_target": "aarch64-v8-linux-gnu", "machine": "X64"},
{"sys_target": "x86_64-v1-linux-gnu", "machine": "ARM64"},
{"sys_target": "x86_64-v2-linux-gnu", "machine": "ARM64"},
{"sys_target": "x86_64-v2-linux-gnu", "feat_set": "none"},
{"sys_target": "x86_64-v2-linux-gnu", "feat_set": "default"},
{"sys_target": "x86_64-v2-linux-gnu", "feat_set": "logging"},
{"sys_target": "x86_64-v3-linux-gnu", "machine": "ARM64"},
{"sys_target": "x86_64-v3-linux-gnu", "feat_set": "none"},
{"sys_target": "x86_64-v3-linux-gnu", "feat_set": "default"},
{"sys_target": "x86_64-v3-linux-gnu", "feat_set": "logging"},
{"sys_target": "x86_64-v3-linux-gnu", "bake_target": "smoke-valgrind"},
{"sys_target": "x86_64-v4-linux-gnu", "machine": "ARM64"},
{"sys_target": "x86_64-v4-linux-gnu", "feat_set": "none"},
{"sys_target": "x86_64-v4-linux-gnu", "feat_set": "default"},
{"sys_target": "x86_64-v4-linux-gnu", "feat_set": "logging"},
{"sys_target": "x86_64-v4-linux-gnu", "bake_target": "smoke-valgrind"},
]
nix:
if: >
!failure() && !cancelled()
&& !contains(inputs.head_msg, '[ci only it]')
&& !contains(inputs.head_msg, '[ci no build]')
&& !contains(github.ref, 'refs/pull')
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["release"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["stable"]')[0])
&& contains(fromJSON(inputs.sys_targets), fromJSON('["x86_64-v1-linux-gnu"]')[0])
&& fromJSON(inputs.build_nix)
name: Smoke NixOS
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["smoke-nix"]'
cargo_profiles: '["release"]'
feat_sets: '["all"]'
rust_toolchains: '["stable"]'
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: '["x86_64-v1-linux-gnu"]'
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
rust-sdk-integ:
if: >
!failure() && !cancelled()
&& !contains(inputs.head_msg, '[ci no build]')
&& inputs.rust_sdk_integ
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
&& contains(fromJSON(inputs.rust_targets), fromJSON('["x86_64-unknown-linux-gnu"]')[0])
name: Matrix SDK Integration
needs: [smoke]
uses: ./.github/workflows/bake.yml
with:
#bake_targets: '["rust-sdk-integ", "rust-sdk-valgrind"]'
bake_targets: '["rust-sdk-integ"]'
cargo_profiles: ${{inputs.cargo_profiles}}
feat_sets: '["all"]'
rust_toolchains: '["nightly"]'
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: '["x86_64-unknown-linux-gnu"]'
sys_targets: ${{inputs.sys_targets}}
machines: '["X64"]'
runner: ${{inputs.complement_runner}}
includes: ${{inputs.includes}}
artifact: >
{
"rust-sdk-integ": {
"src": "/var/log/tuwunel.log",
"dst": "rust-sdk-integ.tuwunel.log",
},
"rust-sdk-valgrind": {
"src": "/var/log/tuwunel.log",
"dst": "rust-sdk-valgrind.tuwunel.log",
}
}
excludes: >
[
{"bake_target": "rust-sdk-valgrind", "cargo_profile": "test"},
{"feat_set": "none"},
{"feat_set": "logging"},
{"cargo_profile": "release"},
{"cargo_profile": "release-debuginfo"},
{"cargo_profile": "release-native"},
{"cargo_profile": "test", "sys_target": "x86_64-v2-linux-gnu"},
{"cargo_profile": "test", "sys_target": "x86_64-v3-linux-gnu"},
{"cargo_profile": "bench", "sys_target": "x86_64-v1-linux-gnu"},
{"cargo_profile": "bench", "sys_target": "x86_64-v2-linux-gnu"},
{"rust_target": "aarch64-unknown-linux-gnu"},
{"sys_target": "aarch64-v8-linux-gnu"},
]
complement:
if: >
!failure() && !cancelled()
&& !contains(inputs.head_msg, '[ci no build]')
&& inputs.complement
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["bench"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
&& contains(fromJSON(inputs.sys_targets), fromJSON('["x86_64-v3-linux-gnu"]')[0])
name: Complement
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["complement-tester", "complement-testee"]'
cargo_profiles: '["bench"]'
feat_sets: '["logging"]'
rust_toolchains: '["nightly"]'
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: '["x86_64-v3-linux-gnu"]'
machines: ${{inputs.machines}}
runner: ${{inputs.complement_runner}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
compliance:
if: >
!failure() && !cancelled()
&& !contains(inputs.head_msg, '[ci no build]')
&& inputs.complement
&& inputs.machines
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["bench"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
&& contains(fromJSON(inputs.sys_targets), fromJSON('["x86_64-v3-linux-gnu"]')[0])
name: Matrix Compliance
needs: [complement, smoke]
runs-on: ["${{matrix.machine}}", "${{inputs.complement_runner}}"]
concurrency:
group: complement-cant-walk-and-chew-bubblegum
cancel-in-progress: false
strategy:
fail-fast: false
matrix:
cargo_profile: ${{fromJSON('["bench"]')}}
feat_set: ${{fromJSON('["logging"]')}}
rust_toolchain: ${{fromJSON('["nightly"]')}}
sys_name: ${{fromJSON(inputs.sys_names)}}
sys_version: ${{fromJSON(inputs.sys_versions)}}
rust_target: ${{fromJSON(inputs.rust_targets)}}
sys_target: ${{fromJSON('["x86_64-v3-linux-gnu"]')}}
machine: ${{fromJSON(inputs.machines)}}
exclude: ${{fromJSON(inputs.excludes)}}
include: ${{fromJSON(inputs.includes)}}
steps:
- uses: actions/checkout@v3
- name: Execute
id: execute
env:
cargo_profile: ${{matrix.cargo_profile}}
rust_toolchain: ${{matrix.rust_toolchain}}
rust_target: ${{matrix.rust_target}}
feat_set: ${{matrix.feat_set}}
sys_name: ${{matrix.sys_name}}
sys_target: ${{matrix.sys_target}}
sys_version: ${{matrix.sys_version}}
machine: ${{matrix.machine}}
run: |
docker/complement.sh
- if: success() || failure() && steps.execute.outcome == 'failure'
name: Extract
id: extract
env:
name: complement_tester__${{matrix.sys_name}}__${{matrix.sys_version}}__${{matrix.sys_target}}
tag: latest
run: |
cid=$(cat "$name")
docker cp "$cid:/usr/src/complement/new_results.jsonl" tests/complement/results.jsonl
- if: success() || failure() && steps.execute.outcome == 'failure'
name: Upload New Results
id: upload-result
uses: actions/upload-artifact@v4
with:
name: complement_results-${{matrix.feat_set}}-${{matrix.sys_name}}-${{matrix.sys_target}}.jsonl
path: ./tests/complement/results.jsonl
- if: failure() && steps.execute.outcome == 'failure'
name: Upload Failure Output
id: upload-output
uses: actions/upload-artifact@v4
with:
name: complement_output-${{matrix.feat_set}}-${{matrix.sys_name}}-${{matrix.sys_target}}.jsonl
path: ./complement.jsonl
if-no-files-found: ignore
- name: Accept
id: accept
run: |
git diff --exit-code --color --color-moved
+6 -6
View File
@@ -79,7 +79,7 @@ test-conduit.toml
/.gitlab-ci.d
# mdbook output
/public/
public/
# macOS
.DS_Store
@@ -96,9 +96,9 @@ rustc-ice-*
# complement test logs are huge
tests/test_results/complement/test_logs.jsonl
# Node
node_modules/
# cargo profiles from -Z self-profile
*.mm_profdata
# Rspress
doc_build/
.rspress/
# Editor crashfiles
*.save
*.swp
+8
View File
@@ -0,0 +1,8 @@
<!-- Please describe your changes here -->
-----------------------------------------------------------------------------
- [ ] I ran `cargo fmt`, `cargo clippy`, and `cargo test`
- [ ] I agree to release my code and all other changes of this MR under the Apache-2.0 license
+3
View File
@@ -0,0 +1,3 @@
# Docs: Map markdown to html files
- source: /docs/(.+)\.md/
public: '\1.html'
-18
View File
@@ -1,18 +0,0 @@
AlexPewMaster <git@alex.unbox.at> <68469103+AlexPewMaster@users.noreply.github.com>
Daniel Wiesenberg <weasy@hotmail.de> <weasy666@gmail.com>
Devin Ragotzy <devin.ragotzy@gmail.com> <d6ragotzy@wmich.edu>
Devin Ragotzy <devin.ragotzy@gmail.com> <dragotzy7460@mail.kvcc.edu>
Ginger <ginger@gingershaped.computer> <75683114+gingershaped@users.noreply.github.com>
Jonas Platte <jplatte+git@posteo.de> <jplatte+gitlab@posteo.de>
Jonas Zohren <git-pbkyr@jzohren.de> <gitlab-jfowl-0ux98@sh14.de>
Jonathan de Jong <jonathan@automatia.nl> <jonathandejong02@gmail.com>
June Clementine Strawberry <june@3.dog> <june@girlboss.ceo>
June Clementine Strawberry <june@3.dog> <strawberry@pupbrain.dev>
June Clementine Strawberry <june@3.dog> <strawberry@puppygock.gay>
Olivia Lee <olivia@computer.surgery> <benjamin@computer.surgery>
Rudi Floren <rudi.floren@gmail.com> <rudi.floren@googlemail.com>
Tamara Schmitz <tamara.zoe.schmitz@posteo.de> <15906939+tamara-schmitz@users.noreply.github.com>
Timo Kösters <timo@koesters.xyz>
nexy7574 <git@nexy7574.co.uk> <nex@noreply.forgejo.ellis.link>
nexy7574 <git@nexy7574.co.uk> <nex@noreply.localhost>
x4u <xi.zhu@protonmail.ch> <14617923-x4u@users.noreply.gitlab.com>
-47
View File
@@ -1,47 +0,0 @@
default_install_hook_types:
- pre-commit
- commit-msg
default_stages:
- pre-commit
- manual
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: fix-byte-order-marker
- id: check-case-conflict
- id: check-symlinks
- id: destroyed-symlinks
- id: check-yaml
- id: check-json
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
- id: check-merge-conflict
- id: check-added-large-files
- repo: https://github.com/crate-ci/typos
rev: v1.41.0
hooks:
- id: typos
- id: typos
name: commit-msg-typos
stages: [commit-msg]
- repo: https://github.com/crate-ci/committed
rev: v1.1.9
hooks:
- id: committed
- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt
entry: cargo +nightly fmt --
language: system
types: [rust]
pass_filenames: false
stages:
- pre-commit
+2 -23
View File
@@ -1,27 +1,6 @@
[files]
extend-exclude = ["*.csr", "*.lock", "pnpm-lock.yaml"]
[default]
extend-ignore-re = [
"(?Rm)^.*(#|//|<!--)\\s*spellchecker:disable-line(\\s*-->)$", # Ignore a line by making it trail with a `spellchecker:disable-line` comment
"^[0-9a-f]{7,}$", # Commit hashes
# some heuristics for base64 strings
"[A-Za-z0-9+=]{72,}",
"([A-Za-z0-9+=]|\\\\\\s\\*){72,}",
"[0-9+][A-Za-z0-9+]{30,}[a-z0-9+]",
"\\$[A-Z0-9+][A-Za-z0-9+]{6,}[a-z0-9+]",
"\\b[a-z0-9+/=][A-Za-z0-9+/=]{7,}[a-z0-9+/=][A-Z]\\b",
# In the renovate config
".ontainer"
]
[default.extend-words]
"allocatedp" = "allocatedp"
"conduwuit" = "conduwuit"
"continuwuity" = "continuwuity"
"continuwity" = "continuwuity"
"execuse" = "execuse"
"oltp" = "OTLP"
"leafs" = "leafs"
"serialize" = "serialize"
-11
View File
@@ -1,11 +0,0 @@
{
"cSpell.words": [
"Forgejo",
"appservice",
"appservices",
"conduwuit",
"continuwuity",
"homeserver",
"homeservers"
]
}
-58
View File
@@ -1,58 +0,0 @@
# Continuwuity 0.5.3 (2026-01-12)
## Features
- Improve the display of nested configuration with the `!admin server show-config` command. Contributed by @Jade (#1279)
## Bugfixes
- Fixed `M_BAD_JSON` error when sending invites to other servers or when providing joins. Contributed by @nex (#1286)
## Docs
- Improve admin command documentation generation. Contributed by @ginger (#1280)
## Misc
- Improve timeout-related code for federation and URL previews. Contributed by @Jade (#1278)
# Continuwuity 0.5.2 (2026-01-09)
## Features
- Added support for issuing additional registration tokens, stored in the database, which supplement the existing registration token hardcoded in the config file. These tokens may optionally expire after a certain number of uses or after a certain amount of time has passed. Additionally, the `registration_token_file` configuration option is superseded by this feature and **has been removed**. Use the new `!admin token` command family to manage registration tokens. Contributed by @ginger (#783).
- Implemented a configuration defined admin list independent of the admin room. Contributed by @Terryiscool160. (#1253)
- Added support for invite and join anti-spam via Draupnir and Meowlnir, similar to that of synapse-http-antispam. Contributed by @nex. (#1263)
- Implemented account locking functionality, to complement user suspension. Contributed by @nex. (#1266)
- Added admin command to forcefully log out all of a user's existing sessions. Contributed by @nex. (#1271)
- Implemented toggling the ability for an account to log in without mutating any of its data. Contributed by @nex. (#1272)
- Add support for custom room create event timestamps, to allow generating custom prefixes in hashed room IDs. Contributed by @nex. (#1277)
- Certain potentially dangerous admin commands are now restricted to only be usable in the admin room and server console. Contributed by @ginger.
## Bugfixes
- Fixed unreliable room summary fetching and improved error messages. Contributed by @nex. (#1257)
- Client requested timeout parameter is now applied to e2ee key lookups and claims. Related federation requests are now also concurrent. Contributed by @nex. (#1261)
- Fixed the whoami endpoint returning HTTP 404 instead of HTTP 403, which confused some appservices. Contributed by @nex. (#1276)
## Misc
- The `console` feature is now enabled by default, allowing the server console to be used for running admin commands directly. To automatically open the console on startup, set the `admin_console_automatic` config option to `true`. Contributed by @ginger.
- We now (finally) document our container image mirrors. Contributed by @Jade
# Continuwuity 0.5.0 (2025-12-30)
**This release contains a CRITICAL vulnerability patch, and you must update as soon as possible**
## Features
- Enabled the OTLP exporter in default builds, and allow configuring the exporter protocol. (@Jade). (#1251)
## Bug Fixes
- Don't allow admin room upgrades, as this can break the admin room (@timedout) (#1245)
- Fix invalid creators in power levels during upgrade to v12 (@timedout) (#1245)
+14 -13
View File
@@ -17,24 +17,24 @@ ## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Demonstrating empathy and kindness toward other people.
* Being respectful of differing opinions, viewpoints, and experiences.
* Giving and gracefully accepting constructive feedback.
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
and learning from the experience.
* Focusing on what is best not just for us as individuals, but for the overall
community
community.
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
any kind.
* Trolling, insulting or derogatory comments, and personal or political attacks.
* Public or private harassment.
* Publishing others' private information, such as a physical or email address,
without their explicit permission
without their explicit permission.
* Other conduct which could reasonably be considered inappropriate in a
professional setting
professional setting.
## Enforcement Responsibilities
@@ -59,10 +59,11 @@ ## Scope
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement over Matrix at [#continuwuity:continuwuity.org](https://matrix.to/#/#continuwuity:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org) or email at <tom@tcpip.uk>, <jade@continuwuity.org> and <nex@continuwuity.org> respectively.
All complaints will be reviewed and investigated promptly and fairly.
reported to the community leaders responsible for enforcement over email at
<abuse@tuwunel.chat> or over Matrix at @abuse:tuwunel.chat.
All community leaders are obligated to respect the privacy and security of the
All complaints will be reviewed and investigated promptly and fairly. All
community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
+80 -128
View File
@@ -1,173 +1,125 @@
# Contributing guide
This page is about contributing to Continuwuity. The
[development](/development/index.mdx) and [code style guide](/development/code_style.mdx) pages may be of interest for you as well.
This page is for about contributing to Tuwunel. The
[development](./development.md) page may be of interest for you as well.
If you would like to work on an [issue][issues] that is not assigned, preferably
ask in the Matrix room first at [#continuwuity:continuwuity.org][continuwuity-matrix],
ask in the Matrix room first at [#tuwunel:tuwunel.chat][tuwunel-chat],
and comment on it.
### Code Style
### Linting and Formatting
Please review and follow the [code style guide](/development/code_style.mdx) for formatting, linting, naming conventions, and other code standards.
It is mandatory all your changes satisfy the lints (clippy, rustc, rustdoc, etc)
and your code is formatted via the **nightly** `cargo fmt`. A lot of the
`rustfmt.toml` features depend on nightly toolchain. It would be ideal if they
weren't nightly-exclusive features, but they currently still are. CI's rustfmt
uses nightly.
### Pre-commit Checks
If you need to allow a lint, please make sure it's either obvious as to why
(e.g. clippy saying redundant clone but it's actually required) or it has a
comment saying why. Do not write inefficient code for the sake of satisfying
lints. If a lint is wrong and provides a more inefficient solution or
suggestion, allow the lint and mention that in a comment.
Continuwuity uses pre-commit hooks to enforce various coding standards and catch common issues before they're committed. These checks include:
### Running CI tests locally
- Code formatting and linting
- Typo detection (both in code and commit messages)
- Checking for large files
- Ensuring proper line endings and no trailing whitespace
- Validating YAML, JSON, and TOML files
- Checking for merge conflicts
You can run these checks locally by installing [prefligit](https://github.com/j178/prefligit):
```bash
# Requires UV: https://docs.astral.sh/uv/getting-started/installation/
# Mac/linux: curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows: powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# Install prefligit using cargo-binstall
cargo binstall prefligit
# Install git hooks to run checks automatically
prefligit install
# Run all checks
prefligit --all-files
```
Alternatively, you can use [pre-commit](https://pre-commit.com/):
```bash
# Requires python
# Install pre-commit
pip install pre-commit
# Install the hooks
pre-commit install
# Run all checks manually
pre-commit run --all-files
```
These same checks are run in CI via the prefligit-checks workflow to ensure consistency. These must pass before the PR is merged.
### Running tests locally
Tests, compilation, and linting can be run with standard Cargo commands:
```bash
# Run tests
cargo test
# Check compilation
cargo check --workspace --features full
# Run lints
cargo clippy --workspace --features full
# Auto-fix: cargo clippy --workspace --features full --fix --allow-staged;
# Format code (must use nightly)
cargo +nightly fmt
```
<sub>TODO: docker bake matrix</sub>
### Matrix tests
Continuwuity uses [Complement][complement] for Matrix protocol compliance testing. Complement tests are run manually by developers, and documentation on how to run these tests locally is currently being developed.
CI runs [Complement][complement], but currently does not fail if results from
the checked-in results differ with the new results. If your changes are done to
fix Matrix tests, note that in your pull request. If more Complement tests start
failing from your changes, please review the logs (they are uploaded as
artifacts) and determine if they're intended or not.
If your changes are done to fix Matrix tests, please note that in your pull request. If more Complement tests start failing from your changes, please review the logs and determine if they're intended or not.
If you'd like to run Complement locally using Nix, see the
[testing](development/testing.md) page.
[Sytest][sytest] is currently unsupported.
[Sytest][sytest] support will come soon.
### Writing documentation
Continuwuity's website uses [`mdbook`][mdbook] and is deployed via CI using Cloudflare Pages
in the [`documentation.yml`][documentation.yml] workflow file. All documentation is in the `docs/`
directory at the top level.
Tuwunel's website uses [`mdbook`][mdbook] and deployed via CI using GitHub
Pages in the [`documentation.yml`][documentation.yml] workflow file with Nix's
mdbook in the devshell. All documentation is in the `docs/` directory at the top
level. The compiled mdbook website is also uploaded as an artifact.
To build the documentation locally:
To build the documentation using Nix, run: `bin/nix-build-and-cache just .#book`
1. Install mdbook if you don't have it already:
```bash
cargo install mdbook # or cargo binstall, or another method
```
The output of the mdbook generation is in `result/`. mdbooks can be opened in
your browser from the individual HTML files without any web server needed.
2. Build the documentation:
```bash
mdbook build
```
### Inclusivity and Diversity
The output of the mdbook generation is in `public/`. You can open the HTML files directly in your browser without needing a web server.
All **MUST** code and write with inclusivity and diversity in mind. See the
[following page by Google on writing inclusive code and
documentation](https://developers.google.com/style/inclusive-documentation).
This **EXPLICITLY** forbids usage of terms like "blacklist"/"whitelist" and
"master"/"slave", [forbids gender-specific words and
phrases](https://developers.google.com/style/pronouns#gender-neutral-pronouns),
forbids ableist language like "sanity-check", "cripple", or "insane", and
forbids culture-specific language (e.g. US-only holidays or cultures).
### Commit Messages
No exceptions are allowed. Dependencies that may use these terms are allowed but
[do not replicate the name in your functions or
variables](https://developers.google.com/style/inclusive-documentation#write-around).
Continuwuity follows the [Conventional Commits](https://www.conventionalcommits.org/) specification for commit messages. This provides a standardized format that makes the commit history more readable and enables automated tools to generate changelogs.
In addition to language, write and code with the user experience in mind. This
is software that intends to be used by everyone, so make it easy and comfortable
for everyone to use. 🏳️‍⚧️
The basic structure is:
### Variable, comment, function, etc standards
```
<type>[(optional scope)]: <description>
[optional body]
[optional footer(s)]
```
The allowed types for commits are:
- `fix`: Bug fixes
- `feat`: New features
- `docs`: Documentation changes
- `style`: Changes that don't affect the meaning of the code (formatting, etc.)
- `refactor`: Code changes that neither fix bugs nor add features
- `perf`: Performance improvements
- `test`: Adding or fixing tests
- `build`: Changes to the build system or dependencies
- `ci`: Changes to CI configuration
- `chore`: Other changes that don't modify source or test files
Examples:
```
feat: add user authentication
fix(database): resolve connection pooling issue
docs: update installation instructions
```
The project uses the `committed` hook to validate commit messages in pre-commit. This ensures all commits follow the conventional format.
Rust's default style and standards with regards to [function names, variable
names, comments](https://rust-lang.github.io/api-guidelines/naming.html), etc
applies here.
### Creating pull requests
Please try to keep contributions to the Forgejo Instance. While the mirrors of continuwuity
allow for pull/merge requests, there is no guarantee the maintainers will see them in a timely
Please try to keep contributions to the GitHub. While the mirrors of Tuwunel
allow for pull/merge requests, there is no guarantee I will see them in a timely
manner. Additionally, please mark WIP or unfinished or incomplete PRs as drafts.
This prevents us from having to ping once in a while to double check the status
This prevents me from having to ping once in a while to double check the status
of it, especially when the CI completed successfully and everything so it
*looks* done.
Before submitting a pull request, please ensure:
1. Your code passes all CI checks (formatting, linting, typo detection, etc.)
2. Your code follows the [code style guide](/development/code_style.md)
3. Your commit messages follow the conventional commits format
4. Tests are added for new functionality
5. Documentation is updated if needed
If you open a pull request on one of the mirrors, it is your responsibility to
inform me about its existence. In the future I may try to solve this with more
repo bots in the Tuwunel Matrix room. There is no mailing list or email-patch
support on the sr.ht mirror, but if you'd like to email me a git patch you can
do so at `maintainer@tuwunel.chat`.
Direct all PRs/MRs to the `main` branch.
By sending a pull request or patch, you are agreeing that your changes are
allowed to be licenced under the Apache-2.0 licence and all of your conduct is
in line with the Contributor's Covenant, and continuwuity's Code of Conduct.
in line with the Contributor's Covenant, and Tuwunel's Code of Conduct.
Contribution by users who violate either of these code of conducts may not have
Contribution by users who violate either of these code of conducts will not have
their contributions accepted. This includes users who have been banned from
continuwuity Matrix rooms for Code of Conduct violations.
Tuwunel Matrix rooms for Code of Conduct violations.
[issues]: https://forgejo.ellis.link/continuwuation/continuwuity/issues
[continuwuity-matrix]: https://matrix.to/#/#continuwuity:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org
### Branch Policy
##### This section applies to Matrix-Construct members and Tuwunel maintainers
All branches on the matrix-construct/tuwunel repository are _centrally
maintained_. They may be rebased without your consent. Trivial conflicts may be
resolved by another maintainer. Please resolve more difficult conflicts as soon
as possible. Personal forks are advised to reduce the workload on other
maintainers. Stale branches will be deleted to reduce the effort for this
policy.
[issues]: https://github.com/matrix-construct/tuwunel/issues
[tuwunel-chat]: https://matrix.to/#/#tuwunel:tuwunel.chat
[complement]: https://github.com/matrix-org/complement/
[sytest]: https://github.com/matrix-org/sytest/
[cargo-deb]: https://github.com/kornelski/cargo-deb
[lychee]: https://github.com/lycheeverse/lychee
[markdownlint-cli]: https://github.com/igorshubovych/markdownlint-cli
[cargo-audit]: https://github.com/RustSec/rustsec/tree/main/cargo-audit
[direnv]: https://direnv.net/
[mdbook]: https://rust-lang.github.io/mdBook/
[documentation.yml]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/.forgejo/workflows/documentation.yml
[documentation.yml]: https://github.com/matrix-construct/tuwunel/blob/main/.github/workflows/docs.yml
Generated
+736 -1128
View File
File diff suppressed because it is too large Load Diff
+569 -518
View File
File diff suppressed because it is too large Load Diff
+120 -86
View File
@@ -1,123 +1,157 @@
# continuwuity
# Tuwunel<sup>💕</sup>
![GitHub License](https://img.shields.io/github/license/matrix-construct/tuwunel?style=flat&color=%238A2BE2)
![GitHub Created At](https://img.shields.io/github/created-at/matrix-construct/tuwunel?style=flat&color=%238A2BE2)
![GitHub Commit Activity](https://img.shields.io/github/commit-activity/m/matrix-construct/tuwunel?style=flat&link=https%3A%2F%2Fgithub.com%2Fmatrix-construct%2Ftuwunel%2Fpulse%2Fmonthly&color=%238A2BE2)
![Docker Pulls](https://img.shields.io/docker/pulls/jevolk/tuwunel?style=flat&color=8A2BE2)
![GitHub Repo Stars](https://img.shields.io/github/stars/matrix-construct/tuwunel?style=flat&link=https%3A%2F%2Fgithub.com%2Fmatrix-construct%2Ftuwunel&color=%238A2BE2)
[![CI/CD](https://github.com/matrix-construct/tuwunel/actions/workflows/main.yml/badge.svg?branch=main&style=flat)](https://github.com/matrix-construct/tuwunel/actions/workflows/main.yml)
<!-- ANCHOR: catchphrase -->
## A community-driven [Matrix](https://matrix.org/) homeserver in Rust
[![Chat on Matrix](https://img.shields.io/matrix/continuwuity%3Acontinuwuity.org?server_fqdn=matrix.continuwuity.org&fetchMode=summary&logo=matrix)](https://matrix.to/#/#continuwuity:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org) [![Join the space](https://img.shields.io/matrix/space%3Acontinuwuity.org?server_fqdn=matrix.continuwuity.org&fetchMode=summary&logo=matrix&label=space)](https://matrix.to/#/#space:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org)
## High Performance Matrix Homeserver in Rust!
<!-- ANCHOR_END: catchphrase -->
[continuwuity] is a Matrix homeserver written in Rust.
It's the official community continuation of the [conduwuit](https://github.com/girlbossceo/conduwuit) homeserver.
<!-- ANCHOR: body -->
[![forgejo.ellis.link](https://img.shields.io/badge/Ellis%20Git-main+packages-green?style=flat&logo=forgejo&labelColor=fff)](https://forgejo.ellis.link/continuwuation/continuwuity) [![Stars](https://forgejo.ellis.link/continuwuation/continuwuity/badges/stars.svg?style=flat)](https://forgejo.ellis.link/continuwuation/continuwuity/stars) [![Issues](https://forgejo.ellis.link/continuwuation/continuwuity/badges/issues/open.svg?style=flat)](https://forgejo.ellis.link/continuwuation/continuwuity/issues?state=open) [![Pull Requests](https://forgejo.ellis.link/continuwuation/continuwuity/badges/pulls/open.svg?style=flat)](https://forgejo.ellis.link/continuwuation/continuwuity/pulls?state=open)
Tuwunel is a featureful [Matrix](https://matrix.org/) homeserver you can use instead of Synapse
with your favorite [client](https://matrix.org/ecosystem/clients/),
[bridge](https://matrix.org/ecosystem/bridges/) or
[bot](https://matrix.org/ecosystem/integrations/). It is written entirely in Rust to be a scalable,
lightweight, low-cost, community-driven alternative covering all but the most niche uses.
[![GitHub](https://img.shields.io/badge/GitHub-mirror-blue?style=flat&logo=github&labelColor=fff&logoColor=24292f)](https://github.com/continuwuity/continuwuity) [![Stars](https://img.shields.io/github/stars/continuwuity/continuwuity?style=flat)](https://github.com/continuwuity/continuwuity/stargazers)
This project is the official successor to conduwuit, which
was a featureful and high-performance fork of [Conduit](https://gitlab.com/famedly/conduit), all
community-lead homeservers implementing the compatible
[Matrix Specification](https://spec.matrix.org/latest/).
[![GitLab](https://img.shields.io/badge/GitLab-mirror-blue?style=flat&logo=gitlab&labelColor=fff)](https://gitlab.com/continuwuity/continuwuity) [![Stars](https://img.shields.io/gitlab/stars/continuwuity/continuwuity?style=flat)](https://gitlab.com/continuwuity/continuwuity/-/starrers)
Tuwunel is operated by enterprise users with a vested interest in sponsoring its continued
development. It is now maintained by full-time staff.
[![Codeberg](https://img.shields.io/badge/Codeberg-mirror-2185D0?style=flat&logo=codeberg&labelColor=fff)](https://codeberg.org/continuwuity/continuwuity) [![Stars](https://codeberg.org/continuwuity/continuwuity/badges/stars.svg?style=flat)](https://codeberg.org/continuwuity/continuwuity/stars)
### Getting Started
### Why does this exist?
- [GitHub Releases](https://github.com/matrix-construct/tuwunel/releases)
- [Sourcecode](https://github.com/matrix-construct/tuwunel/) `git clone https://github.com/matrix-construct/tuwunel.git`
- [DockerHub](https://hub.docker.com/r/jevolk/tuwunel) or `docker pull jevolk/tuwunel:latest`
- [GHCR](https://github.com/matrix-construct/tuwunel/pkgs/container/tuwunel) or `docker pull ghcr.io/matrix-construct/tuwunel:latest`
- Static binaries available as [releases](https://github.com/matrix-construct/tuwunel/releases) or [build artifacts](https://github.com/matrix-construct/tuwunel/actions?query=branch%3Amain).
- Deb and RPM packages available as [releases](https://github.com/matrix-construct/tuwunel/releases) or [build artifacts](https://github.com/matrix-construct/tuwunel/actions?query=branch%3Amain).
- Arch package available as [tuwunel](https://aur.archlinux.org/packages/tuwunel) or [tuwunel-git](https://aur.archlinux.org/packages/tuwunel-git).
- Nix package still [needs some love](https://github.com/NixOS/nixpkgs/issues/415469).
The original conduwuit project has been archived and is no longer maintained. Rather than letting this Rust-based Matrix homeserver disappear, a group of community contributors have forked the project to continue its development, fix outstanding issues, and add new features.
**1.** [Configure](https://matrix-construct.github.io/tuwunel/configuration.html) by
copying and editing the `tuwunel-example.toml`. The `server_name` and `database_path` must be
configured. **Most users deploy via docker or a distribution package and should follow the
[appropriate guide](https://matrix-construct.github.io/tuwunel/deploying.html) instead.**
This is just a summary for the impatient. See the full
[documentation](https://matrix-construct.github.io/tuwunel/).
We aim to provide a stable, well-maintained alternative for current conduwuit users and welcome newcomers seeking a lightweight, efficient Matrix homeserver.
> [!TIP]
> Avoid using a sub-domain for your `server_name`. You can always delegate later with a [`.well-known`](https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-well-known.md)
> file, but you can never change your `server_name`.
### Who are we?
**2.** Setup TLS certificates. Most users enjoy the [Caddy](https://caddyserver.com/) reverse-proxy
which automates their certificate renewal. Advanced users can load their own TLS certificates
using the configuration and Tuwunel can be deployed without a reverse proxy. Example
`/etc/caddy/Caddyfile` configuration with [Element](https://github.com/element-hq/element-web/releases)
unzipped to `/var/www/element`:
```
tuwunel.me, tuwunel.me:8448 {
reverse_proxy localhost:8008
}
web.tuwunel.me {
root * /var/www/element/
file_server
}
```
`caddy reload --config /etc/caddy/Caddyfile`
We are a group of Matrix enthusiasts, developers and system administrators who have used conduwuit and believe in its potential. Our team includes both previous
contributors to the original project and new developers who want to help maintain and improve this important piece of Matrix infrastructure.
**3.** Start the server, connect your client and register your username. The first registration is
granted server admin.
We operate as an open community project, welcoming contributions from anyone interested in improving continuwuity.
> [!TIP]
> Configure a secret `registration_token` and set `allow_registration = true`
### What is Matrix?
🤗 Did you find this and other documentation helpful? We would love to hear feedback about setting
up Tuwunel.
[Matrix](https://matrix.org) is an open, federated, and extensible network for
decentralized communication. Users from any Matrix homeserver can chat with users from all
other homeservers over federation. Matrix is designed to be extensible and built on top of.
You can even use bridges such as Matrix Appservices to communicate with users outside of Matrix, like a community on Discord.
### What are the project's goals?
### Migrating to Tuwunel
Continuwuity aims to:
| Can I migrate from | |
|-----------------|-----------|
| conduwuit? | ✅ Yes. This will be supported at a minimum for one year, but likely indefinitely. |
| Synapse? | ❌ Not yet, but this is planned and an important issue. Subscribe to [#2](https://github.com/matrix-construct/tuwunel/issues/2). |
| Conduit? | ❌ Not right now, but this is planned for the near future. Subscribe to [#41](https://github.com/matrix-construct/tuwunel/issues/41). |
| Any other fork of Conduit? | ❌ No. The migration must be explicitly listed in this table. |
> [!CAUTION]
> **Never switch between different forks of Conduit or you will corrupt your database.**
> All derivatives of Conduit share the same linear database version without any awareness of other
> forks. The database will permanently corrupt and we will not be able to help you.
- Maintain a stable, reliable Matrix homeserver implementation in Rust
- Improve compatibility and specification compliance with the Matrix protocol
- Fix bugs and performance issues from the original conduwuit
- Add missing features needed by homeserver administrators
- Provide comprehensive documentation and easy deployment options
- Create a sustainable development model for long-term maintenance
- Keep a lightweight, efficient codebase that can run on modest hardware
#### Migrating from conduwuit
### Can I try it out?
Migrating from conduwuit to Tuwunel _just works_. In technical parlance it is a "binary swap."
All you have to do is update to the latest Tuwunel and change the path to the executable from
`conduwuit` to `tuwunel`.
Check out the [documentation](https://continuwuity.org) for installation instructions.
Anything else named "conduwuit" is still recognized, this includes environment variables with prefixes
such as `CONDUWUIT_`. In fact, `CONDUIT_` is still recognized for our legacy users. You may have
noticed that various configs, yamls, services, users, and other items were renamed, but if you
were a conduwuit user we recommend against changing anything at all. This will keep things simple.
If you are not sure please ask. If you found out that something did in fact need to be changed
please open an issue immediately.
There are currently no open registration Continuwuity instances available.
### What are we working on?
### Upgrading & Downgrading Tuwunel
We're working our way through all of the issues in the [Forgejo project](https://forgejo.ellis.link/continuwuation/continuwuity/issues).
We strive to make moving between versions of Tuwunel safe and easy. Downgrading Tuwunel is always
safe but often prevented by a guard. An error will indicate the downgrade is not possible and a
newer version which does not error must be sought.
- [Packaging & availability in more places](https://forgejo.ellis.link/continuwuation/continuwuity/issues/747)
- [Appservices bugs & features](https://forgejo.ellis.link/continuwuation/continuwuity/issues?q=&type=all&state=open&labels=178&milestone=0&assignee=0&poster=0)
- [Improving compatibility and spec compliance](https://forgejo.ellis.link/continuwuation/continuwuity/issues?labels=119)
- Automated testing
- [Admin API](https://forgejo.ellis.link/continuwuation/continuwuity/issues/748)
- [Policy-list controlled moderation](https://forgejo.ellis.link/continuwuation/continuwuity/issues/750)
#### Branches
### Can I migrate my data from x?
The main branch is always _reasonably safe_ to run. We understand the propensity for users to simply clone
the main branch to get up and running, and we're obliged to ensure it's always viable. Nevertheless, only
tagged releases are true releases.
- Conduwuit: Yes
- Conduit: No, database is now incompatible
- Grapevine: No, database is now incompatible
- Dendrite: No
- Synapse: No
#### Container Tracking
We haven't written up a guide on migrating from incompatible homeservers yet. Reach out to us if you need to do this!
> [!IMPORTANT]
> **We strongly advise tracking the `:latest` tag when automatically updating.**
Tracking `:latest` gives us the necessary discretion to keep you on the appropriate stable version.
We discourage tracking the main branch unless frequent restarts are acceptable. Alternatively,
tracking the `:preview` tag provides the latest release-candidate becoming equivalent to `:latest`
after a release. Tracking the `:preview` tag is a worthy alternative to the main branch, with
turbulence limited to release-time.
### Getting Help & Support
If you are opposed to using github, or if private discussion is required such as for security
disclosures, or for any other reason, I would be happy to receive your DM at
[@jason:tuwunel.me](https://matrix.to/#/@jason:tuwunel.me). This will not be bothering me as it would
be my pleasure to help you when possible. As an emergency contact you can send an email to
jasonzemos@gmail.com.
##### Tuwunel Fanclub
We have an unofficial community-run chat which is publicly accessible at
[#tuwunel:matrix.org](https://matrix.to/#/#tuwunel:matrix.org). The members, content, or moderation
decisions of this room are not in any way related or endorsed by this project or its sponsors,
and not all project staff will be present there. There will be at least some presence by staff to
offer assistance so long as the room remains in minimally good standing.
## Tuwunel<sup>💕</sup>
Tuwunel's theme is **empathy** in communication defined by the works of
[Edith Stein](https://plato.stanford.edu/entries/stein/). Empathy is the basis for how we approach
every message and our responsibility to the other in every conversation.
<!-- ANCHOR_END: body -->
## Contribution
### Development flow
- Features / changes must developed in a separate branch
- For each change, create a descriptive PR
- Your code will be reviewed by one or more of the continuwuity developers
- The branch will be deployed live on multiple tester's matrix servers to shake out bugs
- Once all testers and reviewers have agreed, the PR will be merged to the main branch
- The main branch will have nightly builds deployed to users on the cutting edge
- Every week or two, a new release is cut.
The main branch is always green!
### Policy on pulling from other forks
We welcome contributions from other forks of conduwuit, subject to our review process.
When incorporating code from other forks:
- All external contributions must go through our standard PR process
- Code must meet our quality standards and pass tests
- Code changes will require testing on multiple test servers before merging
- Attribution will be given to original authors and forks
- We prioritize stability and compatibility when evaluating external contributions
- Features that align with our project goals will be given priority consideration
<!-- ANCHOR: footer -->
#### Contact
Join our [Matrix room](https://matrix.to/#/#continuwuity:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org) and [space](https://matrix.to/#/#space:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org) to chat with us about the project!
<!-- ANCHOR_END: footer -->
[continuwuity]: https://forgejo.ellis.link/continuwuation/continuwuity
+47
View File
@@ -0,0 +1,47 @@
# Tuwunel 1.4.6
November 6, 2025
### New Features
- Element Call discovery support was implemented by @tototomate123 in (#209). Adding a `[[global.well_known.rtc_transports]]` section in your [config file](https://github.com/matrix-construct/tuwunel/blob/e1f89b69ea117f166be423f035a5a34f4c0e7366/tuwunel-example.toml#L1835-L1851) enables discovery. More information on setting up Element Call can be found at [Spaetzblog](https://sspaeth.de/2024/11/sfu/), skipping step one, and performing step three in your Tuwunel config.
- Dehydrated Device support (MSC3814) is now available (#200). This feature allows users to receive encrypted messages without being logged in. Supporting clients will setup the dehydrated device automatically and it will "just work" behind the scenes; in fact, these clients will also hide it from the sessions list to avoid confusion. Support is not widespread yet but it has been tested with matrix-js-sdk clients such as Element-web. This feature was commissioned and made public by an enterprise sponsor.
- Notification panel (the 🔔 button) has been implemented in (#201). Even though Element-web now requires enabling it in the Labs menu, the underlying support (`GET /_matrix/client/v3/notifications`) enhances the push-notification handling of other clients.
- Live room previews are now available. This support (`GET /_matrix/client/v3/events`) allows users, including guests, to sync updates for a public room without joining (4afd6f347b1).
- Thanks to a suggestion by @cyberdoors in (#29), the configuration option `encryption_enabled_by_default_for_room_type` is now available. This feature can enable encryption for a room even when the client does not. The values `all` or `invite` are accepted, the latter roughly meaning DM's only. Neither are enabled by default.
### Enhancements
- Thank you @tototomate123 for improving the reverse-proxy docs, adding dedicated pages for both [Caddy](https://github.com/matrix-construct/tuwunel/blob/e0a997c22784b453735b24907e607412b153ba56/docs/deploying/reverse-proxy-caddy.md) and [Nginx](https://github.com/matrix-construct/tuwunel/blob/e0a997c22784b453735b24907e607412b153ba56/docs/deploying/reverse-proxy-nginx.md) in (#209). Thanks to @tycode for pointing out the docs were missing for alternative proxies in (#197).
- Thanks to an observation by @iwalkalone69 in (#40), the last-seen time for a device in the session list is now updated acceptably. This function piggybacks on the presence system to prevent writing too frequently; testing has never shown it more than a minute or few out of date.
- Thanks to an inquiry by @EntityinArray in (#189) guest-accounts can now be enabled while registration tokens are also enabled to prevent fully open account registration. Note that registration tokens don't apply to guest-accounts and those are still fully open.
- Courtesy of @dasha-uwu the list of servers attempted when joining a room is now properly shuffled to increase the odds of finding a viable server, especially if an additional join attempt is made.
### Bug Fixes
- Special thanks to @BVollmerhaus for finding the TURN secret file configured by `turn_secret_file` was broken in (#211), forcing users to configure `turn_secret` directly. Thank you for fixing this in (#212).
- Thank you @scvalex for updating the nix build for Tuwunel's integration tests and re-enabling all checks. (#215)
- Thanks to a report by @Anagastes in (#146) **Nheko and NeoChat users can now enjoy properly verified devices.** Special thanks for the assistance of @deepbluev7 with diagnosing the cross-signing signature issue.
- Database columns intended for deletion, notably `roomsynctoken_shortstatehash`, never had the deletion command actually invoked on them 😭 explaining the lack of enthusiasm after the 1.4.3 release introduced stateless sync. **Users will now see the free disk space they were promised.** This was uncovered during an unrelated issue investigation courtesy of @frebib.
- Thanks to investigation by @dasha-uwu the pagination tokens in the `/relations` endpoint were buggy and now operate correctly.
- Thanks to @Polve for identifying the `DynamicUser=yes` directive in the systemd files was invalid and advising a replacement in (#207).
- Thanks to @daudix for reporting an edge-case where the server will refuse to start rather than robustly reporting errors during startup checks and recreate a missing media directory (#213).
- Push rule evaluation was never implemented for invites arriving over federation. Notifications are now properly sent in this case.
- Sliding-sync handlers were susceptible to errors under rare circumstances escaping to cause an HTTP 500, which wreaks havoc on the rust-sdk. This has now been prevented.
- Federating with Conduit over several non-essential endpoints was broken. It is unclear whether this affected an actual Conduit release version, but thanks to @kladki a fix is scheduled and we have included a workaround now on this end.
-63
View File
@@ -1,63 +0,0 @@
# Security Policy for Continuwuity
This document outlines the security policy for Continuwuity. Our goal is to maintain a secure platform for all users, and we take security matters seriously.
## Supported Versions
We provide security updates for the following versions of Continuwuity:
| Version | Supported |
| -------------- |:----------------:|
| Latest release | ✅ |
| Main branch | ✅ |
| Older releases | ❌ |
We may backport fixes to the previous release at our discretion, but we don't guarantee this.
## Reporting a Vulnerability
### Responsible Disclosure
We appreciate the efforts of security researchers and the community in identifying and reporting vulnerabilities. To ensure that potential vulnerabilities are addressed properly, please follow these guidelines:
1. **Contact members of the team directly** over E2EE private message.
- [@jade:ellis.link](https://matrix.to/#/@jade:ellis.link)
- [@nex:nexy7574.co.uk](https://matrix.to/#/@nex:nexy7574.co.uk)
2. **Email the security team** at [security@continuwuity.org](mailto:security@continuwuity.org). This is not E2EE, so don't include sensitive details.
3. **Do not disclose the vulnerability publicly** until it has been addressed
4. **Provide detailed information** about the vulnerability, including:
- A clear description of the issue
- Steps to reproduce
- Potential impact
- Any possible mitigations
- Version(s) affected, including specific commits if possible
If you have any doubts about a potential security vulnerability, contact us via private channels first! We'd prefer that you bother us, instead of having a vulnerability disclosed without a fix.
### What to Expect
When you report a security vulnerability:
1. **Acknowledgment**: We will acknowledge receipt of your report.
2. **Assessment**: We will assess the vulnerability and determine its impact on our users
3. **Updates**: We will provide updates on our progress in addressing the vulnerability, and may request you help test mitigations
4. **Resolution**: Once resolved, we will notify you and discuss coordinated disclosure
5. **Credit**: We will recognize your contribution (unless you prefer to remain anonymous)
## Security Update Process
When security vulnerabilities are identified:
1. We will develop and test fixes in a private fork
2. Security updates will be released as soon as possible
3. Release notes will include information about the vulnerabilities, avoiding details that could facilitate exploitation where possible
4. Critical security updates may be backported to the previous stable release
## Additional Resources
- [Matrix Security Disclosure Policy](https://matrix.org/security-disclosure-policy/)
- [Continuwuity Documentation](https://continuwuity.org/introduction)
---
This security policy was last updated on May 25, 2025.
+24 -17
View File
@@ -1,25 +1,26 @@
[Unit]
Description=Continuwuity - Matrix homeserver
Documentation=https://continuwuity.org/
Description=Tuwunel Matrix homeserver
Wants=network-online.target
After=network-online.target
Alias=matrix-conduwuit.service
Documentation=https://tuwunel.chat/
RequiresMountsFor=/var/lib/private/tuwunel
[Service]
DynamicUser=yes
User=conduwuit
Group=conduwuit
Type=notify-reload
ReloadSignal=SIGUSR1
Environment="CONTINUWUITY_LOG_TO_JOURNALD=true"
Environment="CONTINUWUITY_JOURNALD_IDENTIFIER=%N"
Environment="CONTINUWUITY_DATABASE_PATH=%S/conduwuit"
Environment="CONTINUWUITY_CONFIG_RELOAD_SIGNAL=true"
TTYPath=/dev/tty25
DeviceAllow=char-tty
StandardInput=tty-force
StandardOutput=tty
StandardError=journal+console
TTYReset=yes
# uncomment to allow buffer to be cleared every restart
TTYVTDisallocate=no
LoadCredential=conduwuit.toml:/etc/conduwuit/conduwuit.toml
ExecStart=/usr/bin/conduwuit --config ${CREDENTIALS_DIRECTORY}/conduwuit.toml
TTYColumns=120
TTYRows=40
AmbientCapabilities=
CapabilityBoundingSet=
@@ -52,21 +53,27 @@ SystemCallArchitectures=native
SystemCallFilter=@system-service @resources
SystemCallFilter=~@clock @debug @module @mount @reboot @swap @cpu-emulation @obsolete @timer @chown @setuid @privileged @keyring @ipc
SystemCallErrorNumber=EPERM
StateDirectory=tuwunel
# ConfigurationDirectory isn't specified here because it's created by
# the distro's package manager.
StateDirectory=conduwuit
RuntimeDirectory=conduwuit
RuntimeDirectory=tuwunel
RuntimeDirectoryMode=0750
Environment="TUWUNEL_CONFIG=/etc/tuwunel/tuwunel.toml"
BindPaths=/var/lib/private/tuwunel:/var/lib/conduwuit
BindPaths=/var/lib/private/tuwunel:/var/lib/private/conduwuit
BindPaths=/var/lib/private/tuwunel:/var/lib/matrix-conduit
BindPaths=/var/lib/private/tuwunel:/var/lib/private/matrix-conduit
ExecStart=/usr/bin/tuwunel
Restart=on-failure
RestartSec=5
TimeoutStopSec=4m
TimeoutStartSec=10m
TimeoutStartSec=4m
StartLimitInterval=1m
StartLimitBurst=5
[Install]
WantedBy=multi-user.target
Alias=matrix-tuwunel.service
+15 -8
View File
@@ -1,23 +1,30 @@
[book]
title = "continuwuity"
description = "continuwuity is a community continuation of the conduwuit Matrix homeserver, written in Rust."
authors = [
"girlbossceo",
"jevolk"
]
description = "Tuwunel, a high performance successor to Conduit and Conduwuit"
language = "en"
authors = ["The continuwuity Community"]
text-direction = "ltr"
multilingual = false
src = "docs"
title = "Tuwunel One"
text-direction = "ltr"
[build]
build-dir = "public"
create-missing = true
extra-watch-dirs = ["debian", "docs"]
extra-watch-dirs = [
"debian",
"docs",
]
[rust]
edition = "2024"
[output.html]
edit-url-template = "https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/{path}"
git-repository-url = "https://forgejo.ellis.link/continuwuation/continuwuity"
git-repository-icon = "fa-git-alt"
git-repository-url = "https://github.com/matrix-construct/tuwunel"
edit-url-template = "https://github.com/matrix-construct/tuwunel/edit/main/{path}"
git-repository-icon = "fa-github-square"
[output.html.search]
limit-results = 15
-1
View File
@@ -1 +0,0 @@
The announcement checker will now announce errors it encounters in the first run to the admin room, plus a few other misc improvements. Contributed by @Jade
+13 -13
View File
@@ -1,20 +1,20 @@
array-size-threshold = 4096
cognitive-complexity-threshold = 94 # TODO reduce me ALARA
excessive-nesting-threshold = 11 # TODO reduce me to 4 or 5
future-size-threshold = 7745 # TODO reduce me ALARA
cognitive-complexity-threshold = 100 # TODO reduce me ALARA
excessive-nesting-threshold = 8
future-size-threshold = 8192
stack-size-threshold = 196608 # TODO reduce me ALARA
too-many-lines-threshold = 780 # TODO reduce me to <= 100
type-complexity-threshold = 250 # reduce me to ~200
large-error-threshold = 256 # TODO reduce me ALARA
disallowed-macros = [
{ path = "log::error", reason = "use conduwuit_core::error" },
{ path = "log::warn", reason = "use conduwuit_core::warn" },
{ path = "log::info", reason = "use conduwuit_core::info" },
{ path = "log::debug", reason = "use conduwuit_core::debug" },
{ path = "log::trace", reason = "use conduwuit_core::trace" },
]
#disallowed-macros = [
# { path = "log::error", reason = "use tuwunel_core::error" },
# { path = "log::warn", reason = "use tuwunel_core::warn" },
# { path = "log::info", reason = "use tuwunel_core::info" },
# { path = "log::debug", reason = "use tuwunel_core::debug" },
# { path = "log::trace", reason = "use tuwunel_core::trace" },
#]
disallowed-methods = [
{ path = "tokio::spawn", reason = "use and pass conduuwit_core::server::Server::runtime() to spawn from" },
]
#disallowed-methods = [
# { path = "tokio::spawn", reason = "use and pass tuwunel_core::server::Server::runtime() to spawn from" },
#]
-3
View File
@@ -1,3 +0,0 @@
style = "conventional"
subject_length = 72
allowed_types = ["ci", "build", "fix", "feat", "chore", "docs", "style", "refactor", "perf", "test"]
+36
View File
@@ -0,0 +1,36 @@
# Tuwunel for Debian
Information about downloading and deploying the Debian package. This may also be
referenced for other `apt`-based distros such as Ubuntu.
### Installation
It is recommended to see the [generic deployment guide](../deploying/generic.md)
for further information if needed as usage of the Debian package is generally
related.
No `apt` repository is currently offered yet, it is in the works/development.
### Configuration
When installed, the example config is placed at `/etc/tuwunel/tuwunel.toml`
as the default config. The config mentions things required to be changed before
starting.
You can tweak more detailed settings by uncommenting and setting the config
options in `/etc/tuwunel/tuwunel.toml`.
### Running
The package uses the [`tuwunel.service`](../configuration/examples.md#example-systemd-unit-file)
systemd unit file to start and stop Tuwunel. The binary is installed at `/usr/sbin/tuwunel`.
This package assumes by default that Tuwunel will be placed behind a reverse
proxy. The default config options apply (listening on `localhost` and TCP port
`6167`). Matrix federation requires a valid domain name and TLS, so you will
need to set up TLS certificates and renewal for it to work properly if you
intend to federate.
Consult various online documentation and guides on setting up a reverse proxy
and TLS. Caddy is documented at the [generic deployment guide](../deploying/generic.md#setting-up-the-reverse-proxy)
as it's the easiest and most user friendly.
+3 -3
View File
@@ -6,13 +6,13 @@ set -e
#. /usr/share/debconf/confmodule
#
## Ask for the Matrix homeserver name, address and port.
#db_input high conduwuit/hostname || true
#db_input high tuwunel/hostname || true
#db_go
#
#db_input low conduwuit/address || true
#db_input low tuwunel/address || true
#db_go
#
#db_input medium conduwuit/port || true
#db_input medium tuwunel/port || true
#db_go
exit 0
+47
View File
@@ -0,0 +1,47 @@
#!/bin/sh
set -e
# TODO: implement debconf support that is maintainable without duplicating the config
#. /usr/share/debconf/confmodule
TUWUNEL_DATABASE_PATH=/var/lib/tuwunel
TUWUNEL_CONFIG_PATH=/etc/tuwunel
case "$1" in
configure)
# Create the `tuwunel` user if it does not exist yet.
if ! getent passwd tuwunel > /dev/null ; then
echo 'Adding system user for the tuwunel Matrix homeserver' 1>&2
adduser --system --group --quiet \
--home "$TUWUNEL_DATABASE_PATH" \
--disabled-login \
--shell "/usr/sbin/nologin" \
tuwunel
fi
# Create the database path if it does not exist yet and fix up ownership
# and permissions for the config.
mkdir -v -p "$TUWUNEL_DATABASE_PATH"
# symlink the previous location for compatibility if it does not exist yet.
if ! test -L "/var/lib/matrix-conduit" ; then
ln -s -v "$TUWUNEL_DATABASE_PATH" "/var/lib/matrix-conduit"
fi
if ! test -L "/var/lib/conduwuit" ; then
ln -s -v "$TUWUNEL_DATABASE_PATH" "/var/lib/conduwuit"
fi
chown -v tuwunel:tuwunel -R "$TUWUNEL_DATABASE_PATH"
chown -v tuwunel:tuwunel -R "$TUWUNEL_CONFIG_PATH"
chmod -v 740 "$TUWUNEL_DATABASE_PATH"
echo ''
echo 'Make sure you edit the example config at /etc/tuwunel/tuwunel.toml before starting!'
echo 'To start the server, run: systemctl start tuwunel.service'
echo ''
;;
esac
#DEBHELPER#
+52
View File
@@ -0,0 +1,52 @@
#!/bin/sh
set -e
#. /usr/share/debconf/confmodule
TUWUNEL_CONFIG_PATH=/etc/tuwunel
TUWUNEL_DATABASE_PATH=/var/lib/tuwunel
CONDUIT_DATABASE_PATH_SYMLINK=/var/lib/matrix-conduit
CONDUWUIT_DATABASE_PATH_SYMLINK=/var/lib/conduwuit
case $1 in
purge)
# Remove debconf changes from the db
#db_purge
# Per https://www.debian.org/doc/debian-policy/ch-files.html#behavior
# "configuration files must be preserved when the package is removed, and
# only deleted when the package is purged."
#
if [ -d "$TUWUNEL_CONFIG_PATH" ]; then
if test -L "$TUWUNEL_CONFIG_PATH"; then
echo "Deleting tuwunel configuration files"
rm -v -r "$TUWUNEL_CONFIG_PATH"
fi
fi
if [ -d "$TUWUNEL_DATABASE_PATH" ]; then
if test -L "$TUWUNEL_DATABASE_PATH"; then
echo "Deleting tuwunel database directory"
rm -r "$TUWUNEL_DATABASE_PATH"
fi
fi
if [ -d "$CONDUIT_DATABASE_PATH_SYMLINK" ]; then
if test -L "$CONDUIT_DATABASE_SYMLINK"; then
echo "Removing matrix-conduit symlink"
rm -r "$CONDUIT_DATABASE_PATH_SYMLINK"
fi
fi
if [ -d "$CONDUWUIT_DATABASE_PATH_SYMLINK" ]; then
if test -L "$CONDUWUIT_DATABASE_SYMLINK"; then
echo "Removing conduwuit symlink"
rm -r "$CONDUWUIT_DATABASE_PATH_SYMLINK"
fi
fi
;;
esac
#DEBHELPER#
+65
View File
@@ -0,0 +1,65 @@
[Unit]
Description=Tuwunel Matrix homeserver
Wants=network-online.target
After=network-online.target
Documentation=https://tuwunel.chat/
[Service]
User=tuwunel
Group=tuwunel
Type=notify
Environment="TUWUNEL_CONFIG=/etc/tuwunel/tuwunel.toml"
ExecStart=/usr/sbin/tuwunel
ReadWritePaths=/var/lib/tuwunel /etc/tuwunel
AmbientCapabilities=
CapabilityBoundingSet=
DevicePolicy=closed
LockPersonality=yes
MemoryDenyWriteExecute=yes
NoNewPrivileges=yes
#ProcSubset=pid
ProtectClock=yes
ProtectControlGroups=yes
ProtectHome=yes
ProtectHostname=yes
ProtectKernelLogs=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
ProtectProc=invisible
ProtectSystem=strict
PrivateDevices=yes
PrivateMounts=yes
PrivateTmp=yes
PrivateUsers=yes
PrivateIPC=yes
RemoveIPC=yes
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
RestrictNamespaces=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
SystemCallArchitectures=native
SystemCallFilter=@system-service @resources
SystemCallFilter=~@clock @debug @module @mount @reboot @swap @cpu-emulation @obsolete @timer @chown @setuid @privileged @keyring @ipc
SystemCallErrorNumber=EPERM
#StateDirectory=tuwunel
RuntimeDirectory=tuwunel
RuntimeDirectoryMode=0750
Restart=on-failure
RestartSec=5
TimeoutStopSec=2m
TimeoutStartSec=2m
StartLimitInterval=1m
StartLimitBurst=5
[Install]
WantedBy=multi-user.target
Alias=matrix-tuwunel.service
+1 -1
View File
@@ -1 +1 @@
docs/development/index.mdx
docs/development.md
-269
View File
@@ -1,269 +0,0 @@
ARG RUST_VERSION=1
ARG DEBIAN_VERSION=bookworm
FROM --platform=$BUILDPLATFORM docker.io/tonistiigi/xx AS xx
FROM --platform=$BUILDPLATFORM rust:${RUST_VERSION}-slim-${DEBIAN_VERSION} AS base
FROM --platform=$BUILDPLATFORM rust:${RUST_VERSION}-slim-${DEBIAN_VERSION} AS toolchain
# Prevent deletion of apt cache
RUN rm -f /etc/apt/apt.conf.d/docker-clean
# Match Rustc version as close as possible
# rustc -vV
ARG LLVM_VERSION=20
# ENV RUSTUP_TOOLCHAIN=${RUST_VERSION}
# Install repo tools
# Line one: compiler tools
# Line two: curl, for downloading binaries
# Line three: for xx-verify
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && apt-get install -y \
pkg-config make jq \
curl git software-properties-common \
file
# LLVM packages
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
curl https://apt.llvm.org/llvm.sh > llvm.sh && \
chmod +x llvm.sh && \
./llvm.sh ${LLVM_VERSION} && \
rm llvm.sh
# Create symlinks for LLVM tools
RUN <<EOF
set -o xtrace
# clang
ln -s /usr/bin/clang-${LLVM_VERSION} /usr/bin/clang
ln -s "/usr/bin/clang++-${LLVM_VERSION}" "/usr/bin/clang++"
# lld
ln -s /usr/bin/ld64.lld-${LLVM_VERSION} /usr/bin/ld64.lld
ln -s /usr/bin/ld.lld-${LLVM_VERSION} /usr/bin/ld.lld
ln -s /usr/bin/lld-${LLVM_VERSION} /usr/bin/lld
ln -s /usr/bin/lld-link-${LLVM_VERSION} /usr/bin/lld-link
ln -s /usr/bin/wasm-ld-${LLVM_VERSION} /usr/bin/wasm-ld
EOF
# Developer tool versions
# renovate: datasource=github-releases depName=cargo-bins/cargo-binstall
ENV BINSTALL_VERSION=1.16.6
# renovate: datasource=github-releases depName=psastras/sbom-rs
ENV CARGO_SBOM_VERSION=0.9.1
# renovate: datasource=crate depName=lddtree
ENV LDDTREE_VERSION=0.4.0
# renovate: datasource=crate depName=timelord-cli
ENV TIMELORD_VERSION=3.0.1
# Install unpackaged tools
RUN <<EOF
set -o xtrace
curl --retry 5 -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
cargo binstall --no-confirm cargo-sbom --version $CARGO_SBOM_VERSION
cargo binstall --no-confirm lddtree --version $LDDTREE_VERSION
cargo binstall --no-confirm timelord-cli --version $TIMELORD_VERSION
EOF
# Set up xx (cross-compilation scripts)
COPY --from=xx / /
ARG TARGETPLATFORM
# Install libraries linked by the binary
# xx-* are xx-specific meta-packages
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
xx-apt-get install -y \
xx-c-essentials xx-cxx-essentials pkg-config \
liburing-dev
# Set up Rust toolchain
WORKDIR /app
COPY ./rust-toolchain.toml .
RUN rustc --version \
&& xx-cargo --setup-target-triple
# Build binary
# Configure incremental compilation based on build context
ARG CARGO_INCREMENTAL=0
RUN echo "CARGO_INCREMENTAL=${CARGO_INCREMENTAL}" >> /etc/environment
# Configure pkg-config
RUN <<EOF
set -o xtrace
if command -v "$(xx-info)-pkg-config" >/dev/null 2>/dev/null; then
echo "PKG_CONFIG_LIBDIR=/usr/lib/$(xx-info)/pkgconfig" >> /etc/environment
echo "PKG_CONFIG=/usr/bin/$(xx-info)-pkg-config" >> /etc/environment
fi
echo "PKG_CONFIG_ALLOW_CROSS=true" >> /etc/environment
EOF
# Configure cc to use clang version
RUN <<EOF
set -o xtrace
echo "CC=clang" >> /etc/environment
echo "CXX=clang++" >> /etc/environment
EOF
# Cross-language LTO
RUN <<EOF
set -o xtrace
echo "CFLAGS=-flto" >> /etc/environment
echo "CXXFLAGS=-flto" >> /etc/environment
# Linker is set to target-compatible clang by xx
echo "RUSTFLAGS='-Clinker-plugin-lto -Clink-arg=-fuse-ld=lld'" >> /etc/environment
EOF
# Apply CPU-specific optimizations if TARGET_CPU is provided
ARG TARGET_CPU
RUN <<EOF
set -o allexport
set -o xtrace
. /etc/environment
if [ -n "${TARGET_CPU}" ]; then
echo "CFLAGS='${CFLAGS} -march=${TARGET_CPU}'" >> /etc/environment
echo "CXXFLAGS='${CXXFLAGS} -march=${TARGET_CPU}'" >> /etc/environment
echo "RUSTFLAGS='${RUSTFLAGS} -C target-cpu=${TARGET_CPU}'" >> /etc/environment
fi
EOF
# Prepare output directories
RUN mkdir /out
FROM toolchain AS builder
# Get source
COPY . .
# Restore timestamps from timelord cache if available
RUN --mount=type=cache,target=/timelord/ \
echo "Restoring timestamps from timelord cache"; \
timelord sync --source-dir /app --cache-dir /timelord;
ARG TARGETPLATFORM
# Verify environment configuration
RUN xx-cargo --print-target-triple
# Conduwuit version info
ARG GIT_COMMIT_HASH
ARG GIT_COMMIT_HASH_SHORT
ARG GIT_REMOTE_URL
ARG GIT_REMOTE_COMMIT_URL
ARG CONDUWUIT_VERSION_EXTRA
ARG CONTINUWUITY_VERSION_EXTRA
ENV GIT_COMMIT_HASH=$GIT_COMMIT_HASH
ENV GIT_COMMIT_HASH_SHORT=$GIT_COMMIT_HASH_SHORT
ENV GIT_REMOTE_URL=$GIT_REMOTE_URL
ENV GIT_REMOTE_COMMIT_URL=$GIT_REMOTE_COMMIT_URL
ENV CONDUWUIT_VERSION_EXTRA=$CONDUWUIT_VERSION_EXTRA
ENV CONTINUWUITY_VERSION_EXTRA=$CONTINUWUITY_VERSION_EXTRA
ARG RUST_PROFILE=release
# Build the binary
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git/db \
--mount=type=cache,target=/app/target,id=continuwuity-cargo-target-${TARGET_CPU}-${TARGETPLATFORM}-${RUST_PROFILE} \
bash <<'EOF'
set -o allexport
set -o xtrace
. /etc/environment
TARGET_DIR=($(cargo metadata --no-deps --format-version 1 | \
jq -r ".target_directory"))
mkdir /out/sbin
PACKAGE=conduwuit
xx-cargo build --locked --profile ${RUST_PROFILE} \
-p $PACKAGE;
BINARIES=($(cargo metadata --no-deps --format-version 1 | \
jq -r ".packages[] | select(.name == \"$PACKAGE\") | .targets[] | select( .kind | map(. == \"bin\") | any ) | .name"))
for BINARY in "${BINARIES[@]}"; do
echo $BINARY
xx-verify $TARGET_DIR/$(xx-cargo --print-target-triple)/${RUST_PROFILE}/$BINARY
cp $TARGET_DIR/$(xx-cargo --print-target-triple)/${RUST_PROFILE}/$BINARY /out/sbin/$BINARY
done
EOF
# Generate Software Bill of Materials (SBOM)
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git/db \
bash <<'EOF'
set -o xtrace
mkdir /out/sbom
typeset -A PACKAGES
for BINARY in /out/sbin/*; do
BINARY_BASE=$(basename ${BINARY})
package=$(cargo metadata --no-deps --format-version 1 | jq -r ".packages[] | select(.targets[] | select( .kind | map(. == \"bin\") | any ) | .name == \"$BINARY_BASE\") | .name")
if [ -z "$package" ]; then
continue
fi
PACKAGES[$package]=1
done
for PACKAGE in $(echo ${!PACKAGES[@]}); do
echo $PACKAGE
cargo sbom --cargo-package $PACKAGE > /out/sbom/$PACKAGE.spdx.json
done
EOF
# Extract dynamically linked dependencies
RUN <<'DEPS_EOF'
set -o xtrace
mkdir /out/libs /out/libs-root
# Process each binary
for BINARY in /out/sbin/*; do
if lddtree_output=$(lddtree "$BINARY" 2>/dev/null) && [ -n "$lddtree_output" ]; then
echo "$lddtree_output" | awk '{print $(NF-0) " " $1}' | sort -u -k 1,1 | \
awk '{dest = ($2 ~ /^\//) ? "/out/libs-root" $2 : "/out/libs/" $2; print "install -D " $1 " " dest}' | \
while read cmd; do eval "$cmd"; done
fi
done
# Show what will be copied to runtime
echo "=== Libraries being copied to runtime image:"
find /out/libs* -type f 2>/dev/null | sort || echo "No libraries found"
DEPS_EOF
FROM ubuntu:latest AS prepper
# Create layer structure
RUN mkdir -p /layer1/etc/ssl/certs \
/layer2/usr/lib \
/layer3/sbin /layer3/sbom
# Copy SSL certs and root-path libraries to layer1 (ultra-stable)
COPY --from=base /etc/ssl/certs /layer1/etc/ssl/certs
COPY --from=builder /out/libs-root/ /layer1/
# Copy application libraries to layer2 (semi-stable)
COPY --from=builder /out/libs/ /layer2/usr/lib/
# Copy binaries and SBOM to layer3 (volatile)
COPY --from=builder /out/sbin/ /layer3/sbin/
COPY --from=builder /out/sbom/ /layer3/sbom/
# Fix permissions after copying
RUN chmod -R 755 /layer1 /layer2 /layer3
FROM scratch
WORKDIR /
# Copy ultra-stable layer (SSL certs, system libraries)
COPY --from=prepper /layer1/ /
# Copy semi-stable layer (application libraries)
COPY --from=prepper /layer2/ /
# Copy volatile layer (binaries, SBOM)
COPY --from=prepper /layer3/ /
# Inform linker where to find libraries
ENV LD_LIBRARY_PATH=/usr/lib
# Continuwuity default port
EXPOSE 8008
CMD ["/sbin/conduwuit"]
+105
View File
@@ -0,0 +1,105 @@
# syntax = docker/dockerfile:1.11-labs
FROM input AS cargo
ARG sys_triple
ARG rust_target
ARG rust_toolchain
ARG RUST_HOME
ARG RUSTUP_HOME
ARG CARGO_HOME
ARG CARGO_TARGET
ARG CARGO_TARGET_DIR
ARG cargo_target_profile
ARG cargo_target_artifact
ARG cargo_target_share
ARG cargo_share
ARG CARGO_TERM_VERBOSE=0
ARG RUST_BACKTRACE
ARG JEMALLOC_OVERRIDE
ARG ROCKSDB_LIB_DIR
ARG VALGRINDFLAGS=""
ARG CARGO_BUILD_RUSTFLAGS
ARG CARGO_PROFILE_TEST_DEBUG
ARG CARGO_PROFILE_TEST_INCREMENTAL
ARG CARGO_PROFILE_BENCH_DEBUG
ARG CARGO_PROFILE_BENCH_LTO
ARG CARGO_PROFILE_RELEASE_LTO
ARG CARGO_PROFILE_RELEASE_DEBUGINFO_DEBUG
ARG CARGO_PROFILE_RELEASE_DEBUGINFO_LTO
ARG cargo_profile
ARG cargo_features
ARG cargo_spec_features
ARG cargo_cmd
ARG color_args="--color always"
ARG recipe_args=""
ARG cargo_args=""
ARG git_checkout
ARG targ_dir="${CARGO_TARGET_DIR}/${cargo_target_profile}"
ARG targ_targ_dir="${CARGO_TARGET_DIR}/${rust_target}/${cargo_target_profile}"
WORKDIR /
COPY --link --from=input . .
COPY --link --from=rust ${RUST_HOME} ${RUST_HOME}
COPY --link --from=deps /usr/src/tuwunel /usr/src/tuwunel
WORKDIR /usr/lib/${sys_triple}
COPY --link --from=rocksdb . .
WORKDIR /usr/src/tuwunel
SHELL ["/bin/bash", "-c"]
ENV PATH="${CARGO_HOME}/bin:$PATH"
ENV CARGO_TERM_VERBOSE="${CARGO_TERM_VERBOSE}"
ENV RUST_BACKTRACE="${RUST_BACKTRACE}"
ENV JEMALLOC_OVERRIDE="${JEMALLOC_OVERRIDE}"
ENV ROCKSDB_LIB_DIR="${ROCKSDB_LIB_DIR}"
ENV VALGRINDFLAGS="${VALGRINDFLAGS}"
ENV CARGO_PROFILE_TEST_DEBUG="${CARGO_PROFILE_TEST_DEBUG}"
ENV CARGO_PROFILE_TEST_INCREMENTAL="${CARGO_PROFILE_TEST_INCREMENTAL}"
ENV CARGO_PROFILE_BENCH_DEBUG="${CARGO_PROFILE_BENCH_DEBUG}"
ENV CARGO_PROFILE_BENCH_LTO="${CARGO_PROFILE_BENCH_LTO}"
ENV CARGO_PROFILE_RELEASE_LTO="${CARGO_PROFILE_RELEASE_LTO}"
ENV CARGO_PROFILE_RELEASE_DEBUGINFO_DEBUG="${CARGO_PROFILE_RELEASE_DEBUGINFO_DEBUG}"
ENV CARGO_PROFILE_RELEASE_DEBUGINFO_LTO="${CARGO_PROFILE_RELEASE_DEBUGINFO_LTO}"
ENV CARGO_BUILD_RUSTFLAGS="${CARGO_BUILD_RUSTFLAGS}"
ENV CARGO_TARGET_DIR="${CARGO_TARGET_DIR}"
RUN \
--mount=type=cache,dst=${RUSTUP_HOME}/downloads,sharing=shared \
--mount=type=cache,dst=${CARGO_HOME}/registry,sharing=shared \
--mount=type=cache,dst=${CARGO_HOME}/git,sharing=shared \
--mount=type=cache,dst=${targ_dir}/deps,id=${cargo_share}/deps,sharing=locked \
--mount=type=cache,dst=${targ_dir}/build,id=${cargo_share}/build,sharing=locked \
--mount=type=cache,dst=${targ_dir}/examples,id=${cargo_share}/examples,sharing=locked \
--mount=type=cache,dst=${targ_dir}/incremental,id=${cargo_share}/incremental,sharing=locked \
--mount=type=cache,dst=${targ_dir}/.fingerprint,id=${cargo_share}/fingerprint,sharing=locked \
--mount=type=cache,dst=${targ_targ_dir}/deps,id=${cargo_target_share}/deps,sharing=locked \
--mount=type=cache,dst=${targ_targ_dir}/build,id=${cargo_target_share}/build,sharing=locked \
--mount=type=cache,dst=${targ_targ_dir}/examples,id=${cargo_target_share}/examples,sharing=locked \
--mount=type=cache,dst=${targ_targ_dir}/incremental,id=${cargo_target_share}/incremental,sharing=locked \
--mount=type=cache,dst=${targ_targ_dir}/.fingerprint,id=${cargo_target_share}/fingerprint,sharing=locked \
<<EOF
set -eux
ulimit -n 65535
rustup run "${rust_toolchain}" \
cargo ${cargo_cmd} \
--verbose \
--locked \
--workspace \
"${cargo_spec_features}" \
"--features=${cargo_features}" \
"--profile=${cargo_profile}" \
"--target=${CARGO_TARGET}" \
"--target-dir=${CARGO_TARGET_DIR}" \
"--manifest-path=Cargo.toml" \
${recipe_args} \
${color_args} \
${cargo_args}
# If this image is further reused with other cargo commands, all
# modifications made by cargo chef cook outside of target-dir have to be
# cleared. If not, resulting build artifacts will link incorrectly, even
# without error. For example, a target executable may be produced which
# does nothing except exit(0). If you have observed a smoketest failing in
# such a manner, investigate this as a cause of the issue.
git restore -W -S --source=${git_checkout} .
EOF
+28
View File
@@ -0,0 +1,28 @@
# syntax = docker/dockerfile:1.11-labs
FROM input AS audit
ARG rust_toolchain="nightly"
ARG RUSTUP_HOME
ARG CARGO_HOME
ARG audit_args=""
WORKDIR /
COPY --link --from=input . .
WORKDIR /usr/src/tuwunel
RUN \
--mount=type=cache,dst=${RUSTUP_HOME}/downloads,sharing=shared \
--mount=type=cache,dst=${CARGO_HOME}/registry,sharing=shared \
--mount=type=cache,dst=${CARGO_HOME}/git,sharing=shared \
<<EOF
set -eux
rustup run ${rust_toolchain} \
cargo audit \
--stale \
--deny yanked \
--deny unsound \
--deny unmaintained \
--deny warnings \
--color=always \
${audit_args}
EOF
+83
View File
@@ -0,0 +1,83 @@
# syntax = docker/dockerfile:1.11-labs
FROM input AS build-deb
ARG rust_target
ARG rust_toolchain
ARG RUSTUP_HOME
ARG CARGO_HOME
ARG CARGO_TARGET
ARG CARGO_TARGET_DIR
ARG cargo_target_profile
ARG cargo_target_artifact
ARG cargo_target_share
ARG cargo_share
ARG cargo_profile
ARG cargo_features
ARG cargo_spec_features
ARG targ_dir="${CARGO_TARGET_DIR}/${cargo_target_profile}"
ARG targ_targ_dir="${CARGO_TARGET_DIR}/${rust_target}/${cargo_target_profile}"
ARG pkg_dir
ARG deb_args=""
WORKDIR /
COPY --link --from=input . .
WORKDIR /usr/src/tuwunel
RUN \
--mount=type=cache,dst=${RUSTUP_HOME}/downloads,sharing=shared \
--mount=type=cache,dst=${CARGO_HOME}/registry,sharing=shared \
--mount=type=cache,dst=${CARGO_HOME}/git,sharing=shared \
--mount=type=cache,dst=${targ_dir}/deps,id=${cargo_share}/deps,sharing=locked \
--mount=type=cache,dst=${targ_dir}/build,id=${cargo_share}/build,sharing=locked \
--mount=type=cache,dst=${targ_dir}/examples,id=${cargo_share}/examples,sharing=locked \
--mount=type=cache,dst=${targ_dir}/incremental,id=${cargo_share}/incremental,sharing=locked \
--mount=type=cache,dst=${targ_dir}/.fingerprint,id=${cargo_share}/fingerprint,sharing=locked \
--mount=type=cache,dst=${targ_targ_dir}/deps,id=${cargo_target_share}/deps,sharing=locked \
--mount=type=cache,dst=${targ_targ_dir}/build,id=${cargo_target_share}/build,sharing=locked \
--mount=type=cache,dst=${targ_targ_dir}/examples,id=${cargo_target_share}/examples,sharing=locked \
--mount=type=cache,dst=${targ_targ_dir}/incremental,id=${cargo_target_share}/incremental,sharing=locked \
--mount=type=cache,dst=${targ_targ_dir}/.fingerprint,id=${cargo_target_share}/fingerprint,sharing=locked \
<<EOF
set -eux
mkdir -p "${pkg_dir}"
rustup run ${rust_toolchain} \
cargo deb \
--verbose \
--locked \
--no-build \
"${cargo_spec_features}" \
--features "${cargo_features}" \
--profile "${cargo_profile}" \
--target "${CARGO_TARGET}" \
--manifest-path Cargo.toml \
--multiarch same \
--compress-type gz \
--output "${pkg_dir}" \
${deb_args}
mv ${pkg_dir}/* "${pkg_dir}/tuwunel.deb"
dpkg --info "${pkg_dir}/tuwunel.deb"
dpkg --contents "${pkg_dir}/tuwunel.deb"
EOF
FROM scratch AS deb
ARG pkg_dir
COPY --from=input ${pkg_dir}/tuwunel.deb .
FROM input AS deb-install
ARG pkg_dir
WORKDIR /
COPY --link --from=input . .
WORKDIR ${pkg_dir}
COPY --from=deb . .
RUN <<EOF
set -eux
dpkg --info tuwunel.deb
dpkg --contents tuwunel.deb
dpkg --install tuwunel.deb
EOF
+25
View File
@@ -0,0 +1,25 @@
# syntax = docker/dockerfile:1.11-labs
FROM input AS fmt
ARG rust_toolchain="nightly"
ARG RUSTUP_HOME
ARG CARGO_HOME
ARG fmt_args=""
WORKDIR /
COPY --link --from=input . .
WORKDIR /usr/src/tuwunel
RUN \
--mount=type=cache,dst=${RUSTUP_HOME}/downloads,sharing=shared \
--mount=type=cache,dst=${CARGO_HOME}/registry,sharing=shared \
--mount=type=cache,dst=${CARGO_HOME}/git,sharing=shared \
<<EOF
set -eux
rustup run ${rust_toolchain} \
cargo fmt \
--all \
--check \
--manifest-path Cargo.toml \
${fmt_args}
EOF
+36
View File
@@ -0,0 +1,36 @@
# syntax = docker/dockerfile:1.11-labs
FROM input AS lychee
ARG rust_toolchain="nightly"
ARG RUSTUP_HOME
ARG CARGO_HOME
ARG lychee_cache_age="7d"
ARG lychee_mode="color"
# .lycheecache is hardcoded as path to reg file in the cwd so we execute lychee
# in cache directory itself. all paths here should be absolute paths
ARG lychee_args="/usr/src/tuwunel/docs /usr/src/tuwunel/*.md"
WORKDIR /
COPY --link --from=input . .
WORKDIR /usr/src/
RUN \
--mount=type=cache,dst=${RUSTUP_HOME}/downloads,sharing=shared \
--mount=type=cache,dst=${CARGO_HOME}/registry,sharing=shared \
--mount=type=cache,dst=${CARGO_HOME}/git,sharing=shared \
--mount=type=cache,dst=lychee,sharing=locked \
<<EOF
set -eux
cd lychee
rustup run ${rust_toolchain} \
lychee \
--verbose \
--no-progress \
--offline \
--cache \
--max-cache-age "${lychee_cache_age}" \
--mode "${lychee_mode}" \
--exclude /usr/src/tuwunel/contributing.md \
--exclude /usr/src/tuwunel/development/testing.md \
${lychee_args}
EOF
+76
View File
@@ -0,0 +1,76 @@
# syntax = docker/dockerfile:1.11-labs
FROM input AS build-rpm
ARG rust_target
ARG rust_toolchain
ARG RUSTUP_HOME
ARG CARGO_HOME
ARG CARGO_TARGET
ARG CARGO_TARGET_DIR
ARG cargo_target_profile
ARG cargo_target_artifact
ARG cargo_target_share
ARG cargo_share
ARG cargo_profile
ARG cargo_features
ARG cargo_spec_features
ARG targ_dir="${CARGO_TARGET_DIR}/${cargo_target_profile}"
ARG targ_targ_dir="${CARGO_TARGET_DIR}/${rust_target}/${cargo_target_profile}"
ARG pkg_dir
ARG gen_rpm_args=""
WORKDIR /
COPY --link --from=input . .
WORKDIR /usr/src/tuwunel
RUN \
--mount=type=cache,dst=${RUSTUP_HOME}/downloads,sharing=shared \
--mount=type=cache,dst=${CARGO_HOME}/registry,sharing=shared \
--mount=type=cache,dst=${CARGO_HOME}/git,sharing=shared \
--mount=type=cache,dst=${targ_dir}/deps,id=${cargo_share}/deps,sharing=locked \
--mount=type=cache,dst=${targ_dir}/build,id=${cargo_share}/build,sharing=locked \
--mount=type=cache,dst=${targ_dir}/examples,id=${cargo_share}/examples,sharing=locked \
--mount=type=cache,dst=${targ_dir}/incremental,id=${cargo_share}/incremental,sharing=locked \
--mount=type=cache,dst=${targ_dir}/.fingerprint,id=${cargo_share}/fingerprint,sharing=locked \
--mount=type=cache,dst=${targ_targ_dir}/deps,id=${cargo_target_share}/deps,sharing=locked \
--mount=type=cache,dst=${targ_targ_dir}/build,id=${cargo_target_share}/build,sharing=locked \
--mount=type=cache,dst=${targ_targ_dir}/examples,id=${cargo_target_share}/examples,sharing=locked \
--mount=type=cache,dst=${targ_targ_dir}/incremental,id=${cargo_target_share}/incremental,sharing=locked \
--mount=type=cache,dst=${targ_targ_dir}/.fingerprint,id=${cargo_target_share}/fingerprint,sharing=locked \
<<EOF
set -eux
mkdir -p "${pkg_dir}"
rustup run ${rust_toolchain} \
cargo generate-rpm \
--package src/main \
--auto-req auto \
--target "${CARGO_TARGET}" \
--target-dir "${CARGO_TARGET_DIR}" \
--profile "${cargo_profile}" \
--payload-compress zstd \
--output "${pkg_dir}" \
${gen_rpm_args}
mv ${pkg_dir}/* "${pkg_dir}/tuwunel.rpm"
EOF
FROM scratch AS rpm
ARG pkg_dir
COPY --from=input ${pkg_dir}/tuwunel.rpm .
FROM input AS rpm-install
ARG pkg_dir
WORKDIR /
COPY --link --from=input . .
WORKDIR ${pkg_dir}
COPY --link --from=rpm . .
RUN <<EOF
set -eux
rpm -i --test tuwunel.rpm
rpm -i tuwunel.rpm
EOF
+25
View File
@@ -0,0 +1,25 @@
# syntax = docker/dockerfile:1.11-labs
FROM input AS typos
ARG rust_toolchain="nightly"
ARG RUSTUP_HOME
ARG CARGO_HOME
ARG typos_args=""
WORKDIR /
COPY --link --from=input . .
WORKDIR /usr/src/tuwunel
RUN \
--mount=type=cache,dst=${RUSTUP_HOME}/downloads,sharing=shared \
--mount=type=cache,dst=${CARGO_HOME}/registry,sharing=shared \
--mount=type=cache,dst=${CARGO_HOME}/git,sharing=shared \
<<EOF
set -eux
rustup run ${rust_toolchain} \
typos \
--color always \
--exclude docker \
--exclude nix \
${typos_args}
EOF
+210
View File
@@ -0,0 +1,210 @@
# syntax = docker/dockerfile:1.11-labs
FROM input AS key-gen
WORKDIR /complement
COPY <<EOF v3.ext
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.0 = *.docker.internal
DNS.1 = hs1
DNS.2 = hs2
DNS.3 = hs3
DNS.4 = hs4
IP.1 = 127.0.0.1
EOF
RUN <<EOF
set -eux
mkdir ca
openssl genrsa \
-out private_key.pem \
2048
openssl req \
-new \
-sha256 \
-key private_key.pem \
-subj "/C=US/ST=CA/O=MyOrg, Inc./CN=hs1" \
-addext "subjectAltName = DNS:*.docker.internal DNS:hs1, DNS:hs2, DNS:hs3, DNS:hs4, IP:127.0.0.1" \
-out signing_request.csr
openssl x509 \
-req \
-extfile v3.ext \
-in signing_request.csr \
-key private_key.pem \
-out certificate.crt \
-days 1 \
-sha256
EOF
RUN [ -f certificate.crt ] && [ -f private_key.pem ]
FROM scratch AS complement-config
WORKDIR /complement
COPY --from=key-gen /complement/* .
COPY --from=source /usr/src/tuwunel/tests/complement/results.jsonl old_results.jsonl
COPY <<EOF complement.toml
[global]
address = "0.0.0.0"
admin_room_notices = false
allow_device_name_federation = true
allow_guest_registration = true
allow_invalid_tls_certificates = true
allow_legacy_media = true
allow_public_room_directory_over_federation = true
allow_public_room_directory_without_auth = true
allow_registration = true
create_admin_room = false
database_path = "/database"
dns_attempts = 20
dns_timeout = 60
federation_idle_timeout = 300
intentionally_unknown_config_option_for_testing = true
ip_range_denylist = []
log = "debug,tuwunel=trace,h2=warn,hyper=warn"
log_colors = false
log_guest_registrations = false
log_span_events = "NONE"
log_thread_ids = true
media_compat_file_link = false
media_startup_check = true
port = [8008, 8448]
prune_missing_media = true
query_trusted_key_servers_first = false
query_trusted_key_servers_first_on_join = false
request_conn_timeout = 60
request_timeout = 120
rocksdb_log_level = "debug"
rocksdb_max_log_files = 1
rocksdb_paranoid_file_checks = true
rocksdb_recovery_mode = 0
sender_idle_timeout = 300
sender_retry_backoff_limit = 300
sender_timeout = 300
startup_netburst = true
startup_netburst_keep = -1
trusted_servers = []
url_preview_domain_contains_allowlist = ["*"]
url_preview_domain_explicit_denylist = ["*"]
well_known_conn_timeout = 60
well_known_timeout = 60
yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse = true
[global.tls]
certs = "/complement/certificate.crt"
dual_protocol = true
key = "/complement/private_key.pem"
EOF
FROM input AS complement-testee
EXPOSE 8008 8448
RUN mkdir /database
COPY --from=complement-config * /complement/
ENV TUWUNEL_CONFIG="/complement/complement.toml"
ENTRYPOINT tuwunel -Oserver_name=\""$SERVER_NAME\""
FROM input AS complement-testee-valgrind
EXPOSE 8008 8448
RUN mkdir /database
COPY --from=complement-config * /complement/
ENV TUWUNEL_CONFIG="/complement/complement.toml"
ENTRYPOINT valgrind \
--leak-check=no \
--undef-value-errors=no \
--exit-on-first-error=yes \
--error-exitcode=1 \
tuwunel \
-Oserver_name=\""$SERVER_NAME\""
FROM input AS complement-base
ARG var_cache
ARG var_lib_apt
ARG complement_ref="426bc3458e5287398ec39ab7d2b8f2e3103dcf39"
ARG complement_tags="conduwuit_blacklist"
ARG complement_tests="./tests/..."
ARG complement_run=".*"
WORKDIR /usr/src
ADD https://github.com/matrix-construct/complement.git#${complement_ref} complement
WORKDIR /usr/src/complement
ENV COMPLEMENT_BASE_IMAGE="complement-testee"
RUN \
--mount=type=cache,dst=/go/pkg/mod/cache,sharing=locked \
<<EOF
env
set -eux
go test -tags="$complement_tags" -list="$complement_run" $complement_tests
EOF
FROM input AS complement-tester
ARG complement_verbose=0
ARG complement_debug=0
ARG complement_dirty=0
ARG complement_count=1
ARG complement_parallel=1
ARG complement_shuffle=1337
ARG complement_timeout="1h"
ARG complement_run=".*"
ARG complement_skip=""
ARG complement_tags="conduwuit_blacklist"
ARG complement_tests="./tests/..."
ARG complement_base_image
WORKDIR /usr/src/complement
ENV COMPLEMENT_DEBUG=$complement_debug
ENV complement_parallel="$complement_parallel"
ENV complement_shuffle="$complement_shuffle"
ENV complement_tags="$complement_tags"
ENV complement_timeout="$complement_timeout"
ENV complement_count="$complement_count"
ENV complement_tests="$complement_tests"
ENV complement_skip="$complement_skip"
ENV complement_run="$complement_run"
ENV complement_tests="$complement_tests"
ENV COMPLEMENT_ENABLE_DIRTY_RUNS="$complement_dirty"
ENV COMPLEMENT_ALWAYS_PRINT_SERVER_LOGS="$complement_verbose"
ENV COMPLEMENT_HOSTNAME_RUNNING_COMPLEMENT="host.docker.internal"
ENV COMPLEMENT_HOST_MOUNTS="/var/run/docker.sock:/var/run/docker.sock"
ENV jq_res='{Action: .Action, Test: .Test}'
ENV jq_sel='select((.Action == \"pass\" or .Action == \"fail\" or .Action == \"skip\") and .Test != null)'
ENV jq_tab='[.Action, .Test] | @tsv'
ENV jq_out='select(.Test != null) | {Test: .Test, Output: .Output}'
COPY --from=complement-config /complement/old_results.jsonl .
COPY <<EOF uwu.sh
env;
set -eux;
COMPLEMENT_BASE_IMAGE="\${1:-$complement_base_image}"
go test
-json
"-shuffle=\$complement_shuffle"
"-parallel=\$complement_parallel"
"-timeout=\$complement_timeout"
"-count=\$complement_count"
"-tags=\$complement_tags"
"-skip=\$complement_skip"
"-run=\$complement_run"
"\$complement_tests"
| jq --unbuffered -c "."
| tee output.jsonl
| jq --unbuffered -c "$jq_sel | $jq_res"
| tee results.jsonl
| jq --unbuffered -r "$jq_tab"
;
jq -s -c "sort_by(.Test)[]" < results.jsonl | uniq > new_results.jsonl;
jq -s -c "sort_by(.Test, .Timestamp)[] | $jq_out" < output.jsonl > full_output.jsonl;
EOF
RUN echo $(tr -d '\n' < uwu.sh) > uwu.sh && chmod a+x uwu.sh
ENTRYPOINT ["/bin/bash", "/usr/src/complement/uwu.sh"]
+29
View File
@@ -0,0 +1,29 @@
# syntax = docker/dockerfile:1.11-labs
FROM input AS install
ARG rust_target
ARG CARGO_TARGET_DIR
ARG cargo_target_profile
ARG install_prefix
ARG assert_linkage=""
WORKDIR /
COPY --link --from=input . .
WORKDIR ${install_prefix}
ENV src_path="${CARGO_TARGET_DIR}/${rust_target}/${cargo_target_profile}/tuwunel"
ENV dst_path="${install_prefix}/bin/tuwunel"
COPY --from=bins $src_path $dst_path
RUN <<EOF
ret=$(ldd "${dst_path}")
if [ "$ret" = "0" ] && [ "$assert_linkage" = "static" ]; then
exit 1
elif [ "$ret" != "0" ] && [ "$assert_linkage" = "dynamic" ]; then
exit 1
fi
set -eux
ldd -v ${dst_path} || true
du -h ${dst_path}
sha1sum ${dst_path}
EOF
+100
View File
@@ -0,0 +1,100 @@
# syntax = docker/dockerfile:1.11-labs
FROM input AS rust-sdk-integration
ARG sys_name
ARG sys_version
ARG feat_set
ARG rust_target
ARG rust_toolchain
ARG cargo_profile
ARG RUSTUP_HOME
ARG CARGO_HOME
ARG CARGO_TARGET
ARG MRSDK_TARGET_DIR="/usr/src/matrix-rust-sdk/target"
ARG mrsdk_target_share
#ARG mrsdk_ref="integration"
ARG mrsdk_ref="tuwunel-changes"
ARG mrsdk_test_args=""
ARG mrsdk_test_opts=""
ARG mrsdk_skip_list=""
ARG mrsdk_parallel=2
ARG mrsdk_startup_delay="10s"
ARG mrsdk_testee="/usr/bin/tuwunel"
WORKDIR /usr/src
ADD --link https://github.com/matrix-construct/matrix-rust-sdk.git#${mrsdk_ref} matrix-rust-sdk
WORKDIR /etc
COPY <<EOF tuwunel.toml
[global]
admin_room_notices = false
allow_device_name_federation = true
allow_guest_registration = true
allow_legacy_media = true
allow_public_room_directory_over_federation = true
allow_public_room_directory_without_auth = true
allow_registration = true
create_admin_room = false
ip_range_denylist = []
log = "debug,tuwunel=trace,h2=warn,hyper=warn"
log_colors = false
log_guest_registrations = false
log_span_events = "NONE"
log_thread_ids = true
media_compat_file_link = false
media_startup_check = true
query_trusted_key_servers_first = false
query_trusted_key_servers_first_on_join = false
rocksdb_log_level = "debug"
rocksdb_max_log_files = 1
rocksdb_paranoid_file_checks = true
rocksdb_recovery_mode = 0
trusted_servers = []
url_preview_domain_contains_allowlist = ["*"]
url_preview_domain_explicit_denylist = ["*"]
yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse = true
EOF
WORKDIR /usr/lib
COPY --link --from=install /usr/lib .
WORKDIR /usr/bin
COPY --link --from=install /usr/bin/tuwunel .
WORKDIR /usr/src/matrix-rust-sdk
SHELL ["/bin/bash", "-c"]
ENV RUST_BACKTRACE="full"
ENV TUWUNEL_CONFIG="/etc/tuwunel.toml"
ENV TUWUNEL_DATABASE_PATH="/var/db/tuwunel"
ENV TUWUNEL_SERVER_NAME="localhost"
ENV TUWUNEL_PORT="[8448]"
ENV HOMESERVER_URL="http://localhost:8448"
RUN \
--mount=type=cache,dst=${RUSTUP_HOME}/downloads,sharing=shared \
--mount=type=cache,dst=${CARGO_HOME}/registry,sharing=shared \
--mount=type=cache,dst=${CARGO_HOME}/git,sharing=shared \
--mount=type=cache,dst=${MRSDK_TARGET_DIR},id=${mrsdk_target_share},sharing=locked \
<<EOF
set -eux
nohup ${mrsdk_testee[@]} 1> /var/log/tuwunel.log &
PID=$!; trap "sleep 10s; set +e; kill -QUIT ${PID}; wait ${PID}" EXIT
sleep "${mrsdk_startup_delay}"
rustup run ${rust_toolchain} \
cargo test \
--locked \
--release \
"--color=always" \
"--features=default" \
"--target=${rust_target}" \
"--target-dir=${MRSDK_TARGET_DIR}" \
"--package=matrix-sdk-integration-testing" \
${mrsdk_test_args[@]} \
-- \
"--color=always" \
"--test-threads=${mrsdk_parallel}" \
${mrsdk_skip_list[@]} \
${mrsdk_test_opts[@]} \
;
EOF
+91
View File
@@ -0,0 +1,91 @@
# syntax = docker/dockerfile:1.11-labs
FROM input AS nix-base
WORKDIR /
COPY --link --from=input . .
RUN \
--mount=type=cache,dst=/nix,sharing=shared \
--mount=type=cache,dst=/root/.cache/nix,sharing=shared \
--mount=type=cache,dst=/root/.local/state/nix,sharing=shared \
<<EOF
set -eux
curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install > nix-install
sh ./nix-install --daemon
rm nix-install
EOF
FROM nix-base AS build-nix
WORKDIR /usr/src/tuwunel
COPY --link --from=source /usr/src/tuwunel .
RUN \
--mount=type=cache,dst=/nix,sharing=shared \
--mount=type=cache,dst=/root/.cache/nix,sharing=shared \
--mount=type=cache,dst=/root/.local/state/nix,sharing=shared \
<<EOF
set -eux
nix-build \
--verbose \
--cores 0 \
--max-jobs $(nproc) \
--log-format raw \
.
cp -afRL --copy-contents result /opt/tuwunel
EOF
FROM input AS smoke-nix
WORKDIR /
COPY --link --from=nix-base . .
WORKDIR /usr/src/tuwunel
COPY --link --from=source /usr/src/tuwunel .
ENV TUWUNEL_DATABASE_PATH="/tmp/tuwunel/smoketest.db"
ENV TUWUNEL_LOG="info"
RUN \
--mount=type=cache,dst=/nix,sharing=shared \
--mount=type=cache,dst=/root/.cache/nix,sharing=shared \
--mount=type=cache,dst=/root/.local/state/nix,sharing=shared \
<<EOF
set -eux
alias nix="nix --extra-experimental-features nix-command --extra-experimental-features flakes"
nix run \
--verbose \
--cores 0 \
--max-jobs $(nproc) \
--log-format raw \
.#all-features \
-- \
-Otest='["smoke", "fresh"]' \
-Oserver_name=\"localhost\" \
EOF
FROM input AS nix-pkg
WORKDIR /
COPY --link --from=nix-base . .
WORKDIR /usr/src/tuwunel
COPY --link --from=source /usr/src/tuwunel .
RUN \
--mount=type=cache,dst=/nix,sharing=shared \
--mount=type=cache,dst=/root/.cache/nix,sharing=shared \
--mount=type=cache,dst=/root/.local/state/nix,sharing=shared \
<<EOF
set -eux
alias nix="nix --extra-experimental-features nix-command --extra-experimental-features flakes"
ID=$(nix-store --realise $(nix path-info --derivation))
mkdir -p tuwunel
nix-store --export $ID > tuwunel/tuwunel.drv
tar -cvf /opt/tuwunel.nix.tar tuwunel
EOF
+93
View File
@@ -0,0 +1,93 @@
# syntax = docker/dockerfile:1.11-labs
FROM input AS rocksdb-fetch
ARG rocksdb_branch="tuwunel-changes"
ARG rust_rocksdb_branch="conduwuit-changes"
ARG librocksdb_submodule="librocksdb-sys/rocksdb"
WORKDIR /
COPY --link --from=input . .
WORKDIR /usr/src
COPY --link --from=recipe rocksdb.url .
RUN <<EOF
set -eux
rocksdb_url="$(cat rocksdb.url)"
git clone \
--depth 1 \
--single-branch \
--branch "${rust_rocksdb_branch}" \
"--recurse-submodules=${librocksdb_submodule}" \
"${rocksdb_url}" \
/usr/src/rocksdb
EOF
FROM input AS rocksdb-build
ARG rocksdb_shared=0
ARG rocksdb_portable="1"
ARG rocksdb_opt_level="3"
ARG rocksdb_build_type="Release"
ARG rocksdb_cxx_flags="-ftls-model=initial-exec"
ARG rocksdb_make_verbose="ON"
ARG rocksdb_make_rule_messages="OFF"
ARG rocksdb_jemalloc=1
ARG rocksdb_iouring=1
ARG rocksdb_zstd=1
ARG rocksdb_lz4=0
ARG rocksdb_bz2=0
ARG rocksdb_zlib=0
ARG rocksdb_snappy=0
ARG nprocs
WORKDIR /
COPY --link --from=input . .
COPY --link --from=rocksdb-fetch /usr/src/rocksdb /usr/src/rocksdb
WORKDIR /usr/src/rocksdb/librocksdb-sys/rocksdb
ENV CC="clang"
ENV CXX="clang++"
ENV nprocs=${nprocs}
RUN <<EOF
set -eux
cmake -H. -Bbuild \
"-DCMAKE_RULE_MESSAGES:BOOL=${rocksdb_make_rule_messages}" \
"-DCMAKE_VERBOSE_MAKEFILE:BOOL=${rocksdb_make_verbose}" \
"-DCMAKE_BUILD_TYPE=${rocksdb_build_type}" \
"-DBUILD_SHARED_LIBS=${rocksdb_shared}" \
"-DROCKSDB_BUILD_SHARED=${rocksdb_shared}" \
"-DCMAKE_CXX_FLAGS:STRING=${rocksdb_cxx_flags}" \
"-DCMAKE_CXX_FLAGS_RELEASE:STRING=-g0 -O${rocksdb_opt_level} -DNDEBUG" \
"-DPORTABLE=${rocksdb_portable}" \
"-DFAIL_ON_WARNINGS=0" \
"-DUSE_RTTI=0" \
"-DWITH_RUNTIME_DEBUG=0" \
"-DWITH_JNI=0" \
"-DWITH_EXAMPLES=0" \
"-DWITH_BENCHMARK=0" \
"-DWITH_BENCHMARK_TOOLS=0" \
"-DWITH_TRACE_TOOLS=0" \
"-DWITH_CORE_TOOLS=0" \
"-DWITH_TOOLS=0" \
"-DWITH_TESTS=0" \
"-DWITH_GFLAGS=0" \
"-DWITH_LIBURING=${rocksdb_iouring}" \
"-DWITH_JEMALLOC=${rocksdb_jemalloc}" \
"-DWITH_ZSTD=${rocksdb_zstd}" \
"-DWITH_LZ4=${rocksdb_lz4}" \
"-DWITH_BZ2=${rocksdb_bz2}" \
"-DWITH_ZLIB=${rocksdb_zlib}" \
"-DWITH_SNAPPY=${rocksdb_snappy}"
nprocs=${nprocs:=$(nproc)}
cmake \
--build build \
--target install \
--parallel "${nprocs}"
EOF
FROM scratch AS rocksdb
COPY --from=input /usr/src/rocksdb/librocksdb-sys/rocksdb/build/librocksdb.* .
+66
View File
@@ -0,0 +1,66 @@
# syntax = docker/dockerfile:1.11-labs
FROM input AS rustup
ARG RUST_HOME
ARG rust_target
ARG rustup_version="1.28.2"
ARG rustup_profile="minimal"
WORKDIR ${RUST_HOME}
RUN <<EOF
set -eux
var="${rustup_version}/${rust_target}"
url="https://static.rust-lang.org/rustup/archive/$var/rustup-init"
curl -S -O -s "$url"
chmod a+rx rustup-init
EOF
FROM input AS rust
ARG rust_toolchain
ARG rust_target
ARG RUST_HOME
ARG RUSTUP_HOME
ARG CARGO_HOME
ARG CARGO_TARGET
ARG rustup_version="1.28.1"
ARG rustup_profile="minimal"
ARG CARGO_TERM_VERBOSE
ARG rustup_components
ARG cargo_installs
WORKDIR ${RUST_HOME}
ENV CARGO_TARGET="${rust_target}"
ENV RUSTUP_HOME="${RUSTUP_HOME}"
ENV CARGO_HOME="${CARGO_HOME}"
ENV PATH="${CARGO_HOME}/bin:$PATH"
RUN \
--mount=type=cache,dst=${RUSTUP_HOME}/downloads,sharing=locked \
--mount=type=cache,dst=${CARGO_HOME}/registry,sharing=locked \
--mount=type=cache,dst=${CARGO_HOME}/git,sharing=locked \
<<EOF
set -eux
./rustup-init -y \
--quiet \
--profile "${rustup_profile}" \
--default-host "${CARGO_TARGET}" \
--default-toolchain "${rust_toolchain}" \
--no-update-default-toolchain \
--no-modify-path
chmod -R a+rw $CARGO_HOME $RUSTUP_HOME
rm rustup-init
rustup component add \
--toolchain ${rust_toolchain} \
--target ${rust_target} \
${rustup_components} \
;
rustup run --install ${rust_toolchain} \
cargo install \
--locked \
--target ${rust_target} \
${cargo_installs} \
;
EOF
+66
View File
@@ -0,0 +1,66 @@
# syntax = docker/dockerfile:1.11-labs
FROM input AS smoke-version
COPY --link --from=input . .
RUN <<EOF
set -eux
tuwunel -V
version=$(tuwunel -V)
/bin/test -n "$version"
EOF
FROM input AS smoke-startup
COPY --link --from=input . .
ENV TUWUNEL_LOG="info"
ENV TUWUNEL_DATABASE_PATH="/tmp/smoketest.db"
RUN <<EOF
set -eux
tuwunel \
-Otest='["smoke"]' \
-Oserver_name=\"localhost\" \
-Odatabase_path=\"${TUWUNEL_DATABASE_PATH}\"
rm -rf "${TUWUNEL_DATABASE_PATH}"
EOF
FROM input AS smoke-valgrind
ARG leak_check="no"
ARG undef_value_errors="no"
COPY --link --from=input . .
ENV TUWUNEL_LOG="info"
ENV TUWUNEL_DATABASE_PATH="/tmp/smoketest.db"
RUN <<EOF
set -eux
ulimit -n 65535
valgrind \
--leak-check=${leak_check} \
--undef-value-errors=${undef_value_errors} \
--exit-on-first-error=yes \
--error-exitcode=1 \
tuwunel \
-Otest='["smoke"]' \
-Oserver_name=\"localhost\" \
-Odatabase_path=\"${TUWUNEL_DATABASE_PATH}\"
rm -rf "${TUWUNEL_DATABASE_PATH}"
EOF
FROM input AS smoke-perf
COPY --link --from=input . .
ENV TUWUNEL_LOG="error"
ENV TUWUNEL_DATABASE_PATH="/tmp/smoketest.db"
RUN <<EOF
set -eux
perf stat \
-j \
-ddd \
tuwunel \
-Otest='["smoke"]' \
-Oserver_name=\"localhost\" \
-Odatabase_path=\"${TUWUNEL_DATABASE_PATH}\"
rm -rf "${TUWUNEL_DATABASE_PATH}"
EOF
+92
View File
@@ -0,0 +1,92 @@
# syntax = docker/dockerfile:1.11-labs
FROM input AS source
ARG git_checkout
ADD --link --keep-git-dir . /usr/src/tuwunel
WORKDIR /usr/src/tuwunel
RUN <<EOF
set -eux
git reset \
--hard \
--no-recurse-submodules \
${git_checkout}
EOF
FROM input AS ingredients
ARG rust_target
ARG rust_toolchain
ARG RUST_HOME
ARG RUSTUP_HOME
ARG CARGO_HOME
ARG CARGO_TARGET
ARG CARGO_TERM_VERBOSE=0
ARG RUST_BACKTRACE
ARG JEMALLOC_OVERRIDE
ARG ROCKSDB_LIB_DIR
WORKDIR /
COPY --link --from=rust ${RUST_HOME} ${RUST_HOME}
COPY --link --from=source /usr/src/tuwunel /usr/src/tuwunel
WORKDIR /usr/src/tuwunel
ENV PATH="${CARGO_HOME}/bin:$PATH"
ENV CARGO_TERM_VERBOSE="${CARGO_TERM_VERBOSE}"
ENV RUST_BACKTRACE="${RUST_BACKTRACE}"
ENV JEMALLOC_OVERRIDE="${JEMALLOC_OVERRIDE}"
ENV ROCKSDB_LIB_DIR="${ROCKSDB_LIB_DIR}"
RUN \
--mount=type=cache,dst=${RUSTUP_HOME}/downloads,sharing=locked \
--mount=type=cache,dst=${CARGO_HOME}/registry,sharing=locked \
--mount=type=cache,dst=${CARGO_HOME}/git,sharing=locked \
<<EOF
set -eux
git submodule update \
--remote \
--no-fetch \
--recursive \
--checkout \
--init
rustup run ${rust_toolchain} \
cargo fetch \
--locked \
--target ${CARGO_TARGET}
EOF
FROM input AS preparing
ARG rust_target
ARG rust_toolchain
ARG RUSTUP_HOME
ARG CARGO_HOME
ARG CARGO_TARGET
WORKDIR /usr/src/tuwunel
RUN \
--mount=type=cache,dst=${RUSTUP_HOME}/downloads,sharing=locked \
--mount=type=cache,dst=${CARGO_HOME}/registry,sharing=locked \
--mount=type=cache,dst=${CARGO_HOME}/git,sharing=locked \
<<EOF
set -euxo pipefail
rustup run ${rust_toolchain} \
cargo chef prepare \
--recipe-path recipe.json
manifest="Cargo.toml"
package="rust-librocksdb-sys"
cmd="cargo tree --manifest-path ${manifest} -f {r} -p ${package}"
url="$(rustup run ${rust_toolchain} ${cmd} | head -n 1)"
url="https://github.com/matrix-construct/rust-rocksdb" #TODO fixme
echo "$url" > rocksdb.url
sha1sum recipe.json rocksdb.url
EOF
FROM scratch AS recipe
WORKDIR /
COPY --from=preparing /usr/src/tuwunel/recipe.json .
COPY --from=preparing /usr/src/tuwunel/rocksdb.url .
+28
View File
@@ -0,0 +1,28 @@
# syntax = docker/dockerfile:1.11-labs
ARG sys_name=debian
ARG sys_version=testing-slim
FROM ${sys_name}:${sys_version} AS system
FROM input AS runtime
ARG var_cache
ARG var_lib_apt
ARG packages
ARG DEBIAN_FRONTEND
ENV DEBIAN_FRONTEND="${DEBIAN_FRONTEND}"
RUN \
--mount=type=cache,dst=/var/cache,id=${var_cache},sharing=locked \
--mount=type=cache,dst=/var/lib/apt,id=${var_lib_apt},sharing=locked \
<<EOF
echo $(uname -a) $0 $-
set -eux
keep_downloaded='Binary::apt::APT::Keep-Downloaded-Packages "true";'
echo "$keep_downloaded" > /etc/apt/apt.conf.d/keep-downloaded
rm -f /etc/apt/apt.conf.d/docker-clean
apt-get -y -U install --no-install-recommends ${packages}
EOF
+106
View File
@@ -0,0 +1,106 @@
# Docker Builder
> [!NOTE]
> This directory is for building docker images. For [deploying](https://github.com/matrix-construct/tuwunel/tree/main/docs/deploying)
> [docker](https://github.com/matrix-construct/tuwunel/blob/main/docs/deploying/docker.md) visit
> the appropriate documentation instead.
All Docker images for the project are built here. All images are
[Docker Bake](https://docs.docker.com/build/bake/) targets. All targets are leaves and
branches of a unified tree leading to a single root. It is a combinatorial matrix
of images from shared intermediate layers with a huge ever-growing pulsating cache.
The result is the ability to run continuous integration for a number of build
variations while only paying the cost of rebuilding the last layer for each one.
### Layout
This directory is made up of three types of files:
- Shell scripts are the user interface. Use this system through one of the shell scripts. The
bake files can still be docker'ed directly but it's recommended to run the script.
- The `.hcl` files specify the targets of the tree. This is all standard
[docker bake](https://docs.docker.com/build/bake/reference/). All targets are ordered where each
depends on one or more below it. The root of the tree is at the bottom. At the time of this
writing there is only one `bake.hcl` file but this might be broken up; in any case there will
always be a single unified tree.
- The `Dockerfile.*` files are like "library functions" and provide definition for targets.
These are written generically in the style of "template functions" with many variables allowing
many targets to create many variations using the same Dockerfile.
### Getting started
1. You will need to install docker buildx/buildkit and maybe a couple other related things.
`apt-get install docker-buildx`
2. You will need to create a builder. There are a few complications that must be explained here
so please be patient.
- Some unsavory options are required for some targets. It might be possible to omit these if
you're not building the full tree. Otherwise I've included them in the create command below.
- To run the complement compliance suite we need the `--allow-insecure-entitlement network.host`.
This requirement is probably a defect in Complement.
- The default cache policies are usually insufficient and custom values should be used,
though the ones below are probably too much for a single or simple build.
Finally create:
```
cat <<EOF > ./buildkitd.toml
[system]
platformsCacheMaxAge = "504h"
[worker.oci]
enabled = true
gc = true
reservedSpace = "64GB"
maxUsedSpace = "128GB"
[[worker.oci.gcpolicy]]
reservedSpace = "64GB"
maxUsedSpace = "128GB"
all = true
EOF
BKD_FLAGS="--allow-insecure-entitlement network.host"
docker buildx create \
--name owo \
--bootstrap \
--buildkitd-config ./buildkitd.toml \
--driver docker-container \
--buildkitd-flags "$BKD_FLAGS"
```
3. Build something simple. The usage is `./bake.sh [target]` which defaults to building all
elements for one vector of the full matrix. You can start smaller though by running
`docker/bake.sh system` which is the root target. You can browse the `bake.hcl` from the bottom
and progressively build targets, or build one or more leaf targets directly. For example try
to run a smoketest: `./bake.sh tests-smoke`.
4. Build something more complicated. Set environment variables or just edit the default vectors
near the top of in the `bake.sh` with multiple elements (they are JSON arrays). You can take
cues from the primary user of this system, the [GitHub CI](https://github.com/matrix-construct/tuwunel/blob/main/.github/workflows/main.yml#L32)
5. Defeat the final boss by building and running complement to completion. This will involve
building the targets for `complement-tester` and `complement-testee` using `bake.sh` and then
invoking `complement.sh`. You can take cues again from another user of this in the
[GitHub CI](https://github.com/matrix-construct/tuwunel/blob/7e8c4c8883ca17de91c3323d329541342366ee0c/.github/workflows/test.yml#L140).
## Notes
- For CI our builders are more persistent rather than being created and destroyed for
each invocation. The builder is meant to be safely reused across operations, but
for concurrent operations this is tricky, see the next point.
- For CI our builders are isolated only by actor/user. This will probably change to
`actor/repo/branch` as it's easy to cause issues with concurrent builds right now.
However we can't accept destroying the builder after each use, so we'll likely
choose `actor/repo/branch` with the expectation of one build at a time under those
constraints. Some external caching might need to be contrived between builders for
deduplication but with care such that malicious actors cannot poison data used
by other actors, otherwise it defeats the purpose of builder isolation.
+2047
View File
File diff suppressed because it is too large Load Diff
Executable
+118
View File
@@ -0,0 +1,118 @@
#!/bin/bash
set -eo pipefail
BASEDIR=$(dirname "$0")
CI="${CI:-false}"
CI_VERBOSE="${CI_VERBOSE:-false}"
CI_VERBOSE_ENV="${CI_VERBOSE_ENV:-$CI_VERBOSE}"
CI_SILENT_BAKE="${CI_SILENT_BAKE:-false}"
CI_PRINT_BAKE="${CI_PRINT_BAKE:-$CI_VERBOSE}"
default_cargo_profiles='["test"]'
default_feat_sets='["all"]'
default_rust_toolchains='["nightly"]'
default_rust_targets='["x86_64-unknown-linux-gnu"]'
default_sys_names='["debian"]'
default_sys_versions='["testing-slim"]'
default_sys_targets='["x86_64-v1-linux-gnu"]'
if test ! -z "$cargo_profile"; then
env_cargo_profiles="[\"${cargo_profile}\"]"
fi
if test ! -z "$feat_set"; then
env_feat_sets="[\"${feat_set}\"]"
fi
if test ! -z "$rust_target"; then
env_rust_targets="[\"${rust_target}\"]"
fi
if test ! -z "$rust_toolchain"; then
env_rust_toolchains="[\"${rust_toolchain}\"]"
fi
if test ! -z "$sys_name"; then
env_sys_names="[\"${sys_name}\"]"
fi
if test ! -z "$sys_target"; then
env_sys_targets="[\"${sys_target}\"]"
fi
if test ! -z "$sys_version"; then
env_sys_versions="[\"${sys_version}\"]"
fi
set -a
bake_target="${bake_target:-$@}"
cargo_profiles="${env_cargo_profiles:-$default_cargo_profiles}"
feat_sets="${env_feat_sets:-$default_feat_sets}"
rust_targets="${env_rust_targets:-$default_rust_targets}"
rust_toolchains="${env_rust_toolchains:-$default_rust_toolchains}"
sys_names="${env_sys_names:-$default_sys_names}"
sys_targets="${env_sys_targets:-$default_sys_targets}"
sys_versions="${env_sys_versions:-$default_sys_versions}"
docker_dir="$PWD/$BASEDIR"
builder_name="${GITHUB_ACTOR:-owo}"
toolchain_toml="$docker_dir/../rust-toolchain.toml"
rust_msrv=$(grep "channel = " "$toolchain_toml" | cut -d'=' -f2 | sed 's/\s"\|"$//g')
rocksdb_opt_level=3
rocksdb_portable=1
git_checkout="${git_checkout:-HEAD}"
use_chef="true"
set +a
###############################################################################
export DOCKER_BUILDKIT=1
if test "$CI" = "true"; then
export BUILDKIT_PROGRESS="plain"
fi
args=""
args="$args --provenance=false"
args="$args --builder ${builder_name}"
#args="$args --set *.platform=${sys_platform}"
if test "$CI" = "true"; then
args="$args --allow=network.host"
fi
if test "$(uname)" = "Darwin"; then
nprocs=$(sysctl -n hw.logicalcpu)
args="$args --set *.args.nprocs=${nprocs}"
:
else
nprocs=$(nproc)
args="$args --set *.args.nprocs=${nprocs}"
:
fi
if test "$CI_SILENT_BAKE" = "true"; then
args="$args --progress=quiet"
fi
arg="$args -f $BASEDIR/bake.hcl"
trap 'set +x; date; echo -e "\033[1;41;37mERROR\033[0m"' ERR
if test "$CI_VERBOSE_ENV" = "true"; then
date
env
fi
if test "$CI_PRINT_BAKE" = "true"; then
docker buildx bake --print $arg $bake_target
fi
if test "$NO_BAKE" = "1"; then
exit 0
fi
trap '' ERR
set -ux
docker buildx bake $arg $bake_target
set +x
echo -e "\033[1;42;30mACCEPT\033[0m"
+105
View File
@@ -0,0 +1,105 @@
#!/bin/bash
set -eo pipefail
BASEDIR=$(dirname "$0")
CI="${CI:-false}"
CI_VERBOSE="${CI_VERBOSE_ENV:-false}"
CI_VERBOSE_ENV="${CI_VERBOSE_ENV:-$CI_VERBOSE}"
default_cargo_profile="test"
default_feat_set="all"
default_rust_toolchain="nightly"
default_rust_target="x86_64-unknown-linux-gnu"
default_sys_name="debian"
default_sys_target="x86_64-v1-linux-gnu"
default_sys_version="testing-slim"
default_complement_verbose=0
default_complement_dirty=0
default_complement_count=1
default_complement_parallel=1
default_complement_shuffle=0
default_complement_timeout="1h"
default_complement_run=".*"
run="${1:-$default_complement_run}"
skip=""
skip="${skip}TestToDeviceMessagesOverFederation/stopped_server"
skip="${skip}|TestToDeviceMessagesOverFederation/interrupted_connectivity"
skip="${skip}|TestRoomCreate/Parallel/POST_/createRoom_makes_a_room_with_a_topic_and_writes_rich_topic_representation"
skip="${skip}|TestRoomCreate/Parallel/POST_/createRoom_makes_a_room_with_a_topic_via_initial_state_overwritten_by_topic"
skip="${skip}|TestLogin/parallel/POST_/"
skip="${skip}|TestUnbanViaInvite"
skip="${skip}|TestRoomState/Parallel/GET_/publicRooms_lists_newly-created_room"
skip="${skip}|TestThreadReceiptsInSyncMSC4102"
set -a
cargo_profile="${cargo_profile:-$default_cargo_profile}"
feat_set="${feat_set:-$default_feat_set}"
rust_target="${rust_target:-$default_rust_target}"
rust_toolchain="${rust_toolchain:-$default_rust_toolchain}"
sys_name="${sys_name:-$default_sys_name}"
sys_target="${sys_target:-$default_sys_target}"
sys_version="${sys_version:-$default_sys_version}"
runner_name=$(echo $RUNNER_NAME | cut -d"." -f1)
runner_num=$(echo $RUNNER_NAME | cut -d"." -f2)
set +a
###############################################################################
envs=""
envs="$envs -e complement_verbose=${complement_verbose:-$default_complement_verbose}"
envs="$envs -e complement_count=${complement_count:-$default_complement_count}"
envs="$envs -e complement_dirty=${complement_dirty:-$default_complement_dirty}"
envs="$envs -e complement_parallel=${complement_parallel:-$default_complement_parallel}"
envs="$envs -e complement_shuffle=${complement_shuffle:-$default_complement_shuffle}"
envs="$envs -e complement_timeout=${complement_timeout:-$default_complement_timeout}"
envs="$envs -e complement_skip=${complement_skip:-$skip}"
envs="$envs -e complement_run=${1:-$default_complement_run}"
set -x
tester_image="complement-tester--${sys_name}--${sys_version}--${sys_target}"
testee_image="complement-testee--${cargo_profile}--${rust_toolchain}--${rust_target}--${feat_set}--${sys_name}--${sys_version}--${sys_target}"
name="complement_tester__${sys_name}__${sys_version}__${sys_target}"
sock="/var/run/docker.sock"
arg="--name $name -v $sock:$sock --network=host $envs $tester_image ${testee_image}"
set +x
if test "$CI_VERBOSE_ENV" = "true"; then
date
env
fi
docker rm -f "$name" 2>/dev/null
arg="-d $arg"
cid=$(docker run $arg)
if test "$CI" = "true"; then
echo -n "$cid" > "$name"
fi
output_src="$cid:/usr/src/complement/full_output.jsonl"
output_dst="complement.jsonl"
extract_output() {
docker cp "$output_src" "$output_dst"
}
result_src="$cid:/usr/src/complement/new_results.jsonl"
result_dst="tests/complement/results.jsonl"
extract_results() {
docker cp "$result_src" "$result_dst"
}
trap 'extract_output; set +x; date; echo -e "\033[1;41;37mERROR\033[0m"' ERR
trap 'docker container stop $cid; extract_output' INT
docker logs -f "$cid"
docker wait "$cid" 2>/dev/null
extract_results
git diff -U0 --color --shortstat "$result_dst" | (grep "$run" || true)
git diff --quiet --exit-code "$result_dst"
echo -e "\033[1;42;30mACCEPT\033[0m"
-200
View File
@@ -1,200 +0,0 @@
# Why does this exist?
# Debian doesn't provide prebuilt musl packages
# rocksdb requires a prebuilt liburing, and linking fails if a gnu one is provided
ARG RUST_VERSION=1
ARG ALPINE_VERSION=3.22
FROM --platform=$BUILDPLATFORM docker.io/tonistiigi/xx AS xx
FROM --platform=$BUILDPLATFORM rust:${RUST_VERSION}-alpine${ALPINE_VERSION} AS base
FROM --platform=$BUILDPLATFORM rust:${RUST_VERSION}-alpine${ALPINE_VERSION} AS toolchain
# Install repo tools and dependencies
RUN --mount=type=cache,target=/etc/apk/cache apk add \
build-base pkgconfig make jq bash \
curl git file \
llvm-dev clang clang-static lld
# Developer tool versions
# renovate: datasource=github-releases depName=cargo-bins/cargo-binstall
ENV BINSTALL_VERSION=1.16.6
# renovate: datasource=github-releases depName=psastras/sbom-rs
ENV CARGO_SBOM_VERSION=0.9.1
# renovate: datasource=crate depName=lddtree
ENV LDDTREE_VERSION=0.4.0
# Install unpackaged tools
RUN <<EOF
set -o xtrace
curl --retry 5 -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
cargo binstall --no-confirm cargo-sbom --version $CARGO_SBOM_VERSION
cargo binstall --no-confirm lddtree --version $LDDTREE_VERSION
EOF
# Set up xx (cross-compilation scripts)
COPY --from=xx / /
ARG TARGETPLATFORM
# Install libraries linked by the binary
RUN --mount=type=cache,target=/etc/apk/cache xx-apk add musl-dev gcc g++ liburing-dev
# Set up Rust toolchain
WORKDIR /app
COPY ./rust-toolchain.toml .
RUN rustc --version \
&& xx-cargo --setup-target-triple
# Build binary
# We disable incremental compilation to save disk space, as it only produces a minimal speedup for this case.
RUN echo "CARGO_INCREMENTAL=0" >> /etc/environment
# Configure pkg-config
RUN <<EOF
set -o xtrace
if command -v "$(xx-info)-pkg-config" >/dev/null 2>/dev/null; then
echo "PKG_CONFIG_LIBDIR=/usr/lib/$(xx-info)/pkgconfig" >> /etc/environment
echo "PKG_CONFIG=/usr/bin/$(xx-info)-pkg-config" >> /etc/environment
fi
echo "PKG_CONFIG_ALLOW_CROSS=true" >> /etc/environment
EOF
# Configure cc to use clang version
RUN <<EOF
set -o xtrace
echo "CC=clang" >> /etc/environment
echo "CXX=clang++" >> /etc/environment
EOF
# Cross-language LTO
RUN <<EOF
set -o xtrace
echo "CFLAGS=-flto" >> /etc/environment
echo "CXXFLAGS=-flto" >> /etc/environment
# Linker is set to target-compatible clang by xx
echo "RUSTFLAGS='-Clinker-plugin-lto -Clink-arg=-fuse-ld=lld'" >> /etc/environment
EOF
# Apply CPU-specific optimizations if TARGET_CPU is provided
ARG TARGET_CPU
RUN <<EOF
set -o allexport
set -o xtrace
. /etc/environment
if [ -n "${TARGET_CPU}" ]; then
echo "CFLAGS='${CFLAGS} -march=${TARGET_CPU}'" >> /etc/environment
echo "CXXFLAGS='${CXXFLAGS} -march=${TARGET_CPU}'" >> /etc/environment
echo "RUSTFLAGS='${RUSTFLAGS} -C target-cpu=${TARGET_CPU}'" >> /etc/environment
fi
EOF
# Prepare output directories
RUN mkdir /out
FROM toolchain AS builder
# Get source
COPY . .
ARG TARGETPLATFORM
# Verify environment configuration
RUN xx-cargo --print-target-triple
# Conduwuit version info
ARG GIT_COMMIT_HASH
ARG GIT_COMMIT_HASH_SHORT
ARG GIT_REMOTE_URL
ARG GIT_REMOTE_COMMIT_URL
ARG CONDUWUIT_VERSION_EXTRA
ARG CONTINUWUITY_VERSION_EXTRA
ENV GIT_COMMIT_HASH=$GIT_COMMIT_HASH
ENV GIT_COMMIT_HASH_SHORT=$GIT_COMMIT_HASH_SHORT
ENV GIT_REMOTE_URL=$GIT_REMOTE_URL
ENV GIT_REMOTE_COMMIT_URL=$GIT_REMOTE_COMMIT_URL
ENV CONDUWUIT_VERSION_EXTRA=$CONDUWUIT_VERSION_EXTRA
ENV CONTINUWUITY_VERSION_EXTRA=$CONTINUWUITY_VERSION_EXTRA
ARG RUST_PROFILE=release
# Build the binary
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git/db \
--mount=type=cache,target=/app/target,id=continuwuity-cargo-target-${TARGET_CPU}-${TARGETPLATFORM}-musl-${RUST_PROFILE} \
bash <<'EOF'
set -o allexport
set -o xtrace
. /etc/environment
TARGET_DIR=($(cargo metadata --no-deps --format-version 1 | \
jq -r ".target_directory"))
mkdir /out/sbin
PACKAGE=conduwuit
xx-cargo build --locked --profile ${RUST_PROFILE} \
-p $PACKAGE --no-default-features --features bindgen-static,release_max_log_level,standard;
BINARIES=($(cargo metadata --no-deps --format-version 1 | \
jq -r ".packages[] | select(.name == \"$PACKAGE\") | .targets[] | select( .kind | map(. == \"bin\") | any ) | .name"))
for BINARY in "${BINARIES[@]}"; do
echo $BINARY
xx-verify $TARGET_DIR/$(xx-cargo --print-target-triple)/release/$BINARY
cp $TARGET_DIR/$(xx-cargo --print-target-triple)/release/$BINARY /out/sbin/$BINARY
done
EOF
# Generate Software Bill of Materials (SBOM)
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git/db \
bash <<'EOF'
set -o xtrace
mkdir /out/sbom
typeset -A PACKAGES
for BINARY in /out/sbin/*; do
BINARY_BASE=$(basename ${BINARY})
package=$(cargo metadata --no-deps --format-version 1 | jq -r ".packages[] | select(.targets[] | select( .kind | map(. == \"bin\") | any ) | .name == \"$BINARY_BASE\") | .name")
if [ -z "$package" ]; then
continue
fi
PACKAGES[$package]=1
done
for PACKAGE in $(echo ${!PACKAGES[@]}); do
echo $PACKAGE
cargo sbom --cargo-package $PACKAGE > /out/sbom/$PACKAGE.spdx.json
done
EOF
# Extract dynamically linked dependencies
RUN <<EOF
set -o xtrace
mkdir /out/libs
mkdir /out/libs-root
for BINARY in /out/sbin/*; do
lddtree "$BINARY" | awk '{print $(NF-0) " " $1}' | sort -u -k 1,1 | awk '{print "install", "-D", $1, (($2 ~ /^\//) ? "/out/libs-root" $2 : "/out/libs/" $2)}' | xargs -I {} sh -c {}
done
EOF
FROM scratch
WORKDIR /
# Copy root certs for tls into image
# You can also mount the certs from the host
# --volume /etc/ssl/certs:/etc/ssl/certs:ro
COPY --from=base /etc/ssl/certs /etc/ssl/certs
# Copy our build
COPY --from=builder /out/sbin/ /sbin/
# Copy SBOM
COPY --from=builder /out/sbom/ /sbom/
# Copy dynamic libraries to root
COPY --from=builder /out/libs-root/ /
COPY --from=builder /out/libs/ /usr/lib/
# Inform linker where to find libraries
ENV LD_LIBRARY_PATH=/usr/lib
# Continuwuity default port
EXPOSE 8008
CMD ["/sbin/conduwuit"]
+1
View File
@@ -0,0 +1 @@
../CODE_OF_CONDUCT.md
+1
View File
@@ -0,0 +1 @@
SUMMARY.md
+25
View File
@@ -0,0 +1,25 @@
# Summary
- [Introduction](introduction.md)
- [Configuration](configuration.md)
- [Examples](configuration/examples.md)
- [Deploying](deploying.md)
- [Generic](deploying/generic.md)
- [Reverse Proxy - Caddy](deploying/reverse-proxy-caddy.md)
- [Reverse Proxy - Nginx](deploying/reverse-proxy-nginx.md)
- [NixOS](deploying/nixos.md)
- [Docker](deploying/docker.md)
- [Kubernetes](deploying/kubernetes.md)
- [Arch Linux](deploying/arch-linux.md)
- [Debian](deploying/debian.md)
- [Red Hat](deploying/redhat.md)
- [FreeBSD](deploying/freebsd.md)
- [TURN](turn.md)
- [Appservices](appservices.md)
- [Maintenance](maintenance.md)
- [Troubleshooting](troubleshooting.md)
- [Development](development.md)
- [Contributing](contributing.md)
- [Testing](development/testing.md)
- [Hot Reloading ("Live" Development)](development/hot_reload.md)
- [Tuwunel Community Code of Conduct](CODE_OF_CONDUCT.md)
-69
View File
@@ -1,69 +0,0 @@
[
{
"type": "file",
"name": "introduction",
"label": "Continuwuity"
},
{
"type": "file",
"name": "configuration",
"label": "Configuration"
},
{
"type": "dir",
"name": "deploying",
"label": "Deploying"
},
{
"type": "file",
"name": "turn",
"label": "TURN"
},
{
"type": "file",
"name": "appservices",
"label": "Appservices"
},
{
"type": "file",
"name": "maintenance",
"label": "Maintenance"
},
{
"type": "file",
"name": "troubleshooting",
"label": "Troubleshooting"
},
{
"type": "divider"
},
{
"type": "dir-section-header",
"name": "development",
"label": "Development",
"collapsible": true,
"collapsed": false
},
{
"type": "divider"
},
{
"type": "section-header",
"label": "Reference"
},
{
"type": "file",
"label": "Configuration Reference",
"name": "/reference/config"
},
{
"type": "dir",
"label": "Admin Command Reference",
"name": "/reference/admin/"
},
{
"type": "divider"
},
"community",
"security"
]
-37
View File
@@ -1,37 +0,0 @@
[
{
"text": "Guide",
"link": "/introduction",
"activeMatch": "^/(introduction|configuration|deploying|turn|appservices|maintenance|troubleshooting)"
},
{
"text": "Development",
"link": "/development/index",
"activeMatch": "^/development/"
},
{
"text": "Reference",
"items": [
{
"text": "Configuration Reference",
"link": "/reference/config"
},
{
"text": "Admin Command Reference",
"link": "/reference/admin/"
},
{
"text": "Server Reference",
"link": "/reference/server"
}
]
},
{
"text": "Community",
"link": "/community"
},
{
"text": "Security",
"link": "/security"
}
]
+5 -5
View File
@@ -3,8 +3,8 @@ # Setting up Appservices
## Getting help
If you run into any problems while setting up an Appservice: ask us in
[#continuwuity:continuwuity.org](https://matrix.to/#/#continuwuity:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org) or
[open an issue on Forgejo](https://forgejo.ellis.link/continuwuation/continuwuity/issues/new).
[#tuwunel:tuwunel.chat](https://matrix.to/#/#tuwunel:tuwunel.chat) or
[open an issue on GitHub](https://github.com/matrix-construct/tuwunel/issues/new).
## Set up the appservice - general instructions
@@ -14,7 +14,7 @@ ## Set up the appservice - general instructions
At some point the appservice guide should ask you to add a registration yaml
file to the homeserver. In Synapse you would do this by adding the path to the
homeserver.yaml, but in Continuwuity you can do this from within Matrix:
homeserver.yaml, but in tuwunel you can do this from within Matrix:
First, go into the `#admins` room of your homeserver. The first person that
registered on the homeserver automatically joins it. Then send a message into
@@ -37,9 +37,9 @@ ## Set up the appservice - general instructions
The server bot should answer with `Appservices (1): your-bridge`
Then you are done. Continuwuity will send messages to the appservices and the
Then you are done. Tuwunel will send messages to the appservices and the
appservice can send requests to the homeserver. You don't need to restart
Continuwuity, but if it doesn't work, restarting while the appservice is running
tuwunel, but if it doesn't work, restarting while the appservice is running
could help.
## Appservice-specific instructions
-139
View File
@@ -1,139 +0,0 @@
# Continuwuity Community Guidelines
Welcome to the Continuwuity commuwunity! We're excited to have you here. Continuwuity is a
continuation of the conduwuit homeserver, which in turn is a hard-fork of the Conduit homeserver,
aimed at making Matrix more accessible and inclusive for everyone.
This space is dedicated to fostering a positive, supportive, and welcoming environment for everyone.
These guidelines apply to all Continuwuity spaces, including our Matrix rooms and any other
community channels that reference them. We've written these guidelines to help us all create an
environment where everyone feels safe and respected.
For code and contribution guidelines, please refer to the
[Contributor's Covenant](https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CODE_OF_CONDUCT.md).
Below are additional guidelines specific to the Continuwuity community.
## Our Values and Expected Behaviors
We strive to create a community based on mutual respect, collaboration, and inclusivity. We expect
all members to:
1. **Be Respectful and Inclusive**: Treat everyone with respect. We're committed to a community
where everyone feels safe, regardless of background, identity, or experience. Discrimination,
harassment, or hate speech won't be tolerated. Remember that each person experiences the world
differently; share your own perspective and be open to learning about others'.
2. **Be Positive and Constructive**: Engage in discussions constructively and support each other.
If you feel angry or frustrated, take a break before participating. Approach disagreements with
the goal of understanding, not winning. Focus on the issue, not the person.
3. **Communicate Clearly and Kindly**: Our community includes neurodivergent individuals and those
who may not appreciate sarcasm or subtlety. Communicate clearly and kindly. Avoid ambiguity and
ensure your messages can be easily understood by all. Avoid placing the burden of education on
marginalized groups; please make an effort to look into your questions before asking others for
detailed explanations.
4. **Be Open to Improving Inclusivity**: Actively participate in making our community more inclusive.
Report behaviour that contradicts these guidelines (see Reporting and Enforcement below) and be
open to constructive feedback aimed at improving our community. Understand that discussing
negative experiences can be emotionally taxing; focus on the message, not the tone.
5. **Commit to Our Values**: Building an inclusive community requires ongoing effort from everyone.
Recognise that addressing bias and discrimination is a continuous process that needs commitment
and action from all members.
## Unacceptable Behaviors
To ensure everyone feels safe and welcome, the following behaviors are considered unacceptable
within the Continuwuity community:
* **Harassment and Discrimination**: Avoid offensive comments related to background, family status,
gender, gender identity or expression, marital status, sex, sexual orientation, native language,
age, ability, race and/or ethnicity, caste, national origin, socioeconomic status, religion,
geographic location, or any other dimension of diversity. Don't deliberately misgender someone or
question the legitimacy of their gender identity.
* **Violence and Threats**: Do not engage in any form of violence or threats, including inciting
violence towards anyone or encouraging self-harm. Posting or threatening to post someone else's
personally identifying information ("doxxing") is also forbidden.
* **Personal Attacks**: Disagreements happen, but they should never turn into personal attacks.
Don't insult, demean, or belittle others.
* **Unwelcome Attention or Contact**: Avoid unwelcome sexual attention, inappropriate physical
contact (or simulation thereof), sexualized comments, jokes, or imagery.
* **Disruption**: Do not engage in sustained disruption of discussions, events, or other
community activities.
* **Bad Faith Actions**: Do not intentionally make false reports or otherwise abuse the reporting
process.
This is not an exhaustive list. Any behaviour that makes others feel unsafe or unwelcome may be
subject to enforcement action.
## Matrix Community
These Community Guidelines apply to the entire
[Continuwuity Matrix Space](https://matrix.to/#/#space:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org) and its rooms, including:
### [#continuwuity:continuwuity.org](https://matrix.to/#/#continuwuity:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org)
This room is for support and discussions about Continuwuity. Ask questions, share insights, and help
each other out while adhering to these guidelines.
We ask that this room remain focused on the Continuwuity software specifically: the team are
typically happy to engage in conversations about related subjects in the off-topic room.
### [#offtopic:continuwuity.org](https://matrix.to/#/#offtopic:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org)
For off-topic community conversations about any subject. While this room allows for a wide range of
topics, the same guidelines apply. Please keep discussions respectful and inclusive, and avoid
divisive or stressful subjects like specific country/world politics unless handled with exceptional
care and respect for diverse viewpoints.
General topics, such as world events, are welcome as long as they follow the guidelines. If a member
of the team asks for the conversation to end, please respect their decision.
### [#dev:continuwuity.org](https://matrix.to/#/#dev:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org)
This room is dedicated to discussing active development of Continuwuity, including ongoing issues or
code development. Collaboration here must follow these guidelines, and please consider raising
[an issue](https://forgejo.ellis.link/continuwuation/continuwuity/issues) on the repository to help
track progress.
## Reporting and Enforcement
We take these Community Guidelines seriously to protect our community members. If you witness or
experience unacceptable behaviour, or have any other concerns, please report it.
**How to Report:**
* **Alert Moderators in the Room:** If you feel comfortable doing so, you can address the issue
publicly in the relevant room by mentioning the moderation bot, `@rock:continuwuity.org`, which
will immediately alert all available moderators.
* **Direct Message:** If you're not comfortable raising the issue publicly, please send a direct
message (DM) to one of the room moderators.
Reports will be handled with discretion. We will investigate promptly and thoroughly.
**Enforcement Actions:**
Anyone asked to stop unacceptable behaviour is expected to comply immediately. Failure to do so, or
engaging in prohibited behaviour, may result in enforcement action. Moderators may take actions they
deem appropriate, including but not limited to:
1. **Warning**: A direct message or public warning identifying the violation and requesting
corrective action.
2. **Temporary Mute**: Temporary restriction from participating in discussions for a specified
period.
3. **Kick or Ban**: Removal from a room (kick) or the entire community space (ban). Egregious or
repeated violations may result in an immediate ban. Bans are typically permanent and reviewed
only in exceptional circumstances.
Retaliation against those who report concerns in good faith will not be tolerated and will be
subject to the same enforcement actions.
Together, let's build and maintain a community where everyone feels valued, safe, and respected.
— The Continuwuity Moderation Team
+84
View File
@@ -0,0 +1,84 @@
# Configuration
This chapter describes various ways to configure Tuwunel.
## Basics
Tuwunel uses a config file for the majority of the settings, but also supports
setting individual config options via commandline.
Please refer to the [example config file](./configuration/examples.md#example-configuration) for all of those settings.
The config file to use can be specified on the commandline when running
Tuwunel by specifying the `-c`, `--config` flag. It is also possible to specify
more than one config file.
Alternatively, you can use the environment variable `TUWUNEL_CONFIG` to specify
the config file to used. Conduit's environment variables are supported for
backwards compatibility.
> [!IMPORTANT]
> It is bad practice to uncomment default options without changing them. Many
> defaults are updated by developers as features evolve and can be essential
> to expected server function.
## Option commandline flag
Tuwunel supports setting individual config options in TOML format from the
`-O` / `--option` flag. For example, you can set your server name via `-O
server_name=\"example.com\"`.
Note that the config is parsed as TOML, and shells like bash will remove quotes.
So unfortunately it is required to escape quotes if the config option takes a
string. This does not apply to options that take booleans or numbers:
- `--option allow_registration=true` works ✅
- `-O max_request_size=99999999` works ✅
- `-O server_name=example.com` does not work ❌
- `--option log=\"debug\"` works ✅
- `--option server_name='"example.com'"` works ✅
## Relevance of configuration settings
There is a specific sequence for reading and overwriting the settings. The
latest setting takes precedence and defines the configuration.
1. Set in `CONDUIT_CONFIG`.
2. Set in `CONDUWUIT_CONFIG`.
3. Set in `TUWUNEL_CONFIG`.
4. Set in the first config file on the command line (e.g. `-c config_file_1.toml`).
5. Set in the second config file on the command line (e.g. `-c config_file_2.toml`).
6. Set in any additional config file on the command line (e.g. `-c config_file_n.toml`).
7. Set within the options (again, the latest option in the list overrides).
## Execute commandline flag
Tuwunel supports running admin commands on startup using the commandline
argument `--execute`. The most notable use for this is to create an admin user
on first startup.
The syntax of this is a standard admin command without the prefix such as
`./tuwunel --execute "users create_user june"`
An example output of a success is:
```
INFO tuwunel_service::admin::startup: Startup command #0 completed:
Created user with user_id: @june:girlboss.ceo and password: `<redacted>`
```
This commandline argument can be paired with the `--option` flag.
## Environment variables
All of the settings that are found in the config file can be specified by using
environment variables. The environment variable names should be all caps and
prefixed with `TUWUNEL_`.
For example, if the setting you are changing is `max_request_size`, then the
environment variable to set is `TUWUNEL_MAX_REQUEST_SIZE`.
To modify config options not in the `[global]` context such as
`[global.well_known]`, use the `__` suffix split: `TUWUNEL_WELL_KNOWN__SERVER`
Conduit and conduwuit's environment variables are supported for backwards
compatibility (e.g. `CONDUIT_SERVER_NAME` or `CONDUWUIT_SERVER_NAME`).
-64
View File
@@ -1,64 +0,0 @@
# Configuration
This chapter describes various ways to configure Continuwuity.
## Basics
Continuwuity uses a config file for the majority of the settings, but also supports
setting individual config options via commandline.
Please refer to the [example config
file](./reference/config.mdx) for all of those
settings.
The config file to use can be specified on the commandline when running
Continuwuity by specifying the `-c`, `--config` flag. Alternatively, you can use
the environment variable `CONDUWUIT_CONFIG` to specify the config file to used.
Conduit's environment variables are supported for backwards compatibility.
## Option commandline flag
Continuwuity supports setting individual config options in TOML format from the
`-O` / `--option` flag. For example, you can set your server name via `-O
server_name=\"example.com\"`.
Note that the config is parsed as TOML, and shells like bash will remove quotes.
So unfortunately it is required to escape quotes if the config option takes a
string. This does not apply to options that take booleans or numbers:
- `--option allow_registration=true` works ✅
- `-O max_request_size=99999999` works ✅
- `-O server_name=example.com` does not work ❌
- `--option log=\"debug\"` works ✅
- `--option server_name='"example.com'"` works ✅
## Execute commandline flag
Continuwuity supports running admin commands on startup using the commandline
argument `--execute`. The most notable use for this is to create an admin user
on first startup.
The syntax of this is a standard admin command without the prefix such as
`./conduwuit --execute "users create_user june"`
An example output of a success is:
```
INFO conduwuit_service::admin::startup: Startup command #0 completed:
Created user with user_id: @june:girlboss.ceo and password: `<redacted>`
```
This commandline argument can be paired with the `--option` flag.
## Environment variables
All of the settings that are found in the config file can be specified by using
environment variables. The environment variable names should be all caps and
prefixed with `CONDUWUIT_`.
For example, if the setting you are changing is `max_request_size`, then the
environment variable to set is `CONDUWUIT_MAX_REQUEST_SIZE`.
To modify config options not in the `[global]` context such as
`[global.well_known]`, use the `__` suffix split: `CONDUWUIT_WELL_KNOWN__SERVER`
Conduit's environment variables are supported for backwards compatibility (e.g.
`CONDUIT_SERVER_NAME`).
+32
View File
@@ -0,0 +1,32 @@
## Example configuration
<details>
<summary>Example configuration</summary>
```toml
{{#include ../../tuwunel-example.toml}}
```
</details>
## Debian systemd unit file
<details>
<summary>Debian systemd unit file</summary>
```
{{#include ../../debian/tuwunel.service}}
```
</details>
## Arch Linux systemd unit file
<details>
<summary>Arch Linux systemd unit file</summary>
```
{{#include ../../arch/tuwunel.service}}
```
</details>
+3
View File
@@ -0,0 +1,3 @@
# Deploying
This chapter describes various ways to deploy Tuwunel.
-3
View File
@@ -1,3 +0,0 @@
# Deploying
This chapter describes various ways to deploy Continuwuity.
+1
View File
@@ -0,0 +1 @@
SUMMARY.md
+11
View File
@@ -0,0 +1,11 @@
# Deployment Guides
- [Generic](generic.md)
- [NixOS](nixos.md)
- [Docker](docker.md)
- [Kubernetes](kubernetes.md)
- [Arch Linux](arch-linux.md)
- [Debian](debian.md)
- [Red Hat](redhat.md)
- [FreeBSD](freebsd.md)
- [Podman systemd](podman-systemd.md)
-42
View File
@@ -1,42 +0,0 @@
[
{
"type": "file",
"name": "generic",
"label": "Generic"
},
{
"type": "file",
"name": "docker",
"label": "Docker"
},
{
"type": "file",
"name": "debian",
"label": "Debian"
},
{
"type": "file",
"name": "fedora",
"label": "Fedora"
},
{
"type": "file",
"name": "nixos",
"label": "NixOS"
},
{
"type": "file",
"name": "arch-linux",
"label": "Arch Linux"
},
{
"type": "file",
"name": "kubernetes",
"label": "Kubernetes"
},
{
"type": "file",
"name": "freebsd",
"label": "FreeBSD"
}
]
+15
View File
@@ -0,0 +1,15 @@
# Tuwunel for Arch Linux
Currently Tuwunel is only on the Arch User Repository (AUR).
The Tuwunel AUR packages are community maintained and are not maintained by
Tuwunel development team, but the AUR package maintainers are in the Matrix
room. Please attempt to verify your AUR package's PKGBUILD file looks fine
before asking for support.
- [tuwunel](https://aur.archlinux.org/packages/tuwunel) - latest tagged
tuwunel
- [tuwunel-git](https://aur.archlinux.org/packages/tuwunel-git) - latest git
tuwunel from `main` branch
- [tuwunel-bin](https://aur.archlinux.org/packages/tuwunel-bin) - latest
tagged tuwunel static binary
-5
View File
@@ -1,5 +0,0 @@
# Continuwuity for Arch Linux
Continuwuity is available in the `archlinuxcn` repository and AUR with the same package name `continuwuity`, which includes the latest tagged version. The development version is available on AUR as `continuwuity-git`.
Simply install the `continuwuity` package. Configure the service in `/etc/conduwuit/conduwuit.toml`, then enable and start the continuwuity.service.

Some files were not shown because too many files have changed in this diff Show More