From 9673bfb92c42cf9a727ba8aca7ffeef4ff35fb58 Mon Sep 17 00:00:00 2001 From: winlin Date: Sun, 30 Oct 2022 21:01:02 +0800 Subject: [PATCH] Config: Support set env_only by SRS_ENV_ONLY. --- .run/env.run.xml | 3 ++- trunk/src/app/srs_app_config.cpp | 3 +++ trunk/src/app/srs_app_config.hpp | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.run/env.run.xml b/.run/env.run.xml index f12de1c68..3e4694cf6 100644 --- a/.run/env.run.xml +++ b/.run/env.run.xml @@ -1,6 +1,7 @@ - + + diff --git a/trunk/src/app/srs_app_config.cpp b/trunk/src/app/srs_app_config.cpp index 40e7ded08..ed98dc8b3 100644 --- a/trunk/src/app/srs_app_config.cpp +++ b/trunk/src/app/srs_app_config.cpp @@ -1848,6 +1848,9 @@ srs_error_t SrsConfig::parse_options(int argc, char** argv) // first hello message. srs_trace(_srs_version); + // Config the env_only_ by env. + if (getenv("SRS_ENV_ONLY")) env_only_ = true; + // Try config files as bellow: // User specified config(not empty), like user/docker.conf // If user specified *docker.conf, try *srs.conf, like user/srs.conf diff --git a/trunk/src/app/srs_app_config.hpp b/trunk/src/app/srs_app_config.hpp index 24f9ddbb1..eeee24b56 100644 --- a/trunk/src/app/srs_app_config.hpp +++ b/trunk/src/app/srs_app_config.hpp @@ -275,6 +275,7 @@ private: // Whether show SRS signature and exit. bool show_signature; // Whether only use environment variable, ignore config file. + // Set it by argv "-e" or env "SRS_ENV_ONLY=on". bool env_only_; // global env variables. private: