Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(windows-client): run the GUI and tunnel in separate processes #4978

Merged
merged 97 commits into from
May 20, 2024

Conversation

ReactorScram
Copy link
Collaborator

@ReactorScram ReactorScram commented May 13, 2024

Ready for review.

Closes #3712.
Supersedes #4940.
Refs #4963.

I haven't figured out if it needs any new automated tests (unit, integration, etc.) but the code itself is ready for review. There is more refactoring that could be done, or could be left for later.

Tasks

Edit tasklist title
Beta Give feedback Tasklist Tasks, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. Move wintun setup from GUI to IPC service / headless client
    Options
  2. Make sure the device ID is in a sensible place
    Options
  3. Export IPC service logs in the zips
    Options
  4. Test GUI + SC IPC service on Windows (f4db808919a passed)
    Options
  5. Make sure IPC service does not busy-loop
    Options
  6. Test un-install checklist for Windows
    Options
  7. Test upgrade checklist for Windows
    Options
  8. Test GUI + systemd IPC service on Linux (c4ab7e7 passed)
    Options
  9. Test upgrade checklist for Linux
    Options
  10. Test un-install checklist for Linux
    Options
  11. Make sure the IPC service logs out and deactivates DNS control if the GUI crashes
    Options
  12. Test network changing
    Options
  13. (it's intended behavior) Look into spurious on_update_resources (fad86babd7)
    Options
  14. Test max partition time on offline laptop (I ended up just setting a 30-day default in the code)
    Options
  15. Make sure headless Client does not busy-loop
    Options
  16. Test standalone headless on Linux
    Options
  17. Add unit / integration tests
    Options
  18. Options

I'm going to want a well-known dir that the Windows IPC service writes logs to,
and that the Windows GUI can pick them up from.

I don't know how I did this for Linux last week, but it should probably be in
here too.
This has a known gap where theoretically the GUI could sign in while the
service is hung in startup, and then the service would wipe out the GUI's
DNS rules.

The workaround for that would be to restart the GUI, but in practice I think
this is almost impossible, Windows would have to give the service no CPU time
while the user was signing in, then the user would have to immediately open
Firezone before the service got running.

Closes #4899
Copy link
Member

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few ideas and questions. Feel free to defer any of the refactoring if you don't feel like it!

There are some questions that I think we should answer before merging (like exit codes on error), hence not approving yet.

rust/gui-client/src-tauri/src/client/ipc/windows.rs Outdated Show resolved Hide resolved
rust/gui-client/src-tauri/src/client.rs Show resolved Hide resolved
rust/headless-client/src/windows.rs Outdated Show resolved Hide resolved
rust/headless-client/src/windows.rs Show resolved Hide resolved
rust/headless-client/src/windows.rs Outdated Show resolved Hide resolved
rust/headless-client/src/windows.rs Show resolved Hide resolved
rust/headless-client/src/windows.rs Outdated Show resolved Hide resolved
@jamilbk
Copy link
Member

jamilbk commented May 17, 2024

Left a few ideas and questions. Feel free to defer any of the refactoring if you don't feel like it!

There are some questions that I think we should answer before merging (like exit codes on error), hence not approving yet.

Yeah if possible let's defer the refactoring until next week so we can ship this. Quite a big PR already

@ReactorScram
Copy link
Collaborator Author

@thomaseizinger I fixed the exit code on error case. I'm not sure if Windows does anything with that exit code but it looks better with it fixed, anyway.

There's like 10+ refactorings I'm pushing off in #5022. I also found that it takes about 30 seconds to sign in on Windows, but I think that's due to the DNS control being slow after the last set of DNS fixes, not due to a regression related to IPC. I can test that next week.

Copy link
Member

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for working in the comments. Let me know if you want to pair on any of the codec stuff! :)

Approving modulo actually setting a non-zero exit code for the Windows service.

rust/headless-client/src/windows.rs Outdated Show resolved Hide resolved
@ReactorScram ReactorScram added this pull request to the merge queue May 20, 2024
Merged via the queue into main with commit 1ef775d May 20, 2024
135 checks passed
@ReactorScram ReactorScram deleted the chore/windows-ipc-service-2 branch May 20, 2024 21:49
github-merge-queue bot pushed a commit that referenced this pull request May 31, 2024
```[tasklist]
### Before opening for review
- [ ] ~~Wait for some other refactors to merge~~
- [x] Test Windows
- [x] Test Linux
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/chore Issues related to repository cleanup or maintenance kind/feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run Windows GUI and tunnel in separate processes
4 participants