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

Allow PORT environment to be not set #46

Merged
merged 2 commits into from
Oct 18, 2022

Conversation

Gusted
Copy link
Member

@Gusted Gusted commented Oct 16, 2022

  • It's quite weird to require the PORT environment to be set, when it already can be set via the config file.

- It's quite weird to require the `PORT` environment to be set, when it
already can be set via the config file.
src/settings.rs Outdated
@@ -170,7 +170,7 @@ impl Settings {
Ok(val) => {
s.set("server.port", val).unwrap();
}
Err(e) => warn!("couldn't interpret PORT: {}", e),
_ => (),
Copy link
Member

Choose a reason for hiding this comment

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

Rather than completely removing the warning message, can you move it the Ok() block and convert it into an info message?

I've faced issues trying to host other software where I couldn't tell if my environment variable was being read or not 😅

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_ => (),
If let Ok(val) = env::var("PORT") {
s.set("server.port", val).unwrap();
log:info!("Overriding port with environment variable");
}

Copy link
Member Author

Choose a reason for hiding this comment

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

I have added a few more points of logging in this file: 9fd8ffd

Copy link
Member

@realaravinth realaravinth left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! :)

@realaravinth realaravinth merged commit af35fdb into mCaptcha:master Oct 18, 2022
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.

None yet

2 participants