mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-14 12:05:58 +08:00
http api secret禁止使用默认的035c73f7-bb6b-4889-a715-d9eb2d1925cc 删除admin_params的设定
This commit is contained in:
@@ -351,6 +351,11 @@ int start_main(int argc,char *argv[]) {
|
||||
#endif //defined(ENABLE_SRT)
|
||||
|
||||
try {
|
||||
auto secret = mINI::Instance()[API::kSecret];
|
||||
if (secret == "035c73f7-bb6b-4889-a715-d9eb2d1925cc" || secret.empty()) {
|
||||
// 使用默认secret被禁止启动
|
||||
throw std::invalid_argument("please modify the configuration named " + API::kSecret + " in " + g_ini_file);
|
||||
}
|
||||
//rtsp服务器,端口默认554
|
||||
if (rtspPort) { rtspSrv->start<RtspSession>(rtspPort); }
|
||||
//rtsps服务器,端口默认322
|
||||
@@ -388,8 +393,7 @@ int start_main(int argc,char *argv[]) {
|
||||
#endif//defined(ENABLE_SRT)
|
||||
|
||||
} catch (std::exception &ex) {
|
||||
WarnL << "端口占用或无权限:" << ex.what();
|
||||
ErrorL << "程序启动失败,请修改配置文件中端口号后重试!";
|
||||
ErrorL << "Start server failed: " << ex.what();
|
||||
sleep(1);
|
||||
#if !defined(_WIN32)
|
||||
if (pid != getpid() && kill_parent_if_failed) {
|
||||
|
||||
Reference in New Issue
Block a user