Commit graph

6344 commits

Author SHA1 Message Date
4a439801b5 Merge branch 'deployment' into feat/space-permission-cascading
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5s
2026-03-19 21:38:38 +00:00
5d4cf82c3d refactor(spaces): remove unused space_id param from sync_power_levels
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5s
Update flake hashes / update-flake-hashes (pull_request) Failing after 5s
sync_power_levels now queries all parent spaces internally via
get_parent_spaces, making the space_id parameter redundant. This also
eliminates redundant work where sync_power_levels_for_children was
calling it once per child per parent space.
2026-03-19 22:34:30 +01:00
52de04403c test(spaces): fix tautological assertions, add missing edge case
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5s
Update flake hashes / update-flake-hashes (pull_request) Failing after 5s
Remove redundant assert!(a || b) after assert!(b). Rename tests to
better reflect what they test. Add multi_space_room_has_reqs_in_one_space_only
to cover room with requirements in space A but not space B.
2026-03-19 22:31:08 +01:00
aae23a083b test(spaces): add multi-space scenario tests
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 6s
Update flake hashes / update-flake-hashes (pull_request) Failing after 6s
Cover highest-wins PL logic across multiple parent spaces, OR-based
join/kick qualification, edge cases (one space has no PL, neither has
PL, user only in one space, same role different PLs across spaces).
2026-03-19 22:29:13 +01:00
982c01e562 fix(spaces): use highest-wins PL logic across multiple parent spaces
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5s
Update flake hashes / update-flake-hashes (pull_request) Failing after 6s
When a room is a child of multiple spaces, sync_power_levels now
computes the maximum power level across ALL parent spaces for each
user, not just the triggering space. validate_pl_change similarly
computes the effective PL as the max across all parents before
rejecting conflicting proposals.
2026-03-19 22:26:30 +01:00
4df2fe2923 fix(spaces): remove is_enabled_for_space guard from ensure_default_roles
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5s
Update flake hashes / update-flake-hashes (pull_request) Failing after 5s
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 4s
The guard prevented ensure_default_roles from working in the enable
command — it checked the cascading state event which hasn't been
written yet at that point. Callers should gate this themselves.
2026-03-19 19:55:44 +01:00
5787f38906 fix(spaces): don't reset manual PL overrides in sync_power_levels
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Update flake hashes / update-flake-hashes (pull_request) Failing after 5s
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 4s
Remove the else branch that stripped power levels from users not managed
by any space role. This was destroying manually-set PLs for users who
happened to be in space-managed rooms but had no space roles. Space
roles should only SET power levels for managed users, never remove
entries for non-managed users.
2026-03-19 19:49:04 +01:00
528c1c501e feat(spaces): handle space leave/ban, fix enable ordering
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 6s
Update flake hashes / update-flake-hashes (pull_request) Failing after 5s
Add handle_space_member_leave to kick users from child rooms when they
leave or are banned from a Space. Handle both Join and Leave/Ban
membership transitions in on_pdu_appended dispatch.

Fix enable command to create default roles before sending the cascading
enable event, preventing enforcement from running against empty roles.
2026-03-19 19:46:40 +01:00
23239b79a9 docs(spaces): update changelog fragment to mention per-space overrides
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 6s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 6s
Update flake hashes / update-flake-hashes (pull_request) Failing after 5s
2026-03-19 19:38:18 +01:00
8494d1d65b fix(spaces): fix clippy semicolon_outside_block, add type alias for complex type
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 5s
Update flake hashes / update-flake-hashes (pull_request) Failing after 6s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 6s
2026-03-19 19:37:28 +01:00
5cc90faa42 fix(spaces): address 10-agent review findings
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 4s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5s
Update flake hashes / update-flake-hashes (pull_request) Failing after 5s
- Make cache fields private, add get_user_roles_in_space and
  get_room_requirements_in_space accessor methods for admin layer
- Add flush_space_from_cache and call it when cascading is disabled
  for a space (prevents stale enforcement data)
- Fix err!(Err("...")) -> err!("...") (redundant variant wrapper)
- Fix variable naming: sender -> server_user in ensure_default_roles
- Fix UFCS turbofish in validate_pl_change to simpler .as_str()
- Import Semaphore instead of inline tokio::sync::Semaphore path
- Add power_level bounds validation in add command (Matrix Int range)
- Add room-is-child-of-space validation in require command
- Handle SPACE_CASCADING_EVENT_TYPE in enforcement dispatch to flush
  cache when a space is disabled
