mirror of
				https://github.com/owncast/owncast.git
				synced 2025-11-01 02:44:31 +08:00 
			
		
		
		
	 5ab901bb36
			
		
	
	5ab901bb36
	
	
	
		
			
			* Fix #981 Use -webserverip to set http listen address * use 0.0.0.0 as default http listen address * add Admin REST API for setting http listen address * full input validation of port and IP
		
			
				
	
	
		
			64 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			64 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| package config
 | |
| 
 | |
| import "github.com/owncast/owncast/models"
 | |
| 
 | |
| // Defaults will hold default configuration values.
 | |
| type Defaults struct {
 | |
| 	Name                 string
 | |
| 	Title                string
 | |
| 	Summary              string
 | |
| 	ServerWelcomeMessage string
 | |
| 	Logo                 string
 | |
| 	Tags                 []string
 | |
| 	PageBodyContent      string
 | |
| 
 | |
| 	DatabaseFilePath string
 | |
| 	WebServerPort    int
 | |
| 	WebServerIP      string
 | |
| 	RTMPServerPort   int
 | |
| 	StreamKey        string
 | |
| 
 | |
| 	YPEnabled bool
 | |
| 	YPServer  string
 | |
| 
 | |
| 	SegmentLengthSeconds int
 | |
| 	SegmentsInPlaylist   int
 | |
| 	StreamVariants       []models.StreamOutputVariant
 | |
| }
 | |
| 
 | |
| // GetDefaults will return default configuration values.
 | |
| func GetDefaults() Defaults {
 | |
| 	return Defaults{
 | |
| 		Name:                 "Owncast",
 | |
| 		Title:                "My Owncast Server",
 | |
| 		Summary:              "This is brief summary of whom you are or what your stream is. You can edit this description in the admin.",
 | |
| 		ServerWelcomeMessage: "",
 | |
| 		Logo:                 "logo.svg",
 | |
| 		Tags: []string{
 | |
| 			"owncast",
 | |
| 			"streaming",
 | |
| 		},
 | |
| 
 | |
| 		PageBodyContent: "# This is your page content that can be edited from the admin.",
 | |
| 
 | |
| 		DatabaseFilePath: "data/owncast.db",
 | |
| 
 | |
| 		YPEnabled: false,
 | |
| 		YPServer:  "https://directory.owncast.online",
 | |
| 
 | |
| 		WebServerPort:  8080,
 | |
| 		WebServerIP:    "0.0.0.0",
 | |
| 		RTMPServerPort: 1935,
 | |
| 		StreamKey:      "abc123",
 | |
| 
 | |
| 		StreamVariants: []models.StreamOutputVariant{
 | |
| 			{
 | |
| 				IsAudioPassthrough: true,
 | |
| 				VideoBitrate:       1200,
 | |
| 				Framerate:          24,
 | |
| 				CPUUsageLevel:      2,
 | |
| 			},
 | |
| 		},
 | |
| 	}
 | |
| }
 |