1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Default to log to console for docker. v4.0.168

This commit is contained in:
winlin 2021-10-08 21:58:33 +08:00
parent 4c087b9376
commit 55d8cb4b7b
7 changed files with 21 additions and 24 deletions

View file

@ -32,4 +32,4 @@ COPY --from=build /usr/local/srs /usr/local/srs
# Default workdir and command. # Default workdir and command.
WORKDIR /usr/local/srs WORKDIR /usr/local/srs
CMD ["./objs/srs", "-c", "conf/srs.conf"] CMD ["./objs/srs", "-c", "conf/docker.conf"]

View file

@ -1,4 +1,4 @@
# main config for srs. # docker config for srs.
# @see full.conf for detail config. # @see full.conf for detail config.
listen 1935; listen 1935;
@ -14,20 +14,10 @@ http_server {
listen 8080; listen 8080;
dir ./objs/nginx/html; dir ./objs/nginx/html;
} }
stats {
network 0;
disk sda sdb xvda xvdb;
}
rtc_server { rtc_server {
enabled on; enabled on;
# Listen at udp://8000 listen 8000;
listen 8000; candidate $CANDIDATE;
#
# The $CANDIDATE means fetch from env, if not configed, use * as default.
#
# The * means retrieving server IP automatically, from all network interfaces,
# @see https://github.com/ossrs/srs/issues/307#issuecomment-599028124
candidate $CANDIDATE;
} }
vhost __defaultVhost__ { vhost __defaultVhost__ {
hls { hls {
@ -39,6 +29,5 @@ vhost __defaultVhost__ {
} }
rtc { rtc {
enabled on; enabled on;
bframe discard;
} }
} }

View file

@ -3,8 +3,8 @@
listen 1935; listen 1935;
max_connections 1000; max_connections 1000;
srs_log_tank file; #srs_log_tank file;
srs_log_file ./objs/srs.log; #srs_log_file ./objs/srs.log;
daemon on; daemon on;
http_api { http_api {
enabled on; enabled on;

View file

@ -8,6 +8,7 @@ The changelog for SRS.
## SRS 4.0 Changelog ## SRS 4.0 Changelog
* v4.0, 2021-10-08, Default to log to console for docker. v4.0.168
* v4.0, 2021-10-07, Fix bugs #2648, #2415. v4.0.167 * v4.0, 2021-10-07, Fix bugs #2648, #2415. v4.0.167
* v4.0, 2021-10-03, Support --arch and --cross-prefix for cross compile. 4.0.166 * v4.0, 2021-10-03, Support --arch and --cross-prefix for cross compile. 4.0.166
* v4.0, 2021-10-03, Actions: Create source tar file srs-server-4.0.165.tar.gz * v4.0, 2021-10-03, Actions: Create source tar file srs-server-4.0.165.tar.gz

View file

@ -6629,10 +6629,16 @@ string SrsConfig::get_ingest_input_url(SrsConfDirective* conf)
return conf->arg0(); return conf->arg0();
} }
extern bool _srs_in_docker;
bool SrsConfig::get_log_tank_file() bool SrsConfig::get_log_tank_file()
{ {
static bool DEFAULT = true; static bool DEFAULT = true;
if (_srs_in_docker) {
DEFAULT = false;
}
SrsConfDirective* conf = root->get("srs_log_tank"); SrsConfDirective* conf = root->get("srs_log_tank");
if (!conf || conf->arg0().empty()) { if (!conf || conf->arg0().empty()) {
return DEFAULT; return DEFAULT;

View file

@ -9,6 +9,6 @@
#define VERSION_MAJOR 4 #define VERSION_MAJOR 4
#define VERSION_MINOR 0 #define VERSION_MINOR 0
#define VERSION_REVISION 167 #define VERSION_REVISION 168
#endif #endif

View file

@ -49,6 +49,7 @@ using namespace std;
// pre-declare // pre-declare
srs_error_t run_directly_or_daemon(); srs_error_t run_directly_or_daemon();
srs_error_t srs_detect_docker();
srs_error_t run_hybrid_server(); srs_error_t run_hybrid_server();
void show_macro_features(); void show_macro_features();
@ -96,6 +97,11 @@ srs_error_t do_main(int argc, char** argv)
#warning "gmp is not used for memory leak, please use gmc instead." #warning "gmp is not used for memory leak, please use gmc instead."
#endif #endif
// Ignore any error while detecting docker.
if ((err = srs_detect_docker()) != srs_success) {
srs_error_reset(err);
}
// never use srs log(srs_trace, srs_error, etc) before config parse the option, // never use srs log(srs_trace, srs_error, etc) before config parse the option,
// which will load the log config and apply it. // which will load the log config and apply it.
if ((err = _srs_config->parse_options(argc, argv)) != srs_success) { if ((err = _srs_config->parse_options(argc, argv)) != srs_success) {
@ -379,11 +385,6 @@ srs_error_t run_directly_or_daemon()
{ {
srs_error_t err = srs_success; srs_error_t err = srs_success;
// Ignore any error while detecting docker.
if ((err = srs_detect_docker()) != srs_success) {
srs_error_reset(err);
}
// Load daemon from config, disable it for docker. // Load daemon from config, disable it for docker.
// @see https://github.com/ossrs/srs/issues/1594 // @see https://github.com/ossrs/srs/issues/1594
bool run_as_daemon = _srs_config->get_daemon(); bool run_as_daemon = _srs_config->get_daemon();