commit:     a8ebf845bdbc931e1a89ea1c6293cf139dd56345
Author:     Karl-Johan Karlsson <creideiki+gentoo-guru <AT> lysator <DOT> liu 
<DOT> se>
AuthorDate: Sun Jul 17 19:07:48 2022 +0000
Commit:     Karl-Johan Karlsson <creideiki+gentoo-guru <AT> lysator <DOT> liu 
<DOT> se>
CommitDate: Sun Jul 17 19:07:48 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=a8ebf845

media-video/owncast: add 0.0.12

Signed-off-by: Karl-Johan Karlsson <creideiki+gentoo-guru <AT> lysator.liu.se>

 media-video/owncast/Manifest                       |  3 +
 ...0.0.12-1758-remove-websocket-origin-check.patch | 22 +++++++
 media-video/owncast/owncast-0.0.12.ebuild          | 67 ++++++++++++++++++++++
 3 files changed, 92 insertions(+)

diff --git a/media-video/owncast/Manifest b/media-video/owncast/Manifest
index 5f3a09303..1f95f11f4 100644
--- a/media-video/owncast/Manifest
+++ b/media-video/owncast/Manifest
@@ -169,3 +169,6 @@ DIST owncast-0.0.10-linux-64bit.zip 14813756 BLAKE2B 
1686b16514887614de229639899
 DIST owncast-0.0.10.tar.gz 9606331 BLAKE2B 
6bbe42fa2a41b11384410e941f214b31a25b54ea233b05f5091cc327c720a66eaa8181c920a173af00fa20b65588abba822815e52bddab8a1d84e56407d044e6
 SHA512 
b105059f3fe662afd112a284c1d7e131bc3a65ba1bb36f529bcffb7841ed7b7d6eb38933518103200b6a4100dde46e6c1717f2ba2d1302defd947cd475335ff3
 DIST owncast-0.0.11-linux-64bit.zip 15056627 BLAKE2B 
6d1ead7d5ff9e4baa94e0cf6bc41e6e64efa2c8628cab37231b41c213d41dd09cb752630969802b35db9d3eb8c709a9c178e0e82e6f19e05ed3bc1876326d983
 SHA512 
6f0e427bd8334cc08728596b46497013224bde49a16bb4453945a1c1671a44735dbf8a825d015589f87768520a650708dee22a0bb845a90349e64729861e2a5c
 DIST owncast-0.0.11.tar.gz 7385501 BLAKE2B 
068ba56e9988ab0c511429f41a811dd6b725c8b431090889f54097ae9405f4b0f18b3a1c0337048013000cff351d4d9182c9748e23b6be70b675a0a34e83d3c2
 SHA512 
4e8427f38a0b2cd7b4ffee1cd0fe5533a85c4781d5d8bf759ce7282d464bccae789b5b78580ca3223a49bdf4dcb070a7ca3dd8e9a0ac85686421ca74650f7503
+DIST owncast-0.0.12-deps.tar.xz 71882432 BLAKE2B 
525b44ba7182432fa4de7aa9b7c0b2145604ef7341d3962ac27807c2ab76445c37a80d0cdd4d9c7884c85cb3546c20564947486cd0f54bc11dce9dfd6fb83409
 SHA512 
0d1b3c229715119062bf310b66a5d9686d4e5c466809e26ebe801448e387c08bf7256f9f81de4c9e4f8c470ec18cb9d10bde4c99fec4c9abbc31dc279bde15ad
+DIST owncast-0.0.12-linux-64bit.zip 19386338 BLAKE2B 
b891d9e414b8adc1adc750faea77012f8435be21db8ebde9c3ca91187848104326107c975edf611e337d816bc0a0eeac17b93e08e36c496a8e84f74ae8eefebe
 SHA512 
aa51901c6bcdfb7a026b8e0a1b755511103f4c0d79f1d0592420fcb53f935670b86f7b5ea495a518374f08efe91d3416da21ec0b4256db07e32744d1a112d2c0
+DIST owncast-0.0.12.tar.gz 10273424 BLAKE2B 
fee74684f6acd214dfd8627947097ae3a7d8a6f7e58a79f51899685887fc1f62009476243a9f2e7b89bd46d577442d7f61e0be9dfe767f7f4bad493076e75f56
 SHA512 
