mirror of
https://github.com/kemko/icecast-ripper.git
synced 2026-01-01 15:55:42 +03:00
renamed some config options
This commit is contained in:
@@ -12,8 +12,8 @@ type Config struct {
|
||||
CheckInterval time.Duration `mapstructure:"CHECK_INTERVAL"`
|
||||
RecordingsPath string `mapstructure:"RECORDINGS_PATH"`
|
||||
TempPath string `mapstructure:"TEMP_PATH"`
|
||||
ServerAddress string `mapstructure:"SERVER_ADDRESS"`
|
||||
RSSFeedURL string `mapstructure:"RSS_FEED_URL"`
|
||||
BindAddress string `mapstructure:"BIND_ADDRESS"`
|
||||
PublicUrl string `mapstructure:"PUBLIC_URL"`
|
||||
LogLevel string `mapstructure:"LOG_LEVEL"`
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@ func LoadConfig() (*Config, error) {
|
||||
"CHECK_INTERVAL": "1m",
|
||||
"RECORDINGS_PATH": "./recordings",
|
||||
"TEMP_PATH": "/tmp",
|
||||
"SERVER_ADDRESS": ":8080",
|
||||
"RSS_FEED_URL": "http://localhost:8080/rss",
|
||||
"BIND_ADDRESS": ":8080",
|
||||
"PUBLIC_URL": "http://localhost:8080",
|
||||
"LOG_LEVEL": "info",
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ type Generator struct {
|
||||
|
||||
// New creates a new RSS Generator instance
|
||||
func New(cfg *config.Config, title, description, streamName string) *Generator {
|
||||
baseURL := cfg.RSSFeedURL
|
||||
baseURL := cfg.PublicUrl
|
||||
if baseURL == "" {
|
||||
slog.Warn("RSS_FEED_URL not set, using default")
|
||||
baseURL = "http://localhost:8080/recordings/"
|
||||
|
||||
@@ -45,7 +45,7 @@ func New(cfg *config.Config, rssGenerator *rss.Generator) *Server {
|
||||
|
||||
// Configure server with sensible timeouts
|
||||
s.server = &http.Server{
|
||||
Addr: cfg.ServerAddress,
|
||||
Addr: cfg.BindAddress,
|
||||
Handler: mux,
|
||||
ReadTimeout: 10 * time.Second,
|
||||
WriteTimeout: 10 * time.Second,
|
||||
@@ -56,7 +56,7 @@ func New(cfg *config.Config, rssGenerator *rss.Generator) *Server {
|
||||
}
|
||||
|
||||
// handleRSS generates and serves the RSS feed
|
||||
func (s *Server) handleRSS(w http.ResponseWriter, r *http.Request) {
|
||||
func (s *Server) handleRSS(w http.ResponseWriter, _ *http.Request) {
|
||||
slog.Debug("Serving RSS feed")
|
||||
|
||||
const maxItems = 50
|
||||
|
||||
Reference in New Issue
Block a user