Merge branch 'master' into rtsp-backchannel

This commit is contained in:
seydx
2024-11-13 11:23:16 +01:00
8 changed files with 47 additions and 11 deletions
+5
View File
@@ -25,6 +25,7 @@ type Info interface {
SetSource(string)
SetURL(string)
WithRequest(*http.Request)
GetSource() string
}
// Connection just like webrtc.PeerConnection
@@ -123,6 +124,10 @@ func (c *Connection) WithRequest(r *http.Request) {
c.UserAgent = r.UserAgent()
}
func (c *Connection) GetSource() string {
return c.Source
}
// Create like os.Create, init Consumer with existing Transport
func Create(w io.Writer) (*Connection, error) {
return &Connection{Transport: w}, nil
+8
View File
@@ -3,6 +3,7 @@ package shell
import (
"os"
"os/signal"
"path/filepath"
"regexp"
"strings"
"syscall"
@@ -51,6 +52,13 @@ func ReplaceEnvVars(text string) string {
dok = true
}
if dir, vok := os.LookupEnv("CREDENTIALS_DIRECTORY"); vok {
value, err := os.ReadFile(filepath.Join(dir, key))
if err == nil {
return strings.TrimSpace(string(value))
}
}
if value, vok := os.LookupEnv(key); vok {
return value
}