2026-03-19 19:31:27 +01:00
2fbbf76692 fix(spaces): add server.running() guards to spawned enforcement tasks
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5s
Update flake hashes / update-flake-hashes (pull_request) Failing after 4s
Check server.running() at the start of each spawned task to avoid
doing enforcement work during shutdown, matching the codebase's
established pattern for short-lived spawned tasks.
2026-03-19 19:16:04 +01:00
89074c9741 fix(spaces): address critical review findings
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 6s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 6s
Update flake hashes / update-flake-hashes (pull_request) Failing after 5s
- Fix pending_enforcement cleanup: wrap enforcement body in async block
  so removal always runs even on semaphore error or early return
- Fix check_join_allowed: remove is_enabled() guard that blocked
  per-space overrides when global flag is false (get_parent_spaces
  already filters by is_enabled_for_space)
- Fix kick/join asymmetry: kick_unqualified_from_rooms now checks all
  parent spaces before kicking, matching check_join_allowed's OR logic
- Fix lock ordering: validate_pl_change now acquires roles before
  user_roles, matching get_user_power_level's order
- Fix ensure_default_roles TOCTOU: move existence check inside state
  lock to prevent concurrent duplicate writes
2026-03-19 18:41:54 +01:00
5740f72b4d refactor(spaces): extract hooks into service methods, minimize touchpoints
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5s
Update flake hashes / update-flake-hashes (pull_request) Failing after 5s
Move all space roles logic out of append.rs, build.rs, and join.rs
into service methods (on_pdu_appended, validate_pl_change,
check_join_allowed). Existing files now have single-line call sites
instead of inline logic. Extract flush_caches helper to deduplicate
cache clearing.
2026-03-19 18:32:05 +01:00
07c38c3339 refactor(spaces): extract event type helpers and PL sync loop
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5s
Update flake hashes / update-flake-hashes (pull_request) Failing after 5s
Extract StateEventType constructor helpers to avoid repeated
to_owned() allocations at each call site. Extract
sync_power_levels_for_children to consolidate 3 identical loops.
2026-03-19 18:17:33 +01:00
482f9145e6 refactor(spaces): consolidate duplicated code, delete redundant tests
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5s
Update flake hashes / update-flake-hashes (pull_request) Failing after 5s
- Delete cache_tests.rs and integration_tests.rs (only tested same two
  free functions already covered in tests.rs via MockCache indirection)
- Extract invite_and_join_user helper, eliminating duplicate invite+join
  PDU pattern in auto_join and handle_space_child_change
- Extract send_space_state! macro, eliminating 8 repeated lock+send
  blocks in admin commands
- Extract resolve_room_as_space! macro for enable/disable/status
- Remove redundant user_qualifies check in SPACE_ROLE_ROOM handler
  (kick_unqualified_from_rooms already checks)
- Add parent_spaces.is_empty() short-circuit in build.rs PL enforcement
- Hoist Arc::clone in append.rs to single binding
- Rename space_roles_cache_capacity -> space_roles_cache_flush_threshold
- Remove remaining trivial serde tests
2026-03-19 18:11:08 +01:00
f5ab4da12d fix(spaces): add early is_enabled() check in join path, use err! macro
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 4s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5s
Update flake hashes / update-flake-hashes (pull_request) Failing after 5s
Skip lock acquisition on every join when feature is globally disabled.
Use conduwuit::err! macro instead of manual Error::Err construction.
2026-03-19 16:47:28 +01:00
ce239078c2 fix(spaces): use pub(super) for test helpers to fix unreachable_pub warning
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5s
Update flake hashes / update-flake-hashes (pull_request) Failing after 5s
2026-03-19 16:45:46 +01:00
879383bd9d refactor(spaces): fix clippy, remove redundant code, consolidate tests
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 6s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5s
Update flake hashes / update-flake-hashes (pull_request) Failing after 5s
- Fix assert!(x.is_err()) clippy errors -> unwrap_err()
- Remove redundant first PL conflict loop in build.rs (second loop
  covers all cases)
