Skip to content

refactor(controller): split runtime modules and clarify code structure - #93

Merged
RentnerKev merged 2 commits into
mainfrom
refactor/runtime-modules
Sep 12, 2026
Merged

RentnerKev merged 2 commits into
mainfrom
refactor/runtime-modules

Conversation

@RentnerKev

Copy link
Copy Markdown
Member

Summary

The controller's large certificate, DNS, renderer and runtime files combined unrelated responsibilities, making persistence and recovery changes difficult to review. Split them into focused modules with small public facades and explicit imports. Separate ACME account registration and order handling, runtime lifecycle and configuration, and safe-path helpers.

Remove explanatory comments from maintained Rust, TypeScript and shell source as requested. Preserve functional tool directives and generated-file markers. Document the module map and recovery invariants in docs/controller-runtime.md and the contribution guide. Existing APIs, serialization, certificate leases, rollback paths and Caddy output remain unchanged.

Related issue

Closes #91

Type of change

  • Refactoring
  • Documentation

Testing

  • bun run check: 752 web tests and 160 Rust tests passed, including format, lint, types, database validation and production builds.
  • bun run certificates:smoke: 45 checks passed.
  • bun run proxy:smoke: 36 checks passed.
  • bun run upstream-tls:smoke: 11 checks passed.
  • Independent function-body and Serde-field comparisons found no lost behavior in the moved certificate, ACME, lifecycle and state code.
  • TypeScript comment removal was checked against the parsed syntax tree before formatting.

Checklist

  • I tested the relevant functionality.
  • Existing tests pass.
  • No new behavior was introduced; existing regression and production smoke coverage was retained.
  • This PR does not include secrets, credentials, production data, or private certificates/keys.
  • I updated documentation where necessary.
  • I linked the relevant issue.

Breaking changes

None. No schema migration or release tag is included.

@coderabbitai

coderabbitai Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: cfb3efce-79d6-44b8-8fe4-c1001c54ef8e


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added documentation Improvements or additions to documentation area: auth Authentication, accounts, sessions, passkeys, and access control. area: proxy Proxy host configuration and request forwarding. area: runtime Caddy and privileged controller runtime behavior. area: certificates Certificates, ACME, trusted CAs, and TLS material. area: database Database schema, migrations, and persistence. area: ui Web interface components, routes, styling, and localization. area: docker Docker images, Compose configuration, and deployment. area: ci Continuous integration and GitHub automation. labels Sep 12, 2026
@github-actions

github-actions Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

🐳 RentnerProxy PR Preview

A test-only image for this pull request has been published successfully.

Images

Type Image
Moving preview for this PR ghcr.io/rentnerkev/rentnerproxy:pr-93
Exact tested build ghcr.io/rentnerkev/rentnerproxy:pr-93-021bee60b39f

Image digest: sha256:d7feb81165d93b9017cfaf5975635f4ea95cd22e10a01c54200ff8bccf0bb61f

Tested and built merge commit: 021bee60b39f933347861b567d13225eaf6c79aa

Pull request head commit: 0d660bd64fa71fceab38f142cbdf38580ceb26dd

For reproducible testing and bug reports, prefer pr-93-021bee60b39f. The pr-93 tag moves to the newest successful preview for this PR.


⚠️ Unreviewed development preview

This image contains unreviewed pull-request code. It may contain bugs, breaking changes, incomplete or incompatible migrations, configuration errors, and changes that damage data or runtime state.

Do not use this PR preview image with production data.

Before testing:

  1. Back up PostgreSQL.
  2. Back up the complete RentnerProxy controller/runtime state in /var/lib/rentnerproxy, including certificates, private keys, ACME state, active configuration, last-known-good state, and trusted CA material.
  3. Prefer a separate test database and separate Docker volumes.
  4. Use an isolated Docker Compose project and avoid production port bindings.

Docker

docker pull ghcr.io/rentnerkev/rentnerproxy:pr-93-021bee60b39f

Docker Compose

In a separate test copy of docker-compose.yml, replace the service image with:

image: ghcr.io/rentnerkev/rentnerproxy:pr-93-021bee60b39f

Then use an isolated Compose project:

docker compose --project-name rentnerproxy-pr-93 pull
docker compose --project-name rentnerproxy-pr-93 up -d

The repository Compose file binds ports 80, 81, and 443; change those bindings or stop the production stack before testing.

This preview is intended only for testing this pull request and is not a production release.

@RentnerKev
RentnerKev force-pushed the refactor/runtime-modules branch from 9650a39 to 0d660bd Compare September 12, 2026 21:24
@RentnerKev
RentnerKev merged commit 0cdc4b9 into main Sep 12, 2026
19 checks passed
@RentnerKev
RentnerKev deleted the refactor/runtime-modules branch September 12, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: auth Authentication, accounts, sessions, passkeys, and access control. area: certificates Certificates, ACME, trusted CAs, and TLS material. area: ci Continuous integration and GitHub automation. area: database Database schema, migrations, and persistence. area: docker Docker images, Compose configuration, and deployment. area: proxy Proxy host configuration and request forwarding. area: runtime Caddy and privileged controller runtime behavior. area: ui Web interface components, routes, styling, and localization. documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(controller): split runtime modules and clarify code structure

1 participant