populateContent.sh 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. #!/bin/bash
  2. # This script will make API calls to the Owncast admin API and populate
  3. # content for the page.
  4. echo "Sending API calls to the Owncast admin to fake server config..."
  5. # Server name
  6. curl 'http://localhost:8080/api/admin/config/name' \
  7. -H 'Accept: */*' \
  8. -H 'Accept-Language: en-US,en;q=0.9' \
  9. -H 'Authorization: Basic YWRtaW46YWJjMTIz' \
  10. -H 'Cache-Control: no-cache' \
  11. -H 'Connection: keep-alive' \
  12. -H 'Content-Type: text/plain;charset=UTF-8' \
  13. -H 'Origin: http://localhost:8080' \
  14. -H 'Pragma: no-cache' \
  15. -H 'Referer: http://localhost:8080/admin/config-public-details/' \
  16. -H 'Sec-Fetch-Dest: empty' \
  17. -H 'Sec-Fetch-Mode: cors' \
  18. -H 'Sec-Fetch-Site: same-origin' \
  19. -H 'Sec-GPC: 1' \
  20. -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36' \
  21. --data-raw '{"value":"My Cool Stream"}' \
  22. --compressed
  23. # Description/Summary
  24. curl 'http://localhost:8080/api/admin/config/serversummary' \
  25. -H 'Accept: */*' \
  26. -H 'Accept-Language: en-US,en;q=0.9' \
  27. -H 'Authorization: Basic YWRtaW46YWJjMTIz' \
  28. -H 'Cache-Control: no-cache' \
  29. -H 'Connection: keep-alive' \
  30. -H 'Content-Type: text/plain;charset=UTF-8' \
  31. -H 'Origin: http://localhost:8080' \
  32. -H 'Pragma: no-cache' \
  33. -H 'Referer: http://localhost:8080/admin/config-public-details/' \
  34. -H 'Sec-Fetch-Dest: empty' \
  35. -H 'Sec-Fetch-Mode: cors' \
  36. -H 'Sec-Fetch-Site: same-origin' \
  37. -H 'Sec-GPC: 1' \
  38. -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36' \
  39. --data-raw '{"value":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. https://owncast.online"}' \
  40. --compressed
  41. # Tags
  42. curl 'http://localhost:8080/api/admin/config/tags' \
  43. -H 'Accept: */*' \
  44. -H 'Accept-Language: en-US,en;q=0.9' \
  45. -H 'Authorization: Basic YWRtaW46YWJjMTIz' \
  46. -H 'Cache-Control: no-cache' \
  47. -H 'Connection: keep-alive' \
  48. -H 'Content-Type: text/plain;charset=UTF-8' \
  49. -H 'Origin: http://localhost:8080' \
  50. -H 'Pragma: no-cache' \
  51. -H 'Referer: http://localhost:8080/admin/config-public-details/' \
  52. -H 'Sec-Fetch-Dest: empty' \
  53. -H 'Sec-Fetch-Mode: cors' \
  54. -H 'Sec-Fetch-Site: same-origin' \
  55. -H 'Sec-GPC: 1' \
  56. -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36' \
  57. --data-raw '{"value":["owncast","streaming","testing","more","tags"]}' \
  58. --compressed
  59. # Page content
  60. curl 'http://localhost:8080/api/admin/config/pagecontent' \
  61. -H 'Accept: */*' \
  62. -H 'Accept-Language: en-US,en;q=0.9' \
  63. -H 'Authorization: Basic YWRtaW46YWJjMTIz' \
  64. -H 'Cache-Control: no-cache' \
  65. -H 'Connection: keep-alive' \
  66. -H 'Content-Type: text/plain;charset=UTF-8' \
  67. -H 'Origin: http://localhost:8080' \
  68. -H 'Pragma: no-cache' \
  69. -H 'Referer: http://localhost:8080/admin/config-public-details/' \
  70. -H 'Sec-Fetch-Dest: empty' \
  71. -H 'Sec-Fetch-Mode: cors' \
  72. -H 'Sec-Fetch-Site: same-origin' \
  73. -H 'Sec-GPC: 1' \
  74. -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36' \
  75. --data-raw '{"value":"# Header\n\nLorem ipsum dolor sit amet, _consectetur adipiscing elit_, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Proin sagittis nisl rhoncus mattis rhoncus. **Mattis pellentesque id nibh tortor id aliquet lectus proin nibh**. Justo donec enim diam vulputate ut pharetra sit amet aliquam. Consectetur lorem donec massa sapien faucibus et molestie. Nisi scelerisque eu ultrices vitae auctor eu augue ut lectus. Lectus magna fringilla urna porttitor rhoncus. A cras semper auctor neque vitae. Sodales neque sodales ut etiam. Interdum velit euismod in pellentesque massa placerat duis ultricies lacus. Dignissim enim sit amet venenatis urna cursus eget.\n\n| Head | Head | Head |\n| --- | --- | --- |\n| Data | Data | Data |\n| Data | Data | Data |\n\n<img src=\"https://pixabay.com/get/g6693fc23171b84946e6533f87ca08dca39dfae8badf1ee1d659e15dbacaa893b18d1e378db050e8a6bcf156b741fb2be21b1c3834d16b2462549cea4e1621229_640.jpg\"/>\n\n## Subheader\n\nUllamcorper morbi tincidunt ornare massa eget egestas. Quis hendrerit dolor magna eget est. Sit amet tellus cras adipiscing enim eu turpis. Pharetra convallis posuere morbi leo urna molestie at. Commodo quis imperdiet massa tincidunt nunc pulvinar. Risus viverra adipiscing at in tellus integer. Felis donec et odio pellentesque diam volutpat. Enim nulla aliquet porttitor lacus luctus accumsan tortor posuere ac. Vel eros donec ac odio tempor orci. Turpis in eu mi bibendum neque egestas. Turpis egestas maecenas pharetra convallis posuere morbi. Non nisi est sit amet facilisis magna etiam tempor. Bibendum ut tristique et egestas quis ipsum suspendisse. Vel fringilla est ullamcorper eget nulla facilisi.\n\n1. List item 1\n2. List item 2\n3. List item 3\n\n[This is a link](https://owncast.online)\n\nScelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique. Sed vulputate mi sit amet mauris commodo quis imperdiet massa. Fermentum posuere urna nec tincidunt. Ut lectus arcu bibendum at varius vel pharetra vel. Ultricies mi quis hendrerit dolor magna eget. Rutrum tellus pellentesque eu tincidunt. Venenatis a condimentum vitae sapien pellentesque habitant. Eget nullam non nisi est sit amet facilisis. Tincidunt vitae semper quis lectus nulla at volutpat diam ut."}' \
  76. --compressed
  77. # Links
  78. curl 'http://localhost:8080/api/admin/config/socialhandles' \
  79. -H 'Accept: */*' \
  80. -H 'Accept-Language: en-US,en;q=0.9' \
  81. -H 'Authorization: Basic YWRtaW46YWJjMTIz' \
  82. -H 'Cache-Control: no-cache' \
  83. -H 'Connection: keep-alive' \
  84. -H 'Content-Type: text/plain;charset=UTF-8' \
  85. -H 'Origin: http://localhost:8080' \
  86. -H 'Pragma: no-cache' \
  87. -H 'Referer: http://localhost:8080/admin/config-public-details/' \
  88. -H 'Sec-Fetch-Dest: empty' \
  89. -H 'Sec-Fetch-Mode: cors' \
  90. -H 'Sec-Fetch-Site: same-origin' \
  91. -H 'Sec-GPC: 1' \
  92. -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36' \
  93. --data-raw '{"value":[{"platform":"github","url":"https://github.com/owncast/owncast"},{"url":"https://facebook.biz/facebook","platform":"facebook"},{"url":"https://linkedin.biz/linkedin","platform":"linkedin"},{"url":"https://twitter.biz/twitter","platform":"twitter"}]}' \
  94. --compressed
  95. # External action buttons
  96. curl 'http://localhost:8080/api/admin/config/externalactions' \
  97. -H 'Accept: */*' \
  98. -H 'Accept-Language: en-US,en;q=0.9' \
  99. -H 'Authorization: Basic YWRtaW46YWJjMTIz' \
  100. -H 'Cache-Control: no-cache' \
  101. -H 'Connection: keep-alive' \
  102. -H 'Content-Type: text/plain;charset=UTF-8' \
  103. -H 'Origin: http://localhost:8080' \
  104. -H 'Pragma: no-cache' \
  105. -H 'Referer: http://localhost:8080/admin/actions/' \
  106. -H 'Sec-Fetch-Dest: empty' \
  107. -H 'Sec-Fetch-Mode: cors' \
  108. -H 'Sec-Fetch-Site: same-origin' \
  109. -H 'Sec-GPC: 1' \
  110. -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36' \
  111. --data-raw '{"value":[{"url":"https://owncast.online/docs","title":"Documentation","description":"","icon":"","color":"","openExternally":false},{"url":"https://media1.giphy.com/media/Ju7l5y9osyymQ/giphy.gif?cid=ecf05e47otegqpl9mqfz880pi861dnjm5loy6kyrquy9lku0&rid=giphy.gif&ct=g","title":"Important","description":"","icon":"https://findicons.com/files/icons/1184/quickpix_2008/128/rick_roll_d.png","color":"#c87fd7","openExternally":false},{"url":"https://randommer.io/random-images","title":"New Tab","description":"","icon":"","color":"","openExternally":true}]}' \
  112. --compressed
  113. # Offline message
  114. curl 'http://localhost:8080/api/admin/config/offlinemessage' \
  115. -H 'Accept: */*' \
  116. -H 'Accept-Language: en-US,en;q=0.9' \
  117. -H 'Authorization: Basic YWRtaW46YWJjMTIz' \
  118. -H 'Cache-Control: no-cache' \
  119. -H 'Connection: keep-alive' \
  120. -H 'Content-Type: text/plain;charset=UTF-8' \
  121. -H 'Origin: http://localhost:8080' \
  122. -H 'Pragma: no-cache' \
  123. -H 'Referer: http://localhost:8080/admin/config-public-details/' \
  124. -H 'Sec-Fetch-Dest: empty' \
  125. -H 'Sec-Fetch-Mode: cors' \
  126. -H 'Sec-Fetch-Site: same-origin' \
  127. -H 'Sec-GPC: 1' \
  128. -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36' \
  129. --data-raw '{"value":"Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. I am offline. This is my message."}' \
  130. --compressed
  131. # Chat welcome message
  132. curl 'http://localhost:8080/api/admin/config/welcomemessage' \
  133. -H 'accept: */*' \
  134. -H 'accept-language: en-US,en;q=0.9' \
  135. -H 'authorization: Basic YWRtaW46aG05dTl4a2c=' \
  136. -H 'cache-control: no-cache' \
  137. -H 'content-type: text/plain;charset=UTF-8' \
  138. -H 'Origin: http://localhost:8080' \
  139. -H 'pragma: no-cache' \
  140. -H 'referer: http://localhost:8080/admin/config-chat/' \
  141. -H 'sec-fetch-dest: empty' \
  142. -H 'sec-fetch-mode: cors' \
  143. -H 'sec-fetch-site: same-origin' \
  144. -H 'sec-gpc: 1' \
  145. -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36' \
  146. --data-raw '{"value":"This is an example chat welcome message."}' \
  147. --compressed