* Replace pkger with go:embed for bundling the admin. Closes #844 * Remove references to pkged.go * Point tests to use an updated version of Go * Add comment to new exported function * Cleanup * Add a dummy pkged.go to alert people to stop using it. * Add simple browser test to make sure the admin is available and renders * Don't panic
This commit is contained in:
parent
822d107ee0
commit
f0bd7d2528
5
.github/workflows/automated-browser.yml
vendored
5
.github/workflows/automated-browser.yml
vendored
@ -5,6 +5,11 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
stable: 'false'
|
||||||
|
go-version: '1.17.2'
|
||||||
|
|
||||||
- name: Run browser tests
|
- name: Run browser tests
|
||||||
run: cd test/automated/browser && ./run.sh
|
run: cd test/automated/browser && ./run.sh
|
||||||
|
|
||||||
|
@ -4,17 +4,19 @@ on:
|
|||||||
push:
|
push:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'webroot/**'
|
- 'webroot/**'
|
||||||
- pkged.go
|
|
||||||
pull_request:
|
pull_request:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'webroot/**'
|
- 'webroot/**'
|
||||||
- pkged.go
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
api:
|
api:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
stable: 'false'
|
||||||
|
go-version: '1.17.2'
|
||||||
- name: Run API tests
|
- name: Run API tests
|
||||||
run: cd test/automated/api && ./run.sh
|
run: cd test/automated/api && ./run.sh
|
||||||
|
|
||||||
|
6
.github/workflows/hls-tests.yml
vendored
6
.github/workflows/hls-tests.yml
vendored
@ -4,11 +4,9 @@ on:
|
|||||||
push:
|
push:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'webroot/**'
|
- 'webroot/**'
|
||||||
- pkged.go
|
|
||||||
pull_request:
|
pull_request:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'webroot/**'
|
- 'webroot/**'
|
||||||
- pkged.go
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
S3_BUCKET: ${{ secrets.S3_BUCKET }}
|
S3_BUCKET: ${{ secrets.S3_BUCKET }}
|
||||||
@ -22,6 +20,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
stable: 'false'
|
||||||
|
go-version: '1.17.2'
|
||||||
- name: Run HLS tests
|
- name: Run HLS tests
|
||||||
run: cd test/automated/hls && ./run.sh
|
run: cd test/automated/hls && ./run.sh
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ OBS, Streamlabs, Restream and many others have been used with Owncast. [Read mor
|
|||||||
1. Ensure you have the gcc compiler configured.
|
1. Ensure you have the gcc compiler configured.
|
||||||
1. Install the [Go toolchain](https://golang.org/dl/).
|
1. Install the [Go toolchain](https://golang.org/dl/).
|
||||||
1. Clone the repo. `git clone https://github.com/owncast/owncast`
|
1. Clone the repo. `git clone https://github.com/owncast/owncast`
|
||||||
1. `go run main.go pkged.go` will run from source.
|
1. `go run main.go` will run from source.
|
||||||
1. Point your [broadcasting software](https://owncast.online/docs/broadcasting/) at your new server and start streaming.
|
1. Point your [broadcasting software](https://owncast.online/docs/broadcasting/) at your new server and start streaming.
|
||||||
|
|
||||||
There is also a supplied `Dockerfile` so you can spin it up from source with little effort. [Read more about running from source](https://owncast.online/docs/building/).
|
There is also a supplied `Dockerfile` so you can spin it up from source with little effort. [Read more about running from source](https://owncast.online/docs/building/).
|
||||||
@ -88,9 +88,8 @@ The admin ui is built at: https://github.com/owncast/owncast-admin it is bundled
|
|||||||
|
|
||||||
To bundle in the latest admin UI:
|
To bundle in the latest admin UI:
|
||||||
|
|
||||||
1. Install pkger. `go install github.com/markbates/pkger/cmd/...`
|
|
||||||
1. From the owncast directory run the packager script: `./build/admin/bundleAdmin.sh`
|
1. From the owncast directory run the packager script: `./build/admin/bundleAdmin.sh`
|
||||||
1. Compile or run like above. `go run main.go pkged.go`
|
1. Compile or run like above. `go run main.go`
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
@ -110,7 +109,7 @@ Owncast consists of two repositories with two standalone projects. [The repo you
|
|||||||
|
|
||||||
1. Install [golangci-lint](https://golangci-lint.run/usage/install/) for helpful warnings and suggestions [directly in your editor](https://golangci-lint.run/usage/integrations/) when writing Go.
|
1. Install [golangci-lint](https://golangci-lint.run/usage/install/) for helpful warnings and suggestions [directly in your editor](https://golangci-lint.run/usage/integrations/) when writing Go.
|
||||||
1. If using VSCode install the [lit-html](https://marketplace.visualstudio.com/items?itemName=bierner.lit-html) extension to aid in syntax highlighting of our frontend HTML + Preact.
|
1. If using VSCode install the [lit-html](https://marketplace.visualstudio.com/items?itemName=bierner.lit-html) extension to aid in syntax highlighting of our frontend HTML + Preact.
|
||||||
1. Run the project with `go run main.go pkged.go` to make sure the Admin (at `/admin`) is available to you in your development environment.
|
1. Run the project with `go run main.go`.
|
||||||
|
|
||||||
|
|
||||||
<!-- LICENSE -->
|
<!-- LICENSE -->
|
||||||
|
@ -10,7 +10,6 @@ PROJECT_SOURCE_DIR=$(pwd)
|
|||||||
cd $INSTALL_TEMP_DIRECTORY
|
cd $INSTALL_TEMP_DIRECTORY
|
||||||
|
|
||||||
shutdown () {
|
shutdown () {
|
||||||
rm -rf "$PROJECT_SOURCE_DIR/admin"
|
|
||||||
rm -rf "$INSTALL_TEMP_DIRECTORY"
|
rm -rf "$INSTALL_TEMP_DIRECTORY"
|
||||||
}
|
}
|
||||||
trap shutdown INT TERM ABRT EXIT
|
trap shutdown INT TERM ABRT EXIT
|
||||||
@ -31,10 +30,12 @@ ADMIN_BUILD_DIR=$(pwd)
|
|||||||
cd $PROJECT_SOURCE_DIR
|
cd $PROJECT_SOURCE_DIR
|
||||||
mkdir -p admin 2> /dev/null
|
mkdir -p admin 2> /dev/null
|
||||||
cd admin
|
cd admin
|
||||||
cp -R ${ADMIN_BUILD_DIR}/out/* .
|
|
||||||
|
|
||||||
echo "Bundling admin into owncast codebase..."
|
# Remove the old one
|
||||||
~/go/bin/pkger
|
rm -rf $PROJECT_SOURCE_DIR/static/admin
|
||||||
|
|
||||||
|
# Copy over the new one
|
||||||
|
mv ${ADMIN_BUILD_DIR}/out $PROJECT_SOURCE_DIR/static/admin
|
||||||
|
|
||||||
shutdown
|
shutdown
|
||||||
echo "Done."
|
echo "Done."
|
||||||
|
@ -1,49 +1,50 @@
|
|||||||
package admin
|
package admin
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"bytes"
|
||||||
"mime"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/markbates/pkger"
|
|
||||||
"github.com/owncast/owncast/router/middleware"
|
"github.com/owncast/owncast/router/middleware"
|
||||||
|
"github.com/owncast/owncast/static"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ServeAdmin will return admin web assets.
|
// ServeAdmin will return admin web assets.
|
||||||
func ServeAdmin(w http.ResponseWriter, r *http.Request) {
|
func ServeAdmin(w http.ResponseWriter, r *http.Request) {
|
||||||
// Set a cache control max-age header
|
adminFiles := static.GetAdmin()
|
||||||
middleware.SetCachingHeaders(w, r)
|
|
||||||
|
|
||||||
// Determine if the requested path is a directory.
|
// Determine if the requested path is a directory.
|
||||||
// If so, append index.html to the request.
|
// If so, append index.html to the request.
|
||||||
path := r.URL.Path
|
path := strings.TrimPrefix(r.URL.Path, "/")
|
||||||
dirCheck, err := pkger.Stat(path)
|
if strings.HasSuffix(path, "/") {
|
||||||
if dirCheck != nil && err == nil && dirCheck.IsDir() {
|
|
||||||
path = filepath.Join(path, "index.html")
|
path = filepath.Join(path, "index.html")
|
||||||
}
|
}
|
||||||
|
|
||||||
f, err := pkger.Open(path)
|
f, err := adminFiles.Open(path)
|
||||||
if err != nil {
|
if os.IsNotExist(err) {
|
||||||
log.Debugln(err, path)
|
w.WriteHeader(http.StatusNotFound)
|
||||||
errorHandler(w, http.StatusNotFound)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
b, err := ioutil.ReadAll(f)
|
info, err := f.Stat()
|
||||||
if err != nil {
|
|
||||||
log.Warnln(err)
|
if os.IsNotExist(err) {
|
||||||
|
w.WriteHeader(http.StatusNotFound)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
mimeType := mime.TypeByExtension(filepath.Ext(path))
|
// Set a cache control max-age header
|
||||||
w.Header().Set("Content-Type", mimeType)
|
middleware.SetCachingHeaders(w, r)
|
||||||
if _, err = w.Write(b); err != nil {
|
|
||||||
|
d, err := adminFiles.ReadFile(path)
|
||||||
|
if err != nil {
|
||||||
log.Errorln(err)
|
log.Errorln(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
func errorHandler(w http.ResponseWriter, status int) {
|
http.ServeContent(w, r, info.Name(), info.ModTime(), bytes.NewReader(d))
|
||||||
w.WriteHeader(status)
|
|
||||||
}
|
}
|
||||||
|
31
go.mod
31
go.mod
@ -1,36 +1,43 @@
|
|||||||
module github.com/owncast/owncast
|
module github.com/owncast/owncast
|
||||||
|
|
||||||
go 1.14
|
go 1.17
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
|
|
||||||
github.com/amalfra/etag v0.0.0-20190921100247-cafc8de96bc5
|
github.com/amalfra/etag v0.0.0-20190921100247-cafc8de96bc5
|
||||||
github.com/aws/aws-sdk-go v1.40.0
|
github.com/aws/aws-sdk-go v1.40.0
|
||||||
github.com/go-ole/go-ole v1.2.4 // indirect
|
|
||||||
github.com/gorilla/websocket v1.4.2
|
github.com/gorilla/websocket v1.4.2
|
||||||
github.com/grafov/m3u8 v0.11.1
|
github.com/grafov/m3u8 v0.11.1
|
||||||
github.com/jonboulle/clockwork v0.2.2 // indirect
|
|
||||||
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible
|
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible
|
||||||
github.com/lestrrat-go/strftime v1.0.4 // indirect
|
|
||||||
github.com/markbates/pkger v0.17.1
|
|
||||||
github.com/mattn/go-sqlite3 v1.14.8
|
github.com/mattn/go-sqlite3 v1.14.8
|
||||||
github.com/microcosm-cc/bluemonday v1.0.15
|
github.com/microcosm-cc/bluemonday v1.0.15
|
||||||
github.com/mssola/user_agent v0.5.3
|
github.com/mssola/user_agent v0.5.3
|
||||||
github.com/mvdan/xurls v1.1.0 // indirect
|
|
||||||
github.com/nareix/joy5 v0.0.0-20200712071056-a55089207c88
|
github.com/nareix/joy5 v0.0.0-20200712071056-a55089207c88
|
||||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
|
|
||||||
github.com/oschwald/geoip2-golang v1.5.0
|
github.com/oschwald/geoip2-golang v1.5.0
|
||||||
github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5
|
github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5
|
||||||
github.com/schollz/sqlite3dump v1.3.0
|
github.com/schollz/sqlite3dump v1.3.0
|
||||||
github.com/shirou/gopsutil v3.21.9+incompatible
|
github.com/shirou/gopsutil v3.21.9+incompatible
|
||||||
github.com/sirupsen/logrus v1.8.1
|
github.com/sirupsen/logrus v1.8.1
|
||||||
github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf
|
github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf
|
||||||
github.com/tklauser/go-sysconf v0.3.5 // indirect
|
|
||||||
github.com/yuin/goldmark v1.4.1
|
github.com/yuin/goldmark v1.4.1
|
||||||
golang.org/x/mod v0.5.1
|
golang.org/x/mod v0.5.1
|
||||||
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 // indirect
|
|
||||||
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324
|
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324
|
||||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
|
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
|
||||||
mvdan.cc/xurls v1.1.0
|
mvdan.cc/xurls v1.1.0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
|
||||||
|
github.com/aymerick/douceur v0.2.0 // indirect
|
||||||
|
github.com/go-ole/go-ole v1.2.4 // indirect
|
||||||
|
github.com/gorilla/css v1.0.0 // indirect
|
||||||
|
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||||
|
github.com/jonboulle/clockwork v0.2.2 // indirect
|
||||||
|
github.com/lestrrat-go/strftime v1.0.4 // indirect
|
||||||
|
github.com/mvdan/xurls v1.1.0 // indirect
|
||||||
|
github.com/oschwald/maxminddb-golang v1.8.0 // indirect
|
||||||
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
|
github.com/tklauser/go-sysconf v0.3.5 // indirect
|
||||||
|
github.com/tklauser/numcpus v0.2.2 // indirect
|
||||||
|
golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect
|
||||||
|
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 // indirect
|
||||||
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
|
)
|
||||||
|
16
go.sum
16
go.sum
@ -12,8 +12,6 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
|
|||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI=
|
github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI=
|
||||||
github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
|
github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
|
||||||
github.com/gobuffalo/here v0.6.0 h1:hYrd0a6gDmWxBM4TnrGw8mQg24iSVoIkHEk7FodQcBI=
|
|
||||||
github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM=
|
|
||||||
github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY=
|
github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY=
|
||||||
github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c=
|
github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c=
|
||||||
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
|
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
|
||||||
@ -26,18 +24,12 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGw
|
|||||||
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
|
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
|
||||||
github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ=
|
github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ=
|
||||||
github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8=
|
github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8=
|
||||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
|
||||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
|
||||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
|
||||||
github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8=
|
github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8=
|
||||||
github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is=
|
github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is=
|
||||||
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible h1:Y6sqxHMyB1D2YSzWkLibYKgg+SwmyFU9dF2hn6MdTj4=
|
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible h1:Y6sqxHMyB1D2YSzWkLibYKgg+SwmyFU9dF2hn6MdTj4=
|
||||||
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible/go.mod h1:ZQnN8lSECaebrkQytbHj4xNgtg8CR7RYXnPok8e0EHA=
|
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible/go.mod h1:ZQnN8lSECaebrkQytbHj4xNgtg8CR7RYXnPok8e0EHA=
|
||||||
github.com/lestrrat-go/strftime v1.0.4 h1:T1Rb9EPkAhgxKqbcMIPguPq8glqXTA1koF8n9BHElA8=
|
github.com/lestrrat-go/strftime v1.0.4 h1:T1Rb9EPkAhgxKqbcMIPguPq8glqXTA1koF8n9BHElA8=
|
||||||
github.com/lestrrat-go/strftime v1.0.4/go.mod h1:E1nN3pCbtMSu1yjSVeyuRFVm/U0xoR76fd03sz+Qz4g=
|
github.com/lestrrat-go/strftime v1.0.4/go.mod h1:E1nN3pCbtMSu1yjSVeyuRFVm/U0xoR76fd03sz+Qz4g=
|
||||||
github.com/markbates/pkger v0.17.1 h1:/MKEtWqtc0mZvu9OinB9UzVN9iYCwLWuyUv4Bw+PCno=
|
|
||||||
github.com/markbates/pkger v0.17.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI=
|
|
||||||
github.com/mattn/go-sqlite3 v1.14.7/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
github.com/mattn/go-sqlite3 v1.14.7/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
||||||
github.com/mattn/go-sqlite3 v1.14.8 h1:gDp86IdQsN/xWjIEmr9MF6o9mpksUgh0fu+9ByFxzIU=
|
github.com/mattn/go-sqlite3 v1.14.8 h1:gDp86IdQsN/xWjIEmr9MF6o9mpksUgh0fu+9ByFxzIU=
|
||||||
github.com/mattn/go-sqlite3 v1.14.8/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
github.com/mattn/go-sqlite3 v1.14.8/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
||||||
@ -49,8 +41,6 @@ github.com/mvdan/xurls v1.1.0 h1:OpuDelGQ1R1ueQ6sSryzi6P+1RtBpfQHM8fJwlE45ww=
|
|||||||
github.com/mvdan/xurls v1.1.0/go.mod h1:tQlNn3BED8bE/15hnSL2HLkDeLWpNPAwtw7wkEq44oU=
|
github.com/mvdan/xurls v1.1.0/go.mod h1:tQlNn3BED8bE/15hnSL2HLkDeLWpNPAwtw7wkEq44oU=
|
||||||
github.com/nareix/joy5 v0.0.0-20200712071056-a55089207c88 h1:CXq5QLPMcfGEZMx8uBMyLdDiUNV72vlkSiyqg+jf7AI=
|
github.com/nareix/joy5 v0.0.0-20200712071056-a55089207c88 h1:CXq5QLPMcfGEZMx8uBMyLdDiUNV72vlkSiyqg+jf7AI=
|
||||||
github.com/nareix/joy5 v0.0.0-20200712071056-a55089207c88/go.mod h1:XmAOs6UJXpNXRwKk+KY/nv5kL6xXYXyellk+A1pTlko=
|
github.com/nareix/joy5 v0.0.0-20200712071056-a55089207c88/go.mod h1:XmAOs6UJXpNXRwKk+KY/nv5kL6xXYXyellk+A1pTlko=
|
||||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
|
|
||||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
|
||||||
github.com/oschwald/geoip2-golang v1.5.0 h1:igg2yQIrrcRccB1ytFXqBfOHCjXWIoMv85lVJ1ONZzw=
|
github.com/oschwald/geoip2-golang v1.5.0 h1:igg2yQIrrcRccB1ytFXqBfOHCjXWIoMv85lVJ1ONZzw=
|
||||||
github.com/oschwald/geoip2-golang v1.5.0/go.mod h1:xdvYt5xQzB8ORWFqPnqMwZpCpgNagttWdoZLlJQzg7s=
|
github.com/oschwald/geoip2-golang v1.5.0/go.mod h1:xdvYt5xQzB8ORWFqPnqMwZpCpgNagttWdoZLlJQzg7s=
|
||||||
github.com/oschwald/maxminddb-golang v1.8.0 h1:Uh/DSnGoxsyp/KYbY1AuP0tYEwfs0sCph9p/UMXK/Hk=
|
github.com/oschwald/maxminddb-golang v1.8.0 h1:Uh/DSnGoxsyp/KYbY1AuP0tYEwfs0sCph9p/UMXK/Hk=
|
||||||
@ -73,7 +63,6 @@ github.com/spf13/pflag v1.0.4-0.20181223182923-24fa6976df40/go.mod h1:DYY7MBk1bd
|
|||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
|
||||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
@ -115,11 +104,6 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
|
|||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
|
||||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
|
|
||||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
|
||||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|
||||||
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|
||||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||||
|
4
main.go
4
main.go
@ -5,7 +5,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/markbates/pkger"
|
|
||||||
"github.com/owncast/owncast/logging"
|
"github.com/owncast/owncast/logging"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
|
|
||||||
@ -18,9 +17,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Enable bundling of admin assets
|
|
||||||
_ = pkger.Include("/admin")
|
|
||||||
|
|
||||||
dbFile := flag.String("database", "", "Path to the database file.")
|
dbFile := flag.String("database", "", "Path to the database file.")
|
||||||
logDirectory := flag.String("logdir", "", "Directory where logs will be written to")
|
logDirectory := flag.String("logdir", "", "Directory where logs will be written to")
|
||||||
backupDirectory := flag.String("backupdir", "", "Directory where backups will be written to")
|
backupDirectory := flag.String("backupdir", "", "Directory where backups will be written to")
|
||||||
|
1
static/admin/404/index.html
Normal file
1
static/admin/404/index.html
Normal file
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
self.__BUILD_MANIFEST=function(s,c,a,e,t,i,f,n,b,d,o,h,g,u){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[s,c,e,t,i,f,b,"static/chunks/pages/index-3ba269b54a8f308320fd.js"],"/_error":["static/chunks/pages/_error-ea939aab753d9e9db3bd.js"],"/access-tokens":[s,c,a,"static/chunks/pages/access-tokens-9bc1c9dd3309a3ec4f21.js"],"/actions":[s,a,"static/chunks/pages/actions-877d508e9ce23f852ac6.js"],"/chat/messages":[d,s,c,a,f,o,"static/chunks/pages/chat/messages-7ee04cd432c0e9a41c62.js"],"/chat/users":[d,s,c,a,f,o,"static/chunks/pages/chat/users-3e30c33f945e12103605.js"],"/config-chat":["static/chunks/pages/config-chat-9e64011c5142bb4cde30.js"],"/config-public-details":[s,a,n,"static/css/daab8d18100466477c6d.css","static/chunks/361-11c54fbc23b235ad7af7.js","static/chunks/pages/config-public-details-3c26a3ed0000b5440538.js"],"/config-server-details":[h,"static/chunks/pages/config-server-details-d708db0714de42812fbd.js"],"/config-social-items":[s,a,"static/chunks/pages/config-social-items-a7f65f614734b1284dc5.js"],"/config-storage":["static/chunks/pages/config-storage-376cc500207ec51ed7bd.js"],"/config-video":[s,a,h,"static/chunks/364-d398b818a027a7a7eb4e.js","static/chunks/pages/config-video-d4c8ac1f1f5e2b10a1b2.js"],"/hardware-info":[g,c,e,i,n,u,"static/chunks/pages/hardware-info-f9651667f386dc8adc51.js"],"/help":[e,"static/chunks/334-7b22cd3bdbdd9b073ddd.js","static/chunks/pages/help-addeb25f330508a229ad.js"],"/logs":[s,c,t,"static/chunks/pages/logs-80d875f16adc4edd0cec.js"],"/offline-notice":[s,c,e,t,b,"static/chunks/pages/offline-notice-220dfaa8eb4b5d8a1ef0.js"],"/upgrade":[s,"static/chunks/840-e2546e86a9f097d6f20f.js","static/chunks/pages/upgrade-c5fdf5dc1f90cc34e241.js"],"/viewer-info":[g,c,e,i,n,u,"static/chunks/pages/viewer-info-99bf5368ac1c24732e47.js"],"/webhooks":[s,a,"static/chunks/pages/webhooks-927f6b527b4234d4fa06.js"],sortedPages:["/","/_app","/_error","/access-tokens","/actions","/chat/messages","/chat/users","/config-chat","/config-public-details","/config-server-details","/config-social-items","/config-storage","/config-video","/hardware-info","/help","/logs","/offline-notice","/upgrade","/viewer-info","/webhooks"]}}("static/chunks/23-f55205d707e591f0168c.js","static/chunks/924-f83c6a5efb63742cec73.js","static/chunks/614-1e74c3ac41cdd8da7cad.js","static/chunks/689-35f2a306e6434b0319fd.js","static/chunks/835-4646cc28de3139d4e0d8.js","static/chunks/277-523d880908ae13758a1f.js","static/chunks/354-90541e85108fb0b393fd.js","static/chunks/74-ef23b34310205aa6b8db.js","static/chunks/676-8018048eb217f2a19212.js","static/chunks/29107295-62449f6ab50432c0efef.js","static/chunks/821-a0eee837a5aa58606b12.js","static/chunks/701-f32a6ed8ba8f13456f21.js","static/chunks/36bcf0ca-afaab5d8fc9855302fe5.js","static/chunks/937-6948bcb00194f10fdf0a.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|
@ -0,0 +1 @@
|
|||||||
|
self.__SSG_MANIFEST=new Set,self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB();
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[354],{8354:function(t,r,e){e.d(r,{Z:function(){return d}});var n=e(19013),a=e(13882);function o(t,r){(0,a.Z)(2,arguments);var e=(0,n.Z)(t),o=(0,n.Z)(r),s=e.getTime()-o.getTime();return s<0?-1:s>0?1:s}function s(t,r){(0,a.Z)(2,arguments);var e=(0,n.Z)(t),o=(0,n.Z)(r),s=e.getFullYear()-o.getFullYear(),u=e.getMonth()-o.getMonth();return 12*s+u}function u(t){(0,a.Z)(1,arguments);var r=(0,n.Z)(t);return r.setHours(23,59,59,999),r}function i(t){(0,a.Z)(1,arguments);var r=(0,n.Z)(t),e=r.getMonth();return r.setFullYear(r.getFullYear(),e+1,0),r.setHours(23,59,59,999),r}function f(t){(0,a.Z)(1,arguments);var r=(0,n.Z)(t);return u(r).getTime()===i(r).getTime()}function c(t,r){(0,a.Z)(2,arguments);var e,u=(0,n.Z)(t),i=(0,n.Z)(r),c=o(u,i),l=Math.abs(s(u,i));if(l<1)e=0;else{1===u.getMonth()&&u.getDate()>27&&u.setDate(30),u.setMonth(u.getMonth()-c*l);var h=o(u,i)===-c;f((0,n.Z)(t))&&1===l&&1===o(t,i)&&(h=!1),e=c*(l-Number(h))}return 0===e?0:e}var l=e(70184),h=e(4958);function m(t){return function(t,r){if(null==t)throw new TypeError("assign requires that input parameter not be null or undefined");for(var e in r=r||{})Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e]);return t}({},t)}var Z=e(24262),D=1440,v=43200;function M(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,a.Z)(2,arguments);var s=e.locale||h.Z;if(!s.formatDistance)throw new RangeError("locale must contain formatDistance property");var u=o(t,r);if(isNaN(u))throw new RangeError("Invalid time value");var i,f,M=m(e);M.addSuffix=Boolean(e.addSuffix),M.comparison=u,u>0?(i=(0,n.Z)(r),f=(0,n.Z)(t)):(i=(0,n.Z)(t),f=(0,n.Z)(r));var d,g=(0,l.Z)(f,i),p=((0,Z.Z)(f)-(0,Z.Z)(i))/1e3,X=Math.round((g-p)/60);if(X<2)return e.includeSeconds?g<5?s.formatDistance("lessThanXSeconds",5,M):g<10?s.formatDistance("lessThanXSeconds",10,M):g<20?s.formatDistance("lessThanXSeconds",20,M):g<40?s.formatDistance("halfAMinute",null,M):g<60?s.formatDistance("lessThanXMinutes",1,M):s.formatDistance("xMinutes",1,M):0===X?s.formatDistance("lessThanXMinutes",1,M):s.formatDistance("xMinutes",X,M);if(X<45)return s.formatDistance("xMinutes",X,M);if(X<90)return s.formatDistance("aboutXHours",1,M);if(X<D){var b=Math.round(X/60);return s.formatDistance("aboutXHours",b,M)}if(X<2520)return s.formatDistance("xDays",1,M);if(X<v){var w=Math.round(X/D);return s.formatDistance("xDays",w,M)}if(X<86400)return d=Math.round(X/v),s.formatDistance("aboutXMonths",d,M);if((d=c(f,i))<12){var T=Math.round(X/v);return s.formatDistance("xMonths",T,M)}var x=d%12,Y=Math.floor(d/12);return x<3?s.formatDistance("aboutXYears",Y,M):x<9?s.formatDistance("overXYears",Y,M):s.formatDistance("almostXYears",Y+1,M)}function d(t,r){return(0,a.Z)(1,arguments),M(t,Date.now(),r)}}}]);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[820],{14977:function(n,_,u){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_error",function(){return u(3359)}])}},function(n){n.O(0,[774,888,179],(function(){return _=14977,n(n.s=_);var _}));var _=n.O();_N_E=_}]);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[255],{24887:function(e,n,t){"use strict";t.r(n),t.d(n,{FETCH_INTERVAL:function(){return N},default:function(){return k}});var r=t(15861),s=t(87757),a=t.n(s),c=t(67294),o=t(4525),i=t(60293),u=t(94853),d=t(58416),l=t(2023),f=t(8354),m=t(99382),p=t(90978),h=t(9431),g=t(85893);function x(e){var n=e.data,t=[{title:"Display Name",key:"username",render:function(e){var n=e.user,t={connectedAt:e.connectedAt,messageCount:e.messageCount,userAgent:e.userAgent};return(0,g.jsx)(m.Z,{user:n,connectionInfo:t,children:(0,g.jsx)("span",{className:"display-name",children:n.displayName})})},sorter:function(e,n){return e.user.displayName-n.user.displayName},sortDirections:["descend","ascend"]},{title:"Messages sent",dataIndex:"messageCount",key:"messageCount",className:"number-col",sorter:function(e,n){return e.messageCount-n.messageCount},sortDirections:["descend","ascend"]},{title:"Connected Time",dataIndex:"connectedAt",key:"connectedAt",defaultSortOrder:"ascend",render:function(e){return(0,f.Z)(new Date(e))},sorter:function(e,n){return new Date(e.connectedAt).getTime()-new Date(n.connectedAt).getTime()},sortDirections:["descend","ascend"]},{title:"User Agent",dataIndex:"userAgent",key:"userAgent",render:function(e){return(0,h.AB)(e)}},{title:"Location",dataIndex:"geo",key:"geo",render:function(e){return e?"".concat(e.regionName,", ").concat(e.countryCode):"-"}},{title:"",key:"block",className:"actions-col",render:function(e,n){return(0,g.jsx)(p.Z,{user:n.user,isEnabled:!n.user.disabledAt})}}];return(0,g.jsx)(l.Z,{className:"table-container",pagination:{hideOnSinglePage:!0},columns:t,dataSource:n,size:"small",rowKey:"id"})}var v=o.Z.Title,N=1e4;function k(){var e=((0,c.useContext)(i.aC)||{}).online,n=(0,c.useState)([]),t=n[0],s=n[1],o=(0,c.useState)([]),l=o[0],f=o[1],m=function(){var e=(0,r.Z)(a().mark((function e(){var n,t;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,u.rQ)(u.qk);case 3:n=e.sent,s(n),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log("==== error",e.t0);case 10:return e.prev=10,e.next=13,(0,u.rQ)(u.Kp);case 13:t=e.sent,f(t),e.next=20;break;case 17:e.prev=17,e.t1=e.catch(10),console.log("==== error",e.t1);case 20:case"end":return e.stop()}}),e,null,[[0,7],[10,17]])})));return function(){return e.apply(this,arguments)}}();(0,c.useEffect)((function(){var e;return m(),e=setInterval(m,N),function(){clearInterval(e)}}),[e]);var p=e?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(x,{data:l}),(0,g.jsxs)("p",{className:"description",children:["Visit the"," ",(0,g.jsx)("a",{href:"https://owncast.online/docs/viewers/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"documentation"})," ","to configure additional details about your viewers."]})]}):(0,g.jsx)("p",{className:"description",children:"When a stream is active and chat is enabled, connected chat clients will be displayed here."});return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(v,{children:["Connected Chat Participants ",e?"(".concat(l.length,")"):null]}),p,(0,g.jsx)("br",{}),(0,g.jsx)("br",{}),(0,g.jsx)(v,{children:"Banned Users"}),(0,g.jsx)(d.Z,{data:t})]})}},22494:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/chat/users",function(){return t(24887)}])}},function(e){e.O(0,[662,23,924,614,354,821,774,888,179],(function(){return n=22494,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[233],{75615:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return y}});var r=t(36725),o=t(1635),s=t(99683),i=t(71577),l=t(27049),a=t(85689),c=t(89281),d=t(11700),h=t(59004),x=t(2877),u=t(60106),j=t(39831),p=t(61209),f=t(50592),g=t(14182),w=t(98507),Z=t(39906),m=t(10039),b=(t(67294),t(85893));function y(){var e=[{icon:(0,b.jsx)(h.Z,{style:{fontSize:"24px"}}),title:"I want to configure my owncast instance",content:(0,b.jsx)("div",{children:(0,b.jsxs)("a",{href:"https://owncast.online/docs/configuration/?source=admin",target:"_blank",rel:"noopener noreferrer",children:[(0,b.jsx)(x.Z,{})," Learn more"]})})},{icon:(0,b.jsx)(u.Z,{style:{fontSize:"24px"}}),title:"Help configuring my broadcasting software",content:(0,b.jsx)("div",{children:(0,b.jsxs)("a",{href:"https://owncast.online/docs/broadcasting/?source=admin",target:"_blank",rel:"noopener noreferrer",children:[(0,b.jsx)(x.Z,{})," Learn more"]})})},{icon:(0,b.jsx)(j.Z,{style:{fontSize:"24px"}}),title:"I want to embed my stream into another site",content:(0,b.jsx)("div",{children:(0,b.jsxs)("a",{href:"https://owncast.online/docs/embed/?source=admin",target:"_blank",rel:"noopener noreferrer",children:[(0,b.jsx)(x.Z,{})," Learn more"]})})},{icon:(0,b.jsx)(p.Z,{style:{fontSize:"24px"}}),title:"I want to customize my website",content:(0,b.jsx)("div",{children:(0,b.jsxs)("a",{href:"https://owncast.online/docs/website/?source=admin",target:"_blank",rel:"noopener noreferrer",children:[(0,b.jsx)(x.Z,{})," Learn more"]})})},{icon:(0,b.jsx)(f.Z,{style:{fontSize:"24px"}}),title:"I want to tweak my video output",content:(0,b.jsx)("div",{children:(0,b.jsxs)("a",{href:"https://owncast.online/docs/encoding/?source=admin",target:"_blank",rel:"noopener noreferrer",children:[(0,b.jsx)(x.Z,{})," Learn more"]})})},{icon:(0,b.jsx)(g.Z,{style:{fontSize:"24px"}}),title:"I want to use an external storage provider",content:(0,b.jsx)("div",{children:(0,b.jsxs)("a",{href:"https://owncast.online/docs/storage/?source=admin",target:"_blank",rel:"noopener noreferrer",children:[(0,b.jsx)(x.Z,{})," Learn more"]})})}],n=[{icon:(0,b.jsx)(w.Z,{style:{fontSize:"24px"}}),title:"I found a bug",content:(0,b.jsxs)("div",{children:["If you found a bug, then please",(0,b.jsxs)("a",{href:"https://github.com/owncast/owncast/issues/new/choose",target:"_blank",rel:"noopener noreferrer",children:[" ","let us know"]})]})},{icon:(0,b.jsx)(Z.Z,{style:{fontSize:"24px"}}),title:"I have a general question",content:(0,b.jsxs)("div",{children:["Most general questions are answered in our",(0,b.jsxs)("a",{href:"https://owncast.online/docs/faq/?source=admin",target:"_blank",rel:"noopener noreferrer",children:[" ","FAQ"]})," ","or exist in our"," ",(0,b.jsx)("a",{href:"https://github.com/owncast/owncast/discussions",target:"_blank",rel:"noopener noreferrer",children:"discussions"})]})},{icon:(0,b.jsx)(m.Z,{style:{fontSize:"24px"}}),title:"I want to build add-ons for Owncast",content:(0,b.jsxs)("div",{children:["You can build your own bots, overlays, tools and add-ons with our",(0,b.jsx)("a",{href:"https://owncast.online/thirdparty?source=admin",target:"_blank",rel:"noopener noreferrer",children:"\xa0developer APIs.\xa0"})]})}];return(0,b.jsxs)("div",{className:"help-page",children:[(0,b.jsx)(d.Z,{style:{textAlign:"center"},children:"How can we help you?"}),(0,b.jsxs)(r.Z,{gutter:[16,16],justify:"space-around",align:"middle",children:[(0,b.jsxs)(o.Z,{xs:24,lg:12,style:{textAlign:"center"},children:[(0,b.jsx)(s.ZP,{status:"500"}),(0,b.jsx)(d.Z,{level:2,children:"Troubleshooting"}),(0,b.jsx)(i.Z,{target:"_blank",rel:"noopener noreferrer",href:"https://owncast.online/docs/troubleshooting/?source=admin",icon:(0,b.jsx)(x.Z,{}),type:"primary",children:"Fix your problems"})]}),(0,b.jsxs)(o.Z,{xs:24,lg:12,style:{textAlign:"center"},children:[(0,b.jsx)(s.ZP,{status:"404"}),(0,b.jsx)(d.Z,{level:2,children:"Documentation"}),(0,b.jsx)(i.Z,{target:"_blank",rel:"noopener noreferrer",href:"https://owncast.online/docs?source=admin",icon:(0,b.jsx)(x.Z,{}),type:"primary",children:"Read the Docs"})]})]}),(0,b.jsx)(l.Z,{}),(0,b.jsx)(d.Z,{level:2,children:"Common tasks"}),(0,b.jsx)(r.Z,{gutter:[16,16],children:e.map((function(e){return(0,b.jsx)(o.Z,{xs:24,lg:12,children:(0,b.jsx)(a.Z,{children:(0,b.jsx)(c.Z,{avatar:e.icon,title:e.title,description:e.content})})},e.title)}))}),(0,b.jsx)(l.Z,{}),(0,b.jsx)(d.Z,{level:2,children:"Other"}),(0,b.jsx)(r.Z,{gutter:[16,16],children:n.map((function(e){return(0,b.jsx)(o.Z,{xs:24,lg:12,children:(0,b.jsx)(a.Z,{children:(0,b.jsx)(c.Z,{avatar:e.icon,title:e.title,description:e.content})})},e.title)}))})]})}},44156:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/help",function(){return t(75615)}])}},function(e){e.O(0,[689,334,774,888,179],(function(){return n=44156,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
|
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[203],{13285:function(e,n,r){"use strict";r.d(n,{Z:function(){return d}});r(67294);var t=r(4525),i=r(60331),a=r(2023),u=r(53731),s=r(12924),o=r(85893),c=t.Z.Title;function l(e,n){var r="black";return"warning"===n.level?r="orange":"error"===n.level&&(r="red"),(0,o.jsx)(i.Z,{color:r,children:e})}function f(e){return(0,o.jsx)(u.Z,{children:e})}function d(e){var n=e.logs,r=e.pageSize;if(null===n||void 0===n||!n.length)return null;var t=[{title:"Level",dataIndex:"level",key:"level",filters:[{text:"Info",value:"info"},{text:"Warning",value:"warning"},{text:"Error",value:"Error"}],onFilter:function(e,n){return 0===n.level.indexOf(e)},render:l},{title:"Timestamp",dataIndex:"time",key:"time",render:function(e){var n=new Date(e);return(0,s.Z)(n,"pp P")},sorter:function(e,n){return new Date(e.time).getTime()-new Date(n.time).getTime()},sortDirections:["descend","ascend"],defaultSortOrder:"descend"},{title:"Message",dataIndex:"message",key:"message",render:f}];return(0,o.jsxs)("div",{className:"logs-section",children:[(0,o.jsx)(c,{children:"Logs"}),(0,o.jsx)(a.Z,{size:"middle",dataSource:n,columns:t,rowKey:function(e){return e.time},pagination:{pageSize:r||20}})]})}},25588:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return l}});var t=r(15861),i=r(87757),a=r.n(i),u=r(67294),s=r(13285),o=r(94853),c=r(85893);function l(){var e=(0,u.useState)([]),n=e[0],r=e[1],i=function(){var e=(0,t.Z)(a().mark((function e(){var n;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,o.rQ)(o.sG);case 3:n=e.sent,r(n),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log("==== error",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}();return(0,u.useEffect)((function(){var e;return setInterval(i,5e3),i(),e=setInterval(i,5e3),function(){clearInterval(e)}}),[]),(0,c.jsx)(s.Z,{logs:n,pageSize:20})}},84841:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/logs",function(){return r(25588)}])}},function(e){e.O(0,[23,924,835,774,888,179],(function(){return n=84841,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
|
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[69],{59334:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return O}});var n=t(4942),c=t(15861),a=t(87757),o=t.n(a),u=t(67294),i=t(32840),s=t(4525),l=t(2023),f=t(94853),d=t(85893);function p(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function h(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?p(Object(t),!0).forEach((function(r){(0,n.Z)(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var b=s.Z.Title;function j(e){var r=Object.values(e),t=[{title:"Name",dataIndex:"name",key:"name",render:function(e,r){return(0,d.jsx)("a",{href:r.browser_download_url,children:e})}},{title:"Size",dataIndex:"size",key:"size",render:function(e){return"".concat((e/1024/1024).toFixed(2)," MB")}}];return(0,d.jsx)(l.Z,{dataSource:r,columns:t,rowKey:function(e){return e.id},size:"large",pagination:!1})}function O(){var e=(0,u.useState)({html_url:"",name:"",created_at:null,body:"",assets:[]}),r=e[0],t=e[1],n=function(){var e=(0,c.Z)(o().mark((function e(){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,f.Kt)();case 3:r=e.sent,t(r),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log("==== error",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}();return(0,u.useEffect)((function(){n()}),[]),r?(0,d.jsxs)("div",{className:"upgrade-page",children:[(0,d.jsx)(b,{level:2,children:(0,d.jsx)("a",{href:r.html_url,children:r.name})}),(0,d.jsx)(b,{level:5,children:new Date(r.created_at).toDateString()}),(0,d.jsx)(i.Z,{children:r.body}),(0,d.jsx)("h3",{children:"Downloads"}),(0,d.jsx)(j,h({},r.assets))]}):null}},20014:function(e,r,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/upgrade",function(){return t(59334)}])}},function(e){e.O(0,[774,23,840,888,179],(function(){return r=20014,e(e.s=r);var r}));var r=e.O();_N_E=r}]);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
!function(){"use strict";var e={},n={};function t(r){var o=n[r];if(void 0!==o)return o.exports;var i=n[r]={id:r,loaded:!1,exports:{}},u=!0;try{e[r].call(i.exports,i,i.exports,t),u=!1}finally{u&&delete n[r]}return i.loaded=!0,i.exports}t.m=e,function(){var e=[];t.O=function(n,r,o,i){if(!r){var u=1/0;for(l=0;l<e.length;l++){r=e[l][0],o=e[l][1],i=e[l][2];for(var a=!0,c=0;c<r.length;c++)(!1&i||u>=i)&&Object.keys(t.O).every((function(e){return t.O[e](r[c])}))?r.splice(c--,1):(a=!1,i<u&&(u=i));if(a){e.splice(l--,1);var f=o();void 0!==f&&(n=f)}}return n}i=i||0;for(var l=e.length;l>0&&e[l-1][2]>i;l--)e[l]=e[l-1];e[l]=[r,o,i]}}(),t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,{a:n}),n},t.d=function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},t.f={},t.e=function(e){return Promise.all(Object.keys(t.f).reduce((function(n,r){return t.f[r](e,n),n}),[]))},t.u=function(e){return"static/chunks/"+e+".e602e2954bee4d3743a7.js"},t.miniCssF=function(e){return"static/css/"+{361:"daab8d18100466477c6d",888:"aa68552b8433355aec7c"}[e]+".css"},t.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},function(){var e={},n="_N_E:";t.l=function(r,o,i,u){if(e[r])e[r].push(o);else{var a,c;if(void 0!==i)for(var f=document.getElementsByTagName("script"),l=0;l<f.length;l++){var d=f[l];if(d.getAttribute("src")==r||d.getAttribute("data-webpack")==n+i){a=d;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,t.nc&&a.setAttribute("nonce",t.nc),a.setAttribute("data-webpack",n+i),a.src=r),e[r]=[o];var s=function(n,t){a.onerror=a.onload=null,clearTimeout(p);var o=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((function(e){return e(t)})),n)return n(t)},p=setTimeout(s.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=s.bind(null,a.onerror),a.onload=s.bind(null,a.onload),c&&document.head.appendChild(a)}}}(),t.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},t.p="/admin/_next/",function(){var e={272:0};t.f.j=function(n,r){var o=t.o(e,n)?e[n]:void 0;if(0!==o)if(o)r.push(o[2]);else if(272!=n){var i=new Promise((function(t,r){o=e[n]=[t,r]}));r.push(o[2]=i);var u=t.p+t.u(n),a=new Error;t.l(u,(function(r){if(t.o(e,n)&&(0!==(o=e[n])&&(e[n]=void 0),o)){var i=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;a.message="Loading chunk "+n+" failed.\n("+i+": "+u+")",a.name="ChunkLoadError",a.type=i,a.request=u,o[1](a)}}),"chunk-"+n,n)}else e[n]=0},t.O.j=function(n){return 0===e[n]};var n=function(n,r){var o,i,u=r[0],a=r[1],c=r[2],f=0;if(u.some((function(n){return 0!==e[n]}))){for(o in a)t.o(a,o)&&(t.m[o]=a[o]);if(c)var l=c(t)}for(n&&n(r);f<u.length;f++)i=u[f],t.o(e,i)&&e[i]&&e[i][0](),e[u[f]]=0;return t.O(l)},r=self.webpackChunk_N_E=self.webpackChunk_N_E||[];r.forEach(n.bind(null,0)),r.push=n.bind(null,r.push.bind(r))}()}();
|
9
static/admin/_next/static/css/aa68552b8433355aec7c.css
Normal file
9
static/admin/_next/static/css/aa68552b8433355aec7c.css
Normal file
File diff suppressed because one or more lines are too long
1
static/admin/_next/static/css/daab8d18100466477c6d.css
Normal file
1
static/admin/_next/static/css/daab8d18100466477c6d.css
Normal file
File diff suppressed because one or more lines are too long
1
static/admin/access-tokens/index.html
Normal file
1
static/admin/access-tokens/index.html
Normal file
File diff suppressed because one or more lines are too long
1
static/admin/actions/index.html
Normal file
1
static/admin/actions/index.html
Normal file
File diff suppressed because one or more lines are too long
1
static/admin/chat/messages/index.html
Normal file
1
static/admin/chat/messages/index.html
Normal file
File diff suppressed because one or more lines are too long
1
static/admin/chat/users/index.html
Normal file
1
static/admin/chat/users/index.html
Normal file
File diff suppressed because one or more lines are too long
1
static/admin/config-chat/index.html
Normal file
1
static/admin/config-chat/index.html
Normal file
File diff suppressed because one or more lines are too long
1
static/admin/config-public-details/index.html
Normal file
1
static/admin/config-public-details/index.html
Normal file
File diff suppressed because one or more lines are too long
1
static/admin/config-server-details/index.html
Normal file
1
static/admin/config-server-details/index.html
Normal file
File diff suppressed because one or more lines are too long
1
static/admin/config-social-items/index.html
Normal file
1
static/admin/config-social-items/index.html
Normal file
File diff suppressed because one or more lines are too long
1
static/admin/config-storage/index.html
Normal file
1
static/admin/config-storage/index.html
Normal file
File diff suppressed because one or more lines are too long
1
static/admin/config-video/index.html
Normal file
1
static/admin/config-video/index.html
Normal file
File diff suppressed because one or more lines are too long
19
static/admin/hardware-info/index.html
Normal file
19
static/admin/hardware-info/index.html
Normal file
File diff suppressed because one or more lines are too long
1
static/admin/help/index.html
Normal file
1
static/admin/help/index.html
Normal file
File diff suppressed because one or more lines are too long
1
static/admin/index.html
Normal file
1
static/admin/index.html
Normal file
File diff suppressed because one or more lines are too long
1
static/admin/logs/index.html
Normal file
1
static/admin/logs/index.html
Normal file
File diff suppressed because one or more lines are too long
1
static/admin/offline-notice/index.html
Normal file
1
static/admin/offline-notice/index.html
Normal file
File diff suppressed because one or more lines are too long
1
static/admin/upgrade/index.html
Normal file
1
static/admin/upgrade/index.html
Normal file
File diff suppressed because one or more lines are too long
1
static/admin/viewer-info/index.html
Normal file
1
static/admin/viewer-info/index.html
Normal file
File diff suppressed because one or more lines are too long
1
static/admin/webhooks/index.html
Normal file
1
static/admin/webhooks/index.html
Normal file
File diff suppressed because one or more lines are too long
14
static/static.go
Normal file
14
static/static.go
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package static
|
||||||
|
|
||||||
|
import "embed"
|
||||||
|
|
||||||
|
//go:embed admin/*
|
||||||
|
//go:embed admin/_next/static
|
||||||
|
//go:embed admin/_next/static/chunks/pages/*.js
|
||||||
|
//go:embed admin/_next/static/*/*.js
|
||||||
|
var adminFiles embed.FS
|
||||||
|
|
||||||
|
// GetAdmin will return an embedded filesystem reference to the admin web app.
|
||||||
|
func GetAdmin() embed.FS {
|
||||||
|
return adminFiles
|
||||||
|
}
|
@ -18,7 +18,7 @@ fi
|
|||||||
pushd ../../.. > /dev/null
|
pushd ../../.. > /dev/null
|
||||||
|
|
||||||
# Build and run owncast from source
|
# Build and run owncast from source
|
||||||
go build -o owncast main.go pkged.go
|
go build -o owncast main.go
|
||||||
./owncast -database $TEMP_DB &
|
./owncast -database $TEMP_DB &
|
||||||
SERVER_PID=$!
|
SERVER_PID=$!
|
||||||
|
|
||||||
|
28
test/automated/browser/admin.test.js
Normal file
28
test/automated/browser/admin.test.js
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
const listenForErrors = require('./lib/errors.js').listenForErrors;
|
||||||
|
const ADMIN_USERNAME = 'admin';
|
||||||
|
const ADMIN_PASSWORD = 'abc123';
|
||||||
|
|
||||||
|
describe('Video embed page', () => {
|
||||||
|
beforeAll(async () => {
|
||||||
|
await page.setViewport({ width: 1080, height: 720 });
|
||||||
|
listenForErrors(browser, page);
|
||||||
|
|
||||||
|
// set HTTP Basic auth
|
||||||
|
await page.authenticate({
|
||||||
|
username: ADMIN_USERNAME,
|
||||||
|
password: ADMIN_PASSWORD,
|
||||||
|
});
|
||||||
|
|
||||||
|
await page.goto('http://localhost:5309/admin');
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll(async () => {
|
||||||
|
await page.waitForTimeout(3000);
|
||||||
|
await page.screenshot({ path: 'screenshots/admin.png', fullPage: true });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have rendered the admin home page', async () => {
|
||||||
|
await page.waitForSelector('.home-container');
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
@ -18,7 +18,7 @@ fi
|
|||||||
pushd ../../.. > /dev/null
|
pushd ../../.. > /dev/null
|
||||||
|
|
||||||
# Build and run owncast from source
|
# Build and run owncast from source
|
||||||
go build -o owncast main.go pkged.go
|
go build -o owncast main.go
|
||||||
BROWSER_TEST=true ./owncast -rtmpport 9021 -webserverport 5309 -database $TEMP_DB &
|
BROWSER_TEST=true ./owncast -rtmpport 9021 -webserverport 5309 -database $TEMP_DB &
|
||||||
SERVER_PID=$!
|
SERVER_PID=$!
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ fi
|
|||||||
pushd ../../.. >/dev/null
|
pushd ../../.. >/dev/null
|
||||||
|
|
||||||
# Build and run owncast from source
|
# Build and run owncast from source
|
||||||
go build -o owncast main.go pkged.go
|
go build -o owncast main.go
|
||||||
./owncast -database $TEMP_DB &
|
./owncast -database $TEMP_DB &
|
||||||
SERVER_PID=$!
|
SERVER_PID=$!
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user