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(client): introduce extensible YAML config #2329

Merged
merged 17 commits into from
Jan 28, 2025
Merged

Conversation

fortuna
Copy link
Collaborator

@fortuna fortuna commented Jan 15, 2025

This is part 2 of #2306.

TODO:

  • Delete Shadowsocks from TransportConfig. Let's use the explicit TCP/UDP only when not using the legacy formats.
  • Separate built object type (e.g. ShadowsocksStreamDialer) and their configs (e.g. ShadowsocksConfig) in the Config documentation
  • Choose between $parser and $type
  • Move TunnelConfig parsing to Go. It needs to be in YAML
    • Propagate service provider error somehow
  • Propagate unsupported error somehow
  • Decide on firsthHop when tcp and udp differ

@fortuna fortuna marked this pull request as ready for review January 15, 2025 23:26
@fortuna fortuna requested review from a team as code owners January 15, 2025 23:26
@fortuna fortuna requested review from sbruens and jyyi1 January 15, 2025 23:26
@fortuna
Copy link
Collaborator Author

fortuna commented Jan 16, 2025

@sbruens @jyyi1 here is an attempt to document the config format. Please let me know how I can improve it: https://github.com/Jigsaw-Code/outline-apps/blob/fortuna-go-config/client/config.md

Copy link
Contributor

@jyyi1 jyyi1 left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM with some comments!

client/config.md Outdated Show resolved Hide resolved
client/config.md Show resolved Hide resolved
firstHop = streamFirstHop
}
return &InvokeMethodResult{
Value: firstHop,
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we return an error here or just the empty result?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not having a shared first hop is not really an error. We just won't have something to show. Perhaps firsthHop should be a struct instead, and we could show both.

Without the struct, people won't be able to use separate endpoints for tcp and udp on Windows, even if they are on the same IP, because we don't have the IP returned

provider := newTestProvider()

node, err := ParseConfigYAML(`
$type: ss
Copy link
Contributor

Choose a reason for hiding this comment

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

$type or $parser?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Settled on $type

)

// ConfigParserKey is the config key used to specify the parser to use to parse an object.
const ConfigParserKey = "$parser"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be $parser or $type? The document says $type.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Settled on $type

Copy link
Collaborator Author

@fortuna fortuna left a comment

Choose a reason for hiding this comment

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

I realized I need to do a few more things to this PR before submitting. I'm adding the TODO to the description

client/src/www/app/outline_server_repository/config.ts Outdated Show resolved Hide resolved
client/config.md Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@fortuna fortuna left a comment

Choose a reason for hiding this comment

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

This is ready for review again. I finally got the tunnel config parsing and error propagation working

)

// ConfigParserKey is the config key used to specify the parser to use to parse an object.
const ConfigParserKey = "$parser"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Settled on $type

provider := newTestProvider()

node, err := ParseConfigYAML(`
$type: ss
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Settled on $type

@fortuna fortuna requested review from jyyi1 and sbruens January 27, 2025 23:00
@fortuna fortuna merged commit c1f0be6 into master Jan 28, 2025
31 checks passed
@fortuna fortuna deleted the fortuna-go-config branch January 28, 2025 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants