Commit Graph
100 Commits
Author SHA1 Message Date
Gabe Kangas 1a1e2a3738 Revert "Update test to reflect the newline -> br tag change"
This reverts commit 3d09698355.
2021-08-18 18:08:17 -07:00
Gabe Kangas e5735b8d6d Remove adding <br> tags to newlines 2021-08-18 18:08:07 -07:00
Gabe Kangas 3d09698355 Update test to reflect the newline -> br tag change 2021-08-18 17:51:33 -07:00
Gabe Kangas 3618a28240 Re-enable unsafe tags as they are needed for emoji 2021-08-18 17:00:52 -07:00
Gabe Kangas 8907566ed1 Fixing chat message formatting in #1315 2021-08-18 16:11:00 -07:00
Gabe KangasandGitHub af7720a483 Use the same screenshot as the web site
It's fancier.
2021-08-14 20:24:54 -07:00
Gabe Kangas 04bb97bffc Fix build error on FreeBSD. Closes #1243 2021-08-13 15:34:00 -07:00
Gabe Kangas a0a8257cb7 Bump version constant 2021-08-13 00:26:10 -07:00
Gabe Kangas ea66ccfe3d Update admin bundle 2021-08-13 00:26:00 -07:00
Gabe Kangas 4ea416fdbe Update the user object name change time when changing name. Closes #1277 2021-08-13 00:05:22 -07:00
Gabe Kangas a8c5267e18 Update micromodal 2021-08-13 00:05:22 -07:00
Gabe Kangas 17468f276a Update markjs 2021-08-13 00:05:22 -07:00
Gabe Kangas e2f9ea5195 Update htm 2021-08-13 00:05:22 -07:00
Gabe Kangas c791722d71 Update vhs 2021-08-13 00:05:22 -07:00
Gabe KangasandJannik bf17293e8b Add automated integration test for client list API.
- Connects via websocket
- Verifies user list exists
- If GeoIP data is available it will test that the geo property of a
  client is populated.
