Package Details: owncast 0.2.1-4

Git Clone URL: https://aur.archlinux.org/owncast.git (read-only, click to copy)
Package Base: owncast
Description: Self-hosted live video streaming (chat included)
Upstream URL: None
Licenses: MIT
Submitter: pjvds
Maintainer: envolution
Last Packager: envolution
Votes: 7
Popularity: 0.68
First Submitted: 2020-12-20 13:10 (UTC)
Last Updated: 2025-01-21 18:45 (UTC)

Pinned Comments

envolution commented on 2025-01-21 18:47 (UTC)

Updated - thanks for your help schlmm, please let me know if there's any issues with the updated build files

==> NOTE: ****************************************************************************************
==> NOTE: Default admin login is at localhost:8080/admin with user = admin and password = abc123.
==> NOTE: It is highly recommended to change this from the default.
==> NOTE: 
==> NOTE: Owncast's webroot (front-end) is /usr/share/webapps/owncast
==> NOTE: 
==> NOTE: The backend service can be enabled (and started) by: systemctl enable --now start owncast
==> NOTE: 
==> NOTE: for production environments use a proper webserver for the front-end (ie. apache/nginx)
==> NOTE: a sample nginx config file is at /usr/share/owncast/nginx.sample.conf
==> NOTE: 
==> NOTE: for documentation, visit https://owncast.online/docs/
==> NOTE: ****************************************************************************************

Latest Comments

1 2 3 Next › Last »

schlmm commented on 2025-01-22 08:33 (UTC)

looks good 👍 thank you

envolution commented on 2025-01-21 18:47 (UTC)

Updated - thanks for your help schlmm, please let me know if there's any issues with the updated build files

==> NOTE: ****************************************************************************************
==> NOTE: Default admin login is at localhost:8080/admin with user = admin and password = abc123.
==> NOTE: It is highly recommended to change this from the default.
==> NOTE: 
==> NOTE: Owncast's webroot (front-end) is /usr/share/webapps/owncast
==> NOTE: 
==> NOTE: The backend service can be enabled (and started) by: systemctl enable --now start owncast
==> NOTE: 
==> NOTE: for production environments use a proper webserver for the front-end (ie. apache/nginx)
==> NOTE: a sample nginx config file is at /usr/share/owncast/nginx.sample.conf
==> NOTE: 
==> NOTE: for documentation, visit https://owncast.online/docs/
==> NOTE: ****************************************************************************************

schlmm commented on 2025-01-21 09:50 (UTC) (edited on 2025-01-21 10:15 (UTC) by schlmm)

yeah it should only serve the static output from buildWeb.sh (which is ./static/web)

also it would be good to run buildWeb.sh before running the go build, so that https://github.com/owncast/owncast/issues/4149 doesnt happen (the developer thinks Releases are not shipped as source code, which breaks this PKGBUILD currently)

my nginx.conf now, with bundled output in /usr/share/webapps/owncast

server {
    # server_name "..."
    root "/usr/share/webapps/owncast";
    location @proxy {
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_pass http://127.0.0.1:8080;
    }
    location / {
        try_files $uri @proxy;
    }
}

envolution commented on 2025-01-20 02:23 (UTC)

@schlmm thanks for your input. I think I've addressed most of the concerns but in all honesty I'm not sure if the final structure of /usr/share/webapps/owncast is correct. Should it serve only the static output from buildWeb.sh ?

envolution commented on 2025-01-20 02:17 (UTC) (edited on 2025-01-20 02:19 (UTC) by envolution)

updated instructions

==> NOTE: ****************************************************************************************
==> NOTE: Default admin login is at localhost:8080/admin with user = admin and password = abc123.
==> NOTE: It is highly recommended to change this from the default.
==> NOTE: 
==> NOTE: Owncast's webroot (front-end) is /usr/share/webapps/owncast/web
==> NOTE: 
==> NOTE: The backend service can be enabled (and started) by: systemctl enable --now start owncast
==> NOTE: 
==> NOTE: The frontend will need to be built by running: 
==> NOTE:  $ sudo chown -R owncast:owncast /usr/share/webapps/owncast
==> NOTE:  $ sudo -u owncast /usr/share/webapps/owncast/bundleWeb.sh
==> NOTE: 
==> NOTE: You can test the front-end by running: 
==> NOTE:  $ sudo -u owncast npm run dev --prefix /usr/share/webapps/owncast/web
==> NOTE: 
==> NOTE: for production environments use a proper webserver for the front-end (ie. apache/nginx)
==> NOTE: 
==> NOTE: for documentation, visit https://owncast.online/docs/
==> NOTE: ****************************************************************************************

