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

[Request] Setting the websocket host and port to be set via settings and environment variables. #1

Open
ChTBoner opened this issue Oct 9, 2022 · 5 comments

Comments

@ChTBoner
Copy link
Contributor

ChTBoner commented Oct 9, 2022

Hi,

As promised here is the first of a small set of features for bugs/features

As SNI and QUsb2Snes can be ran remotely, I think it would be nice if it were possible to set their host and port from the settings and/or from environment variables.

@dagit
Copy link
Owner

dagit commented Oct 9, 2022

I'm not a huge fan of env variables, but adding them as command line options and reflecting them in settings.toml should be easy.

I could use some help testing them. It's not a configuration I'm familiar with.

@dagit
Copy link
Owner

dagit commented Oct 9, 2022

Also, while I could implement this very fast (but testing it would take me longer), I'd also be happy to help you do it if you wanted to practice making contributions.

You'll need to add the setting to AppConfig: https://github.com/dagit/annelid/blob/master/src/main.rs#L53

I've been making everything in there Optional and then providing a reasonable default. You can think of the AppConfig type as a pre-validation input. Once the value has been set from either a) the command line, b) settings.toml, or c) the default, then you can move the decided upon value into LiveSplitCoreRenderer. As for precedent, I usually let things in settings.toml take precedent over the default. And things on the command line take precedent over things in settings.toml.

I hope that helps!

@ChTBoner
Copy link
Contributor Author

Thanks, I took a look at the code a that's what I figured. I am gonna fork and try

@dagit
Copy link
Owner

dagit commented Nov 3, 2022

I was doing some annelid work today and I was wondering if you've made any progress or have any questions.

@ChTBoner
Copy link
Contributor Author

ChTBoner commented Nov 3, 2022

I tried to work on it recently and released my Rust was a bit.... rusty, for lack of a less punny word...
I spent some time refreshing my knowledge, but I don't expect to finish this soon.

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

No branches or pull requests

2 participants