Commit graph

1288 commits

Author SHA1 Message Date
gabek
7af5030f5b Prettified Code! 2021-07-20 02:23:06 +00:00
Gabe Kangas
b6f68628c0
Chat refactor + persistent backing chat users (#1163)
* First pass at chat user registration and validation

* Disable chat if the user is disabled/blocked or the server hits max connections

* Handle dropping sockets if chat is disabled

* Fix origin in automated chat test

* Work for updated chat moderation

* Chat message markdown rendering and fix tests

* Put /api/chat behind a chat user access token. Closes #1085

* Reject blocked username changes

* More WIP moderation

* Defer configuring chat until we know if it is enabled. Closes #1135

* chat user blocking. Closes #1096

* Add tests around user access for #1096

* Add external integration chat message API + update integration auth middleware to pass along integration name. Closes #1092

* Delete old chat messages from db as to not hold on to excessive data. Closes #1152

* Add schema migration for messages. Closes #1155

* Commit updated API documentation

* Add chat load test

* Shared db mutex and db optimizations

* Simplify past display name handling

* Use a new test db for each test run

* Wire up the external messages actions + add tests for them

* Move access tokens to be actual users

* Run message pruning at launch + fix comparison

* Do not return API users in disabled users response

* Fix incorrect highlighting. Closes #1160

* Consolidate user table statements

* Set the max process connection limit to 70% of maximum

* Fix wrong old display name being returned in name change event

* Delete the old chat server files

* Wire back up the webhooks

* Remove unused

* Invalidate user cache on changes

* Do not send rendered body as RawBody

* Some cleanup

* Standardize names for external API users to ExternalAPIUser

* Do not log token

* Checkout branch when building admin for testing

* Bundle in dev admin for testing

* Some cleanup

* Cleanup js logs

* Cleanup and standardize event names

* Clean up some logging

* Update API spec. Closes #1133

* Commit updated API documentation

* Change paths to be better named

* Commit updated API documentation

* Update admin bundle

* Fix duplicate event name

* Rename scope var

* Update admin bundle

* Move connected clients controller into admin package

* Fix collecting usernames for autocomplete purposes

* No longer generate username when it is empty

* Sort clients and users by timestamp

* Move file to admin controller package

* Swap, so the comments stay correct

Co-authored-by: Jannik <jannik@outlook.com>

* Use explicit type alias

Co-authored-by: Jannik <jannik@outlook.com>

* Remove commented code.

Co-authored-by: Jannik <jannik@outlook.com>

* Cleanup test

* Remove some extra logging

* Add some clarity

* Update dev instance of admin for testing

* Consolidate lines

Co-authored-by: Jannik <jannik@outlook.com>

* Remove commented unused vars

Co-authored-by: Jannik <jannik@outlook.com>

* Until needed do not return IP address with client list

* Fix typo of wrong var

* Typo led to a bad test. Fix typo and fix test.

* Guard against the socket reconnecting on error if previously set to shutdown

* Do not log access tokens

* Return success message on enable/disable user

* Clean up some inactionable error messages. Sent ban message. Sort banned users.

* fix styling for when chat is completely disabled

* Unused

* guard against nil clients

* Update dev admin bundle

* Do not unhide messages when unblocking user just to be safe. Send removal action from the controller

* Add convinience function for getting active connections for a single user

* Lock db on these mutations

* Cleanup force disconnect using GetClientsForUser and capture client reference explicitly

* No longer re-showing banned user messages for safety. Removing this test.

* Remove no longer needed comment

* Tweaks to forbidden username handling.

- Standardize naming to not use "block" but "forbidden" instead.
- Pass array over the wire instead of string.
- Add API test
- Fix default list incorrectly being appended to custom list.

* Logging cleanup

* Update dev admin bundle

* Add an artificial delay in order to visually see message being hidden when testing

* Remove the user cache as it is a premature optimization

* When connected to chat let the user know their current user details to sync the username in the UI

* On connected send current display name back to client.
- Move name change out of chat component.
- Add additional event type constants.

* Fix broken workflow due to typo

* Troubleshoot workflow

* Bump htm from 3.0.4 to 3.1.0 in /build/javascript (#1181)

* Bump htm from 3.0.4 to 3.1.0 in /build/javascript

Bumps [htm](https://github.com/developit/htm) from 3.0.4 to 3.1.0.
- [Release notes](https://github.com/developit/htm/releases)
- [Commits](https://github.com/developit/htm/compare/3.0.4...3.1.0)

---
updated-dependencies:
- dependency-name: htm
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Run npm run build and update libraries

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gabe Kangas <gabek@real-ity.com>

* Commit updated Javascript packages

* Re-send current user info when a rejected name change takes place

* All socket writes should be through the send chan and not directly

* Seed the random generator

* Add keys and indexes to users table

* a util to generate consistent emoji markup

* console clean up

* mod tidy

* Commit updated API documentation

* Handle the max payload size of a socket message.
- Only close socket if x2 greater than the max size.
- Send the user a message if a message is too large.
- Surface the max size in bytes in the config.

* Update admin bundle

* Force all events to be sent in their own socket message and do not concatinate in a single message

* Update chat embed to register for access token

* Use a different access token for embed chat

* Update the chat message bubble background color to be bolder

* add base tag to open links in new window, closes #1220

* Support text input of :emoji: in chat (#1190)

* Initial implementation of emoji injection

* fix bookkeeping with multiple emoji

* make the emoji lookup case-insensitive

* try another solution for Caretposition

* add title to emojis

minor refactoring

* bind moji injection to InputKeyUp

* simplify the code

replace all found emojis

* inject emoji if the modifer is released earlier

* more efficient emoji tag search

* use json emoji.emoji as url

* use createEmojiMarkup()

* move emojify() to chat.js

* emojify on paste

* cleanup emoji titles in paste

* update inputText in InputKeyup

* mark emoji titles with 2*zwnj

this way paste cleanup will not interfere with text which include zwnj

* emoji should not change the inputText

* Do not show join messages when chat is offline. Closes #1224
- Show stream starting/ending messages in chat.
- When stream starts show everyone the welcome message.

* Force scrolling chat to bottom after history is populated regardless of scroll position. Closes https://github.com/owncast/owncast/issues/1222

* use maxSocketPayloadSize to calculate total bytes of message payload (#1221)

* utilize maxSocketPayloadSize from config; update chatInput to calculate based on that value instead of text value; remove usage of inputText for counting

* add a buffer to account for entire websocket payload for message char counting; trim nbsp;'s from ends of messages when calculating count

Co-authored-by: Gabe Kangas <gabek@real-ity.com>

Co-authored-by: Owncast <owncast@owncast.online>
Co-authored-by: Jannik <jannik@outlook.com>
Co-authored-by: Ginger Wong <omqmail@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Meisam <39205857+MFTabriz@users.noreply.github.com>
2021-07-19 19:22:29 -07:00
gabek
e3dc736cf4 Prettified Code! 2021-07-20 01:51:46 +00:00
Gabe Kangas
6328fc6f90 Fix date comparison for showing last stream date. Closes https://github.com/owncast/owncast/issues/1223 2021-07-19 18:51:10 -07:00
Gabe Kangas
fcc25bd1e7 Clean up the github readme and add some fun badges for surfacing some links and info 2021-07-19 12:27:21 -07:00
Gabe Kangas
37fedb8ab8 Ignore some additional non-fatal errors 2021-07-18 13:10:08 -07:00
Meisam
617156b18d
link assets under the same protocol for bots (#1187)
* link assets under the same protocol

* use // for metadata  urls
2021-07-17 20:28:20 -07:00
dependabot[bot]
19514f2a62
Bump github.com/mattn/go-sqlite3 from 1.14.7 to 1.14.8 (#1198)
Bumps [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) from 1.14.7 to 1.14.8.
- [Release notes](https://github.com/mattn/go-sqlite3/releases)
- [Commits](https://github.com/mattn/go-sqlite3/compare/v1.14.7...v1.14.8)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-sqlite3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-16 15:24:37 -07:00
Owncast
6d8e0ddfe5 Commit updated Javascript packages 2021-07-15 23:47:47 +00:00
dependabot[bot]
09a46289c0
Bump @videojs/http-streaming from 2.9.1 to 2.9.2 in /build/javascript (#1188)
Bumps [@videojs/http-streaming](https://github.com/videojs/http-streaming) from 2.9.1 to 2.9.2.
- [Release notes](https://github.com/videojs/http-streaming/releases)
- [Changelog](https://github.com/videojs/http-streaming/blob/main/CHANGELOG.md)
- [Commits](https://github.com/videojs/http-streaming/compare/v2.9.1...v2.9.2)

---
updated-dependencies:
- dependency-name: "@videojs/http-streaming"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-15 16:46:38 -07:00
dependabot[bot]
41273eff9a
Bump github.com/aws/aws-sdk-go from 1.39.0 to 1.40.0 (#1189)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.39.0 to 1.40.0.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.39.0...v1.40.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-15 11:54:22 -07:00
Meisam
a00052ef89
set summary in metadata (#1185) 2021-07-13 14:44:03 -07:00
Owncast
72ad211ff8 Commit updated Javascript packages 2021-07-13 03:45:20 +00:00
dependabot[bot]
d0b1b604a0
Bump htm from 3.0.4 to 3.1.0 in /build/javascript (#1181)
* Bump htm from 3.0.4 to 3.1.0 in /build/javascript

Bumps [htm](https://github.com/developit/htm) from 3.0.4 to 3.1.0.
- [Release notes](https://github.com/developit/htm/releases)
- [Commits](https://github.com/developit/htm/compare/3.0.4...3.1.0)

---
updated-dependencies:
- dependency-name: htm
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Run npm run build and update libraries

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gabe Kangas <gabek@real-ity.com>
2021-07-12 20:44:21 -07:00
gabek
cea07697f3 Prettified Code! 2021-07-12 17:25:14 +00:00
gingervitis
ab254a3902
put emojiPicker instance in state so page can correctly reflect updates when it has instantiated (#1182) 2021-07-12 10:24:41 -07:00
Gabe Kangas
0c6378976c
Troubleshoot workflow 2021-07-12 09:13:06 -07:00
Gabe Kangas
e84149ea50
Fix broken workflow due to typo 2021-07-12 09:04:28 -07:00
Gabe Kangas
5968aa49d2 Fix initial creation of logging directory 2021-07-11 17:08:51 -07:00
Meisam
d042fd70d1
Cache the custom emoji list (#1175)
* use emojiCache

* add emojiCacheTimestamp

* add function description

* better logging
2021-07-11 15:34:56 -07:00
Meisam
08b6c4e3cf
Better handling of os.Stat() errors (#1173) 2021-07-09 18:31:43 -07:00
Meisam
7361578412
style fix for error checking (#1170)
+additional linting
2021-07-09 11:16:44 -07:00
Meisam
a13e1e75e2
proper cleanup and permission check for the hls directory (#1167)
* check error on hls cleanup

* rm HLS directories before creating new ones

* don't mask the variable

* mv cleanupDirectory() to utils

* add user-friendly error messages
2021-07-08 12:35:53 -07:00
dependabot[bot]
0e0199aa98
Bump github.com/microcosm-cc/bluemonday from 1.0.14 to 1.0.15 (#1168)
Bumps [github.com/microcosm-cc/bluemonday](https://github.com/microcosm-cc/bluemonday) from 1.0.14 to 1.0.15.
- [Release notes](https://github.com/microcosm-cc/bluemonday/releases)
- [Commits](https://github.com/microcosm-cc/bluemonday/compare/v1.0.14...v1.0.15)

---
updated-dependencies:
- dependency-name: github.com/microcosm-cc/bluemonday
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-08 10:56:28 -07:00
Rohan Sharma
8fe28dc941
remove the unnecessary websocket connection from the embed player (#1165) 2021-07-06 17:46:52 -07:00
dependabot[bot]
2aff63d73f
Bump github.com/aws/aws-sdk-go from 1.38.66 to 1.39.0 (#1161)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.38.66 to 1.39.0.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.38.66...v1.39.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-05 11:07:20 -07:00
dependabot[bot]
b4596a508d
Bump github.com/yuin/goldmark from 1.3.9 to 1.4.0 (#1162)
Bumps [github.com/yuin/goldmark](https://github.com/yuin/goldmark) from 1.3.9 to 1.4.0.
- [Release notes](https://github.com/yuin/goldmark/releases)
- [Commits](https://github.com/yuin/goldmark/compare/v1.3.9...v1.4.0)

---
updated-dependencies:
- dependency-name: github.com/yuin/goldmark
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-05 11:06:13 -07:00
Jannik
3f9f4a151c
refactor: use io.Pipe and ffmpeg's stdin (#1148)
This removes the usage of `syscall.Mkfifo` which was previously used and
won't work on Windows systems and opens the door for other processes on
the computer to interfere in the rtmp stream (dumping bad content in the
fifo, removing the file, blocking the file in offline status).
Instead, this patch introduces an `io.Pipe` which pipes the RTMP stream
to the ffmpeg command while staying in Owncast.

Further links:
* ffmpeg on using `pipe:0` as an input: https://ffmpeg.org/ffmpeg-protocols.html#pipe
2021-07-03 12:28:25 -07:00
dependabot[bot]
0858e2ed52
Bump video.js from 7.12.3 to 7.13.3 in /build/javascript (#1145)
* Bump video.js from 7.12.3 to 7.13.3 in /build/javascript

Bumps [video.js](https://github.com/videojs/video.js) from 7.12.3 to 7.13.3.
- [Release notes](https://github.com/videojs/video.js/releases)
- [Changelog](https://github.com/videojs/video.js/blob/main/CHANGELOG.md)
- [Commits](https://github.com/videojs/video.js/compare/v7.12.3...v7.13.3)

---
updated-dependencies:
- dependency-name: video.js
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Copy library over

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gabe Kangas <gabek@real-ity.com>
2021-07-01 18:31:48 -07:00
Jannik
edc777ae1b
🐛 use currentBroadcast for playlist overwrites (#1149)
Fixes #1147 since it looks into currentBroadcast and does not use the configuration of the next stream.
2021-07-01 18:27:56 -07:00
Meisam
3b6ef78ff7
fix video variant sorting (#1150) 2021-07-01 18:17:50 -07:00
dependabot[bot]
1f05923545
Bump github.com/shirou/gopsutil (#1146)
Bumps [github.com/shirou/gopsutil](https://github.com/shirou/gopsutil) from 3.21.5+incompatible to 3.21.6+incompatible.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/compare/v3.21.5...v3.21.6)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-01 09:01:50 -07:00
Gabe Kangas
0802a20f4f Do not save invalid disconnect time 2021-06-29 11:38:13 -07:00
Gabe Kangas
12104978e8 Some linter cleanup 2021-06-29 10:21:00 -07:00
Gabe Kangas
ab3bbd59bf Cleanup the persisted disconnected time 2021-06-29 10:04:26 -07:00
dependabot[bot]
516e4e89c0
Bump github.com/yuin/goldmark from 1.3.8 to 1.3.9 (#1141)
Bumps [github.com/yuin/goldmark](https://github.com/yuin/goldmark) from 1.3.8 to 1.3.9.
- [Release notes](https://github.com/yuin/goldmark/releases)
- [Commits](https://github.com/yuin/goldmark/compare/v1.3.8...v1.3.9)

---
updated-dependencies:
- dependency-name: github.com/yuin/goldmark
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-29 08:22:59 -07:00
Gabe Kangas
199e70fade Fix the passed in version number not being used due to an incorrect var 2021-06-28 16:01:01 -07:00
Gabe Kangas
d28c4b96f3 Fix invalid nil time being returned 2021-06-28 13:59:23 -07:00
Gabe Kangas
2c2736aef9
Use full path to dependency 2021-06-23 18:20:46 -07:00
dependabot[bot]
43b37e84db
Bump github.com/aws/aws-sdk-go from 1.38.65 to 1.38.66 (#1136)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.38.65 to 1.38.66.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.38.65...v1.38.66)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-23 18:20:13 -07:00
Gabe Kangas
610a3ef834 Calm down excessive dependabot updates 2021-06-23 18:17:13 -07:00
dependabot[bot]
b37edfe7fe
Bump @videojs/http-streaming from 2.9.0 to 2.9.1 in /build/javascript (#1134)
Bumps [@videojs/http-streaming](https://github.com/videojs/http-streaming) from 2.9.0 to 2.9.1.
- [Release notes](https://github.com/videojs/http-streaming/releases)
- [Changelog](https://github.com/videojs/http-streaming/blob/main/CHANGELOG.md)
- [Commits](https://github.com/videojs/http-streaming/compare/v2.9.0...v2.9.1)

---
updated-dependencies:
- dependency-name: "@videojs/http-streaming"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-23 11:00:07 -07:00
dependabot[bot]
8ccef737ef
Bump color-string from 1.5.4 to 1.5.5 in /build/javascript (#1131)
Bumps [color-string](https://github.com/Qix-/color-string) from 1.5.4 to 1.5.5.
- [Release notes](https://github.com/Qix-/color-string/releases)
- [Changelog](https://github.com/Qix-/color-string/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Qix-/color-string/compare/1.5.4...1.5.5)

---
updated-dependencies:
- dependency-name: color-string
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-22 08:09:55 -07:00
dependabot[bot]
acb0bbe702
Bump github.com/aws/aws-sdk-go from 1.38.64 to 1.38.65 (#1130)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.38.64 to 1.38.65.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.38.64...v1.38.65)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-22 08:03:54 -07:00
Gabe Kangas
010bdeaffd Fix incorrect error message 2021-06-21 20:16:57 -07:00
Gabe Kangas
6f11351840 Remove unused property 2021-06-21 20:16:44 -07:00
Gabe Kangas
1586d80a32 Wire up blocked chat username controller 2021-06-21 20:16:21 -07:00
Gabe Kangas
99d04c8e69
Customize stalebot to close stale PRs 2021-06-21 09:46:32 -07:00
Gabe Kangas
20c272ff3d Guard against invalid last disconnect time 2021-06-20 20:16:27 -07:00
Gabe Kangas
e61b83c5ed Fix missing space in viewer count 2021-06-20 20:15:08 -07:00