mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Config: Support overwrote by environment variables. (#3197)
* Support overwrite by environment virable. * modify duplicated code * Config: Add stat for envrionment config. * Config: Fix utest fail. Co-authored-by: pengfei.ma <pengfei.ma@ctechm.com> Co-authored-by: winlin <winlin@vip.126.com>
This commit is contained in:
parent
dc20d5ddbc
commit
eb04f92176
8 changed files with 474 additions and 84 deletions
|
@ -27,6 +27,9 @@ using namespace std;
|
|||
// Whether we are in docker, defined in main module.
|
||||
extern bool _srs_in_docker;
|
||||
|
||||
// Whether setup config by environment variables.
|
||||
extern bool _srs_config_by_env;
|
||||
|
||||
// Check the feature by cond
|
||||
#define SRS_CHECK_FEATURE(cond, ss) if (cond) ss << "&" << #cond << "=1"
|
||||
#define SRS_CHECK_FEATURE2(cond, key, ss) if (cond) ss << "&" << key << "=1"
|
||||
|
@ -159,6 +162,7 @@ void srs_build_features(stringstream& ss)
|
|||
SRS_CHECK_FEATURE(exec, ss);
|
||||
SRS_CHECK_FEATURE(transcode, ss);
|
||||
SRS_CHECK_FEATURE(security, ss);
|
||||
SRS_CHECK_FEATURE2(_srs_config_by_env, "env", ss);
|
||||
|
||||
SRS_CHECK_FEATURE2(_srs_cls->enabled(), "cls", ss);
|
||||
SRS_CHECK_FEATURE3(_srs_cls->nn_logs(), "logs", _srs_cls->nn_logs(), ss);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue