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

New config API with TOML #9

Merged
merged 10 commits into from
Aug 21, 2024
Merged

New config API with TOML #9

merged 10 commits into from
Aug 21, 2024

Conversation

stevapple
Copy link
Contributor

@stevapple stevapple commented Aug 16, 2024

This PR adds a new config API base on TOML, aiming for replacing the existing JSON one. The new config API has adopted the following changes:

  • Thanks to TOML, we're able to group the config items in a natural way;
  • logger has gained a switch and now requires an endpoint URL, preparing for the upcoming OpenTelemetry support;
  • host-keys can be hard-coded alternatively in base64 or string format;
  • DNS names are now supported to determine if PROXY protocol is allowed;
  • Some of the config keys are renamed.

Tests are updated to reflect these changes. They now uses static fixtures, eliminating the requirement of a /tmp/sshmux directory and ssh-keygen tool. The JSON APIs are deprecated but not removed, so tests are now performed against both formats.

This PR also adds SO_REUSEPORT support to sshmux, unblocking #1.

@stevapple stevapple force-pushed the config-toml branch 3 times, most recently from 7f3f527 to c934655 Compare August 18, 2024 16:42
@stevapple
Copy link
Contributor Author

@iBug Request for an early review before the documentation is finished.

We'd like to take advantage of the expressivity of TOML to unblock more and more flexible configurations.

@iBug
Copy link
Member

iBug commented Aug 19, 2024

Looks great so far. Nothing to complain about. Keep up with your good work!

README.md Outdated Show resolved Hide resolved
@stevapple stevapple requested a review from iBug August 19, 2024 13:08
@stevapple stevapple marked this pull request as ready for review August 19, 2024 13:08
@stevapple
Copy link
Contributor Author

I have to apologize that this PR goes far beyond simply adding an alternative config API, but it's not an easy task to split all the updates off now.

I would try some time tomorrow if I have time. If it didn't work, we'll have to squash all those stuffs in a single commit.

config.go Outdated Show resolved Hide resolved
config.go Outdated Show resolved Hide resolved
@stevapple
Copy link
Contributor Author

I would try some time tomorrow if I have time.

I believe the commit history is now clean enough for a fast-forward merge.

@stevapple stevapple force-pushed the config-toml branch 2 times, most recently from 3aafe04 to eb038a6 Compare August 21, 2024 05:12
@stevapple stevapple requested a review from iBug August 21, 2024 05:13
@iBug iBug merged commit 1e8e5af into USTC-vlab:master Aug 21, 2024
2 checks passed
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