Skip to content

chore: add Vpn.Service app for Manager #9

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

Merged
merged 3 commits into from
Dec 16, 2024
Merged

chore: add Vpn.Service app for Manager #9

merged 3 commits into from
Dec 16, 2024

Conversation

deansheather
Copy link
Member

@deansheather deansheather commented Dec 9, 2024

  • Implements a basic .NET hosted service manager architecture with Microsoft.Extensions
  • Adds a Manager and ManagerService for handling Manager lifecycle
  • Adds a ManagerRpcService for managing the RPC server and passing requests to the Manager singleton
  • Adds a Downloader for handling singleflight for downloading files
  • Implements downloading with progress reporting, ETag validation, and Authenticode validation

Also:

  • Moves tests into their own projects due to differing build requirements

TODO:

  • Implement AuthenticodeDownloadValidator tests with binaries (I guess download them from somewhere and cache them during the test?)
  • Design ClientMessage and merge upstream, update vpn.proto
  • Implement ClientMessage requests/responses
  • Add code for launching and connecting to child VPN process

Relates to #2

- Implements a basic .NET hosted service manager architecture with
  Microsoft.Extensions
- Adds a Manager and ManagerService for handling Manager lifecycle
- Adds a ManagerRpcService for managing the RPC server and passing
  requests to the Manager singleton
- Adds a Downloader for handling singleflight for downloading files
- Implements downloading with progress reporting, ETag validation, and
  Authenticode validation
@deansheather deansheather marked this pull request as ready for review December 12, 2024 10:26
@deansheather
Copy link
Member Author

This PR is getting huge so I'm going to get this merged so I can request reviews in smaller chunks going forward. Most of this is the boilerplate which enables writing the actual application code (although I probably could've done the Downloader in another PR at the very least :/)

_handler = handler;

// Yes, this is the best way to get an unused port using HttpListener.
// It sucks.
Copy link
Member

Choose a reason for hiding this comment

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

😭

[RegularExpression(@"^([a-zA-Z0-9_-]+\.)*[a-zA-Z0-9_-]+$")]
public string ServiceRpcPipeName { get; set; } = "Coder.Desktop.Vpn";

// TODO: pick a better default path
Copy link
Member

Choose a reason for hiding this comment

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

Probably just AppData?

Copy link
Member Author

Choose a reason for hiding this comment

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

Can't be writable by users so it will definitely be in ProgramData or Program Files

@deansheather deansheather merged commit 29d485b into main Dec 16, 2024
@deansheather deansheather deleted the dean/service branch December 16, 2024 12:58
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.

2 participants