schlmm commented on 2025-01-19 19:39 (UTC)

if only the bundled web interface is included, i think its good to have it it in the package (allowing to profit from nginx/apache cache instead of proxying all the static files). but the complete web source code + node modules is a little overkill i think :)

envolution commented on 2025-01-19 17:05 (UTC)

@schlmm @Max-P thanks for the reports, I haven't the opportunity to look at this today but will address these issues as soon as I can. Would like to keep nvm if possible so we're not using potentially incompatible node versions. Would you guys prefer if the web portion was a separate package?

schlmm commented on 2025-01-19 11:14 (UTC) (edited on 2025-01-19 15:22 (UTC) by schlmm)

i don't see the advantage of having the frontend source code laying in /var/lib/owncast/web, because it is missing the npm run build step? so i have to go in there and run npm run build to serve the files directly via nginx?

another thing: when just proxying owncast via nginx (like before), there are some files 404ing:

  • /_next/static/chunks/2154-63dd456ac6fee50f.js
  • /_next/static/5kksd1kpTmd1xq36fA65H/_ssgManifest.js
  • /_next/static/5kksd1kpTmd1xq36fA65H/_buildManifest.js

also the backend doesnt work anymore and also have some 404s:

  • /_next/static/chunks/5889-a1e0f029f8f41a0b.js
  • /_next/static/5kksd1kpTmd1xq36fA65H/_buildManifest.js
  • /_next/static/chunks/pages/admin-5214723d460c65c1.js
  • /_next/static/5kksd1kpTmd1xq36fA65H/_ssgManifest.js

does this work for anybody?

update: okey the missing files isnt a problem of the aur package. if i manually build from source, same thing happens (upstream issue: https://github.com/owncast/owncast/issues/4149)

here is a patch for a working build.
i got rid of nvm and just use npm and build the web with ./build/web/bundleWeb.sh
also i changed the path of the builded web interface to /usr/share/webapps/owncast (like the package guideline suggests)

 diff --git a/PKGBUILD b/PKGBUILD
index 553628d..9471d37 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -9,7 +9,7 @@ pkgdesc='Self-hosted live video streaming (chat included)'
 arch=(x86_64)
 license=(MIT)
 depends=(glibc)
-makedepends=(git go npm nvm)
+makedepends=(git go npm)
 source=(
   "$pkgname-$pkgver.tar.gz::https://github.com/owncast/owncast/archive/refs/tags/v${pkgver}.tar.gz"
   owncast.tempfiles.conf
@@ -23,30 +23,17 @@ b2sums=('6b28be597b6c1089d0a207b114f789cb1e5c215aa7fa7529600fc3112ba3654d73aa51b
 options=(emptydirs !strip)
 install=$pkgname.install

-_ensure_local_nvm() {
-  which nvm >/dev/null 2>&1 && nvm deactivate && nvm unload
-  export NVM_DIR="${srcdir}/.nvm"
-  source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
-}
-
-prepare() {
-  _ensure_local_nvm
-  nvm install --lts=iron
-}
-
 build() {
   cd "$pkgname-$pkgver"
+  # build the frontend
+  sed -i '/git rev-parse --show-toplevel/d' ./build/web/bundleWeb.sh
+  ./build/web/bundleWeb.sh
   # Build backend
   export CGO_CPPFLAGS="${CPPFLAGS}"
   export CGO_CFLAGS="${CFLAGS}"
   export CGO_CXXFLAGS="${CXXFLAGS}"
   export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
   go build -o "${pkgname}" -ldflags "-extldflags '${LDFLAGS}' -s -w -X main.version=${pkgver}"
-
-  #Build frontend
-  _ensure_local_nvm
-  cd web
-  npm install
 }

 package() {
@@ -55,9 +42,10 @@ package() {
   install -vDm644 $pkgname.tempfiles.conf "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
   cd $pkgname-$pkgver
   install -vdm755 "$pkgdir/var/lib/$pkgname"
-  cp -R web "$pkgdir/var/lib/$pkgname/"
-  echo "lts/iron" >"$pkgdir"/var/lib/"$pkgname"/web/.nvmrc
   install -vDm755 $pkgname -t "$pkgdir/usr/bin/"
   install -vDm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
+
+  install -d "${pkgdir}/usr/share/webapps/owncast"
+  cp -r static/web/* "${pkgdir}/usr/share/webapps/owncast"
 }
 # vim:set ts=2 sw=2 et:

Max-P commented on 2025-01-19 00:57 (UTC)

This doesn't build on a clean system:

chown: invalid user: « owncast:owncast »

This is because on the build system, owncast is not installed so its user doesn't exist.