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

Does it possible use env variable on conf #1222

Closed
jhaoheng opened this issue Sep 12, 2018 · 10 comments
Closed

Does it possible use env variable on conf #1222

jhaoheng opened this issue Sep 12, 2018 · 10 comments
Assignees
Labels
EnglishNative This issue is conveyed exclusively in English. Feature It's a new feature.
Milestone

Comments

@jhaoheng
Copy link

as title

Thanks

@winlinvip
Copy link
Member

Why use env varables?

@matclayton
Copy link

This would be very useful for us as well. By using Env var in the conf files we can change the configuration from outside the pod. For example we would like to be able to do, which right now we dynamically change in a script before starting srs

on_publish ${CALLBACK_URL}/_internal/live/on_publish/?internal_key=${INTERNAL_KEY};

@daxaxelrod
Copy link

+1

@winlinvip winlinvip self-assigned this Aug 23, 2021
@winlinvip winlinvip added the Feature It's a new feature. label Aug 23, 2021
@winlinvip winlinvip added this to the SRS 5.0 release milestone Aug 23, 2021
@winlinvip
Copy link
Member

Make sense.

@winlinvip
Copy link
Member

SRS 5.0 supports config with ENV, see #2277

@winlinvip winlinvip added the EnglishNative This issue is conveyed exclusively in English. label Jul 28, 2023
@irg1008
Copy link

irg1008 commented Jun 15, 2024

Is this anywhere in the docs? It's so difficult to find something out with this lib... hm

@irg1008
Copy link

irg1008 commented Jun 15, 2024

As fare as that PR goes we can't still set http_hooks env vars

@suzp1984
Copy link
Contributor

@irg1008 which http_hooks env vars didn't works as you expected? Could you gives the cmd args or steps to reproduce?
As I know all the configs are documented in conf/full.conf, which can be the config guideline, for http_hooks section, on_connect and on_close are missing.

@irg1008
Copy link

irg1008 commented Jun 16, 2024

@irg1008 which http_hooks env vars didn't works as you expected? Could you gives the cmd args or steps to reproduce?

As I know all the configs are documented in conf/full.conf, which can be the config guideline, for http_hooks section, on_connect and on_close are missing.

Yeah I looked at conf file but didn't find any env vars for http hooks

@suzp1984
Copy link
Contributor

@irg1008 which http_hooks env vars didn't works as you expected? Could you gives the cmd args or steps to reproduce?
As I know all the configs are documented in conf/full.conf, which can be the config guideline, for http_hooks section, on_connect and on_close are missing.

Yeah I looked at conf file but didn't find any env vars for http hooks

srs/trunk/conf/full.conf

Lines 1587 to 1588 in e3d74fb

# Overwrite by env SRS_VHOST_HTTP_HOOKS_ON_PUBLISH for all vhosts.
on_publish http://127.0.0.1:8085/api/v1/streams http://localhost:8085/api/v1/streams;

env SRS_VHOST_HTTP_HOOKS_ON_PUBLISH

winlinvip added a commit that referenced this issue Aug 13, 2024
1. add on_connect & on_close directives to conf/full.conf;
2. let http_hooks env overwrite support multi values; e.g.
SRS_VHOST_HTTP_HOOKS_ON_CONNECT="http://127.0.0.1/api/connect
http://localhost/api/connect"

related to
#1222 (comment)
Above comments said `http_hook` env may not works as expected, as I
found there are still has some issue in `http_hooks` env configuration,
but this PR may not target above problem.

---------

Co-authored-by: winlin <winlinvip@gmail.com>
winlinvip added a commit that referenced this issue Aug 13, 2024
1. add on_connect & on_close directives to conf/full.conf;
2. let http_hooks env overwrite support multi values; e.g.
SRS_VHOST_HTTP_HOOKS_ON_CONNECT="http://127.0.0.1/api/connect
http://localhost/api/connect"

related to
#1222 (comment)
Above comments said `http_hook` env may not works as expected, as I
found there are still has some issue in `http_hooks` env configuration,
but this PR may not target above problem.

---------

Co-authored-by: winlin <winlinvip@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EnglishNative This issue is conveyed exclusively in English. Feature It's a new feature.
Projects
None yet
Development

No branches or pull requests

6 participants