3fb7efac918d8af241849a9006d711392d596103bf592cf2a09818cf2c3413ef1faf6fe9990ab0d0779b501f0c6be5ad6ac820f963d62564ff1a37d6c4eee2e9

diff --git 
a/media-video/owncast/files/owncast-0.0.12-1758-remove-websocket-origin-check.patch
 
b/media-video/owncast/files/owncast-0.0.12-1758-remove-websocket-origin-check.patch
new file mode 100644
index 000000000..3ba0e914c
--- /dev/null
+++ 
b/media-video/owncast/files/owncast-0.0.12-1758-remove-websocket-origin-check.patch
@@ -0,0 +1,22 @@
+diff --git a/core/chat/chatclient.go b/core/chat/chatclient.go
+index fdcd77e3..4408bd48 100644
+--- a/core/chat/chatclient.go
++++ b/core/chat/chatclient.go
+@@ -3,6 +3,7 @@ package chat
+ import (
+       "bytes"
+       "encoding/json"
++      "net/http"
+       "sync"
+       "time"
+ 
+@@ -60,6 +61,9 @@ const (
+ var upgrader = websocket.Upgrader{
+       ReadBufferSize:  1024,
+       WriteBufferSize: 1024,
++      CheckOrigin:     func(r *http.Request) bool {
++              return true
++      },
+ }
+ 
+ var (

diff --git a/media-video/owncast/owncast-0.0.12.ebuild 
b/media-video/owncast/owncast-0.0.12.ebuild
new file mode 100644
index 000000000..fbf01c434
--- /dev/null
+++ b/media-video/owncast/owncast-0.0.12.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit go-module
+
+DESCRIPTION="A self-hosted live video and web chat server"
+HOMEPAGE="https://owncast.online/ https://github.com/owncast/owncast";
+
+LICENSE="MIT Apache-2.0 ISC BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND="
+       acct-user/owncast
+       acct-group/owncast
+       media-video/ffmpeg"
+
+SRC_URI="https://github.com/owncast/owncast/archive/refs/tags/v${PV}.tar.gz -> 
${P}.tar.gz
+       
https://github.com/owncast/owncast/releases/download/v${PV}/${P}-linux-64bit.zip
+       https://www.lysator.liu.se/~creideiki/owncast-0.0.12-deps.tar.xz";
+
+PATCHES=(
+       "${FILESDIR}/${P}-1758-remove-websocket-origin-check.patch"
+)
+
+src_unpack() {
+       go-module_src_unpack
+
+       # go-module_src_unpack unpacked both the source and the binary
+       # package. This places the binary package files in the wrong
+       # place, but that's hopefully survivable. We need the binary
+       # package to get the minified CSS file, which is generated using
+       # NPM by upstream.
+       cp 
"${WORKDIR}"/webroot/js/web_modules/tailwindcss/dist/tailwind.min.css 
"${S}"/webroot/js/web_modules/tailwindcss/dist/tailwind.min.css || die
+}
+
+src_compile() {
+       go build -v -work -x \
+          -ldflags "-s -w -X github.com/${PN}/${PN}/config.VersionNumber=${PV} 
-X github.com/${PN}/${PN}/config.BuildPlatform=gentoo" \
+          -o ${PN} \
+          github.com/${PN}/${PN} || die
+}
+
+src_install() {
+       dobin ${PN}
+
+       dodoc README.md
+
+       newinitd "${FILESDIR}"/${PN}.initd ${PN}
+
+       diropts -m 0755 -o owncast -g owncast
+       insopts -m 0644 -o owncast -g owncast
+
+       insinto /var/lib/${PN}
+       doins -r static webroot
+}
+
+pkg_postinst() {
+       if [[ -z "${REPLACING_VERSIONS}" ]] ; then
+               einfo "The admin interface at http://localhost:8080/admin/";
+               einfo "has default username 'admin' and password 'abc123'."
+       fi
+
+       einfo "Hardware accelerated transcoding requires support in 
media-video/ffmpeg, see https://owncast.online/docs/codecs/";
+}

Reply via email to