From 00dd62218017af067d6c2e45777ddfd9084690e5 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Sat, 31 Jul 2021 17:44:40 +0200 Subject: [PATCH] rename readIps and PublishIps into readIPs and publishIPs --- internal/conf/path.go | 6 +++--- internal/core/hls_server_test.go | 2 +- internal/core/rtmp_server_test.go | 4 ++-- internal/core/rtsp_server_test.go | 6 +++--- rtsp-simple-server.yml | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/internal/conf/path.go b/internal/conf/path.go index b84bdff8..a96b82ba 100644 --- a/internal/conf/path.go +++ b/internal/conf/path.go @@ -84,11 +84,11 @@ type PathConf struct { // authentication PublishUser string `yaml:"publishUser"` PublishPass string `yaml:"publishPass"` - PublishIPs []string `yaml:"publishIps"` + PublishIPs []string `yaml:"publishIPs"` PublishIPsParsed []interface{} `yaml:"-" json:"-"` ReadUser string `yaml:"readUser"` ReadPass string `yaml:"readPass"` - ReadIPs []string `yaml:"readIps"` + ReadIPs []string `yaml:"readIPs"` ReadIPsParsed []interface{} `yaml:"-" json:"-"` // custom commands @@ -266,7 +266,7 @@ func (pconf *PathConf) fillAndCheck(name string) error { } if pconf.Source != "record" { - return nil, fmt.Errorf("'publishIps' is useless when source is not 'record', since the stream is not provided by a publisher, but by a fixed source") + return nil, fmt.Errorf("'publishIPs' is useless when source is not 'record', since the stream is not provided by a publisher, but by a fixed source") } return parseIPCidrList(pconf.PublishIPs) diff --git a/internal/core/hls_server_test.go b/internal/core/hls_server_test.go index 3457f1e8..898df3db 100644 --- a/internal/core/hls_server_test.go +++ b/internal/core/hls_server_test.go @@ -42,7 +42,7 @@ func TestHLSServerReadAuth(t *testing.T) { " all:\n" + " readUser: testuser\n" + " readPass: testpass\n" + - " readIps: [127.0.0.0/16]\n") + " readIPs: [127.0.0.0/16]\n") require.Equal(t, true, ok) defer p.close() diff --git a/internal/core/rtmp_server_test.go b/internal/core/rtmp_server_test.go index 6cb3c1c0..24bb6b73 100644 --- a/internal/core/rtmp_server_test.go +++ b/internal/core/rtmp_server_test.go @@ -81,7 +81,7 @@ func TestRTMPServerAuth(t *testing.T) { " all:\n" + " publishUser: testuser\n" + " publishPass: testpass\n" + - " readIps: [127.0.0.0/16]\n") + " readIPs: [127.0.0.0/16]\n") require.Equal(t, true, ok) defer p.close() @@ -116,7 +116,7 @@ func TestRTMPServerAuth(t *testing.T) { " all:\n" + " readUser: testuser\n" + " readPass: testpass\n" + - " readIps: [127.0.0.0/16]\n") + " readIPs: [127.0.0.0/16]\n") require.Equal(t, true, ok) defer p.close() diff --git a/internal/core/rtsp_server_test.go b/internal/core/rtsp_server_test.go index c244eff0..31e5510e 100644 --- a/internal/core/rtsp_server_test.go +++ b/internal/core/rtsp_server_test.go @@ -205,7 +205,7 @@ func TestRTSPServerAuth(t *testing.T) { " all:\n" + " publishUser: testuser\n" + " publishPass: test!$()*+.;<=>[]^_-{}\n" + - " publishIps: [127.0.0.0/16]\n") + " publishIPs: [127.0.0.0/16]\n") require.Equal(t, true, ok) defer p.close() @@ -246,7 +246,7 @@ func TestRTSPServerAuth(t *testing.T) { " all:\n" + " readUser: testuser\n" + " readPass: test!$()*+.;<=>[]^_-{}\n" + - " readIps: [127.0.0.0/16]\n") + " readIPs: [127.0.0.0/16]\n") require.Equal(t, true, ok) defer p.close() @@ -408,7 +408,7 @@ func TestRTSPServerAuthFail(t *testing.T) { "hlsDisable: yes\n" + "paths:\n" + " all:\n" + - " publishIps: [128.0.0.1/32]\n") + " publishIPs: [128.0.0.1/32]\n") require.Equal(t, true, ok) defer p.close() diff --git a/rtsp-simple-server.yml b/rtsp-simple-server.yml index ceb44247..c20f98e4 100644 --- a/rtsp-simple-server.yml +++ b/rtsp-simple-server.yml @@ -173,7 +173,7 @@ paths: # sha256-hashed values can be inserted with the "sha256:" prefix. publishPass: # ips or networks (x.x.x.x/24) allowed to publish. - publishIps: [] + publishIPs: [] # username required to read. # sha256-hashed values can be inserted with the "sha256:" prefix. @@ -182,7 +182,7 @@ paths: # sha256-hashed values can be inserted with the "sha256:" prefix. readPass: # ips or networks (x.x.x.x/24) allowed to read. - readIps: [] + readIPs: [] # command to run when this path is initialized. # this can be used to publish a stream and keep it always opened.