Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support overriding properties from flags or environment variables #98

Closed
l-lin opened this issue Oct 6, 2020 · 3 comments
Closed

Support overriding properties from flags or environment variables #98

l-lin opened this issue Oct 6, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@l-lin
Copy link

l-lin commented Oct 6, 2020

Which version are you using?

v0.10.0

Which operating system are you using?

Linux

Enhancement request

It seems there was a time when the rtsp-simple-server could be configured via flags (for example in the #17 comment). However it's now only configurable from a yaml file (from this improvement).

I was wondering if you plan to (re-)support overriding the properties from another source than the configuration file (e.g. flags, environment variables, ...)? What do you think about https://github.com/spf13/viper?


My use case is that I want to spawn dynamically X rtsp-simple-servers in a single server.
For example, if I want to spawn 100 rtsp-simple-services, I could do something like:

#!/usr/bin/env bash

set -e

for i in {0..100}; do
  rtsp_port=$(expr $i + 10000)
  rtp_port=$(expr $i + 8000)
  rtcp_port=$(expr $i + 9000)
  rtsp-simple-servers --rtsp-port="${rtsp_port}" --rtp-port="${rtp_port}" --rtcp-port="${rtcp_port}"
done

But I can't imagine creating 100 rtsp-simple-server.yml files. It's not quite scalable.

Note: I can always mitigate my issue by creating 100 docker containers by mapping the default ports 8554, 8000 and 8001 to the host desired ports.

@aler9 aler9 added the enhancement New feature or request label Oct 8, 2020
@aler9
Copy link
Member

aler9 commented Oct 8, 2020

Hello, i use Grafana a lot, and it's configurable in a way similar to the one proposed by Viper; there's a configuration file, and at the same time config values can be overridden with environment variables.
So yes, i think it can be implemented.

@aler9
Copy link
Member

aler9 commented Oct 17, 2020

feature added in v0.10.1

@aler9 aler9 closed this as completed Oct 17, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Jan 1, 2023

This issue is being locked automatically because it has been closed for more than 6 months.
Please open a new issue in case you encounter a similar problem.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 1, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants