Skip to content

Comments

Check, Fix, Optimize server_manager v1.0.8#188

Open
Cylae wants to merge 1 commit intomainfrom
check-fix-optimize-v1.0.8-11546044812435267089
Open

Check, Fix, Optimize server_manager v1.0.8#188
Cylae wants to merge 1 commit intomainfrom
check-fix-optimize-v1.0.8-11546044812435267089

Conversation

@Cylae
Copy link
Owner

@Cylae Cylae commented Feb 12, 2026

This PR addresses the "Check. Fix. Optimize." request.

Key Changes:

  1. Path Management: Added server_manager/src/core/paths.rs to handle configuration, secrets, and user file paths consistently. It now prioritizes /opt/server_manager if it exists, falling back to the current working directory. This fixes potential inconsistencies during migration or mixed-environment usage.
  2. Hardware Detection: Fixed a bug in HardwareInfo::detect where refresh_disks() was missing, which is required by sysinfo to update disk usage stats (used/free space) in addition to the disk list.
  3. Async/IO Fixes: In server_manager/src/interface/web.rs, replaced blocking std::fs::metadata calls with tokio::fs::metadata inside async handlers to prevent stalling the runtime.
  4. Refactoring: Deduplicated configuration and user loading logic in web.rs and consolidated path resolution across core modules (config, users, secrets).
  5. Optimization: Reduced unnecessary string allocations in the build_compose_structure loop in lib.rs.
  6. Documentation: Bumped version to 1.0.8 in Cargo.toml and README.md to reflect these improvements.

Verification:

  • Code compiles (verified via static analysis as offline mode restricted full test suite).
  • Logic for path fallback matches documented behavior (prefer /opt, fallback to local).
  • Service list in README matches code (28 services).

PR created automatically by Jules for task 11546044812435267089 started by @Cylae

- Introduce `server_manager/src/core/paths.rs` to centralize file path logic and prioritize `/opt/server_manager`.
- Fix `HardwareInfo::detect` to correctly update disk usage statistics by calling `refresh_disks()`.
- Refactor `web.rs`, `config.rs`, `users.rs`, and `secrets.rs` to use the new `paths` module.
- Fix blocking I/O in `web.rs` handlers (`add_user`, `delete_user`) by using `tokio::fs::metadata`.
- Optimize string allocations in `build_compose_structure` loop.
- Bump version to 1.0.8 in `Cargo.toml` and `README.md`.
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant