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

Separate port and host in configuration #1950

Merged
merged 1 commit into from
Aug 14, 2020

Conversation

paulpach
Copy link
Contributor

Many cloud providers have an environment variable PORT.
an application is supposed to listen in that port.

Currently, the yaml for listen address looks like this:

backend:
  listen: 0.0.0.0:7000

the problem is that I can't use the port environment variable there.

This PR changes it to this:

backend:
  listen:
    host: 0.0.0.0
    port: 7000

if I want to use the PORT environment variable, now I can do it like this:

backend:
  listen:
    host: 0.0.0.0
    port:
      $secret:
         env: PORT

@paulpach paulpach requested a review from a team as a code owner August 13, 2020 16:19
Copy link
Member

@Rugvip Rugvip left a comment

Choose a reason for hiding this comment

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

Thanks! 🎉

As mentioned on Discord, I think it would be best if we could keep the existing way of specifying the listen address too. Letting backend.listen be either a string or an object. You can check it with typeof config.get('backend.listen') === 'string'

Many cloud providers have an environment variable PORT.
an application is supposed to listen in that port.

Currently,  the yaml for listen address looks like this:
```yaml
backend:
  listen: 0.0.0.0:7000
```

the problem is that I can't use the port environment variable there.

This PR changes it to this:
```yaml
backend:
  listen:
    host: 0.0.0.0
    port: 7000
```

if I want to use the PORT environment variable, now I can do it like this:

```yaml
backend:
  listen:
    host: 0.0.0.0
    port:
      $secret:
         env: PORT
```
Copy link
Member

@Rugvip Rugvip left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@Rugvip Rugvip merged commit 442ee14 into backstage:master Aug 14, 2020
@paulpach paulpach deleted the envport branch August 14, 2020 13:08
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