defaults.go 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. PageBodyContent string
  9. FederationGoLiveMessage string
  10. Summary string
  11. ServerWelcomeMessage string
  12. Logo string
  13. YPServer string
  14. Title string
  15. DatabaseFilePath string
  16. FederationUsername string
  17. WebServerIP string
  18. Name string
  19. AdminPassword string
  20. StreamKeys []models.StreamKey
  21. StreamVariants []models.StreamOutputVariant
  22. Tags []string
  23. RTMPServerPort int
  24. SegmentsInPlaylist int
  25. SegmentLengthSeconds int
  26. WebServerPort int
  27. ChatEstablishedUserModeTimeDuration time.Duration
  28. YPEnabled bool
  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. }