defaults.go 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. package config
  2. import (
  3. "time"
  4. "github.com/owncast/owncast/models"
  5. )
  6. // Defaults will hold default configuration values.
  7. type Defaults struct {
  8. Name string
  9. Title string
  10. Summary string
  11. ServerWelcomeMessage string
  12. Logo string
  13. Tags []string
  14. PageBodyContent string
  15. DatabaseFilePath string
  16. WebServerPort int
  17. WebServerIP string
  18. RTMPServerPort int
  19. AdminPassword string
  20. StreamKeys []models.StreamKey
  21. YPEnabled bool
  22. YPServer string
  23. SegmentLengthSeconds int
  24. SegmentsInPlaylist int
  25. StreamVariants []models.StreamOutputVariant
  26. FederationUsername string
  27. FederationGoLiveMessage string
  28. ChatEstablishedUserModeTimeDuration time.Duration
  29. }
  30. // GetDefaults will return default configuration values.
  31. func GetDefaults() Defaults {
  32. return Defaults{
  33. Name: "New Owncast Server",
  34. Summary: "This is a new live video streaming server powered by Owncast.",
  35. ServerWelcomeMessage: "",
  36. Logo: "logo.svg",
  37. AdminPassword: "abc123",
  38. StreamKeys: []models.StreamKey{
  39. {Key: "abc123", Comment: "Default stream key"},
  40. },
  41. Tags: []string{
  42. "owncast",
  43. "streaming",
  44. },
  45. PageBodyContent: `
  46. # Welcome to Owncast!
  47. - This is a live stream powered by [Owncast](https://owncast.online), a free and open source live streaming server.
  48. - To discover more examples of streams, visit [Owncast's directory](https://directory.owncast.online).
  49. - If you're the owner of this server you should visit the admin and customize the content on this page.
  50. <hr/>
  51. <video id="video" controls preload="metadata" style="width: 60vw; max-width: 600px; min-width: 200px;" poster="https://videos.owncast.online/t/xaJ3xNn9Y6pWTdB25m9ai3">
  52. <source src="https://assets.owncast.tv/video/owncast-embed.mp4" type="video/mp4" />
  53. </video>
  54. `,
  55. DatabaseFilePath: "data/owncast.db",
  56. YPEnabled: false,
  57. YPServer: "https://directory.owncast.online",
  58. WebServerPort: 8080,
  59. WebServerIP: "0.0.0.0",
  60. RTMPServerPort: 1935,
  61. ChatEstablishedUserModeTimeDuration: time.Minute * 15,
  62. StreamVariants: []models.StreamOutputVariant{
  63. {
  64. IsAudioPassthrough: true,
  65. VideoBitrate: 1200,
  66. Framerate: 24,
  67. CPUUsageLevel: 2,
  68. },
  69. },
  70. FederationUsername: "streamer",
  71. FederationGoLiveMessage: "I've gone live!",
  72. }
  73. }