2021-08-13 08:52:36 +02:00
Gabe KangasandJannik 6f57f570d2 Restore GeoIP support to now support chat users. Closes #1304 2021-08-13 08:52:36 +02:00
Gabe KangasandGitHub 5adf2cdecd Pass along disconnect time to determine chat disable timer duration (#1310) 2021-08-12 23:24:43 -07:00
Gabe Kangas 6fb383d04b Only ignore messages 5min after disconnect. Part of fixing #1268 2021-08-12 22:40:10 -07:00
Gabe Kangas f87d4f960a Add formatting 2021-08-12 22:39:12 -07:00
Gabe KangasandGitHub a01fe638cc Increase golangci-lint timeout 2021-08-12 21:33:11 -07:00
Gabe Kangas cf87f53da3 Do not send empty type when its not apropriate 2021-08-12 21:20:06 -07:00
Gabe Kangas 9d0ae44c3c Give stream status webhooks an id and timestamp 2021-08-12 20:02:17 -07:00
Gabe Kangas 53d0e8653e Remove old unused function 2021-08-12 17:23:28 -07:00
Gabe Kangas b966d32d77 Incorrect webhook event type is being sent on user joined. Fixes #1302 2021-08-12 13:19:09 -07:00
Gabe Kangas f5a045dedc Update admin bundle 2021-08-10 12:19:26 -07:00
Gabe Kangas 784d10c1e9 Remove "Sent" being inserted incorrectly. Fixes #1252 2021-08-05 21:40:40 -07:00
Gabe Kangas dcc7a7c5c3 Support assigning nil as time instead of setting time as invalid. Fix typo that led to incorrect disconnect time. Maybe addresses #1268? 2021-08-03 17:47:16 -07:00
Gabe Kangas 12cbe529de Fix incorrect handling of messages array. Closes #1287 2021-07-31 12:48:42 -07:00
Gabe Kangas e72b0c640c Update error message 2021-07-28 13:00:20 -07:00
Gabe Kangas 810b0cd5da Explicitly add CORS wildcard on all OPTIONS requests 2021-07-28 12:47:15 -07:00
Gabe Kangas 509c658080 Add OPTIONS preflight support for 3rd party auth.
- Explicitly add wildcard CORS header within the middleware.
- Accept all OPTIONS preflight requests within the middlware.
- Add success tests for the OPTIONS request.
- Add failure tests for GET requests.
2021-07-28 12:40:55 -07:00
Gabe Kangas 031a848b7a No need to publicly log this 2021-07-28 12:37:26 -07:00
Gabe Kangas 8f32c13ca6 Fix incorrect controller method. Remove wildcard cors from /api/chat 2021-07-28 12:36:48 -07:00
Gabe Kangas 41cfe33b8d Fix typo of missing colon 2021-07-27 15:33:57 -07:00
Gabe Kangas 10f50a03e7 Hide external actions row if there are zero actions. Closes https://github.com/owncast/owncast/issues/1119 2021-07-27 15:25:19 -07:00
Gabe KangasandGitHub b5bb28b396 Dependabot does not have access to commit 2021-07-27 13:02:14 -07:00
Gabe Kangas fac06257ad Add in the optimization where multiple websocket events can exist within a single message 2021-07-26 19:23:15 -07:00
Gabe Kangas 8b2747e4d7 Add some sqlite optimizations 2021-07-26 17:35:23 -07:00
Gabe Kangas f20aa4478d Add a simple caching of chat history as an optimization 2021-07-26 17:35:04 -07:00
Gabe Kangas f85b54cfeb Pass along just the client id instead a reference to the entire client when unregistering the client 2021-07-26 17:34:50 -07:00
Gabe Kangas f23a1202cc Do not set title text for users without data. Closes #1249 2021-07-25 22:41:15 -07:00
Gabe Kangas 45af1f5135 Apdate admin bundle 2021-07-25 22:16:31 -07:00
Gabe Kangas ae78283caf Remove extra log from displaying 2021-07-22 23:34:51 -07:00
Gabe Kangas 484098afda Some migration fixes and database optimizations 2021-07-22 23:30:25 -07:00
Gabe Kangas a366923797 Update admin bundle 2021-07-22 18:42:19 -07:00
Gabe Kangas 3dc3ad75f6 Cleanup errors that are not fatal during filesystem cleanup 2021-07-22 16:50:30 -07:00
Gabe Kangas c3e8e78dad Centralize chan closure to be done in the client, not the server. Set chan size to max message size. 2021-07-22 15:27:12 -07:00
Gabe Kangas f782e82909 Fix potential concurrent access condition 2021-07-22 15:27:12 -07:00
Gabe Kangas c1dd1b9bf3 fix exception 2021-07-21 23:19:33 -07:00
Gabe Kangas e7e1758fa4 Force history messages to always be at the front of the messages array 2021-07-21 22:23:24 -07:00
Gabe Kangas 1d7b7727d2 Update admin bundle 2021-07-21 17:32:49 -07:00
Gabe Kangas 2cf761a3f1 Clarify in routes and names that it is chat clients being returned 2021-07-21 17:19:15 -07:00
Gabe Kangas 5f322c84f6 Update admin bundle 2021-07-21 10:05:05 -07:00
Gabe Kangas 96993435d8 Add missing space. Closes #1231 2021-07-20 23:25:23 -07:00
Gabe KangasandGitHub 4715598d7e Override default protocol if one is set in settings (#1226)
* Default to http but use the protocol set in settings if available

* Add missing instance of the protocol
2021-07-20 10:34:59 -07:00
Gabe Kangas 44d6a36b77 Cleanup linter warnings 2021-07-19 23:49:16 -07:00
Gabe Kangas b59d348adc Update api spec 2021-07-19 22:53:02 -07:00
Gabe Kangas af0c6c0cb3 Update admin bundle 2021-07-19 22:04:11 -07:00
Gabe Kangas bae469d513 Remove pointing to admin branch 2021-07-19 21:58:12 -07:00
Gabe Kangas bf4d4c81f9 Add dependencies overview doc 2021-07-19 20:17:31 -07:00
Gabe KangasGitHubOwncastJannikGinger Wongdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Meisam
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
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
Gabe KangasandGitHub 0c6378976c Troubleshoot workflow 2021-07-12 09:13:06 -07:00
Gabe KangasandGitHub 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
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
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 KangasandGitHub 2c2736aef9 Use full path to dependency 2021-06-23 18:20:46 -07:00
Gabe Kangas 610a3ef834 Calm down excessive dependabot updates 2021-06-23 18:17:13 -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 KangasandGitHub 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
Gabe Kangas bb8aea6446 Revert "Consolidate the ping and status request APIs"
This reverts commit b96cd2e93e.
2021-06-20 20:11:21 -07:00
Gabe Kangas f2b2e5c61c Revert "Remove ping requests now that it has been consolidated with status requests"
This reverts commit d9a6be2ac6.
2021-06-20 20:11:21 -07:00
57674206b2 Fix + update external modal (#1106)
* Update external action modal. Uses Micromodal. Closes #1020

* refactor modal handling to isolate loading in modal component

* modal style cleanup

* Remove log

Co-authored-by: Ginger Wong <omqmail@gmail.com>
2021-06-20 17:23:39 -07:00
Gabe Kangas 89dfcfb047 Fix buggy saving of lastDisconnectTime now used for #1111 2021-06-20 11:30:29 -07:00
Gabe Kangas d9a6be2ac6 Remove ping requests now that it has been consolidated with status requests 2021-06-13 14:30:18 -07:00
Gabe Kangas b96cd2e93e Consolidate the ping and status request APIs 2021-06-10 22:07:56 -07:00
Gabe Kangas ba4a4b0b13 Update admin bundle 2021-06-10 15:12:41 -07:00
Gabe Kangas 306a0066d1 Fix concurrency crash. Closes #1067 2021-06-07 21:59:43 -07:00
Gabe Kangas e994412f4b Fix webapp not loading after youtube embed was removed in #1079 2021-06-07 17:36:43 -07:00
Gabe Kangas 5e198bcec6 Add arm64 arch to build targets. Closes #1053 2021-06-05 00:02:34 -07:00
Gabe Kangas dc70642892 Fix missing package.json for load tests 2021-06-04 20:03:11 -07:00
Gabe Kangas a357cc7c09 Update admin bundle 2021-06-04 19:49:37 -07:00
Gabe Kangas fc13f98102 Rebuild frontend js libs 2021-06-04 19:47:59 -07:00
Gabe Kangas 5ef1596d65 Remove extra references to config file 2021-05-27 19:59:33 -07:00
Gabe Kangas 94136d4361 Demote log message 2021-05-24 21:43:13 -07:00
Gabe Kangas 0b40e4db7b Update admin bundle 2021-05-24 16:37:09 -07:00
Gabe Kangas 1a0beb1d0e Fix tests 2021-05-23 14:27:35 -07:00
Gabe Kangas 5cdb6c3417 Create+use logs dir within data dir for logging 2021-05-23 14:24:20 -07:00
Gabe Kangas fd864acab1 Update admin bundle 2021-05-23 00:02:05 -07:00
Gabe Kangas 61e07bf945 API for setting a list of blocked usernames. For #782 2021-05-22 21:50:34 -07:00