cleanup(office): drop OO_SERVER_URL + obsolete CSP + nu_service.nu #19

Merged
zaelgohary merged 1 commit from development_cleanup_drop_oo_server_url into development 2026-04-27 11:33:01 +00:00
Member

Summary

Removes deadweight surfaced by post-merge architecture review.

OO_SERVER_URL is no longer read by any service after #17. The only remaining use was the CSP gate in the editor wrapper, which is itself obsolete: OnlyOffice now generates URLs from X-Forwarded-Proto, so the scheme already matches the page's scheme — upgrade-insecure-requests is a no-op.

scripts/nu_service.nu (278 lines) duplicates the hero_office --start/--stop selfstart CLI added in #10.

Closes #18

Changes

  • crates/hero_office_ui/src/config.rs — drop oo_server_url field + env load
  • crates/hero_office_ui/src/handlers.rs — drop the entire CSP block from the editor wrapper renderer
  • crates/hero_office/src/main.rs — drop OO_SERVER_URL from selfstart CLI's forwarded env lists
  • scripts/nu_service.nu — deleted (278 lines)
  • 6 sibling files (hero_office_examples/, hero_office_server/{config,main,onlyoffice}.rs) — drive-by fmt drift cleanup

Test Results

  • cargo fmt --check
  • cargo check --workspace
  • cargo clippy -p hero_office_ui -p hero_office -- -D warnings
  • cargo test -p hero_office_server -p hero_office
  • npx playwright test office_editor_real 4/4

Manual verification

After deploying the new binary, hero_office_ui's action env no longer contains OO_SERVER_URL; the editor wrapper page emits no Content-Security-Policy meta tag; the editor still loads + renders documents end-to-end via SSH tunnel from the mac.

Net

-286 LoC (-305 deletions, +19 insertions).

## Summary Removes deadweight surfaced by post-merge architecture review. `OO_SERVER_URL` is no longer read by any service after #17. The only remaining use was the CSP gate in the editor wrapper, which is itself obsolete: OnlyOffice now generates URLs from `X-Forwarded-Proto`, so the scheme already matches the page's scheme — `upgrade-insecure-requests` is a no-op. `scripts/nu_service.nu` (278 lines) duplicates the `hero_office --start/--stop` selfstart CLI added in #10. ## Related Issue Closes #18 ## Changes - `crates/hero_office_ui/src/config.rs` — drop `oo_server_url` field + env load - `crates/hero_office_ui/src/handlers.rs` — drop the entire CSP block from the editor wrapper renderer - `crates/hero_office/src/main.rs` — drop `OO_SERVER_URL` from selfstart CLI's forwarded env lists - `scripts/nu_service.nu` — deleted (278 lines) - 6 sibling files (`hero_office_examples/`, `hero_office_server/{config,main,onlyoffice}.rs`) — drive-by fmt drift cleanup ## Test Results - `cargo fmt --check` ✅ - `cargo check --workspace` ✅ - `cargo clippy -p hero_office_ui -p hero_office -- -D warnings` ✅ - `cargo test -p hero_office_server -p hero_office` ✅ - `npx playwright test office_editor_real` 4/4 ✅ ## Manual verification After deploying the new binary, hero_office_ui's action env no longer contains `OO_SERVER_URL`; the editor wrapper page emits no `Content-Security-Policy` meta tag; the editor still loads + renders documents end-to-end via SSH tunnel from the mac. ## Net **-286 LoC** (-305 deletions, +19 insertions).
OO_SERVER_URL is no longer read by any service after PR #17. The only
remaining use was hero_office_ui's CSP gate
(`oo_url.starts_with("https://")`), which was itself obsolete:
OnlyOffice now generates URLs from X-Forwarded-Host / X-Forwarded-Proto,
so the scheme already matches the page's scheme — the
upgrade-insecure-requests directive is a no-op.

- Drop `oo_server_url` from UiConfig + env load
- Drop the entire CSP block from the editor wrapper renderer
- Drop OO_SERVER_URL from the selfstart CLI's forwarded env lists
- Delete scripts/nu_service.nu (278 lines) — superseded by
  `hero_office --start/--stop` (the selfstart CLI added in PR #10)

Drive-by: cargo fmt sweep on 6 sibling files in hero_office_examples and
hero_office_server (pre-existing drift) to unblock /ci-check.
zaelgohary merged commit 69c48ec8e1 into development 2026-04-27 11:33:01 +00:00
zaelgohary deleted branch development_cleanup_drop_oo_server_url 2026-04-27 11:33:01 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_office!19
No description provided.