- Remove unused OwnedRoomId from SpaceEnforcementData tuple
- Merge make_user_roles/make_requirements into single make_set helper
- Remove trivial tests (HashMap::get, serde defaults, BTreeMap ordering)
- Remove duplicate tests between tests.rs and integration_tests.rs
- MockCache now delegates to existing free functions
- Remove unnecessary scope braces in join.rs
2026-03-19 16:44:54 +01:00
5b56a8b6ed feat(spaces): add per-Space cascading toggle with server-wide default
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 4s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5s
Update flake hashes / update-flake-hashes (pull_request) Failing after 14s
Add com.continuwuity.space.cascading state event for per-Space override
of the server-wide space_permission_cascading config. Add enable/disable/
status admin commands. Strip superfluous comments throughout.
2026-03-19 16:33:15 +01:00
53d4fb892c chore(spaces): fix formatting, add changelog, remove design docs
Run cargo +nightly fmt, add towncrier news fragment, remove plan
documents that served their purpose during development.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 16:10:53 +01:00
Jade Ellis
6b013bcf60
chore: Update funding links 2026-03-19 12:45:12 +00:00
Ginger
05a49ceb60
chore: Whitelist cognitive_complexity lint 2026-03-18 13:59:48 -04:00
Ginger
728c5828ba
feat: Add a panic handler and clean up error page 2026-03-18 13:43:34 -04:00
Ginger
50c94d85a1
fix: Code cleanup 2026-03-18 13:18:53 -04:00
Ginger
0cc188f62c
fix: Remove redirect on index 2026-03-18 12:42:55 -04:00
Ginger
6451671f66
fix: Update doc comment 2026-03-18 12:42:55 -04:00
theS1LV3R
ca21a885d5
chore: Rename option index_page_allow_indexing to allow_web_indexing 2026-03-18 12:42:55 -04:00
Ginger
4af4110f6d
chore: Update news fragment 2026-03-18 12:42:55 -04:00
Ginger
51b450c05c
feat: Use a context struct to store global template context 2026-03-18 12:42:55 -04:00
theS1LV3R
f9d1f71343
fix: Fix logic error 2026-03-18 12:42:55 -04:00
theS1LV3R
7901e4b996
chore: Add news fragment for !1527 2026-03-18 12:42:55 -04:00
theS1LV3R
7b6bf4b78e
feat: Add option for a noindex meta tag on the HTML index page
Adds a new config option `index_page_allow_indexing` which defaults to false.

Fixes: !1527
2026-03-18 12:42:55 -04:00
Ginger
67d5619ccb
fix: Fix password reset page appearance in light mode 2026-03-18 12:42:55 -04:00
Ginger
bf001f96d6
feat: Restrict reset token command 2026-03-18 12:42:55 -04:00
Ginger
ae2b87f03f
fix: Fix M_NOT_FOUND for users with no origin set 2026-03-18 12:42:55 -04:00
Ginger
957cd3502f
fix: Evil CSS hackery 2026-03-18 12:42:55 -04:00
Ginger
a109542eb8
fix: Disable text selection on k10y 2026-03-18 12:42:55 -04:00
Ginger
8c4844b00b
fix: Use error page for extractor rejections 2026-03-18 12:42:55 -04:00
Ginger
eec7103910
feat: Implement dedicated 404 page for routes under /_continuwuity/ 2026-03-18 12:42:55 -04:00
Ginger
43aa172829
feat: Move index to /_continuwuity/ 2026-03-18 12:42:55 -04:00
Ginger
9b4c483b6d
chore: Remove unnecessary database map left over from refactor 2026-03-18 12:42:55 -04:00
Ginger
b885e206ce
fix: Use server name in index again 2026-03-18 12:42:55 -04:00
Ginger
07a935f625
fix: Add CSRF protection 2026-03-18 12:42:55 -04:00
Ginger
d13801e976
fix: Disallow issuing password reset tokens for deactivated users 2026-03-18 12:42:55 -04:00
Ginger
5716c36b47
chore: Change password reset page path 2026-03-18 12:42:55 -04:00
Ginger
f11943b956
chore: News fragment 2026-03-18 12:42:55 -04:00
Ginger
8b726a9c94
chore: Cleanup 2026-03-18 12:42:55 -04:00
Ginger
ffa3c53847
feat: Implement a webpage for self-service password resets 2026-03-18 12:42:55 -04:00
Ginger
da8833fca4
feat: Implement a command for issuing password reset links 2026-03-18 12:42:55 -04:00