owncast/doc/api/index.html

624 lines
1.5 MiB
HTML
Raw Normal View History

2020-10-22 08:42:51 +03:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf8" />
<title>Owncast</title>
<!-- needed for adaptive design -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
padding: 0;
margin: 0;
}
</style>
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-20 05:22:29 +03:00
<script>/*! For license information please see redoc.standalone.js.LICENSE.txt */
2021-09-13 11:27:08 +03:00
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("null")):"function"==typeof define&&define.amd?define(["null"],t):"object"==typeof exports?exports.Redoc=t(require("null")):e.Redoc=t(e.null)}(this,(function(e){return function(){var t={7228:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},2858:function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},3646:function(e,t,n){var r=n(7228);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},1506:function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},4575:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},9100:function(e,t,n){var r=n(9489),o=n(7067);function i(t,n,a){return o()?(e.exports=i=Reflect.construct,e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=i=function(e,t,n){var o=[null];o.push.apply(o,t);var i=new(Function.bind.apply(e,o));return n&&r(i,n.prototype),i},e.exports.default=e.exports,e.exports.__esModule=!0),i.apply(null,arguments)}e.exports=i,e.exports.default=e.exports,e.exports.__esModule=!0},3913:function(e){function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},3269:function(e,t,n){var r=n(379);e.exports=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=r(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}},e.exports.default=e.exports,e.exports.__esModule=!0},9842:function(e,t,n){var r=n(9754),o=n(7067),i=n(8585);e.exports=function(e){var t=o();return function(){var n,o=r(e);if(t){var a=r(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return i(this,n)}},e.exports.default=e.exports,e.exports.__esModule=!0},9713:function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},9754:function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,t(n)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0},2205:function(e,t,n){var r=n(9489);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},430:function(e){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")},e.exports.default=e.exports,e.exports.__esModule=!0},7067:function(e){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.expor
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-20 05:22:29 +03:00
//# sourceMappingURL=redoc.standalone.js.map</script><style data-styled="true" data-styled-version="5.3.0">.egQuEZ{width:calc(100% - 40%);padding:0 40px;}/*!sc*/
@media print,screen and (max-width:75rem){.egQuEZ{width:100%;padding:40px 40px;}}/*!sc*/
.dmghQN{width:calc(100% - 40%);padding:0 40px;}/*!sc*/
@media print,screen and (max-width:75rem){.dmghQN{width:100%;padding:0px 40px;}}/*!sc*/
data-styled.g4[id="sc-hKFxyN"]{content:"egQuEZ,dmghQN,"}/*!sc*/
.fxZJZV{padding:40px 0;}/*!sc*/
.fxZJZV:last-child{min-height:calc(100vh + 1px);}/*!sc*/
.sc-eCApnc > .sc-eCApnc:last-child{min-height:initial;}/*!sc*/
@media print,screen and (max-width:75rem){.fxZJZV{padding:0;}}/*!sc*/
.bJnWIW{padding:40px 0;position:relative;}/*!sc*/
.bJnWIW:last-child{min-height:calc(100vh + 1px);}/*!sc*/
.sc-eCApnc > .sc-eCApnc:last-child{min-height:initial;}/*!sc*/
@media print,screen and (max-width:75rem){.bJnWIW{padding:0;}}/*!sc*/
.bJnWIW:not(:last-of-type):after{position:absolute;bottom:0;width:100%;display:block;content:'';border-bottom:1px solid rgba(0,0,0,0.2);}/*!sc*/
data-styled.g5[id="sc-eCApnc"]{content:"fxZJZV,bJnWIW,"}/*!sc*/
.hsSsLr{width:40%;color:#ffffff;background-color:#263238;padding:0 40px;}/*!sc*/
@media print,screen and (max-width:75rem){.hsSsLr{width:100%;padding:40px 40px;}}/*!sc*/
data-styled.g6[id="sc-jSFjdj"]{content:"hsSsLr,"}/*!sc*/
.gcushC{background-color:#263238;}/*!sc*/
data-styled.g7[id="sc-gKAaRy"]{content:"gcushC,"}/*!sc*/
.KWWXd{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;padding:0;}/*!sc*/
@media print,screen and (max-width:75rem){.KWWXd{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}}/*!sc*/
data-styled.g8[id="sc-iCoGMd"]{content:"KWWXd,"}/*!sc*/
.cTueGk{font-family:Montserrat,sans-serif;font-weight:400;font-size:1.85714em;line-height:1.6em;color:#32329f;}/*!sc*/
data-styled.g9[id="sc-fujyAs"]{content:"cTueGk,"}/*!sc*/
.euRMgx{font-family:Montserrat,sans-serif;font-weight:400;font-size:1.57143em;line-height:1.6em;color:black;}/*!sc*/
data-styled.g10[id="sc-pNWdM"]{content:"euRMgx,"}/*!sc*/
.iXmHCl{color:#ffffff;}/*!sc*/
data-styled.g12[id="sc-kEqXSa"]{content:"iXmHCl,"}/*!sc*/
.eONCmm{border-bottom:1px solid rgba(38,50,56,0.3);margin:1em 0 1em 0;color:rgba(38,50,56,0.5);font-weight:normal;text-transform:uppercase;font-size:0.929em;line-height:20px;}/*!sc*/
data-styled.g13[id="sc-iqAclL"]{content:"eONCmm,"}/*!sc*/
.iUxAWq{cursor:pointer;margin-left:-20px;padding:0;line-height:1;width:20px;display:inline-block;outline:0;}/*!sc*/
.iUxAWq:before{content:'';width:15px;height:15px;background-size:contain;background-image:url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjUxMiIgaGVpZ2h0PSI1MTIiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1MTIgNTEyIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBmaWxsPSIjMDEwMTAxIiBkPSJNNDU5LjcgMjMzLjRsLTkwLjUgOTAuNWMtNTAgNTAtMTMxIDUwLTE4MSAwIC03LjktNy44LTE0LTE2LjctMTkuNC0yNS44bDQyLjEtNDIuMWMyLTIgNC41LTMuMiA2LjgtNC41IDIuOSA5LjkgOCAxOS4zIDE1LjggMjcuMiAyNSAyNSA2NS42IDI0LjkgOTAuNSAwbDkwLjUtOTAuNWMyNS0yNSAyNS02NS42IDAtOTAuNSAtMjQuOS0yNS02NS41LTI1LTkwLjUgMGwtMzIuMiAzMi4yYy0yNi4xLTEwLjItNTQuMi0xMi45LTgxLjYtOC45bDY4LjYtNjguNmM1MC01MCAxMzEtNTAgMTgxIDBDNTA5LjYgMTAyLjMgNTA5LjYgMTgzLjQgNDU5LjcgMjMzLjR6TTIyMC4zIDM4Mi4ybC0zMi4yIDMyLjJjLTI1IDI0LjktNjUuNiAyNC45LTkwLjUgMCAtMjUtMjUtMjUtNjUuNiAwLTkwLjVsOTAuNS05MC41YzI1LTI1IDY1LjUtMjUgOTAuNSAwIDcuOCA3LjggMTIuOSAxNy4yIDE1LjggMjcuMSAyLjQtMS40IDQuOC0yLjUgNi44LTQuNWw0Mi4xLTQyYy01LjQtOS4yLTExLjYtMTgtMTkuNC0yNS44IC01MC01MC0xMzEtNTAtMTgxIDBsLTkwLjUgOTAuNWMtNTAgNTAtNTAgMTMxIDAgMTgxIDUwIDUwIDEzMSA1MCAxODEgMGw2OC42LTY4LjZDMjc0LjYgMzk1LjEgMjQ2LjQgMzkyLjMgMjIwLjMgMzgyLjJ6Ii8+PC9zdmc+Cg==');opacity:0.5;visibility:hidden;display:inline-block;vertical-align:middle;}/*!sc*/
h1:hover > .sc-crzoAE::before,h2:hover > .iUxAWq::before,.iUxAWq:hover::before{visibility:visible;}/*!sc*/
data-styled.g14[id="sc-crzoAE"]{content:"iUxAWq,"}/*!sc*/
.gmNZmS{height:18px;width:18px;vertical-align:middle;float:right;-webkit-transition:-webkit-transform 0.2s ease-out;-webkit-transition:transform 0.2s ease-out;transition:transform 0.2s ease-out;-webkit-transform:rotateZ(-90deg);-ms-transform:rotateZ(-90deg);transform:rotateZ(-90deg);}/*!sc*/
.iFYrlT{height:20px;width:20px;vertical-align:middle;float:right;-webkit-transition:-webkit-transform 0.2s ease-out;-webkit-transition:transform 0.2s ease-out;transition:transform 0.2s ease-out;-webkit-transform:rotateZ(0);-ms-transform:rotateZ(0);transform:rotateZ(0);}/*!sc*/
.iFYrlT polygon{fill:black;}/*!sc*/
.jLtOTj{height:1.5em;width:1.5em;vertical-align:middle;float:left;-webkit-transition:-webkit-transform 0.2s ease-out;-webkit-transition:transform 0.2s ease-out;transition:transform 0.2s ease-out;-webkit-transform:rotateZ(-90deg);-ms-transform:rotateZ(-90deg);transform:rotateZ(-90deg);}/*!sc*/
.jLtOTj polygon{fill:#1d8127;}/*!sc*/
.cEsevO{height:18px;width:18px;vertical-align:middle;-webkit-transition:-webkit-transform 0.2s ease-out;-webkit-transition:transform 0.2s ease-out;transition:transform 0.2s ease-out;-webkit-transform:rotateZ(-90deg);-ms-transform:rotateZ(-90deg);transform:rotateZ(-90deg);}/*!sc*/
2021-09-13 11:27:08 +03:00
.hikpbD{height:1.5em;width:1.5em;vertical-align:middle;float:left;-webkit-transition:-webkit-transform 0.2s ease-out;-webkit-transition:transform 0.2s ease-out;transition:transform 0.2s ease-out;-webkit-transform:rotateZ(-90deg);-ms-transform:rotateZ(-90deg);transform:rotateZ(-90deg);}/*!sc*/
.hikpbD polygon{fill:#d41f1c;}/*!sc*/
data-styled.g15[id="sc-dIsUp"]{content:"gmNZmS,iFYrlT,jLtOTj,cEsevO,hikpbD,"}/*!sc*/
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-20 05:22:29 +03:00
.fABPTr{border-left:1px solid #7c7cbb;box-sizing:border-box;position:relative;padding:10px 10px 10px 0;}/*!sc*/
@media screen and (max-width:50rem){.fABPTr{display:block;overflow:hidden;}}/*!sc*/
tr:first-of-type > .sc-hBMUJo,tr.last > .fABPTr{border-left-width:0;background-position:top left;background-repeat:no-repeat;background-size:1px 100%;}/*!sc*/
tr:first-of-type > .sc-hBMUJo{background-image:linear-gradient( to bottom, transparent 0%, transparent 22px, #7c7cbb 22px, #7c7cbb 100% );}/*!sc*/
tr.last > .sc-hBMUJo{background-image:linear-gradient( to bottom, #7c7cbb 0%, #7c7cbb 22px, transparent 22px, transparent 100% );}/*!sc*/
tr.last + tr > .sc-hBMUJo{border-left-color:transparent;}/*!sc*/
tr.last:first-child > .sc-hBMUJo{background:none;border-left-color:transparent;}/*!sc*/
data-styled.g18[id="sc-hBMUJo"]{content:"fABPTr,"}/*!sc*/
.eQzShU{vertical-align:top;line-height:20px;white-space:nowrap;font-size:13px;font-family:Courier,monospace;}/*!sc*/
.eQzShU.deprecated{-webkit-text-decoration:line-through;text-decoration:line-through;color:#707070;}/*!sc*/
data-styled.g20[id="sc-fFSPTT"]{content:"eQzShU,"}/*!sc*/
.gWxDzL{border-bottom:1px solid #9fb4be;padding:10px 0;width:75%;box-sizing:border-box;}/*!sc*/
tr.expanded .sc-bkbkJK{border-bottom:none;}/*!sc*/
@media screen and (max-width:50rem){.gWxDzL{padding:0 20px;border-bottom:none;border-left:1px solid #7c7cbb;}tr.last > .sc-bkbkJK{border-left:none;}}/*!sc*/
data-styled.g21[id="sc-bkbkJK"]{content:"gWxDzL,"}/*!sc*/
.bcnRwz{color:#7c7cbb;font-family:Courier,monospace;margin-right:10px;}/*!sc*/
.bcnRwz::before{content:'';display:inline-block;vertical-align:middle;width:10px;height:1px;background:#7c7cbb;}/*!sc*/
.bcnRwz::after{content:'';display:inline-block;vertical-align:middle;width:1px;background:#7c7cbb;height:7px;}/*!sc*/
data-styled.g22[id="sc-iemWCZ"]{content:"bcnRwz,"}/*!sc*/
.dYlGyN{border-collapse:separate;border-radius:3px;font-size:14px;border-spacing:0;width:100%;}/*!sc*/
.dYlGyN > tr{vertical-align:middle;}/*!sc*/
@media screen and (max-width:50rem){.dYlGyN{display:block;}.dYlGyN > tr,.dYlGyN > tbody > tr{display:block;}}/*!sc*/
@media screen and (max-width:50rem) and (-ms-high-contrast:none){.dYlGyN td{float:left;width:100%;}}/*!sc*/
.dYlGyN .sc-dIvrsQ,.dYlGyN .sc-dIvrsQ .sc-dIvrsQ .sc-dIvrsQ,.dYlGyN .sc-dIvrsQ .sc-dIvrsQ .sc-dIvrsQ .sc-dIvrsQ .sc-dIvrsQ{margin:1em;margin-right:0;background:#fafafa;}/*!sc*/
.dYlGyN .sc-dIvrsQ .sc-dIvrsQ,.dYlGyN .sc-dIvrsQ .sc-dIvrsQ .sc-dIvrsQ .sc-dIvrsQ,.dYlGyN .sc-dIvrsQ .sc-dIvrsQ .sc-dIvrsQ .sc-dIvrsQ .sc-dIvrsQ .sc-dIvrsQ{background:#ffffff;}/*!sc*/
data-styled.g24[id="sc-hHEiqL"]{content:"dYlGyN,"}/*!sc*/
.jaCkRh{font-size:0.9em;font-family:Courier,monospace;}/*!sc*/
.jaCkRh::after{content:' [';}/*!sc*/
data-styled.g28[id="sc-bCwfaz"]{content:"jaCkRh,"}/*!sc*/
.kHKMOg{font-size:0.9em;font-family:Courier,monospace;}/*!sc*/
.kHKMOg::after{content:']';}/*!sc*/
data-styled.g29[id="sc-iwajpm"]{content:"kHKMOg,"}/*!sc*/
.gNOLNk{background-color:#f5f5f5;border:2px solid #7C7C7C;border-radius:7;cursor:pointer;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;font-size:1em;position:relative;}/*!sc*/
.gNOLNk:hover{border:2px solid #6e6d6d;}/*!sc*/
.gNOLNk:disabled{background-color:#ededed;cursor:unset;}/*!sc*/
data-styled.g30[id="sc-cxNHIi"]{content:"gNOLNk,"}/*!sc*/
.joaceI{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;cursor:inherit;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;height:32px;padding:0 11px;position:relative;width:100%;}/*!sc*/
.joaceI input{background-color:inherit;border:none;font-size:inherit;height:30px;outline:none;width:100%;}/*!sc*/
data-styled.g31[id="sc-lmgQwP"]{content:"joaceI,"}/*!sc*/
.iARuYK{bottom:0;left:11px;position:absolute;right:25px;top:0;}/*!sc*/
data-styled.g32[id="sc-iJCRrE"]{content:"iARuYK,"}/*!sc*/
.csngrC{text-align:left;color:black;bottom:0;left:11px;line-height:30px;overflow:hidden;position:absolute;right:25px;text-overflow:ellipsis;top:0;white-space:nowrap;}/*!sc*/
data-styled.g33[id="sc-giAqHp"]{content:"csngrC,"}/*!sc*/
.hFbBvr{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;bottom:0;color:#808080;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;position:absolute;right:10px;top:0;}/*!sc*/
data-styled.g35[id="sc-bYwzuL"]{content:"hFbBvr,"}/*!sc*/
.iAqBwY{background-color:#ffffff;border:2px solid #6e6d6d;border-radius:4px;box-shadow:0px 4px 4px rgba(0,0,0,0.25);box-sizing:border-box;color:black;display:none;left:0;list-style-type:none;margin:0;max-height:150px;overflow-x:hidden;overflow-y:auto;padding:2px 0;position:absolute;top:100%;width:100%;z-index:9999;}/*!sc*/
.iAqBwY .dropdown-selector-content--empty{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#808080;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;padding:4px 0;}/*!sc*/
.iAqBwY::-webkit-scrollbar{width:5px;}/*!sc*/
.iAqBwY::-webkit-scrollbar-track{background:#ddd;}/*!sc*/
.iAqBwY::-webkit-scrollbar-thumb{background:#666;}/*!sc*/
data-styled.g36[id="sc-kLojOw"]{content:"iAqBwY,"}/*!sc*/
.iyzZle{background-color:#7C7C7C;border:none;color:#f5f5f5;cursor:pointer;font-size:0.95em;overflow:hidden;padding:5px 10px;text-overflow:ellipsis;white-space:nowrap;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}/*!sc*/
.iyzZle:hover{background-color:#7C7C7C;color:#f5f5f5;}/*!sc*/
.iyzZle .option-icon{padding-right:5px;}/*!sc*/
.bbfNvi{background-color:#f5f5f5;border:none;color:inherit;cursor:pointer;font-size:0.95em;overflow:hidden;padding:5px 10px;text-overflow:ellipsis;white-space:nowrap;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}/*!sc*/
.bbfNvi:hover{background-color:#CECECE;}/*!sc*/
.bbfNvi .option-icon{padding-right:5px;}/*!sc*/
data-styled.g40[id="sc-gXfVKN"]{content:"iyzZle,bbfNvi,"}/*!sc*/
.iEFeuB.iEFeuB{box-sizing:border-box;min-width:100px;outline:none;display:inline-block;border-radius:2px;border:1px solid rgba(38,50,56,0.5);vertical-align:bottom;padding:2px 0px 2px 6px;position:relative;width:auto;background:white;color:#263238;font-family:Montserrat,sans-serif;font-size:0.929em;line-height:1.5em;cursor:pointer;-webkit-transition:border 0.25s ease,color 0.25s ease,box-shadow 0.25s ease;transition:border 0.25s ease,color 0.25s ease,box-shadow 0.25s ease;}/*!sc*/
.iEFeuB.iEFeuB:hover,.iEFeuB.iEFeuB:focus-within{border:1px solid #32329f;color:#32329f;box-shadow:0px 0px 0px 1px #32329f;}/*!sc*/
.iEFeuB.iEFeuB .dropdown-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;padding:0;height:auto;padding-right:20px;position:relative;margin-bottom:5px;}/*!sc*/
.iEFeuB.iEFeuB .dropdown-selector-value{font-family:Montserrat,sans-serif;position:relative;font-size:0.929em;width:100%;line-height:1;vertical-align:middle;color:#263238;left:0;-webkit-transition:color 0.25s ease,text-shadow 0.25s ease;transition:color 0.25s ease,text-shadow 0.25s ease;}/*!sc*/
.iEFeuB.iEFeuB .dropdown-arrow{position:absolute;right:3px;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);border-color:#32329f transparent transparent;border-style:solid;border-width:0.35em 0.35em 0;width:0;}/*!sc*/
.iEFeuB.iEFeuB .dropdown-arrow svg{display:none;}/*!sc*/
.iEFeuB.iEFeuB .dropdown-selector-content{position:absolute;margin-top:2px;left:-2px;right:0;z-index:10;min-width:100px;background:white;border:1px solid rgba(38,50,56,0.2);box-shadow:0px 2px 4px 0px rgba(34,36,38,0.12),0px 2px 10px 0px rgba(34,36,38,0.08);max-height:220px;overflow:auto;}/*!sc*/
.iEFeuB.iEFeuB .dropdown-option{font-size:0.9em;color:#263238;cursor:pointer;padding:0.4em;background-color:#ffffff;}/*!sc*/
.iEFeuB.iEFeuB .dropdown-option[aria-selected='true']{background-color:rgba(0,0,0,0.05);}/*!sc*/
.iEFeuB.iEFeuB .dropdown-option:hover{background-color:rgba(38,50,56,0.12);}/*!sc*/
.iEFeuB.iEFeuB input{cursor:pointer;height:1px;background-color:transparent;}/*!sc*/
data-styled.g41[id="sc-cBoqAE"]{content:"iEFeuB,"}/*!sc*/
.joKODG{margin-left:10px;text-transform:none;font-size:0.929em;color:black;}/*!sc*/
data-styled.g43[id="sc-jcwpoC"]{content:"joKODG,"}/*!sc*/
.evYMTo > ul{list-style:none;padding:0;margin:0;margin:0 -5px;}/*!sc*/
.evYMTo > ul > li{padding:5px 10px;display:inline-block;background-color:#11171a;border-bottom:1px solid rgba(0,0,0,0.5);cursor:pointer;text-align:center;outline:none;color:#ccc;margin:0 5px 5px 5px;border:1px solid #07090b;border-radius:5px;min-width:60px;font-size:0.9em;font-weight:bold;}/*!sc*/
.evYMTo > ul > li.react-tabs__tab--selected{color:#333333;background:#ffffff;}/*!sc*/
.evYMTo > ul > li.react-tabs__tab--selected:focus{outline:auto;}/*!sc*/
.evYMTo > ul > li:only-child{-webkit-flex:none;-ms-flex:none;flex:none;min-width:100px;}/*!sc*/
.evYMTo > ul > li.tab-success{color:#1d8127;}/*!sc*/
.evYMTo > ul > li.tab-redirect{color:#ffa500;}/*!sc*/
.evYMTo > ul > li.tab-info{color:#87ceeb;}/*!sc*/
.evYMTo > ul > li.tab-error{color:#d41f1c;}/*!sc*/
.evYMTo > .react-tabs__tab-panel{background:#11171a;}/*!sc*/
.evYMTo > .react-tabs__tab-panel > div,.evYMTo > .react-tabs__tab-panel > pre{padding:20px;margin:0;}/*!sc*/
.evYMTo > .react-tabs__tab-panel > div > pre{padding:0;}/*!sc*/
data-styled.g44[id="sc-carFqZ"]{content:"evYMTo,"}/*!sc*/
.dFWqin code[class*='language-'],.dFWqin pre[class*='language-']{text-shadow:0 -0.1em 0.2em black;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;}/*!sc*/
@media print{.dFWqin code[class*='language-'],.dFWqin pre[class*='language-']{text-shadow:none;}}/*!sc*/
.dFWqin pre[class*='language-']{padding:1em;margin:0.5em 0;overflow:auto;}/*!sc*/
.dFWqin .token.comment,.dFWqin .token.prolog,.dFWqin .token.doctype,.dFWqin .token.cdata{color:hsl(30,20%,50%);}/*!sc*/
.dFWqin .token.punctuation{opacity:0.7;}/*!sc*/
.dFWqin .namespace{opacity:0.7;}/*!sc*/
.dFWqin .token.property,.dFWqin .token.tag,.dFWqin .token.number,.dFWqin .token.constant,.dFWqin .token.symbol{color:#4a8bb3;}/*!sc*/
.dFWqin .token.boolean{color:#e64441;}/*!sc*/
.dFWqin .token.selector,.dFWqin .token.attr-name,.dFWqin .token.string,.dFWqin .token.char,.dFWqin .token.builtin,.dFWqin .token.inserted{color:#a0fbaa;}/*!sc*/
.dFWqin .token.selector + a,.dFWqin .token.attr-name + a,.dFWqin .token.string + a,.dFWqin .token.char + a,.dFWqin .token.builtin + a,.dFWqin .token.inserted + a,.dFWqin .token.selector + a:visited,.dFWqin .token.attr-name + a:visited,.dFWqin .token.string + a:visited,.dFWqin .token.char + a:visited,.dFWqin .token.builtin + a:visited,.dFWqin .token.inserted + a:visited{color:#4ed2ba;-webkit-text-decoration:underline;text-decoration:underline;}/*!sc*/
.dFWqin .token.property.string{color:white;}/*!sc*/
.dFWqin .token.operator,.dFWqin .token.entity,.dFWqin .token.url,.dFWqin .token.variable{color:hsl(40,90%,60%);}/*!sc*/
.dFWqin .token.atrule,.dFWqin .token.attr-value,.dFWqin .token.keyword{color:hsl(350,40%,70%);}/*!sc*/
.dFWqin .token.regex,.dFWqin .token.important{color:#e90;}/*!sc*/
.dFWqin .token.important,.dFWqin .token.bold{font-weight:bold;}/*!sc*/
.dFWqin .token.italic{font-style:italic;}/*!sc*/
.dFWqin .token.entity{cursor:help;}/*!sc*/
.dFWqin .token.deleted{color:red;}/*!sc*/
data-styled.g46[id="sc-iBzEeX"]{content:"dFWqin,"}/*!sc*/
.eQQUSD{opacity:0.7;-webkit-transition:opacity 0.3s ease;transition:opacity 0.3s ease;text-align:right;}/*!sc*/
.eQQUSD:focus-within{opacity:1;}/*!sc*/
.eQQUSD > button{background-color:transparent;border:0;color:inherit;padding:2px 10px;font-family:Roboto,sans-serif;font-size:14px;line-height:1.5em;cursor:pointer;outline:0;}/*!sc*/
.eQQUSD > button:hover,.eQQUSD > button:focus{background:rgba(255,255,255,0.1);}/*!sc*/
data-styled.g47[id="sc-efHYUO"]{content:"eQQUSD,"}/*!sc*/
2020-10-22 08:42:51 +03:00
.ps{overflow:hidden !important;overflow-anchor:none;-ms-overflow-style:none;touch-action:auto;-ms-touch-action:auto;}/*!sc*/
.ps__rail-x{display:none;opacity:0;-webkit-transition:background-color .2s linear,opacity .2s linear;transition:background-color .2s linear,opacity .2s linear;-webkit-transition:background-color .2s linear,opacity .2s linear;height:15px;bottom:0px;position:absolute;}/*!sc*/
.ps__rail-y{display:none;opacity:0;-webkit-transition:background-color .2s linear,opacity .2s linear;transition:background-color .2s linear,opacity .2s linear;-webkit-transition:background-color .2s linear,opacity .2s linear;width:15px;right:0;position:absolute;}/*!sc*/
.ps--active-x > .ps__rail-x,.ps--active-y > .ps__rail-y{display:block;background-color:transparent;}/*!sc*/
.ps:hover > .ps__rail-x,.ps:hover > .ps__rail-y,.ps--focus > .ps__rail-x,.ps--focus > .ps__rail-y,.ps--scrolling-x > .ps__rail-x,.ps--scrolling-y > .ps__rail-y{opacity:0.6;}/*!sc*/
.ps .ps__rail-x:hover,.ps .ps__rail-y:hover,.ps .ps__rail-x:focus,.ps .ps__rail-y:focus,.ps .ps__rail-x.ps--clicking,.ps .ps__rail-y.ps--clicking{background-color:#eee;opacity:0.9;}/*!sc*/
.ps__thumb-x{background-color:#aaa;border-radius:6px;-webkit-transition:background-color .2s linear,height .2s ease-in-out;transition:background-color .2s linear,height .2s ease-in-out;-webkit-transition:background-color .2s linear,height .2s ease-in-out;height:6px;bottom:2px;position:absolute;}/*!sc*/
.ps__thumb-y{background-color:#aaa;border-radius:6px;-webkit-transition:background-color .2s linear,width .2s ease-in-out;transition:background-color .2s linear,width .2s ease-in-out;-webkit-transition:background-color .2s linear,width .2s ease-in-out;width:6px;right:2px;position:absolute;}/*!sc*/
.ps__rail-x:hover > .ps__thumb-x,.ps__rail-x:focus > .ps__thumb-x,.ps__rail-x.ps--clicking .ps__thumb-x{background-color:#999;height:11px;}/*!sc*/
.ps__rail-y:hover > .ps__thumb-y,.ps__rail-y:focus > .ps__thumb-y,.ps__rail-y.ps--clicking .ps__thumb-y{background-color:#999;width:11px;}/*!sc*/
@supports (-ms-overflow-style:none){.ps{overflow:auto !important;}}/*!sc*/
@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){.ps{overflow:auto !important;}}/*!sc*/
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-20 05:22:29 +03:00
data-styled.g51[id="sc-global-kjwiXH1"]{content:"sc-global-kjwiXH1,"}/*!sc*/
.bIbZvd{position:relative;}/*!sc*/
data-styled.g52[id="sc-bBjRSN"]{content:"bIbZvd,"}/*!sc*/
.bHzJuy{font-family:Roboto,sans-serif;font-weight:400;line-height:1.5em;}/*!sc*/
.bHzJuy p:last-child{margin-bottom:0;}/*!sc*/
.bHzJuy h1{font-family:Montserrat,sans-serif;font-weight:400;font-size:1.85714em;line-height:1.6em;color:#32329f;margin-top:0;}/*!sc*/
.bHzJuy h2{font-family:Montserrat,sans-serif;font-weight:400;font-size:1.57143em;line-height:1.6em;color:#333333;}/*!sc*/
.bHzJuy code{color:#e53935;background-color:rgba(38,50,56,0.05);font-family:Courier,monospace;border-radius:2px;border:1px solid rgba(38,50,56,0.1);padding:0 5px;font-size:13px;font-weight:400;word-break:break-word;}/*!sc*/
.bHzJuy pre{font-family:Courier,monospace;white-space:pre;background-color:#11171a;color:white;padding:20px;overflow-x:auto;line-height:normal;border-radius:0px;border:1px solid rgba(38,50,56,0.1);}/*!sc*/
.bHzJuy pre code{background-color:transparent;color:white;padding:0;}/*!sc*/
.bHzJuy pre code:before,.bHzJuy pre code:after{content:none;}/*!sc*/
.bHzJuy blockquote{margin:0;margin-bottom:1em;padding:0 15px;color:#777;border-left:4px solid #ddd;}/*!sc*/
.bHzJuy img{max-width:100%;box-sizing:content-box;}/*!sc*/
.bHzJuy ul,.bHzJuy ol{padding-left:2em;margin:0;margin-bottom:1em;}/*!sc*/
.bHzJuy ul ul,.bHzJuy ol ul,.bHzJuy ul ol,.bHzJuy ol ol{margin-bottom:0;margin-top:0;}/*!sc*/
.bHzJuy table{display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all;border-collapse:collapse;border-spacing:0;margin-top:1.5em;margin-bottom:1.5em;}/*!sc*/
.bHzJuy table tr{background-color:#fff;border-top:1px solid #ccc;}/*!sc*/
.bHzJuy table tr:nth-child(2n){background-color:#fafafa;}/*!sc*/
.bHzJuy table th,.bHzJuy table td{padding:6px 13px;border:1px solid #ddd;}/*!sc*/
.bHzJuy table th{text-align:left;font-weight:bold;}/*!sc*/
.bHzJuy .share-link{cursor:pointer;margin-left:-20px;padding:0;line-height:1;width:20px;display:inline-block;outline:0;}/*!sc*/
.bHzJuy .share-link:before{content:'';width:15px;height:15px;background-size:contain;background-image:url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjUxMiIgaGVpZ2h0PSI1MTIiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1MTIgNTEyIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBmaWxsPSIjMDEwMTAxIiBkPSJNNDU5LjcgMjMzLjRsLTkwLjUgOTAuNWMtNTAgNTAtMTMxIDUwLTE4MSAwIC03LjktNy44LTE0LTE2LjctMTkuNC0yNS44bDQyLjEtNDIuMWMyLTIgNC41LTMuMiA2LjgtNC41IDIuOSA5LjkgOCAxOS4zIDE1LjggMjcuMiAyNSAyNSA2NS42IDI0LjkgOTAuNSAwbDkwLjUtOTAuNWMyNS0yNSAyNS02NS42IDAtOTAuNSAtMjQuOS0yNS02NS41LTI1LTkwLjUgMGwtMzIuMiAzMi4yYy0yNi4xLTEwLjItNTQuMi0xMi45LTgxLjYtOC45bDY4LjYtNjguNmM1MC01MCAxMzEtNTAgMTgxIDBDNTA5LjYgMTAyLjMgNTA5LjYgMTgzLjQgNDU5LjcgMjMzLjR6TTIyMC4zIDM4Mi4ybC0zMi4yIDMyLjJjLTI1IDI0LjktNjUuNiAyNC45LTkwLjUgMCAtMjUtMjUtMjUtNjUuNiAwLTkwLjVsOTAuNS05MC41YzI1LTI1IDY1LjUtMjUgOTAuNSAwIDcuOCA3LjggMTIuOSAxNy4yIDE1LjggMjcuMSAyLjQtMS40IDQuOC0yLjUgNi44LTQuNWw0Mi4xLTQyYy01LjQtOS4yLTExLjYtMTgtMTkuNC0yNS44IC01MC01MC0xMzEtNTAtMTgxIDBsLTkwLjUgOTAuNWMtNTAgNTAtNTAgMTMxIDAgMTgxIDUwIDUwIDEzMSA1MCAxODEgMGw2OC42LTY4LjZDMjc0LjYgMzk1LjEgMjQ2LjQgMzkyLjMgMjIwLjMgMzgyLjJ6Ii8+PC9zdmc+Cg==');opacity:0.5;visibility:hidden;display:inline-block;vertical-align:middle;}/*!sc*/
.bHzJuy h1:hover > .share-link::before,.bHzJuy h2:hover > .share-link::before,.bHzJuy .share-link:hover::before{visibility:visible;}/*!sc*/
.bHzJuy a{-webkit-text-decoration:none;text-decoration:none;color:#32329f;}/*!sc*/
.bHzJuy a:visited{color:#32329f;}/*!sc*/
.bHzJuy a:hover{color:#6868cf;}/*!sc*/
.cJyzuM{font-family:Roboto,sans-serif;font-weight:400;line-height:1.5em;}/*!sc*/
.cJyzuM p:last-child{margin-bottom:0;}/*!sc*/
.cJyzuM p:first-child{margin-top:0;}/*!sc*/
.cJyzuM p:last-child{margin-bottom:0;}/*!sc*/
.cJyzuM h1{font-family:Montserrat,sans-serif;font-weight:400;font-size:1.85714em;line-height:1.6em;color:#32329f;margin-top:0;}/*!sc*/
.cJyzuM h2{font-family:Montserrat,sans-serif;font-weight:400;font-size:1.57143em;line-height:1.6em;color:#333333;}/*!sc*/
.cJyzuM code{color:#e53935;background-color:rgba(38,50,56,0.05);font-family:Courier,monospace;border-radius:2px;border:1px solid rgba(38,50,56,0.1);padding:0 5px;font-size:13px;font-weight:400;word-break:break-word;}/*!sc*/
.cJyzuM pre{font-family:Courier,monospace;white-space:pre;background-color:#11171a;color:white;padding:20px;overflow-x:auto;line-height:normal;border-radius:0px;border:1px solid rgba(38,50,56,0.1);}/*!sc*/
.cJyzuM pre code{background-color:transparent;color:white;padding:0;}/*!sc*/
.cJyzuM pre code:before,.cJyzuM pre code:after{content:none;}/*!sc*/
.cJyzuM blockquote{margin:0;margin-bottom:1em;padding:0 15px;color:#777;border-left:4px solid #ddd;}/*!sc*/
.cJyzuM img{max-width:100%;box-sizing:content-box;}/*!sc*/
.cJyzuM ul,.cJyzuM ol{padding-left:2em;margin:0;margin-bottom:1em;}/*!sc*/
.cJyzuM ul ul,.cJyzuM ol ul,.cJyzuM ul ol,.cJyzuM ol ol{margin-bottom:0;margin-top:0;}/*!sc*/
.cJyzuM table{display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all;border-collapse:collapse;border-spacing:0;margin-top:1.5em;margin-bottom:1.5em;}/*!sc*/
.cJyzuM table tr{background-color:#fff;border-top:1px solid #ccc;}/*!sc*/
.cJyzuM table tr:nth-child(2n){background-color:#fafafa;}/*!sc*/
.cJyzuM table th,.cJyzuM table td{padding:6px 13px;border:1px solid #ddd;}/*!sc*/
.cJyzuM table th{text-align:left;font-weight:bold;}/*!sc*/
.cJyzuM .share-link{cursor:pointer;margin-left:-20px;padding:0;line-height:1;width:20px;display:inline-block;outline:0;}/*!sc*/
.cJyzuM .share-link:before{content:'';width:15px;height:15px;background-size:contain;background-image:url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjUxMiIgaGVpZ2h0PSI1MTIiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1MTIgNTEyIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBmaWxsPSIjMDEwMTAxIiBkPSJNNDU5LjcgMjMzLjRsLTkwLjUgOTAuNWMtNTAgNTAtMTMxIDUwLTE4MSAwIC03LjktNy44LTE0LTE2LjctMTkuNC0yNS44bDQyLjEtNDIuMWMyLTIgNC41LTMuMiA2LjgtNC41IDIuOSA5LjkgOCAxOS4zIDE1LjggMjcuMiAyNSAyNSA2NS42IDI0LjkgOTAuNSAwbDkwLjUtOTAuNWMyNS0yNSAyNS02NS42IDAtOTAuNSAtMjQuOS0yNS02NS41LTI1LTkwLjUgMGwtMzIuMiAzMi4yYy0yNi4xLTEwLjItNTQuMi0xMi45LTgxLjYtOC45bDY4LjYtNjguNmM1MC01MCAxMzEtNTAgMTgxIDBDNTA5LjYgMTAyLjMgNTA5LjYgMTgzLjQgNDU5LjcgMjMzLjR6TTIyMC4zIDM4Mi4ybC0zMi4yIDMyLjJjLTI1IDI0LjktNjUuNiAyNC45LTkwLjUgMCAtMjUtMjUtMjUtNjUuNiAwLTkwLjVsOTAuNS05MC41YzI1LTI1IDY1LjUtMjUgOTAuNSAwIDcuOCA3LjggMTIuOSAxNy4yIDE1LjggMjcuMSAyLjQtMS40IDQuOC0yLjUgNi44LTQuNWw0Mi4xLTQyYy01LjQtOS4yLTExLjYtMTgtMTkuNC0yNS44IC01MC01MC0xMzEtNTAtMTgxIDBsLTkwLjUgOTAuNWMtNTAgNTAtNTAgMTMxIDAgMTgxIDUwIDUwIDEzMSA1MCAxODEgMGw2OC42LTY4LjZDMjc0LjYgMzk1LjEgMjQ2LjQgMzkyLjMgMjIwLjMgMzgyLjJ6Ii8+PC9zdmc+Cg==');opacity:0.5;visibility:hidden;display:inline-block;vertical-align:middle;}/*!sc*/
.cJyzuM h1:hover > .share-link::before,.cJyzuM h2:hover > .share-link::before,.cJyzuM .share-link:hover::before{visibility:visible;}/*!sc*/
.cJyzuM a{-webkit-text-decoration:none;text-decoration:none;color:#32329f;}/*!sc*/
.cJyzuM a:visited{color:#32329f;}/*!sc*/
.cJyzuM a:hover{color:#6868cf;}/*!sc*/
data-styled.g53[id="sc-cOifOu"]{content:"bHzJuy,cJyzuM,"}/*!sc*/
.dXjyFC{font-family:Roboto,sans-serif;font-weight:400;line-height:1.5em;}/*!sc*/
.dXjyFC p:last-child{margin-bottom:0;}/*!sc*/
.dXjyFC p:first-child{margin-top:0;}/*!sc*/
.dXjyFC p:last-child{margin-bottom:0;}/*!sc*/
.dXjyFC p{display:inline-block;}/*!sc*/
.dXjyFC h1{font-family:Montserrat,sans-serif;font-weight:400;font-size:1.85714em;line-height:1.6em;color:#32329f;margin-top:0;}/*!sc*/
.dXjyFC h2{font-family:Montserrat,sans-serif;font-weight:400;font-size:1.57143em;line-height:1.6em;color:#333333;}/*!sc*/
.dXjyFC code{color:#e53935;background-color:rgba(38,50,56,0.05);font-family:Courier,monospace;border-radius:2px;border:1px solid rgba(38,50,56,0.1);padding:0 5px;font-size:13px;font-weight:400;word-break:break-word;}/*!sc*/
.dXjyFC pre{font-family:Courier,monospace;white-space:pre;background-color:#11171a;color:white;padding:20px;overflow-x:auto;line-height:normal;border-radius:0px;border:1px solid rgba(38,50,56,0.1);}/*!sc*/
.dXjyFC pre code{background-color:transparent;color:white;padding:0;}/*!sc*/
.dXjyFC pre code:before,.dXjyFC pre code:after{content:none;}/*!sc*/
.dXjyFC blockquote{margin:0;margin-bottom:1em;padding:0 15px;color:#777;border-left:4px solid #ddd;}/*!sc*/
.dXjyFC img{max-width:100%;box-sizing:content-box;}/*!sc*/
.dXjyFC ul,.dXjyFC ol{padding-left:2em;margin:0;margin-bottom:1em;}/*!sc*/
.dXjyFC ul ul,.dXjyFC ol ul,.dXjyFC ul ol,.dXjyFC ol ol{margin-bottom:0;margin-top:0;}/*!sc*/
.dXjyFC table{display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all;border-collapse:collapse;border-spacing:0;margin-top:1.5em;margin-bottom:1.5em;}/*!sc*/
.dXjyFC table tr{background-color:#fff;border-top:1px solid #ccc;}/*!sc*/
.dXjyFC table tr:nth-child(2n){background-color:#fafafa;}/*!sc*/
.dXjyFC table th,.dXjyFC table td{padding:6px 13px;border:1px solid #ddd;}/*!sc*/
.dXjyFC table th{text-align:left;font-weight:bold;}/*!sc*/
.dXjyFC .share-link{cursor:pointer;margin-left:-20px;padding:0;line-height:1;width:20px;display:inline-block;outline:0;}/*!sc*/
.dXjyFC .share-link:before{content:'';width:15px;height:15px;background-size:contain;background-image:url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjUxMiIgaGVpZ2h0PSI1MTIiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1MTIgNTEyIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBmaWxsPSIjMDEwMTAxIiBkPSJNNDU5LjcgMjMzLjRsLTkwLjUgOTAuNWMtNTAgNTAtMTMxIDUwLTE4MSAwIC03LjktNy44LTE0LTE2LjctMTkuNC0yNS44bDQyLjEtNDIuMWMyLTIgNC41LTMuMiA2LjgtNC41IDIuOSA5LjkgOCAxOS4zIDE1LjggMjcuMiAyNSAyNSA2NS42IDI0LjkgOTAuNSAwbDkwLjUtOTAuNWMyNS0yNSAyNS02NS42IDAtOTAuNSAtMjQuOS0yNS02NS41LTI1LTkwLjUgMGwtMzIuMiAzMi4yYy0yNi4xLTEwLjItNTQuMi0xMi45LTgxLjYtOC45bDY4LjYtNjguNmM1MC01MCAxMzEtNTAgMTgxIDBDNTA5LjYgMTAyLjMgNTA5LjYgMTgzLjQgNDU5LjcgMjMzLjR6TTIyMC4zIDM4Mi4ybC0zMi4yIDMyLjJjLTI1IDI0LjktNjUuNiAyNC45LTkwLjUgMCAtMjUtMjUtMjUtNjUuNiAwLTkwLjVsOTAuNS05MC41YzI1LTI1IDY1LjUtMjUgOTAuNSAwIDcuOCA3LjggMTIuOSAxNy4yIDE1LjggMjcuMSAyLjQtMS40IDQuOC0yLjUgNi44LTQuNWw0Mi4xLTQyYy01LjQtOS4yLTExLjYtMTgtMTkuNC0yNS44IC01MC01MC0xMzEtNTAtMTgxIDBsLTkwLjUgOTAuNWMtNTAgNTAtNTAgMTMxIDAgMTgxIDUwIDUwIDEzMSA1MCAxODEgMGw2OC42LTY4LjZDMjc0LjYgMzk1LjEgMjQ2LjQgMzkyLjMgMjIwLjMgMzgyLjJ6Ii8+PC9zdmc+Cg==');opacity:0.5;visibility:hidden;display:inline-block;vertical-align:middle;}/*!sc*/
.dXjyFC h1:hover > .share-link::before,.dXjyFC h2:hover > .share-link::before,.dXjyFC .share-link:hover::before{visibility:visible;}/*!sc*/
.dXjyFC a{-webkit-text-decoration:none;text-decoration:none;color:#32329f;}/*!sc*/
.dXjyFC a:visited{color:#32329f;}/*!sc*/
.dXjyFC a:hover{color:#6868cf;}/*!sc*/
data-styled.g54[id="sc-Arkif"]{content:"dXjyFC,"}/*!sc*/
.llGFDD{position:relative;}/*!sc*/
data-styled.g55[id="sc-khIgEk"]{content:"llGFDD,"}/*!sc*/
.cVHUjN:hover > .sc-efHYUO{opacity:1;}/*!sc*/
data-styled.g60[id="sc-iNiQyp"]{content:"cVHUjN,"}/*!sc*/
.fqzhkP{font-family:Courier,monospace;font-size:13px;white-space:pre;contain:content;overflow-x:auto;}/*!sc*/
.fqzhkP .redoc-json code > .collapser{display:none;pointer-events:none;}/*!sc*/
.fqzhkP .callback-function{color:gray;}/*!sc*/
.fqzhkP .collapser:after{content:'-';cursor:pointer;}/*!sc*/
.fqzhkP .collapsed > .collapser:after{content:'+';cursor:pointer;}/*!sc*/
.fqzhkP .ellipsis:after{content:' … ';}/*!sc*/
.fqzhkP .collapsible{margin-left:2em;}/*!sc*/
.fqzhkP .hoverable{padding-top:1px;padding-bottom:1px;padding-left:2px;padding-right:2px;border-radius:2px;}/*!sc*/
.fqzhkP .hovered{background-color:rgba(235,238,249,1);}/*!sc*/
.fqzhkP .collapser{background-color:transparent;border:0;color:#fff;font-family:Courier,monospace;font-size:13px;padding-right:6px;padding-left:6px;padding-top:0;padding-bottom:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;width:15px;height:15px;position:absolute;top:4px;left:-1.5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none;padding:2px;}/*!sc*/
.fqzhkP .collapser:focus{outline-color:#fff;outline-style:dotted;outline-width:1px;}/*!sc*/
.fqzhkP ul{list-style-type:none;padding:0px;margin:0px 0px 0px 26px;}/*!sc*/
.fqzhkP li{position:relative;display:block;}/*!sc*/
.fqzhkP .hoverable{display:inline-block;}/*!sc*/
.fqzhkP .selected{outline-style:solid;outline-width:1px;outline-style:dotted;}/*!sc*/
.fqzhkP .collapsed > .collapsible{display:none;}/*!sc*/
.fqzhkP .ellipsis{display:none;}/*!sc*/
.fqzhkP .collapsed > .ellipsis{display:inherit;}/*!sc*/
data-styled.g61[id="sc-jffHpj"]{content:"fqzhkP,"}/*!sc*/
.jzRrfm{padding:0.9em;background-color:rgba(38,50,56,0.4);margin:0 0 10px 0;display:block;font-family:Montserrat,sans-serif;font-size:0.929em;line-height:1.5em;}/*!sc*/
data-styled.g62[id="sc-eJocfa"]{content:"jzRrfm,"}/*!sc*/
.bmwRob{font-family:Montserrat,sans-serif;font-size:12px;position:absolute;z-index:1;top:-11px;left:12px;font-weight:600;color:rgba(255,255,255,0.7);}/*!sc*/
data-styled.g63[id="sc-oeezt"]{content:"bmwRob,"}/*!sc*/
.lhdonw{position:relative;}/*!sc*/
data-styled.g64[id="sc-hhIiOg"]{content:"lhdonw,"}/*!sc*/
.iULjjV.iULjjV{margin-left:10px;text-transform:none;font-size:0.929em;margin:0 0 10px 0;display:block;background-color:rgba(38,50,56,0.4);font-size:1em;border:none;padding:0.9em 1.6em 0.9em 0.9em;box-shadow:none;}/*!sc*/
.iULjjV.iULjjV:hover,.iULjjV.iULjjV:focus-within{border:none;box-shadow:none;}/*!sc*/
.iULjjV.iULjjV:focus-within{background-color:rgba(38,50,56,0.7);}/*!sc*/
.iULjjV.iULjjV .dropdown-arrow{border-top-color:#ffffff;}/*!sc*/
.iULjjV.iULjjV .dropdown-selector-value{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:#ffffff;}/*!sc*/
.iULjjV.iULjjV .dropdown-selector-content{margin:0;margin-top:2px;}/*!sc*/
.iULjjV.iULjjV .dropdown-selector-content .dropdown-option{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;}/*!sc*/
data-styled.g65[id="sc-eirqVv"]{content:"iULjjV,"}/*!sc*/
.hINeXe{margin-top:15px;}/*!sc*/
data-styled.g67[id="sc-gGLxEB"]{content:"hINeXe,"}/*!sc*/
.ihkizP button{background-color:transparent;border:0;outline:0;font-size:13px;font-family:Courier,monospace;cursor:pointer;padding:0;color:#333333;}/*!sc*/
.ihkizP button:focus{font-weight:600;}/*!sc*/
.ihkizP .sc-dIsUp{height:1.1em;width:1.1em;}/*!sc*/
.ihkizP .sc-dIsUp polygon{fill:#666;}/*!sc*/
data-styled.g68[id="sc-ckTSus"]{content:"ihkizP,"}/*!sc*/
.CMpTe{vertical-align:middle;font-size:13px;line-height:20px;}/*!sc*/
data-styled.g69[id="sc-fbIWvP"]{content:"CMpTe,"}/*!sc*/
.bBFKjV{color:rgba(102,102,102,0.9);}/*!sc*/
data-styled.g70[id="sc-FRrlG"]{content:"bBFKjV,"}/*!sc*/
.gJKPGC{color:#666;}/*!sc*/
data-styled.g71[id="sc-fXazdy"]{content:"gJKPGC,"}/*!sc*/
.hUSnpT{vertical-align:middle;font-size:13px;line-height:20px;}/*!sc*/
data-styled.g73[id="sc-TtZnY"]{content:"hUSnpT,"}/*!sc*/
.bsGeIE{color:#d41f1c;font-size:0.9em;font-weight:normal;margin-left:20px;line-height:1;}/*!sc*/
data-styled.g74[id="sc-jHNicF"]{content:"bsGeIE,"}/*!sc*/
.iglPxx{padding-left:10px;}/*!sc*/
data-styled.g85[id="sc-jQAxuV"]{content:"iglPxx,"}/*!sc*/
.ikafbi{margin-top:0;margin-bottom:0.5em;}/*!sc*/
data-styled.g87[id="sc-fcmMJX"]{content:"ikafbi,"}/*!sc*/
.ksfJAW{border:1px solid #32329f;color:#32329f;font-weight:normal;margin-left:0.5em;padding:4px 8px 4px;display:inline-block;-webkit-text-decoration:none;text-decoration:none;cursor:pointer;}/*!sc*/
data-styled.g88[id="sc-GvhzO"]{content:"ksfJAW,"}/*!sc*/
.gCgqqY::before{content:'|';display:inline-block;opacity:0.5;width:15px;text-align:center;}/*!sc*/
.gCgqqY:last-child::after{display:none;}/*!sc*/
data-styled.g89[id="sc-gsWcmt"]{content:"gCgqqY,"}/*!sc*/
.ePwgUU{overflow:hidden;}/*!sc*/
data-styled.g90[id="sc-bXexck"]{content:"ePwgUU,"}/*!sc*/
.hDhyRZ{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-left:-15px;}/*!sc*/
data-styled.g91[id="sc-eGJWMs"]{content:"hDhyRZ,"}/*!sc*/
.eNEvTA{max-height:260px;max-width:260px;padding:2px;width:100%;display:block;}/*!sc*/
data-styled.g92[id="sc-csTbgd"]{content:"eNEvTA,"}/*!sc*/
.hNMhDm{text-align:center;}/*!sc*/
data-styled.g93[id="sc-dFRpbK"]{content:"hNMhDm,"}/*!sc*/
.cnsJiC{display:inline-block;}/*!sc*/
data-styled.g94[id="sc-bsatvv"]{content:"cnsJiC,"}/*!sc*/
.lkJIic{width:9ex;display:inline-block;height:13px;line-height:13px;background-color:#333;border-radius:3px;background-repeat:no-repeat;background-position:6px 4px;font-size:7px;font-family:Verdana,sans-serif;color:white;text-transform:uppercase;text-align:center;font-weight:bold;vertical-align:middle;margin-right:6px;margin-top:2px;}/*!sc*/
.lkJIic.get{background-color:#2F8132;}/*!sc*/
.lkJIic.post{background-color:#186FAF;}/*!sc*/
.lkJIic.put{background-color:#95507c;}/*!sc*/
.lkJIic.options{background-color:#947014;}/*!sc*/
.lkJIic.patch{background-color:#bf581d;}/*!sc*/
.lkJIic.delete{background-color:#cc3333;}/*!sc*/
.lkJIic.basic{background-color:#707070;}/*!sc*/
.lkJIic.link{background-color:#07818F;}/*!sc*/
.lkJIic.head{background-color:#A23DAD;}/*!sc*/
.lkJIic.hook{background-color:#32329f;}/*!sc*/
data-styled.g95[id="sc-gIvpjk"]{content:"lkJIic,"}/*!sc*/
.jxJlxZ{margin:0;padding:0;}/*!sc*/
.sc-euEtCV .sc-euEtCV{font-size:0.929em;}/*!sc*/
.gaEEuU{margin:0;padding:0;display:none;}/*!sc*/
.sc-euEtCV .sc-euEtCV{font-size:0.929em;}/*!sc*/
data-styled.g96[id="sc-euEtCV"]{content:"jxJlxZ,gaEEuU,"}/*!sc*/
.cTzVOd{list-style:none inside none;overflow:hidden;text-overflow:ellipsis;padding:0;}/*!sc*/
data-styled.g97[id="sc-fHCHyC"]{content:"cTzVOd,"}/*!sc*/
.pcWDP{cursor:pointer;color:#333333;margin:0;padding:12.5px 20px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;font-family:Montserrat,sans-serif;font-size:0.929em;text-transform:none;}/*!sc*/
.pcWDP:hover{color:#32329f;}/*!sc*/
.pcWDP:hover{background-color:#ededed;}/*!sc*/
.pcWDP .sc-dIsUp{height:1.5em;width:1.5em;}/*!sc*/
.pcWDP .sc-dIsUp polygon{fill:#333333;}/*!sc*/
.jolsGY{cursor:pointer;color:#333333;margin:0;padding:12.5px 20px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;font-family:Montserrat,sans-serif;color:#333333;}/*!sc*/
.jolsGY:hover{background-color:#e1e1e1;}/*!sc*/
.jolsGY .sc-dIsUp{height:1.5em;width:1.5em;}/*!sc*/
.jolsGY .sc-dIsUp polygon{fill:#333333;}/*!sc*/
data-styled.g98[id="sc-dtLLSn"]{content:"pcWDP,jolsGY,"}/*!sc*/
.hHRjJL{display:inline-block;vertical-align:middle;width:auto;overflow:hidden;text-overflow:ellipsis;}/*!sc*/
.ipvKNC{display:inline-block;vertical-align:middle;width:calc(100% - 38px);overflow:hidden;text-overflow:ellipsis;}/*!sc*/
data-styled.g99[id="sc-dkQUaI"]{content:"hHRjJL,ipvKNC,"}/*!sc*/
.gKXwn{font-size:0.8em;margin-top:10px;padding:0 20px;text-align:left;opacity:0.7;}/*!sc*/
.gKXwn a,.gKXwn a:visited,.gKXwn a:hover{color:#333333 !important;border-top:1px solid #e1e1e1;padding:5px 0;display:block;}/*!sc*/
data-styled.g100[id="sc-WZYut"]{content:"gKXwn,"}/*!sc*/
.jdCbTS{cursor:pointer;position:relative;margin-bottom:5px;}/*!sc*/
data-styled.g106[id="sc-kYPZxB"]{content:"jdCbTS,"}/*!sc*/
.jRjoAh{font-family:Courier,monospace;margin-left:10px;-webkit-flex:1;-ms-flex:1;flex:1;overflow-x:hidden;text-overflow:ellipsis;}/*!sc*/
data-styled.g107[id="sc-xGAEC"]{content:"jRjoAh,"}/*!sc*/
.bMYkBl{outline:0;color:inherit;width:100%;text-align:left;cursor:pointer;padding:10px 30px 10px 10px;border-radius:0;background-color:transparent;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;white-space:nowrap;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:0;border-bottom:1px solid #ccc;-webkit-transition:border-color 0.25s ease;transition:border-color 0.25s ease;}/*!sc*/
.bMYkBl ..sc-xGAEC{color:#333333;}/*!sc*/
.bMYkBl:focus{box-shadow:inset 0 2px 2px rgba(0,0,0,0.45),0 2px 0 rgba(128,128,128,0.25);}/*!sc*/
data-styled.g108[id="sc-dWBRfb"]{content:"bMYkBl,"}/*!sc*/
.cAOCuf{font-size:0.929em;line-height:20px;background-color:#2F8132;color:#ffffff;padding:3px 10px;text-transform:uppercase;font-family:Montserrat,sans-serif;margin:0;}/*!sc*/
.bXnXQF{font-size:0.929em;line-height:20px;background-color:#186FAF;color:#ffffff;padding:3px 10px;text-transform:uppercase;font-family:Montserrat,sans-serif;margin:0;}/*!sc*/
data-styled.g109[id="sc-jHcXXw"]{content:"cAOCuf,bXnXQF,"}/*!sc*/
.gBwOdz{position:absolute;width:100%;z-index:100;background:#fafafa;color:#263238;box-sizing:border-box;box-shadow:0px 0px 6px rgba(0,0,0,0.33);overflow:hidden;border-bottom-left-radius:4px;border-bottom-right-radius:4px;-webkit-transition:all 0.25s ease;transition:all 0.25s ease;visibility:hidden;-webkit-transform:translateY(-50%) scaleY(0);-ms-transform:translateY(-50%) scaleY(0);transform:translateY(-50%) scaleY(0);}/*!sc*/
data-styled.g110[id="sc-bQCEYZ"]{content:"gBwOdz,"}/*!sc*/
.fKFAhr{padding:10px;}/*!sc*/
data-styled.g111[id="sc-fXgAZx"]{content:"fKFAhr,"}/*!sc*/
.gjiGnZ{padding:5px;border:1px solid #ccc;background:#fff;word-break:break-all;color:#32329f;}/*!sc*/
.gjiGnZ > span{color:#333333;}/*!sc*/
data-styled.g112[id="sc-EZqKI"]{content:"gjiGnZ,"}/*!sc*/
.bCvCHz{display:block;border:0;width:100%;text-align:left;padding:10px;border-radius:2px;margin-bottom:4px;line-height:1.5em;background-color:#f2f2f2;cursor:pointer;color:#1d8127;background-color:rgba(29,129,39,0.07);}/*!sc*/
.bCvCHz:focus{outline:auto;outline-color:#1d8127;}/*!sc*/
.bjdvNh{display:block;border:0;width:100%;text-align:left;padding:10px;border-radius:2px;margin-bottom:4px;line-height:1.5em;background-color:#f2f2f2;cursor:pointer;color:#1d8127;background-color:rgba(29,129,39,0.07);cursor:default;}/*!sc*/
.bjdvNh:focus{outline:auto;outline-color:#1d8127;}/*!sc*/
.bjdvNh::before{content:"—";font-weight:bold;width:1.5em;text-align:center;display:inline-block;vertical-align:top;}/*!sc*/
.bjdvNh:focus{outline:0;}/*!sc*/
2021-09-13 11:27:08 +03:00
.gkwAYh{display:block;border:0;width:100%;text-align:left;padding:10px;border-radius:2px;margin-bottom:4px;line-height:1.5em;background-color:#f2f2f2;cursor:pointer;color:#d41f1c;background-color:rgba(212,31,28,0.07);}/*!sc*/
.gkwAYh:focus{outline:auto;outline-color:#d41f1c;}/*!sc*/
data-styled.g113[id="sc-jXcxbT"]{content:"bCvCHz,bjdvNh,gkwAYh,"}/*!sc*/
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-20 05:22:29 +03:00
.jSPrUM{vertical-align:top;}/*!sc*/
data-styled.g117[id="sc-jlZJtj"]{content:"jSPrUM,"}/*!sc*/
.efuQZt{font-size:1.3em;padding:0.2em 0;margin:3em 0 1.1em;color:#333333;font-weight:normal;}/*!sc*/
data-styled.g118[id="sc-dTSzeu"]{content:"efuQZt,"}/*!sc*/
.ikavEm:after{content:' AND ';font-weight:bold;}/*!sc*/
.ikavEm:last-child:after{content:none;}/*!sc*/
.ikavEm a{-webkit-text-decoration:none;text-decoration:none;color:#32329f;}/*!sc*/
.ikavEm a:visited{color:#32329f;}/*!sc*/
.ikavEm a:hover{color:#6868cf;}/*!sc*/
data-styled.g120[id="sc-cbeScs"]{content:"ikavEm,"}/*!sc*/
.fguZND:before{content:'( ';font-weight:bold;}/*!sc*/
.fguZND:after{content:' ) OR ';font-weight:bold;}/*!sc*/
.fguZND:last-child:after{content:' )';}/*!sc*/
.fguZND:only-child:before,.fguZND:only-child:after{content:none;}/*!sc*/
.fguZND a{-webkit-text-decoration:none;text-decoration:none;color:#32329f;}/*!sc*/
.fguZND a:visited{color:#32329f;}/*!sc*/
.fguZND a:hover{color:#6868cf;}/*!sc*/
data-styled.g121[id="sc-hkeOVe"]{content:"fguZND,"}/*!sc*/
.cuYWRV{-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;}/*!sc*/
data-styled.g122[id="sc-gVFcvn"]{content:"cuYWRV,"}/*!sc*/
.bwNcZa{width:75%;}/*!sc*/
@media screen and (max-width:50rem){.bwNcZa{margin-top:10px;}}/*!sc*/
data-styled.g123[id="sc-fWWYYk"]{content:"bwNcZa,"}/*!sc*/
.kZsYIY{display:inline-block;margin:0;}/*!sc*/
data-styled.g124[id="sc-fIxmyt"]{content:"kZsYIY,"}/*!sc*/
.iEcHcE{width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin:1em 0;}/*!sc*/
@media screen and (max-width:50rem){.iEcHcE{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}}/*!sc*/
data-styled.g125[id="sc-gzcbmu"]{content:"iEcHcE,"}/*!sc*/
.kBgcMI{-webkit-backface-visibility:hidden;backface-visibility:hidden;contain:content;overflow:hidden;}/*!sc*/
data-styled.g130[id="sc-irKDMX"]{content:"kBgcMI,"}/*!sc*/
.eUdCtG{margin-bottom:30px;}/*!sc*/
data-styled.g131[id="sc-eWnToP"]{content:"eUdCtG,"}/*!sc*/
.dzKtIW{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:20px;height:20px;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;color:#32329f;}/*!sc*/
data-styled.g132[id="sc-kTCsyW"]{content:"dzKtIW,"}/*!sc*/
.gAerEa{width:260px;background-color:#fafafa;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-backface-visibility:hidden;backface-visibility:hidden;height:100vh;position:-webkit-sticky;position:sticky;position:-webkit-sticky;top:0;}/*!sc*/
@media screen and (max-width:50rem){.gAerEa{position:fixed;z-index:20;width:100%;background:#fafafa;display:none;}}/*!sc*/
@media print{.gAerEa{display:none;}}/*!sc*/
data-styled.g133[id="sc-dvUynV"]{content:"gAerEa,"}/*!sc*/
.bymHyU{outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#f2f2f2;color:#32329f;display:none;cursor:pointer;position:fixed;right:20px;z-index:100;border-radius:50%;box-shadow:0 0 20px rgba(0,0,0,0.3);bottom:44px;width:60px;height:60px;padding:0 20px;}/*!sc*/
@media screen and (max-width:50rem){.bymHyU{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}}/*!sc*/
@media print{.bymHyU{display:none;}}/*!sc*/
data-styled.g134[id="sc-jtiXyc"]{content:"bymHyU,"}/*!sc*/
.bwfRit{font-family:Roboto,sans-serif;font-size:14px;font-weight:400;line-height:1.5em;color:#333333;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;position:relative;text-align:left;-webkit-font-smoothing:antialiased;font-smoothing:antialiased;text-rendering:optimizeSpeed !important;tap-highlight-color:rgba(0,0,0,0);-webkit-text-size-adjust:100%;text-size-adjust:100%;}/*!sc*/
.bwfRit *{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0);}/*!sc*/
data-styled.g135[id="sc-ellfGf"]{content:"bwfRit,"}/*!sc*/
.eWToXe{z-index:1;position:relative;overflow:hidden;width:calc(100% - 260px);contain:layout;}/*!sc*/
@media print,screen and (max-width:50rem){.eWToXe{width:100%;}}/*!sc*/
data-styled.g136[id="sc-kizEQm"]{content:"eWToXe,"}/*!sc*/
.gBTuHc{background:#263238;position:absolute;top:0;bottom:0;right:0;width:calc((100% - 260px) * 0.4);}/*!sc*/
@media print,screen and (max-width:75rem){.gBTuHc{display:none;}}/*!sc*/
data-styled.g137[id="sc-cKRKFl"]{content:"gBTuHc,"}/*!sc*/
.fQwboL{padding:5px 0;}/*!sc*/
data-styled.g138[id="sc-iIgjPs"]{content:"fQwboL,"}/*!sc*/
.gPCWYe{width:calc(100% - 40px);box-sizing:border-box;margin:0 20px;padding:5px 10px 5px 20px;border:0;border-bottom:1px solid #e1e1e1;font-family:Roboto,sans-serif;font-weight:bold;font-size:13px;color:#333333;background-color:transparent;outline:none;}/*!sc*/
data-styled.g139[id="sc-gstuGz"]{content:"gPCWYe,"}/*!sc*/
.icZuVc{position:absolute;left:20px;height:1.8em;width:0.9em;}/*!sc*/
.icZuVc path{fill:#333333;}/*!sc*/
data-styled.g140[id="sc-amkrK"]{content:"icZuVc,"}/*!sc*/
2020-10-22 08:42:51 +03:00
</style>
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">
</head>
<body>
2021-09-13 11:27:08 +03:00
<div id="redoc"><div class="sc-ellfGf bwfRit redoc-wrap"><div class="sc-dvUynV gAerEa menu-content" style="top:0px;height:calc(100vh - 0px)"><div class="sc-dFRpbK hNMhDm"><a href="http://owncast.online" class="sc-bsatvv cnsJiC"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAEvmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS41LjAiPgogPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgeG1sbnM6ZXhpZj0iaHR0cDovL25zLmFkb2JlLmNvbS9leGlmLzEuMC8iCiAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIgogICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgZXhpZjpQaXhlbFhEaW1lbnNpb249IjEyOCIKICAgZXhpZjpQaXhlbFlEaW1lbnNpb249IjEyOCIKICAgZXhpZjpDb2xvclNwYWNlPSIxIgogICB0aWZmOkltYWdlV2lkdGg9IjEyOCIKICAgdGlmZjpJbWFnZUxlbmd0aD0iMTI4IgogICB0aWZmOlJlc29sdXRpb25Vbml0PSIyIgogICB0aWZmOlhSZXNvbHV0aW9uPSI5Ni4wIgogICB0aWZmOllSZXNvbHV0aW9uPSI5Ni4wIgogICBwaG90b3Nob3A6Q29sb3JNb2RlPSIzIgogICBwaG90b3Nob3A6SUNDUHJvZmlsZT0ic1JHQiBJRUM2MTk2Ni0yLjEiCiAgIHhtcDpNb2RpZnlEYXRlPSIyMDIwLTA2LTE4VDAwOjQ2OjEyLTA3OjAwIgogICB4bXA6TWV0YWRhdGFEYXRlPSIyMDIwLTA2LTE4VDAwOjQ2OjEyLTA3OjAwIj4KICAgPHhtcE1NOkhpc3Rvcnk+CiAgICA8cmRmOlNlcT4KICAgICA8cmRmOmxpCiAgICAgIHN0RXZ0OmFjdGlvbj0icHJvZHVjZWQiCiAgICAgIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFmZmluaXR5IERlc2lnbmVyIChNYXIgMzEgMjAyMCkiCiAgICAgIHN0RXZ0OndoZW49IjIwMjAtMDYtMThUMDA6NDY6MTItMDc6MDAiLz4KICAgIDwvcmRmOlNlcT4KICAgPC94bXBNTTpIaXN0b3J5PgogIDwvcmRmOkRlc2NyaXB0aW9uPgogPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KPD94cGFja2V0IGVuZD0iciI/Pn6jclUAAAGCaUNDUHNSR0IgSUVDNjE5NjYtMi4xAAAokXWRzytEURTHPzODESPCwsLipWE15EdNbJSZNNSkaYwy2Mw880PNj9d7I8lW2SpKbPxa8BewVdZKESlZWVgTG/ScZ6Zmkjm3c8/nfu89p3vPBXsko2aNmn7I5gp6OOBTZqNzivOZOlpx0oESUw1tLBQKUtU+7rBZ8abXqlX93L/WuJgwVLDVC4+qml4QnhAOrhQ0i7eF29V0bFH4VNijywWFby09XuQXi1NF/rJYj4T9YG8RVlIVHK9gNa1nheXluLOZZbV0H+slrkRuZlpil3gnBmEC+FCYZBw/XgYYkdlLL4P0yYoq+f2/+VPkJVeVWWMVnSVSpCngEXVZqickJkVPyMiwavX/b1+N5NBgsbrLB7VPpvnWDc4t+N40zc9D0/w+AscjXOTK+fkDGH4XfbOsufeheR3OLstafAfON6DjQYvpsV/JIW5PJuH1BJqi0HYNDfPFnpX2Ob6HyJp81RXs7kGPnG9e+AEyv2fOZnRq6wAAAAlwSFlzAAAOxAAADsQBlSsOGwAAHBpJREFUeJztfXl8VEW69vO852QhYYcAIRsGRETZ3BURRXGcn5/bOKPOOPPduRevv9EZh3tdRp1x+bjM6FXGXcdt3HGDO7ij1w0XRnHBBTAoypJASEjYlyzdp+r9/ugEmqQ7fbrTnaQDz+9XhD6n6q23u556q+qtDdiP/diPfRfsbAU6Gx/fpz36ZeJiUM8EMAzEAADZADIBGADbAdRCdbW1mFdXL88eMZ07O1PnZGKfJcA395sCOJgmgisB9vKbThXbVfF3Nfr4oZc4S1OpY0dgnyPAkpuV2sc7WRx5kURuO0RZazDLqN444VK3MWkKdjD2KQJ8ebe6jmsegMNfAshKgkhVq8uMxRmH/dYtT4K8Dsc+Q4DF93m9BXyIDs5PunBFuXp69oTL3K+SLjvF2CcI8Pm9XhbJJ0mcl8JsKuxOjD/iD86WFOaRdLidrUBHQIFZUJynmtJsitEDLwKYnNJckoxubwE+uSt4CYX3ApAOyM5aq78/ZnrGfR2QV1LQrQnw/h1eYabgGxK9OzDbOmtQeNx/umnRFHTbJuDD24MZQl1glb2RWtPfEjmATgPw1w7NNUF0hFnsFFiLi6xyuFWgwwN4w/uzgh1pdRJGt7QA784yBaC5z2qnNXG9VDgBwPudlL9vdEsCKM1lBmQHm/69dVA7FfsJ0PF4878bR1rldHZi4QOAgqcDuK5ztYiNbtcHUPLfVTXbqqKTw9hXbmzo2dm/Ryx0Kwsw50Z1rQYv7mw9miDM5kgAX3S2Im2hWxGgR3bwcgPt6GFfVKjaodhPgI6DVf1FZ+sQDlUO6GwdYqHbEGDOH+0gq8ExXaX2A4CiQz2QCaHbEAAZjXdZZRfr1GqXd7V3CwI886eGbHVxqulsRVpCaTtbhVjoFgQIKAZkqfbpSuYfAAit62wdYqFbEMDJ0EuMwulsPVpB0eVXD6c9Ae6+fHumAX6TqOfPGsAYQA1grUIt0HLhCAlQQkGEEAdwHPiYTNcNiWnVcUh7AuTkOMUWOqAt868aKmhrgWCjorEOCDQogoFQwScEAhlZQFY2kdkDyOxBiADihAgDANagKkHpHYa0J4ASw02kwlegfqdi145QQTcToBXaMW4wAaAhoMB2gNCQhXCAzCwgpxdMrpO1JnHpHYO0J4BRPaX5/8FGoKFO0VAfquGt1gCmelCmADwg4AE7d7Lsz89mBFKcY7uR9gQIGJwaaFDs2KoIdvT2jDYJZRd1lBrtQVoT4PLzt/WrWqdjdtd0n+ZcFQECj0J1IYB6BU6h8NcAeiRLN1V8lCxZqURaE0AcHGKgjMO0e7CYoca5f9ZzuZvCns+74hfbb3Cov4TwLwBy2qubiv2uvTI6AmlNABWMtv4Lvw5WfvPXp3s+Fenlbc/03gjgzssv3L5IHLyDdpBAQ/+sSjR9R6KL+c7jgzp6iKXCT/BUb/zr7MiFH47bn+69yBhztqWqX9kRwne3ze7b5X0AQJpbAAMe6Mv8q75sa/vc7luu4D1C14EsSkgxq7MSStcJSGsLYEVHKENzbtGCJRqt8vp73vA/MXP3U/2Clrg3luwoIaiC11L5vZOJtCXA+ecZscQBhoq
2020-10-22 08:42:51 +03:00
m -673.67664,1221.6502 -231.2455,-231.24803 55.6165,
-55.627 c 30.5891,-30.59485 56.1806,-55.627 56.8701,-55.627 0.6894,
0 79.8637,78.60862 175.9427,174.68583 l 174.6892,174.6858 174.6892,
-174.6858 c 96.079,-96.07721 175.253196,-174.68583 175.942696,
-174.68583 0.6895,0 26.281,25.03215 56.8701,
55.627 l 55.6165,55.627 -231.245496,231.24803 c -127.185,127.1864
-231.5279,231.248 -231.873,231.248 -0.3451,0 -104.688,
-104.0616 -231.873,-231.248 z
" fill="currentColor"></path></g></svg><svg class="" style="transform:translate(2px, 4px);transition:transform 0.2s ease" viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="15" height="15"><g transform="translate(904.92214,-879.1482)"><path d="
m -673.67664,1221.6502 -231.2455,-231.24803 55.6165,
-55.627 c 30.5891,-30.59485 56.1806,-55.627 56.8701,-55.627 0.6894,
0 79.8637,78.60862 175.9427,174.68583 l 174.6892,174.6858 174.6892,
-174.6858 c 96.079,-96.07721 175.253196,-174.68583 175.942696,
-174.68583 0.6895,0 26.281,25.03215 56.8701,
55.627 l 55.6165,55.627 -231.245496,231.24803 c -127.185,127.1864
-231.5279,231.248 -231.873,231.248 -0.3451,0 -104.688,
-104.0616 -231.873,-231.248 z
2021-09-30 02:37:09 +03:00
" fill="currentColor"></path></g></svg></div></div><div class="sc-kizEQm eWToXe api-content"><div class="sc-eCApnc fxZJZV"><div class="sc-iCoGMd KWWXd"><div class="sc-hKFxyN egQuEZ api-info"><h1 class="sc-fujyAs sc-fcmMJX cTueGk ikafbi">Owncast<!-- --> <span>(<!-- -->0.0.10-dev<!-- -->)</span></h1><p>Download OpenAPI specification<!-- -->:<a download="swagger.json" target="_blank" class="sc-GvhzO ksfJAW">Download</a></p><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"><div class="sc-bXexck ePwgUU"><div class="sc-eGJWMs hDhyRZ"><span class="sc-gsWcmt gCgqqY">Gabe Kangas<!-- -->:<!-- --> <a href="mailto:gabek@real-ity.com">gabek@real-ity.com</a></span> <span class="sc-gsWcmt gCgqqY">URL: <a href="http://owncast.online">http://owncast.online</a></span> <!-- --> </div></div></div><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy" data-role="redoc-summary"></div><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy" data-role="redoc-description"><p>Owncast is a self-hosted live video and web chat server for use with existing popular broadcasting software. The following APIs represent the state in the development branch.</p>
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-20 05:22:29 +03:00
</div></div></div></div><div id="section/Authentication" data-section-id="section/Authentication" class="sc-eCApnc fxZJZV"><div class="sc-iCoGMd KWWXd"><div class="sc-hKFxyN egQuEZ"><h1 class="sc-fujyAs cTueGk"><a class="sc-crzoAE iUxAWq" href="#section/Authentication" aria-label="section/Authentication"></a>Authentication</h1></div></div><div id="section/Authentication/AdminBasicAuth" data-section-id="section/Authentication/AdminBasicAuth" class="sc-eCApnc fxZJZV"><div class="sc-iCoGMd KWWXd"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth"></a>AdminBasicAuth</h2><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"><p>The username for admin basic auth is <code>admin</code> and the password is the stream key.</p>
</div><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"><table class="security-details"><tbody><tr><th> Security Scheme Type </th><td> <!-- -->HTTP<!-- --> </td></tr><tr><th> HTTP Authorization Scheme </th><td> <!-- -->basic<!-- --> </td></tr></tbody></table></div></div></div></div><div id="section/Authentication/AccessToken" data-section-id="section/Authentication/AccessToken" class="sc-eCApnc fxZJZV"><div class="sc-iCoGMd KWWXd"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#section/Authentication/AccessToken" aria-label="section/Authentication/AccessToken"></a>AccessToken</h2><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"><p>3rd party integration auth where a service user must provide an access token.</p>
</div><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"><table class="security-details"><tbody><tr><th> Security Scheme Type </th><td> <!-- -->HTTP<!-- --> </td></tr><tr><th> HTTP Authorization Scheme </th><td> <!-- -->bearer<!-- --> </td></tr></tbody></table></div></div></div></div><div id="section/Authentication/UserToken" data-section-id="section/Authentication/UserToken" class="sc-eCApnc fxZJZV"><div class="sc-iCoGMd KWWXd"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#section/Authentication/UserToken" aria-label="section/Authentication/UserToken"></a>UserToken</h2><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"><p>3rd party integration auth where a service user must provide an access token.</p>
</div><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"><table class="security-details"><tbody><tr><th> Security Scheme Type </th><td> <!-- -->API Key<!-- --> </td></tr><tr><th> <!-- -->Query<!-- --> parameter name:</th><td> <!-- -->accessToken<!-- --> </td></tr></tbody></table></div></div></div></div></div><div id="tag/Admin" data-section-id="tag/Admin" class="sc-eCApnc fxZJZV"><div class="sc-iCoGMd KWWXd"><div class="sc-hKFxyN egQuEZ"><h1 class="sc-fujyAs cTueGk"><a class="sc-crzoAE iUxAWq" href="#tag/Admin" aria-label="tag/Admin"></a>Admin</h1></div></div><div class="sc-hKFxyN dmghQN"><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy redoc-markdown "><p>Admin operations requiring authentication.</p>
</div></div></div><div id="tag/Admin/paths/~1api~1admin~1status/get" data-section-id="tag/Admin/paths/~1api~1admin~1status/get" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Admin/paths/~1api~1admin~1status/get" aria-label="tag/Admin/paths/~1api~1admin~1status/get"></a>Server status and broadcaster<!-- --> </h2><div class="sc-kYPZxB jdCbTS"><button class="sc-dWBRfb bMYkBl"><span type="get" class="sc-jHcXXw cAOCuf http-verb get">get</span><span class="sc-xGAEC jRjoAh">/api/admin/status</span><svg class="sc-dIsUp iFYrlT" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-bQCEYZ gBwOdz"><div class="sc-fXgAZx fKFAhr"><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div><div tabindex="0" role="button"><div class="sc-EZqKI gjiGnZ"><span></span>/api/admin/status</div></div></div></div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Server status and broadcaster details</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-0" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-1" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-1" aria-labelledby="react-tabs-0"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"broadcaster"</span>: <button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"remoteAddr"</span>: <span class="token string">&quot;172.217.164.110&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"time"</span>: <span class="token string">&quot;2020-10-06T23:20:44.588649-07:00&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"streamDetails"</span>: <button class="collapser" aria-label="expand"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"width"</span>: <span class="token number">640</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"height"</span>: <span class="token number">480</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"frameRate"</span>: <span class="token number">24</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"videoBitrate"</span>: <span class="token number">1500</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"videoCodec"</span>: <span class="token string">&quot;mp4a&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"audioBitrate"</span>: <span class="token number">256</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"audioCodec"</span>: <span class="token string">&quot;aac&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"encoder"</span>: <span class="token string">&quot;obs-output module (libobs version 25.0.8)&quot;</span></div></li></ul><span class="token punctuation">}</span></div></li></ul><span class="token punctuation">}</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"online"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"viewerCount"</span>: <span class="token number">3</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token str
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-2" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-3" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-3" aria-labelledby="react-tabs-2"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_0" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_0_list_0" aria-controls="react_dropdown_aria_0_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_0_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_0_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_0_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></span></div></div><div><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"success"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"message"</span>: <span class="token string">&quot;context specific success message&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div></div><div id="tag/Admin/paths/~1api~1admin~1yp~1reset/post" data-section-id="tag/Admin/paths/~1api~1admin~1yp~1reset/post" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Admin/paths/~1api~1admin~1yp~1reset/post" aria-label="tag/Admin/paths/~1api~1admin~1yp~1reset/post"></a>Reset your YP registration key.<!-- --> </h2><div class="sc-kYPZxB jdCbTS"><button class="sc-dWBRfb bMYkBl"><span type="post" class="sc-jHcXXw bXnXQF http-verb post">post</span><span class="sc-xGAEC jRjoAh">/api/admin/yp/reset</span><svg class="sc-dIsUp iFYrlT" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div ar
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-4" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-5" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-5" aria-labelledby="react-tabs-4"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_1" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_1_list_0" aria-controls="react_dropdown_aria_1_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_1_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_1_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_1_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></span></div></div><div><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"success"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"message"</span>: <span class="token string">&quot;context specific success message&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div></div><div id="tag/Admin/paths/~1api~1admin~1chat~1clients/get" data-section-id="tag/Admin/paths/~1api~1admin~1chat~1clients/get" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Admin/paths/~1api~1admin~1chat~1clients/get" aria-label="tag/Admin/paths/~1api~1admin~1chat~1clients/get"></a>Return a list of currently connected clients<!-- --> </h2><div class="sc-kYPZxB jdCbTS"><button class="sc-dWBRfb bMYkBl"><span type="get" class="sc-jHcXXw cAOCuf http-verb get">get</span><span class="sc-xGAEC jRjoAh">/api/admin/chat/clients</span><svg class="sc-dIsUp iFYrlT" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></poly
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Successful response of an array of clients</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-6" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-7" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-7" aria-labelledby="react-tabs-6"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable "><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"connectedAt"</span>: <span class="token string">&quot;2020-10-06T23:20:44.588649-07:00&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"messageCount"</span>: <span class="token number">3</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"userAgent"</span>: <span class="token string">&quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"ipAddress"</span>: <span class="token string">&quot;172.217.164.110&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"geo"</span>: <button class="collapser" aria-label="expand"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"countryCode"</span>: <span class="token string">&quot;US&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"regionName"</span>: <span class="token string">&quot;California&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"timeZone"</span>: <span class="token string">&quot;America/Los_Angeles&quot;</span></div></li></ul><span class="token punctuation">}</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"user"</span>: <button class="collapser" aria-label="expand"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"id"</span>: <span class="token string">&quot;yklw5Imng&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"displayName"</span>: <span class="token string">&quot;awesome-pizza&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"displayColor"</span>: <span class="token number">42</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"createdAt"</span>: <span class="token string">&quo
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>A collection of users.</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-8" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-9" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-9" aria-labelledby="react-tabs-8"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable "><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"id"</span>: <span class="token string">&quot;yklw5Imng&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"displayName"</span>: <span class="token string">&quot;awesome-pizza&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"displayColor"</span>: <span class="token number">42</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"createdAt"</span>: <span class="token string">&quot;2019-08-24T14:15:22Z&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"previousNames"</span>: <span class="token string">&quot;awesome-pizza,user42&quot;</span></div></li></ul><span class="token punctuation">}</span></div></li></ul><span class="token punctuation">]</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="tag/Admin/paths/~1api~1admin~1logs/get" data-section-id="tag/Admin/paths/~1api~1admin~1logs/get" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Admin/paths/~1api~1admin~1logs/get" aria-label="tag/Admin/paths/~1api~1admin~1logs/get"></a>Return recent log entries<!-- --> </h2><div class="sc-kYPZxB jdCbTS"><button class="sc-dWBRfb bMYkBl"><span type="get" class="sc-jHcXXw cAOCuf http-verb get">get</span><span class="sc-xGAEC jRjoAh">/api/admin/logs</span><svg class="sc-dIsUp iFYrlT" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-bQCEYZ gBwOdz"><div class="sc-fXgAZx fKFAhr"><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div><div tabindex="0" role="button"><div class="sc-EZqKI gjiGnZ"><span></span>/api/admin/logs</div></div></div></div></div><div class="sc-eWnToP eUdCtG"><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"><p>Returns server logs.</p>
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Response of server log entries</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-10" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-11" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-11" aria-labelledby="react-tabs-10"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable "><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"message"</span>: <span class="token string">&quot;Owncast v0.0.0-localdev (unknown)&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"level"</span>: <span class="token string">&quot;info&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"time"</span>: <span class="token string">&quot;2020-10-29T18:35:34.422386-07:00&quot;</span></div></li></ul><span class="token punctuation">}</span>,</div></li><li><div class="hoverable "><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"message"</span>: <span class="token string">&quot;Web server running on port: 8080&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"level"</span>: <span class="token string">&quot;info&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"time"</span>: <span class="token string">&quot;2020-10-29T18:35:35.011731-07:00&quot;</span></div></li></ul><span class="token punctuation">}</span>,</div></li><li><div class="hoverable "><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"message"</span>: <span class="token string">&quot;RTMP server is listening for incoming stream on port: 1935&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"level"</span>: <span class="token string">&quot;info&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"time"</span>: <span class="token string">&quot;2020-10-29T18:35:35.011823-07:00&quot;</span></div></li></ul><span class="token punctuation">}</span></div></li></ul><span class="token punctuation">]</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="tag/Admin/paths/~1api~1admin~1logs~1warnings/get" data-section-id="tag/Admin/paths/~1api~1admin~1logs~1warnings/get" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Admin/paths/~1api~1admin~
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Response of server log entries</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-12" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-13" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-13" aria-labelledby="react-tabs-12"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable "><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"message"</span>: <span class="token string">&quot;Owncast v0.0.0-localdev (unknown)&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"level"</span>: <span class="token string">&quot;info&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"time"</span>: <span class="token string">&quot;2020-10-29T18:35:34.422386-07:00&quot;</span></div></li></ul><span class="token punctuation">}</span>,</div></li><li><div class="hoverable "><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"message"</span>: <span class="token string">&quot;Web server running on port: 8080&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"level"</span>: <span class="token string">&quot;info&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"time"</span>: <span class="token string">&quot;2020-10-29T18:35:35.011731-07:00&quot;</span></div></li></ul><span class="token punctuation">}</span>,</div></li><li><div class="hoverable "><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"message"</span>: <span class="token string">&quot;RTMP server is listening for incoming stream on port: 1935&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"level"</span>: <span class="token string">&quot;info&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"time"</span>: <span class="token string">&quot;2020-10-29T18:35:35.011823-07:00&quot;</span></div></li></ul><span class="token punctuation">}</span></div></li></ul><span class="token punctuation">]</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="tag/Admin/paths/~1api~1admin~1serverconfig/get" data-section-id="tag/Admin/paths/~1api~1admin~1serverconfig/get" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Admin/paths/~1api~1admin~1ser
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"></span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-14" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-15" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-15" aria-labelledby="react-tabs-14"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"instanceDetails"</span>: <button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"name"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"summary"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"logo"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"tags"</span>: <button class="collapser" aria-label="expand"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable collapsed"><span class="token string">&quot;string&quot;</span></div></li></ul><span class="token punctuation">]</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"socialHandles"</span>: <button class="collapser" aria-label="expand"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable collapsed"><button class="collapser" aria-label="expand"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"platform"</span>: <span class="token string">&quot;github&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"url"</span>: <span class="token string">&quot;</span><a href="http://github.com/owncast/owncast">http://github.com/owncast/owncast</a><span class="token string">&quot;</span></div></li></ul><span class="token p
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"></span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-16" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-17" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-17" aria-labelledby="react-tabs-16"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable "><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"user"</span>: <button class="collapser" aria-label="expand"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"id"</span>: <span class="token string">&quot;yklw5Imng&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"displayName"</span>: <span class="token string">&quot;awesome-pizza&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"displayColor"</span>: <span class="token number">42</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"createdAt"</span>: <span class="token string">&quot;2019-08-24T14:15:22Z&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"previousNames"</span>: <span class="token string">&quot;awesome-pizza,user42&quot;</span></div></li></ul><span class="token punctuation">}</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"body"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"id"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"visible"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"timestamp"</span>: <span class="token string">&quot;2019-08-
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="visible"><span class="sc-iemWCZ bcnRwz"></span><span>visible</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>Are these messages visible.</p>
</div></div></div></td></tr><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="idArray"><span class="sc-iemWCZ bcnRwz"></span><span>idArray</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV">Array of </span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">strings</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-18" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-19" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-19" aria-labelledby="react-tabs-18"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"visible"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"idArray"</span>: <button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable collapsed"><span class="token string">&quot;string&quot;</span></div></li></ul><span class="token punctuation">]</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-20" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-21" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-21" aria-labelledby="react-tabs-20"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_2" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_2_list_0" aria-controls="react_dropdown_aria_2_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_2_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_2_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_2_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></span></div></div><div><div class="sc-i
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="userId"><span class="sc-iemWCZ bcnRwz"></span><span>userId</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>User ID to act upon.</p>
</div></div></div></td></tr><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="enabled"><span class="sc-iemWCZ bcnRwz"></span><span>enabled</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>Set the enabled state of this user.</p>
</div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-22" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-23" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-23" aria-labelledby="react-tabs-22"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"userId"</span>: <span class="token string">&quot;yklw5Imng&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"enabled"</span>: <span class="token boolean">true</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-24" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-25" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-25" aria-labelledby="react-tabs-24"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_3" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_3_list_0" aria-controls="react_dropdown_aria_3_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_3_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_3_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_3_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></span></div></div><div><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><but
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT sc-ckTSus fABPTr eQzShU ihkizP" kind="field" title="value"><span class="sc-iemWCZ bcnRwz"></span><button aria-label="expand properties"><span>value</span><svg class="sc-dIsUp cEsevO" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string or integer or object or boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-26" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-27" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-27" aria-labelledby="react-tabs-26"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"value"</span>: <span class="token string">&quot;string&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-28" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-29" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-29" aria-labelledby="react-tabs-28"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_4" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_4_list_0" aria-controls="react_dropdown_aria_4_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_4_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_4_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_4_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></span></div></div><div><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT sc-ckTSus fABPTr eQzShU ihkizP" kind="field" title="value"><span class="sc-iemWCZ bcnRwz"></span><button aria-label="expand properties"><span>value</span><svg class="sc-dIsUp cEsevO" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string or integer or object or boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-30" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-31" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-31" aria-labelledby="react-tabs-30"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><span class="token string">&quot;# Welcome to my cool server!&lt;br&gt;&lt;br&gt;I _hope_ you enjoy it.&quot;</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-32" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-33" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-33" aria-labelledby="react-tabs-32"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_5" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_5_list_0" aria-controls="react_dropdown_aria_5_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_5_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_5_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_5_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></span></div></div><div><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"success"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"message"</span>
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT sc-ckTSus fABPTr eQzShU ihkizP" kind="field" title="value"><span class="sc-iemWCZ bcnRwz"></span><button aria-label="expand properties"><span>value</span><svg class="sc-dIsUp cEsevO" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string or integer or object or boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-34" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-35" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-35" aria-labelledby="react-tabs-34"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"value"</span>: <span class="token string">&quot;Streaming my favorite game, Desert Bus.&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-36" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-37" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-37" aria-labelledby="react-tabs-36"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_6" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_6_list_0" aria-controls="react_dropdown_aria_6_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_6_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_6_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_6_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></span></div></div><div><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj colla
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT sc-ckTSus fABPTr eQzShU ihkizP" kind="field" title="value"><span class="sc-iemWCZ bcnRwz"></span><button aria-label="expand properties"><span>value</span><svg class="sc-dIsUp cEsevO" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string or integer or object or boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-38" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-39" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-39" aria-labelledby="react-tabs-38"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"value"</span>: <span class="token string">&quot;string&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-40" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-41" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-41" aria-labelledby="react-tabs-40"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_7" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_7_list_0" aria-controls="react_dropdown_aria_7_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_7_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_7_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_7_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></span></div></div><div><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT sc-ckTSus fABPTr eQzShU ihkizP" kind="field" title="value"><span class="sc-iemWCZ bcnRwz"></span><button aria-label="expand properties"><span>value</span><svg class="sc-dIsUp cEsevO" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string or integer or object or boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-42" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-43" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-43" aria-labelledby="react-tabs-42"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"value"</span>: <span class="token string">&quot;The best in Desert Bus Streaming&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-44" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-45" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-45" aria-labelledby="react-tabs-44"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_8" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_8_list_0" aria-controls="react_dropdown_aria_8_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_8_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_8_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_8_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></span></div></div><div><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT sc-ckTSus fABPTr eQzShU ihkizP" kind="field" title="value"><span class="sc-iemWCZ bcnRwz"></span><button aria-label="expand properties"><span>value</span><svg class="sc-dIsUp cEsevO" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string or integer or object or boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-46" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-47" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-47" aria-labelledby="react-tabs-46"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"value"</span>: <span class="token string">&quot;/img/mylogo.png&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-48" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-49" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-49" aria-labelledby="react-tabs-48"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_9" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_9_list_0" aria-controls="react_dropdown_aria_9_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_9_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_9_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_9_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></span></div></div><div><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT sc-ckTSus fABPTr eQzShU ihkizP" kind="field" title="value"><span class="sc-iemWCZ bcnRwz"></span><button aria-label="expand properties"><span>value</span><svg class="sc-dIsUp cEsevO" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string or integer or object or boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-50" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-51" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-51" aria-labelledby="react-tabs-50"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"value"</span>: <button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable collapsed"><span class="token string">&quot;games&quot;</span>,</div></li><li><div class="hoverable collapsed"><span class="token string">&quot;music&quot;</span>,</div></li><li><div class="hoverable collapsed"><span class="token string">&quot;streaming&quot;</span></div></li></ul><span class="token punctuation">]</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-52" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-53" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-53" aria-labelledby="react-tabs-52"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_10" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_10_list_0" aria-controls="react_dropdown_aria_10_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_10_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_10_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_10_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></spa
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT sc-ckTSus fABPTr eQzShU ihkizP" kind="field" title="value"><span class="sc-iemWCZ bcnRwz"></span><button aria-label="expand properties"><span>value</span><svg class="sc-dIsUp cEsevO" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string or integer or object or boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-54" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-55" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-55" aria-labelledby="react-tabs-54"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"value"</span>: <span class="token string">&quot;/home/owncast/ffmpeg&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-56" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-57" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-57" aria-labelledby="react-tabs-56"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_11" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_11_list_0" aria-controls="react_dropdown_aria_11_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_11_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_11_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_11_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></span></div></div><div><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT sc-ckTSus fABPTr eQzShU ihkizP" kind="field" title="value"><span class="sc-iemWCZ bcnRwz"></span><button aria-label="expand properties"><span>value</span><svg class="sc-dIsUp cEsevO" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string or integer or object or boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-58" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-59" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-59" aria-labelledby="react-tabs-58"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"value"</span>: <span class="token number">8080</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-60" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-61" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-61" aria-labelledby="react-tabs-60"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_12" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_12_list_0" aria-controls="react_dropdown_aria_12_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_12_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_12_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_12_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></span></div></div><div><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT sc-ckTSus fABPTr eQzShU ihkizP" kind="field" title="value"><span class="sc-iemWCZ bcnRwz"></span><button aria-label="expand properties"><span>value</span><svg class="sc-dIsUp cEsevO" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string or integer or object or boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-62" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-63" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-63" aria-labelledby="react-tabs-62"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"value"</span>: <span class="token number">1935</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-64" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-65" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-65" aria-labelledby="react-tabs-64"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_13" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_13_list_0" aria-controls="react_dropdown_aria_13_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_13_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_13_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_13_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></span></div></div><div><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT sc-ckTSus fABPTr eQzShU ihkizP" kind="field" title="value"><span class="sc-iemWCZ bcnRwz"></span><button aria-label="expand properties"><span>value</span><svg class="sc-dIsUp cEsevO" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string or integer or object or boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-66" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-67" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-67" aria-labelledby="react-tabs-66"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"value"</span>: <span class="token boolean">false</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-68" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-69" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-69" aria-labelledby="react-tabs-68"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_14" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_14_list_0" aria-controls="react_dropdown_aria_14_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_14_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_14_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_14_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></span></div></div><div><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><sp
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT sc-ckTSus fABPTr eQzShU ihkizP" kind="field" title="value"><span class="sc-iemWCZ bcnRwz"></span><button aria-label="expand properties"><span>value</span><svg class="sc-dIsUp cEsevO" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string or integer or object or boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-70" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-71" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-71" aria-labelledby="react-tabs-70"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"value"</span>: <span class="token boolean">true</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-72" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-73" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-73" aria-labelledby="react-tabs-72"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_15" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_15_list_0" aria-controls="react_dropdown_aria_15_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_15_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_15_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_15_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></span></div></div><div><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><spa
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT sc-ckTSus fABPTr eQzShU ihkizP" kind="field" title="value"><span class="sc-iemWCZ bcnRwz"></span><button aria-label="expand properties"><span>value</span><svg class="sc-dIsUp cEsevO" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string or integer or object or boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-74" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-75" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-75" aria-labelledby="react-tabs-74"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"value"</span>: <span class="token string">&quot;</span><a href="https://live.mycoolserver.biz">https://live.mycoolserver.biz</a><span class="token string">&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-76" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-77" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-77" aria-labelledby="react-tabs-76"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_16" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_16_list_0" aria-controls="react_dropdown_aria_16_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_16_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_16_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_16_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></span></div></div><div><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="tok
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="value"><span class="sc-iemWCZ bcnRwz"></span><span>value</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">integer</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>The latency level</p>
</div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-78" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-79" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-79" aria-labelledby="react-tabs-78"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"value"</span>: <span class="token number">4</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-80" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-81" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-81" aria-labelledby="react-tabs-80"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_17" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_17_list_0" aria-controls="react_dropdown_aria_17_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_17_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_17_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_17_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></span></div></div><div><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span cl
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT sc-ckTSus fABPTr eQzShU ihkizP" kind="field" title="value"><span class="sc-iemWCZ bcnRwz"></span><button aria-label="expand properties"><span>value</span><svg class="sc-dIsUp cEsevO" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string or integer or object or boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-82" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-83" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-83" aria-labelledby="react-tabs-82"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"value"</span>: <button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable collapsed"><button class="collapser" aria-label="expand"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"framerate"</span>: <span class="token number">30</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"videoPassthrough"</span>: <span class="token boolean">false</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"videoBitrate"</span>: <span class="token number">1800</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"cpuUsageLevel"</span>: <span class="token number">2</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"audioPassthrough"</span>: <span class="token boolean">true</span></div></li></ul><span class="token punctuation">}</span>,</div></li><li><div class="hoverable collapsed"><button class="collapser" aria-label="expand"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"framerate"</span>: <span class="token number">24</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"videoPassthrough"</span>: <span class="token boolean">false</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"videoBitrate"</span>: <span class="token number">1000</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"cpuUsageLevel"</span>: <span class="token number">3</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"audioPassthrough"</span>: <span class="token boolean">true</span></div></li></ul><span class="token punctuation">}</span></div></li></ul><span class="token punctuation">]</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-84" aria-selected="true" aria-d
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="value"><span class="sc-iemWCZ bcnRwz"></span><span>value</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>The video codec to change to.</p>
</div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-86" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-87" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-87" aria-labelledby="react-tabs-86"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"value"</span>: <span class="token string">&quot;libx264&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-88" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-89" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-89" aria-labelledby="react-tabs-88"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_19" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_19_list_0" aria-controls="react_dropdown_aria_19_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_19_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_19_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_19_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></span></div></div><div><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="ho
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT sc-ckTSus fABPTr eQzShU ihkizP" kind="field" title="value"><span class="sc-iemWCZ bcnRwz"></span><button aria-label="expand properties"><span>value</span><svg class="sc-dIsUp cEsevO" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string or integer or object or boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-90" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-91" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-91" aria-labelledby="react-tabs-90"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"value"</span>: <button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"enabled"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"endpoint"</span>: <span class="token string">&quot;</span><a href="https://s3.us-west-000.backblazeb2.com">https://s3.us-west-000.backblazeb2.com</a><span class="token string">&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"accessKey"</span>: <span class="token string">&quot;e1ac500y7000500047156bd060&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"secret"</span>: <span class="token string">&quot;H8FH8eSxM2K/S42CUg5K000Tt4WY2fI&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"bucket"</span>: <span class="token string">&quot;video&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"region"</span>: <span class="token string">&quot;us-west-000&quot;</span></div></li></ul><span class="token punctuation">}</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-92" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-93" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-93" aria-labelledby="react-tabs-92"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_20" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_20_list_0" aria-controls="react_dropdown_aria_20_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Opera
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT sc-ckTSus fABPTr eQzShU ihkizP" kind="field" title="value"><span class="sc-iemWCZ bcnRwz"></span><button aria-label="expand properties"><span>value</span><svg class="sc-dIsUp cEsevO" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string or integer or object or boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-94" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-95" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-95" aria-labelledby="react-tabs-94"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"value"</span>: <button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable collapsed"><button class="collapser" aria-label="expand"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"platform"</span>: <span class="token string">&quot;github&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"url"</span>: <span class="token string">&quot;</span><a href="https://github.com/owncast/owncast">https://github.com/owncast/owncast</a><span class="token string">&quot;</span></div></li></ul><span class="token punctuation">}</span>,</div></li><li><div class="hoverable collapsed"><button class="collapser" aria-label="expand"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"platform"</span>: <span class="token string">&quot;mastodon&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"url"</span>: <span class="token string">&quot;</span><a href="https://mastodon.social/@gabek">https://mastodon.social/@gabek</a><span class="token string">&quot;</span></div></li></ul><span class="token punctuation">}</span></div></li></ul><span class="token punctuation">]</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-96" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-97" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-97" aria-labelledby="react-tabs-96"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_21" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_21_list_0" aria-controls="rea
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-20 05:22:29 +03:00
</div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT sc-ckTSus fABPTr eQzShU ihkizP" kind="field" title="value"><span class="sc-iemWCZ bcnRwz"></span><button aria-label="expand properties"><span>value</span><svg class="sc-dIsUp cEsevO" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string or integer or object or boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-98" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-99" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-99" aria-labelledby="react-tabs-98"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"value"</span>: <span class="token string">&quot;body { color: orange; background: black; }&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-100" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-101" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-101" aria-labelledby="react-tabs-100"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_22" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_22_list_0" aria-controls="react_dropdown_aria_22_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_22_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_22_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_22_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></span></div></div><div><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul cla
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"></span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-102" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-103" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-103" aria-labelledby="react-tabs-102"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable "><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"time"</span>: <span class="token string">&quot;2020-10-03T21:41:00.381996-05:00&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"value"</span>: <span class="token number">50</span></div></li></ul><span class="token punctuation">}</span>,</div></li><li><div class="hoverable "><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"time"</span>: <span class="token string">&quot;2020-10-03T21:42:00.381996-05:00&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"value"</span>: <span class="token number">52</span></div></li></ul><span class="token punctuation">}</span></div></li></ul><span class="token punctuation">]</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="tag/Admin/paths/~1api~1admin~1hardwarestats/get" data-section-id="tag/Admin/paths/~1api~1admin~1hardwarestats/get" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Admin/paths/~1api~1admin~1hardwarestats/get" aria-label="tag/Admin/paths/~1api~1admin~1hardwarestats/get"></a>Hardware Stats<!-- --> </h2><div class="sc-kYPZxB jdCbTS"><button class="sc-dWBRfb bMYkBl"><span type="get" class="sc-jHcXXw cAOCuf http-verb get">get</span><span class="sc-xGAEC jRjoAh">/api/admin/hardwarestats</span><svg class="sc-dIsUp iFYrlT" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><d
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"></span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-104" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-105" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-105" aria-labelledby="react-tabs-104"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"cpu"</span>: <button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable collapsed"><button class="collapser" aria-label="expand"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"time"</span>: <span class="token string">&quot;2020-10-03T21:41:00.381996-05:00&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"value"</span>: <span class="token number">23</span></div></li></ul><span class="token punctuation">}</span>,</div></li><li><div class="hoverable collapsed"><button class="collapser" aria-label="expand"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"time"</span>: <span class="token string">&quot;2020-10-03T21:42:00.381996-05:00&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"value"</span>: <span class="token number">27</span></div></li></ul><span class="token punctuation">}</span>,</div></li><li><div class="hoverable collapsed"><button class="collapser" aria-label="expand"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"time"</span>: <span class="token string">&quot;2020-10-03T21:43:00.381996-05:00&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"value"</span>: <span class="token number">22</span></div></li></ul><span class="token punctuation">}</span></div></li></ul><span class="token punctuation">]</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="proper
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Webhooks are returned</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-106" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-107" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-107" aria-labelledby="react-tabs-106"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"id"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"url"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"events"</span>: <button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable collapsed"><span class="token string">&quot;string&quot;</span></div></li></ul><span class="token punctuation">]</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"timestamp"</span>: <span class="token string">&quot;2019-08-24T14:15:22Z&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"lastUsed"</span>: <span class="token string">&quot;2019-08-24T14:15:22Z&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="tag/Admin/paths/~1api~1admin~1config~1externalactions/post" data-section-id="tag/Admin/paths/~1api~1admin~1config~1externalactions/post" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Admin/paths/~1api~1admin~1config~1externalactions/post" aria-label="tag/Admin/paths/~1api~1admin~1config~1externalactions/post"></a>Set external action URLs.<!-- --> </h2><div class="sc-kYPZxB jdCbTS"><button class="sc-dWBRfb bMYkBl"><span type="post" class="sc-jHcXXw bXnXQF http-verb post">post</span><span class="sc-xGAEC jRjoAh">/api/admin/config/externalactions</span><svg class="sc-dIsUp iFYrlT" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-bQCEYZ gBwOdz"><div class="sc-fXgAZx fKFAhr"><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div><div tabindex="0" role="button"><div class="sc-EZqKI gjiGnZ"><span></span>/api/admin/config/externalactions</div></div></div></div></div><div class="sc-eWnToP eUdCtG"><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"><p>Set a collection of external action URLs that are displayed in the UI.</p>
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><div><div class="sc-bCwfaz jaCkRh"> Array (<!-- -->)</div><div class="sc-jQAxuV iglPxx"><table class="sc-hHEiqL dYlGyN"><tbody><tr><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="url"><span class="sc-iemWCZ bcnRwz"></span><span>url</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>URL of the external action content.</p>
</div></div></div></td></tr><tr><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="title"><span class="sc-iemWCZ bcnRwz"></span><span>title</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>The title to put on the external action button.</p>
</div></div></div></td></tr><tr><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="description"><span class="sc-iemWCZ bcnRwz"></span><span>description</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>Optional additional description to display in the UI.</p>
</div></div></div></td></tr><tr><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="icon"><span class="sc-iemWCZ bcnRwz"></span><span>icon</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>The URL to an image to place on the external action button.</p>
</div></div></div></td></tr><tr><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="color"><span class="sc-iemWCZ bcnRwz"></span><span>color</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>Optional color to use for drawing the action button.</p>
</div></div></div></td></tr><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="openExternally"><span class="sc-iemWCZ bcnRwz"></span><span>openExternally</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>If set this action will open in a new browser tab instead of an internal modal.</p>
</div></div></div></td></tr></tbody></table></div><div class="sc-iwajpm kHKMOg"></div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bjdvNh" disabled=""><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Actions have been updated.</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-108" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-109" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-109" aria-labelledby="react-tabs-108"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable "><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"url"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"title"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"description"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"icon"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"color"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"openExternally"</span>: <span class="token boolean">true</span></div></li></ul><span class="token punctuation">}</span></div></li></ul><span class="token punctuation">]</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="tag/Admin/paths/~1api~1admin~1webhooks~1delete/post" data-section-id="tag/Admin/paths/~1api~1admin~1webhooks~1delete/post" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Admin/paths/~1api~1admin~1webhooks~1delete/post" aria-label="tag/Admin/paths/~1api~1admin~1webhooks~1delete/post"></a>Delete a single webhook.<!-- --> </h2><div class="sc-kYPZxB jdCbTS"><button class="sc-dWBRfb bMYkBl"><span type="post" class="sc-jHcXXw bXnXQF http-verb post">post</span><span class="sc-xGAEC jRjoAh">/api/admin/webhooks/delete</span><svg class="sc-dIsUp iFYrlT" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-bQCEYZ gBwOdz"><div class="sc-fXgAZx fKFAhr"><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div><div tabindex="0" role="button"><div class="sc-EZqKI gjiGnZ"><span></span>/api/admin/webhooks/delete</div></div></div></div></div><div class="sc-eWnToP eUdCtG"><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"><p>Delete a single webhook by its ID.</p>
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="id"><span class="sc-iemWCZ bcnRwz"></span><span>id</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>The webhook id to delete</p>
</div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bjdvNh" disabled=""><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Webhook is deleted</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-110" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-111" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-111" aria-labelledby="react-tabs-110"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"id"</span>: <span class="token string">&quot;string&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="tag/Admin/paths/~1api~1admin~1webhooks~1create/post" data-section-id="tag/Admin/paths/~1api~1admin~1webhooks~1create/post" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Admin/paths/~1api~1admin~1webhooks~1create/post" aria-label="tag/Admin/paths/~1api~1admin~1webhooks~1create/post"></a>Create a webhook.<!-- --> </h2><div class="sc-kYPZxB jdCbTS"><button class="sc-dWBRfb bMYkBl"><span type="post" class="sc-jHcXXw bXnXQF http-verb post">post</span><span class="sc-xGAEC jRjoAh">/api/admin/webhooks/create</span><svg class="sc-dIsUp iFYrlT" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-bQCEYZ gBwOdz"><div class="sc-fXgAZx fKFAhr"><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div><div tabindex="0" role="button"><div class="sc-EZqKI gjiGnZ"><span></span>/api/admin/webhooks/create</div></div></div></div></div><div class="sc-eWnToP eUdCtG"><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"><p>Create a single webhook that acts on the requested events.</p>
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="url"><span class="sc-iemWCZ bcnRwz"></span><span>url</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>The url to post the events to.</p>
</div></div></div></td></tr><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="events"><span class="sc-iemWCZ bcnRwz"></span><span>events</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV">Array of </span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">strings</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>The events to be notified about.</p>
</div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Token was created.</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-112" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-113" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-113" aria-labelledby="react-tabs-112"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"url"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"events"</span>: <button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable collapsed"><span class="token string">&quot;string&quot;</span></div></li></ul><span class="token punctuation">]</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-114" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-115" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-115" aria-labelledby="react-tabs-114"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"name"</span>: <span class="token string">&quot;your new token&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"token"</span>: <span class="token string">&quot;zG2xO-mHTFnelCp5xaIkYEFWcPhoOswOSRmFC1BkI=&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="tag/Chat" data-section-id="tag/Chat" class="sc-eCApnc fxZJZV"><div class="sc-iCoGMd KWWXd"><div class="sc-hKFxyN egQuEZ"><h1 class="sc-fujyAs cTueGk"><a class="sc-crzoAE iUxAWq" href="#tag/Chat" aria-label="tag/Chat"></a>Chat</h1></div></div><div class="sc-hKFxyN dmghQN"><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy redoc-markdown "><p>Endpoints related to the chat interface.</p>
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-20 05:22:29 +03:00
</div></div></div><div id="tag/Chat/paths/~1api~1chat~1register/post" data-section-id="tag/Chat/paths/~1api~1chat~1register/post" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Chat/paths/~1api~1chat~1register/post" aria-label="tag/Chat/paths/~1api~1chat~1register/post"></a>Register a chat user<!-- --> </h2><div class="sc-kYPZxB jdCbTS"><button class="sc-dWBRfb bMYkBl"><span type="post" class="sc-jHcXXw bXnXQF http-verb post">post</span><span class="sc-xGAEC jRjoAh">/api/chat/register</span><svg class="sc-dIsUp iFYrlT" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-bQCEYZ gBwOdz"><div class="sc-fXgAZx fKFAhr"><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div><div tabindex="0" role="button"><div class="sc-EZqKI gjiGnZ"><span></span>/api/chat/register</div></div></div></div></div><div class="sc-eWnToP eUdCtG"><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"><p>Register a user that returns an access token for accessing chat.</p>
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/UserToken" aria-label="section/Authentication/UserToken">UserToken</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="displayName"><span class="sc-iemWCZ bcnRwz"></span><span>displayName</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>Optionally provide a display name you want to assign to this user when registering.</p>
2021-09-13 11:27:08 +03:00
</div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"></span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-116" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-117" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-117" aria-labelledby="react-tabs-116"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"displayName"</span>: <span class="token string">&quot;string&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-118" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-119" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-119" aria-labelledby="react-tabs-118"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"id"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"accessToken"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"displayName"</span>: <span class="token string">&quot;string&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="tag/Chat/paths/~1api~1chat/get" data-section-id="tag/Chat/paths/~1api~1chat/get" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Chat/paths/~1api~1chat/get" aria-label="tag/Chat/paths/~1api~1chat/get"></a>Chat Messages Backlog<!-- --> </h2><div class="sc-kYPZxB jdCbTS"><button class="sc-dWBRfb bMYkBl"><span type="get" class="sc-jHcXXw cAOCuf http-verb get">get</span><span class="sc-xGAEC jRjoAh">/api/chat</span><svg c
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/UserToken" aria-label="section/Authentication/UserToken">UserToken</a></span></span></div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"></span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-120" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-121" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-121" aria-labelledby="react-tabs-120"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable "><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"user"</span>: <button class="collapser" aria-label="expand"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"id"</span>: <span class="token string">&quot;yklw5Imng&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"displayName"</span>: <span class="token string">&quot;awesome-pizza&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"displayColor"</span>: <span class="token number">42</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"createdAt"</span>: <span class="token string">&quot;2019-08-24T14:15:22Z&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"previousNames"</span>: <span class="token string">&quot;awesome-pizza,user42&quot;</span></div></li></ul><span class="token punctuation">}</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"body"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"id"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"visible"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"timestamp"</span>: <span class="token string">&quot;2019-08-24T14:15:22
</div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"></span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-122" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-123" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-123" aria-labelledby="react-tabs-122"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"items"</span>: <button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable collapsed"><button class="collapser" aria-label="expand"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"name"</span>: <span class="token string">&quot;nicolas_cage_party&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"emoji"</span>: <span class="token string">&quot;/img/emoji/nicolas_cage_party.gif&quot;</span></div></li></ul><span class="token punctuation">}</span>,</div></li><li><div class="hoverable collapsed"><button class="collapser" aria-label="expand"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"name"</span>: <span class="token string">&quot;parrot&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"emoji"</span>: <span class="token string">&quot;/img/emoji/parrot.gif&quot;</span></div></li></ul><span class="token punctuation">}</span></div></li></ul><span class="token punctuation">]</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="tag/Integrations" data-section-id="tag/Integrations" class="sc-eCApnc fxZJZV"><div class="sc-iCoGMd KWWXd"><div class="sc-hKFxyN egQuEZ"><h1 class="sc-fujyAs cTueGk"><a class="sc-crzoAE iUxAWq" href="#tag/Integrations" aria-label="tag/Integrations"></a>Integrations</h1></div></div><div class="sc-hKFxyN dmghQN"><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy redoc-markdown "><p>APIs built to allow 3rd parties to interact with an Owncast server.</p>
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-20 05:22:29 +03:00
</div></div></div><div id="tag/Integrations/paths/~1api~1integrations~1streamtitle/post" data-section-id="tag/Integrations/paths/~1api~1integrations~1streamtitle/post" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Integrations/paths/~1api~1integrations~1streamtitle/post" aria-label="tag/Integrations/paths/~1api~1integrations~1streamtitle/post"></a>Set the stream title.<!-- --> </h2><div class="sc-kYPZxB jdCbTS"><button class="sc-dWBRfb bMYkBl"><span type="post" class="sc-jHcXXw bXnXQF http-verb post">post</span><span class="sc-xGAEC jRjoAh">/api/integrations/streamtitle</span><svg class="sc-dIsUp iFYrlT" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-bQCEYZ gBwOdz"><div class="sc-fXgAZx fKFAhr"><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div><div tabindex="0" role="button"><div class="sc-EZqKI gjiGnZ"><span></span>/api/integrations/streamtitle</div></div></div></div></div><div class="sc-eWnToP eUdCtG"><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"><p>Set the title of the currently streaming content.</p>
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AccessToken" aria-label="section/Authentication/AccessToken">AccessToken</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT sc-ckTSus fABPTr eQzShU ihkizP" kind="field" title="value"><span class="sc-iemWCZ bcnRwz"></span><button aria-label="expand properties"><span>value</span><svg class="sc-dIsUp cEsevO" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string or integer or object or boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-124" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-125" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-125" aria-labelledby="react-tabs-124"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"value"</span>: <span class="token string">&quot;Streaming my favorite game, Desert Bus.&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-126" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-127" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-127" aria-labelledby="react-tabs-126"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_23" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_23_list_0" aria-controls="react_dropdown_aria_23_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_23_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_23_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_23_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></span></div></div><div><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul cl
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AccessToken" aria-label="section/Authentication/AccessToken">AccessToken</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="body"><span class="sc-iemWCZ bcnRwz"></span><span>body</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>The message text that will be sent as the user.</p>
</div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Message was sent.</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-128" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-129" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-129" aria-labelledby="react-tabs-128"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"body"</span>: <span class="token string">&quot;string&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-130" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-131" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-131" aria-labelledby="react-tabs-130"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"success"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"message"</span>: <span class="token string">&quot;sent&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="tag/Integrations/paths/~1api~1integrations~1chat~1system/post" data-section-id="tag/Integrations/paths/~1api~1integrations~1chat~1system/post" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Integrations/paths/~1api~1integrations~1chat~1system/post" aria-label="tag/Integrations/paths/~1api~1integrations~1chat~1system/post"></a>Send a system chat message.<!-- --> </h2><div class="sc-kYPZxB jdCbTS"><button class="sc-dWBRfb bMYkBl"><span type="post" class="sc-jHcXXw bXnXQF http-verb post">post</span><span class="sc-xGAEC jRjoAh">/api/integrations/chat/system</span><svg class="sc-dIsUp iFYrlT" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-bQCEYZ gBwOdz"><div class="sc-fXgAZx fKFAhr"><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div><div tabindex="0" role="button"><div class="sc-EZqKI gjiGnZ"><span></span>/api/integrations/chat/system</div>
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AccessToken" aria-label="section/Authentication/AccessToken">AccessToken</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="body"><span class="sc-iemWCZ bcnRwz"></span><span>body</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>The message text that will be sent as the system user.</p>
</div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Message was sent.</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-132" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-133" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-133" aria-labelledby="react-tabs-132"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"body"</span>: <span class="token string">&quot;string&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-134" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-135" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-135" aria-labelledby="react-tabs-134"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"success"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"message"</span>: <span class="token string">&quot;sent&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="tag/Integrations/paths/~1api~1integrations~1chat~1action/post" data-section-id="tag/Integrations/paths/~1api~1integrations~1chat~1action/post" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Integrations/paths/~1api~1integrations~1chat~1action/post" aria-label="tag/Integrations/paths/~1api~1integrations~1chat~1action/post"></a>Send a chat action.<!-- --> </h2><div class="sc-kYPZxB jdCbTS"><button class="sc-dWBRfb bMYkBl"><span type="post" class="sc-jHcXXw bXnXQF http-verb post">post</span><span class="sc-xGAEC jRjoAh">/api/integrations/chat/action</span><svg class="sc-dIsUp iFYrlT" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-bQCEYZ gBwOdz"><div class="sc-fXgAZx fKFAhr"><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div><div tabindex="0" role="button"><div class="sc-EZqKI gjiGnZ"><span></span>/api/integrations/chat/action</div></div></
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AccessToken" aria-label="section/Authentication/AccessToken">AccessToken</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="body"><span class="sc-iemWCZ bcnRwz"></span><span>body</span><div class="sc-TtZnY sc-jHNicF hUSnpT bsGeIE"> required </div></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>The message text that will be sent as the system user.</p>
</div></div></div></td></tr><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="author"><span class="sc-iemWCZ bcnRwz"></span><span>author</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>An optional user name that performed the action.</p>
</div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Message was sent.</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-136" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-137" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-137" aria-labelledby="react-tabs-136"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"body"</span>: <span class="token string">&quot;rolled a 15 on the dice&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"author"</span>: <span class="token string">&quot;JohnSmith&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-138" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-139" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-139" aria-labelledby="react-tabs-138"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"success"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"message"</span>: <span class="token string">&quot;sent&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="tag/Integrations/paths/~1api~1integrations~1chat~1system~1client~1{clientId}/post" data-section-id="tag/Integrations/paths/~1api~1integrations~1chat~1system~1client~1{clientId}/post" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Integrations/paths/~1api~1integrations~1chat~1system~1client~1{clientId}/post" aria-label="tag/Integrations/paths/~1api~1integrations~1chat~1system~1client~1{clientId}/post"></a>Send system chat message to a client, identified by its ClientId<!-- --> </h2><div class="sc-kYPZxB jdCbTS"><button class="sc-dWBRfb bMYkBl"><span type="post" class="sc-jHcXXw bXnXQF http-verb post">post</span><span class="sc-xGAEC jRjoAh">/api/integrations/chat/system/client/{clientId}</span><svg class="sc-dIsUp iFYrlT" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="tr
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AccessToken" aria-label="section/Authentication/AccessToken">AccessToken</a></span></span></div></div><div><h5 class="sc-iqAclL eONCmm">path<!-- --> Parameters</h5><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="clientId"><span class="sc-iemWCZ bcnRwz"></span><span>clientId</span><div class="sc-TtZnY sc-jHNicF hUSnpT bsGeIE"> required </div></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">integer</span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC"> <!-- -->&lt;<!-- -->int64<!-- -->&gt;<!-- --> </span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>Client ID (a unique numeric Id, identifying the client connection)</p>
</div></div></div></td></tr></tbody></table></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="body"><span class="sc-iemWCZ bcnRwz"></span><span>body</span><div class="sc-TtZnY sc-jHNicF hUSnpT bsGeIE"> required </div></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>The message text that will be sent to the client.</p>
</div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Message was sent.</p>
</span></button></div><div><button class="sc-jXcxbT gkwAYh"><svg class="sc-dIsUp hikpbD" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">500<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Message was not sent to the client</p>
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-140" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-141" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-141" aria-labelledby="react-tabs-140"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"body"</span>: <span class="token string">&quot;What a beautiful day. I love it&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-142" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-143" tabindex="0">200</li><li class="tab-error" role="tab" id="react-tabs-144" aria-selected="false" aria-disabled="false" aria-controls="react-tabs-145">500</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-143" aria-labelledby="react-tabs-142"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"success"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"messages"</span>: <span class="token string">&quot;sent&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div><div class="react-tabs__tab-panel" role="tabpanel" id="react-tabs-145" aria-labelledby="react-tabs-144"></div></div></div></div></div></div><div id="tag/Integrations/paths/~1api~1admin~1accesstokens~1create/post" data-section-id="tag/Integrations/paths/~1api~1admin~1accesstokens~1create/post" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Integrations/paths/~1api~1admin~1accesstokens~1create/post" aria-label="tag/Integrations/paths/~1api~1admin~1accesstokens~1create/post"></a>Create an access token.<!-- --> </h2><div class="sc-kYPZxB jdCbTS"><button class="sc-dWBRfb bMYkBl"><span type="post" class="sc-jHcXXw bXnXQF http-verb post">post</span><span class="sc-xGAEC jRjoAh">/api/admin/accesstokens/create</span><svg class="sc-dIsUp iFYrlT" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="name"><span class="sc-iemWCZ bcnRwz"></span><span>name</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>The human-readable name to give this access token.</p>
</div></div></div></td></tr><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="scopes"><span class="sc-iemWCZ bcnRwz"></span><span>scopes</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV">Array of </span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">strings</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Token was created.</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-146" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-147" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-147" aria-labelledby="react-tabs-146"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"name"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"scopes"</span>: <button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable collapsed"><span class="token string">&quot;string&quot;</span></div></li></ul><span class="token punctuation">]</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-148" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-149" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-149" aria-labelledby="react-tabs-148"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"name"</span>: <span class="token string">&quot;your new token&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"token"</span>: <span class="token string">&quot;zG2xO-mHTFnelCp5xaIkYEFWcPhoOswOSRmFC1BkI=&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="tag/Integrations/paths/~1api~1admin~1accesstokens~1delete/post" data-section-id="tag/Integrations/paths/~1api~1admin~1accesstokens~1delete/post" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Integrations/paths/~1api~1admin~1accesstokens~1delete/post" aria-label="tag/Integrations/paths/~1api~1admin~1accesstokens~1delete/post"></a>Delete an access token.<!-- --> </h2><div class="sc-kYPZxB jdCbTS"><button class="sc-dWBRfb bMYkBl"><span type="post" class="sc-jHcXXw bXnXQF http-verb post">post</span><span class="sc-xGAEC jRjoAh">/api/admin/accesstokens/delete</span><s
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="token"><span class="sc-iemWCZ bcnRwz"></span><span>token</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>The token to delete</p>
</div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Token was deleted.</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-150" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-151" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-151" aria-labelledby="react-tabs-150"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"token"</span>: <span class="token string">&quot;string&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-152" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-153" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-153" aria-labelledby="react-tabs-152"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"success"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"message"</span>: <span class="token string">&quot;deleted token&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="tag/Integrations/paths/~1api~1admin~1accesstokens/get" data-section-id="tag/Integrations/paths/~1api~1admin~1accesstokens/get" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Integrations/paths/~1api~1admin~1accesstokens/get" aria-label="tag/Integrations/paths/~1api~1admin~1accesstokens/get"></a>Return all access tokens.<!-- --> </h2><div class="sc-kYPZxB jdCbTS"><button class="sc-dWBRfb bMYkBl"><span type="get" class="sc-jHcXXw cAOCuf http-verb get">get</span><span class="sc-xGAEC jRjoAh">/api/admin/accesstokens</span><svg class="sc-dIsUp iFYrlT" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-bQCEYZ gBwOdz"><div class="sc-fXgAZx fKFAhr"><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div><div tabindex="0" role="button"><div class="sc-EZqKI gjiGnZ"><span></span>/api/admin/accesstokens</div></div></div></div></div><div class="sc-
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Tokens are returned</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-154" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-155" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-155" aria-labelledby="react-tabs-154"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable "><span class="token string">&quot;string&quot;</span></div></li></ul><span class="token punctuation">]</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="tag/Integrations/paths/~1api~1admin~1config~1externalactions/post" data-section-id="tag/Integrations/paths/~1api~1admin~1config~1externalactions/post" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Integrations/paths/~1api~1admin~1config~1externalactions/post" aria-label="tag/Integrations/paths/~1api~1admin~1config~1externalactions/post"></a>Set external action URLs.<!-- --> </h2><div class="sc-kYPZxB jdCbTS"><button class="sc-dWBRfb bMYkBl"><span type="post" class="sc-jHcXXw bXnXQF http-verb post">post</span><span class="sc-xGAEC jRjoAh">/api/admin/config/externalactions</span><svg class="sc-dIsUp iFYrlT" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-bQCEYZ gBwOdz"><div class="sc-fXgAZx fKFAhr"><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div><div tabindex="0" role="button"><div class="sc-EZqKI gjiGnZ"><span></span>/api/admin/config/externalactions</div></div></div></div></div><div class="sc-eWnToP eUdCtG"><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"><p>Set a collection of external action URLs that are displayed in the UI.</p>
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AdminBasicAuth" aria-label="section/Authentication/AdminBasicAuth">AdminBasicAuth</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><div><div class="sc-bCwfaz jaCkRh"> Array (<!-- -->)</div><div class="sc-jQAxuV iglPxx"><table class="sc-hHEiqL dYlGyN"><tbody><tr><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="url"><span class="sc-iemWCZ bcnRwz"></span><span>url</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>URL of the external action content.</p>
</div></div></div></td></tr><tr><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="title"><span class="sc-iemWCZ bcnRwz"></span><span>title</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>The title to put on the external action button.</p>
</div></div></div></td></tr><tr><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="description"><span class="sc-iemWCZ bcnRwz"></span><span>description</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>Optional additional description to display in the UI.</p>
</div></div></div></td></tr><tr><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="icon"><span class="sc-iemWCZ bcnRwz"></span><span>icon</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>The URL to an image to place on the external action button.</p>
</div></div></div></td></tr><tr><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="color"><span class="sc-iemWCZ bcnRwz"></span><span>color</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">string</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>Optional color to use for drawing the action button.</p>
</div></div></div></td></tr><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="openExternally"><span class="sc-iemWCZ bcnRwz"></span><span>openExternally</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>If set this action will open in a new browser tab instead of an internal modal.</p>
</div></div></div></td></tr></tbody></table></div><div class="sc-iwajpm kHKMOg"></div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bjdvNh" disabled=""><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Actions have been updated.</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-156" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-157" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-157" aria-labelledby="react-tabs-156"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable "><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"url"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"title"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"description"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"icon"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"color"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"openExternally"</span>: <span class="token boolean">true</span></div></li></ul><span class="token punctuation">}</span></div></li></ul><span class="token punctuation">]</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="tag/Integrations/paths/~1api~1integrations~1clients/get" data-section-id="tag/Integrations/paths/~1api~1integrations~1clients/get" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Integrations/paths/~1api~1integrations~1clients/get" aria-label="tag/Integrations/paths/~1api~1integrations~1clients/get"></a>Return a list of currently connected clients<!-- --> </h2><div class="sc-kYPZxB jdCbTS"><button class="sc-dWBRfb bMYkBl"><span type="get" class="sc-jHcXXw cAOCuf http-verb get">get</span><span class="sc-xGAEC jRjoAh">/api/integrations/clients</span><svg class="sc-dIsUp iFYrlT" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-bQCEYZ gBwOdz"><div class="sc-fXgAZx fKFAhr"><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div><div tabindex="0" role="button"><div class="sc-EZqKI gjiGnZ"><span></span>/api/integrations/clients</div></div></div></div></div><div class="sc-eWnToP eUdCtG"><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"><p>Return a list of currently connected clients with optional geo details.</p>
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AccessToken" aria-label="section/Authentication/AccessToken">AccessToken</a></span></span></div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Successful response of an array of clients</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-158" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-159" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-159" aria-labelledby="react-tabs-158"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable "><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"connectedAt"</span>: <span class="token string">&quot;2020-10-06T23:20:44.588649-07:00&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"messageCount"</span>: <span class="token number">3</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"userAgent"</span>: <span class="token string">&quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"ipAddress"</span>: <span class="token string">&quot;172.217.164.110&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"geo"</span>: <button class="collapser" aria-label="expand"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"countryCode"</span>: <span class="token string">&quot;US&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"regionName"</span>: <span class="token string">&quot;California&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"timeZone"</span>: <span class="token string">&quot;America/Los_Angeles&quot;</span></div></li></ul><span class="token punctuation">}</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"user"</span>: <button class="collapser" aria-label="expand"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"id"</span>: <span class="token string">&quot;yklw5Imng&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"displayName"</span>: <span class="token string">&quot;awesome-pizza&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"displayColor"</span>: <span class="token number">42</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"createdAt"</span>: <span class="token stri
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AccessToken" aria-label="section/Authentication/AccessToken">AccessToken</a></span></span></div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"></span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-160" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-161" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-161" aria-labelledby="react-tabs-160"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable "><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"user"</span>: <button class="collapser" aria-label="expand"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"id"</span>: <span class="token string">&quot;yklw5Imng&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"displayName"</span>: <span class="token string">&quot;awesome-pizza&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"displayColor"</span>: <span class="token number">42</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"createdAt"</span>: <span class="token string">&quot;2019-08-24T14:15:22Z&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"previousNames"</span>: <span class="token string">&quot;awesome-pizza,user42&quot;</span></div></li></ul><span class="token punctuation">}</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"body"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"id"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"visible"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"timestamp"</span>: <span class="token string">&quot;2019-08-24T14
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-20 05:22:29 +03:00
</div></div><div class="sc-gzcbmu iEcHcE"><div class="sc-gVFcvn cuYWRV"><h5 class="sc-iqAclL sc-fIxmyt eONCmm kZsYIY">Authorizations: </h5></div><div class="sc-fWWYYk bwNcZa"><span class="sc-hkeOVe fguZND"><span class="sc-cbeScs ikavEm"><a href="#section/Authentication/AccessToken" aria-label="section/Authentication/AccessToken">AccessToken</a></span></span></div></div><h5 class="sc-iqAclL eONCmm">Request Body schema: <span class="sc-jcwpoC joKODG">application/json</span></h5><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"></div><table class="sc-hHEiqL dYlGyN"><tbody><tr><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="visible"><span class="sc-iemWCZ bcnRwz"></span><span>visible</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV"></span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">boolean</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"><p>Are these messages visible.</p>
</div></div></div></td></tr><tr class="last undefined"><td class="sc-hBMUJo sc-fFSPTT fABPTr eQzShU" kind="field" title="idArray"><span class="sc-iemWCZ bcnRwz"></span><span>idArray</span></td><td class="sc-bkbkJK gWxDzL"><div><div><span class="sc-fbIWvP sc-FRrlG CMpTe bBFKjV">Array of </span><span class="sc-fbIWvP sc-fXazdy CMpTe gJKPGC">strings</span></div> <div><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div></div></div></td></tr></tbody></table><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Operation Success/Failure Response</p>
2021-09-13 11:27:08 +03:00
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Request samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-162" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-163" tabindex="0">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-163" aria-labelledby="react-tabs-162"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"visible"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"idArray"</span>: <button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable collapsed"><span class="token string">&quot;string&quot;</span></div></li></ul><span class="token punctuation">]</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-164" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-165" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-165" aria-labelledby="react-tabs-164"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Example</span><div role="button" class="sc-cxNHIi gNOLNk dropdown sc-cBoqAE sc-eirqVv iEFeuB iULjjV"><div class="sc-lmgQwP joaceI dropdown-selector"><span class="sc-iJCRrE iARuYK dropdown-selector-search"><input id="react_dropdown_aria_24" value="" readonly="" autoComplete="off" role="combobox" aria-hidden="false" aria-expanded="false" aria-haspopup="listbox" aria-activedescendant="react_dropdown_aria_24_list_0" aria-controls="react_dropdown_aria_24_list" aria-label="Example"/></span><span class="sc-giAqHp csngrC dropdown-selector-value" value="Operation succeeded.">Operation succeeded.</span><div class="sc-bYwzuL hFbBvr dropdown-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></div></div><div role="listbox" id="react_dropdown_aria_24_list" style="height:0;width:0;overflow:hidden"><div role="option" id="react_dropdown_aria_24_list_0" aria-selected="true" aria-label="Operation succeeded."></div><div role="option" id="react_dropdown_aria_24_list_1" aria-selected="false" aria-label="Operation failed."></div></div><span class="sc-kLojOw iAqBwY dropdown-selector-content"><div aria-selected="true" class="sc-gXfVKN iyzZle dropdown-option selected focused" selected="">Operation succeeded.</div><div aria-selected="false" class="sc-gXfVKN bbfNvi dropdown-option ">Operation failed.</div></span></div></div><div><d
</div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"></span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-166" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-167" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-167" aria-labelledby="react-tabs-166"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"name"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"summary"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"logo"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"tags"</span>: <button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable collapsed"><span class="token string">&quot;string&quot;</span></div></li></ul><span class="token punctuation">]</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"socialHandles"</span>: <button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable collapsed"><button class="collapser" aria-label="expand"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"platform"</span>: <span class="token string">&quot;github&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"url"</span>: <span class="token string">&quot;</span><a href="http://github.com/owncast/owncast">http://github.com/owncast/owncast</a><span class="token string">&quot;</span></div></li></ul><span class="token punctuation">}</span></div></li></ul><span class="token punctuation">]</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"extraPageContent"</span>: <span class="token string">&quot;&lt;p&gt;This page is &lt;strong&gt;super&lt;/strong&gt; cool!&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"version"</span>: <span class="token string">&quot;Owncast v0.0.3-macOS (ef3796a033b32a312ebf5b334851cbf9959e7ecb)&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></
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-20 05:22:29 +03:00
</div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bjdvNh" disabled=""><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"><p>Successful ping</p>
</span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"></div></div></div><div id="tag/Server/paths/~1api~1status/get" data-section-id="tag/Server/paths/~1api~1status/get" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Server/paths/~1api~1status/get" aria-label="tag/Server/paths/~1api~1status/get"></a>Current Status<!-- --> </h2><div class="sc-kYPZxB jdCbTS"><button class="sc-dWBRfb bMYkBl"><span type="get" class="sc-jHcXXw cAOCuf http-verb get">get</span><span class="sc-xGAEC jRjoAh">/api/status</span><svg class="sc-dIsUp iFYrlT" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-bQCEYZ gBwOdz"><div class="sc-fXgAZx fKFAhr"><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div><div tabindex="0" role="button"><div class="sc-EZqKI gjiGnZ"><span></span>/api/status</div></div></div></div></div><div class="sc-eWnToP eUdCtG"><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"><p>This endpoint is used to discover when a server is broadcasting, the number of active viewers as well as other useful information for updating the user interface.</p>
2021-09-13 11:27:08 +03:00
</div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"></span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-168" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-169" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-169" aria-labelledby="react-tabs-168"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"lastConnectTime"</span>: <span class="token string">&quot;2020-10-03T21:36:22-05:00&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"lastDisconnectTime"</span>: <span class="token keyword">null</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"online"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"overallMaxViewerCount"</span>: <span class="token number">420</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"sessionMaxViewerCount"</span>: <span class="token number">12</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"viewerCount"</span>: <span class="token number">7</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="tag/Server/paths/~1api~1yp/get" data-section-id="tag/Server/paths/~1api~1yp/get" class="sc-eCApnc bJnWIW"><div class="sc-iCoGMd sc-irKDMX KWWXd kBgcMI"><div class="sc-hKFxyN egQuEZ"><h2 class="sc-pNWdM euRMgx"><a class="sc-crzoAE iUxAWq" href="#tag/Server/paths/~1api~1yp/get" aria-label="tag/Server/paths/~1api~1yp/get"></a>Yellow Pages Information<!-- --> </h2><div class="sc-kYPZxB jdCbTS"><button class="sc-dWBRfb bMYkBl"><span type="get" class="sc-jHcXXw cAOCuf http-verb get">get</span><span class="sc-xGAEC jRjoAh">/api/yp</span><svg class="sc-dIsUp iFYrlT" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-bQCEYZ gBwOdz"><div class="sc-fXgAZx fKFAhr"><div class="sc-iBzEeX sc-cOifOu dFWqin cJyzuM"></div><div tabindex="0" role="button"><div class="sc-EZqKI gjiGnZ"><span></span>/api/yp</div></div></div></div></div><div class="sc-eWnToP eUdCtG"><div class="sc-iBzEeX sc-cOifOu dFWqin bHzJuy"><p>Information to be used in the Yellow Pages service, a global directory of Owncast servers.</p>
</div></div><div><h3 class="sc-dTSzeu efuQZt">Responses</h3><div><button class="sc-jXcxbT bCvCHz"><svg class="sc-dIsUp jLtOTj" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-jlZJtj jSPrUM">200<!-- --> </strong><span class="sc-Arkif dXjyFC"></span></button></div></div></div><div class="sc-jSFjdj sc-gKAaRy hsSsLr gcushC"><div><h3 class="sc-kEqXSa iXmHCl"> <!-- -->Response samples<!-- --> </h3><div class="sc-carFqZ evYMTo" data-tabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-170" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-171" tabindex="0">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-171" aria-labelledby="react-tabs-170"><div><div class="sc-hhIiOg lhdonw"><span class="sc-oeezt bmwRob">Content type</span><div class="sc-eJocfa jzRrfm">application/json</div></div><div class="sc-gGLxEB hINeXe"><div class="sc-iNiQyp cVHUjN"><div class="sc-efHYUO eQQUSD"><button><div class="sc-khIgEk llGFDD">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-iBzEeX dFWqin sc-jffHpj fqzhkP"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"name"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"description"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"logo"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"nsfw"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"tags"</span>: <button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable collapsed"><span class="token string">&quot;string&quot;</span></div></li></ul><span class="token punctuation">]</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"online"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"viewerCount"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"overallMaxViewerCount"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"sessionMaxViewerCount"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"lastConnectTime"</span>: <span class="token string">&quot;2019-08-24T14:15:22Z&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div></div><div class="sc-cKRKFl gBTuHc"></div></div></div>
2020-10-22 08:42:51 +03:00
<script>
2021-09-30 02:37:09 +03:00
const __redoc_state = {"menu":{"activeItemIdx":-1},"spec":{"data":{"openapi":"3.0.1","info":{"title":"Owncast","description":"Owncast is a self-hosted live video and web chat server for use with existing popular broadcasting software. The following APIs represent the state in the development branch.\n\n# Authentication\n\n<!-- ReDoc-Inject: <security-definitions> -->","version":"0.0.10-dev","contact":{"name":"Gabe Kangas","email":"gabek@real-ity.com","url":"http://owncast.online"},"x-logo":{"url":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAEvmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS41LjAiPgogPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgeG1sbnM6ZXhpZj0iaHR0cDovL25zLmFkb2JlLmNvbS9leGlmLzEuMC8iCiAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIgogICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgZXhpZjpQaXhlbFhEaW1lbnNpb249IjEyOCIKICAgZXhpZjpQaXhlbFlEaW1lbnNpb249IjEyOCIKICAgZXhpZjpDb2xvclNwYWNlPSIxIgogICB0aWZmOkltYWdlV2lkdGg9IjEyOCIKICAgdGlmZjpJbWFnZUxlbmd0aD0iMTI4IgogICB0aWZmOlJlc29sdXRpb25Vbml0PSIyIgogICB0aWZmOlhSZXNvbHV0aW9uPSI5Ni4wIgogICB0aWZmOllSZXNvbHV0aW9uPSI5Ni4wIgogICBwaG90b3Nob3A6Q29sb3JNb2RlPSIzIgogICBwaG90b3Nob3A6SUNDUHJvZmlsZT0ic1JHQiBJRUM2MTk2Ni0yLjEiCiAgIHhtcDpNb2RpZnlEYXRlPSIyMDIwLTA2LTE4VDAwOjQ2OjEyLTA3OjAwIgogICB4bXA6TWV0YWRhdGFEYXRlPSIyMDIwLTA2LTE4VDAwOjQ2OjEyLTA3OjAwIj4KICAgPHhtcE1NOkhpc3Rvcnk+CiAgICA8cmRmOlNlcT4KICAgICA8cmRmOmxpCiAgICAgIHN0RXZ0OmFjdGlvbj0icHJvZHVjZWQiCiAgICAgIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFmZmluaXR5IERlc2lnbmVyIChNYXIgMzEgMjAyMCkiCiAgICAgIHN0RXZ0OndoZW49IjIwMjAtMDYtMThUMDA6NDY6MTItMDc6MDAiLz4KICAgIDwvcmRmOlNlcT4KICAgPC94bXBNTTpIaXN0b3J5PgogIDwvcmRmOkRlc2NyaXB0aW9uPgogPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KPD94cGFja2V0IGVuZD0iciI/Pn6jclUAAAGCaUNDUHNSR0IgSUVDNjE5NjYtMi4xAAAokXWRzytEURTHPzODESPCwsLipWE15EdNbJSZNNSkaYwy2Mw880PNj9d7I8lW2SpKbPxa8BewVdZKESlZWVgTG/ScZ6Zmkjm3c8/nfu89p3vPBXsko2aNmn7I5gp6OOBTZqNzivOZOlpx0oESUw1tLBQKUtU+7rBZ8abXqlX93L/WuJgwVLDVC4+qml4QnhAOrhQ0i7eF29V0bFH4VNijywWFby09XuQXi1NF/rJYj4T9YG8RVlIVHK9gNa1nheXluLOZZbV0H+slrkRuZlpil3gnBmEC+FCYZBw/XgYYkdlLL4P0yYoq+f2/+VPkJVeVWWMVnSVSpCngEXVZqickJkVPyMiwavX/b1+N5NBgsbrLB7VPpvnWDc4t+N40zc9D0/w+AscjXOTK+fkDGH4XfbOsufeheR3OLstafAfON6DjQYvpsV/JIW5PJuH1BJqi0HYNDfPFnpX2Ob6HyJp81RXs7kGPnG9e+AEyv2fOZnRq6wAAAAlwSFlzAAAOxAAADsQBlSsOGwAAHBpJREFUeJztfXl8VEW69vO852QhYYcAIRsGRETZ3BURRXGcn5/bOKPOOPPduRevv9EZh3tdRp1x+bjM6FXGXcdt3HGDO7ij1w0XRnHBBTAoypJASEjYlyzdp+r9/ugEmqQ7fbrTnaQDz+9XhD6n6q23u556q+qtDdiP/diPfRfsbAU6Gx/fpz36ZeJiUM8EMAzEAADZADIBGADbAdRCdbW1mFdXL88eMZ07O1PnZGKfJcA395sCOJgmgisB9vKbThXbVfF3Nfr4oZc4S1OpY0dgnyPAkpuV2sc7WRx5kURuO0RZazDLqN444VK3MWkKdjD2KQJ8ebe6jmsegMNfAshKgkhVq8uMxRmH/dYtT4K8Dsc+Q4DF93m9BXyIDs5PunBFuXp69oTL3K+SLjvF2CcI8Pm9XhbJJ0mcl8JsKuxOjD/iD86WFOaRdLidrUBHQIFZUJynmtJsitEDLwKYnNJckoxubwE+uSt4CYX3ApAOyM5aq78/ZnrGfR2QV1LQrQnw/h1eYabgGxK9OzDbOmtQeNx/umnRFHTbJuDD24MZQl1glb2RWtPfEjmATgPw1w7NNUF0hFnsFFiLi6xyuFWgwwN4w/uzgh1pdRJGt7QA784yBaC5z2qnNXG9VDgBwPudlL9vdEsCKM1lBmQHm/69dVA7FfsJ0PF4878bR1rldHZi4QOAgqcDuK5ztYiNbtcHUPLfVTXbqqKTw9hXbmzo2dm/Ryx0Kwsw50Z1rQYv7mw9miDM5kgAX3S2Im2hWxGgR3bwcgPt6GFfVKjaodhPgI6DVf1FZ+sQDlUO6GwdYqHbEGDOH+0gq8ExXaX2A4CiQz2QCaHbEAAZjXdZZRfr1GqXd7V3CwI886eGbHVxqulsRVpCaTtbhVjoFgQIKAZkqfbpSuYfAAit62wdYqFbEMDJ0EuMwulsPVpB0eVXD6c9Ae6+fHumAX6TqOfPGsAYQA1grUIt0HLhCAlQQkGEEAdwHPiYTNcNiWnVcUh7AuTkOMUWOqAt868aKmhrgWCjorEOCDQogoFQwScEAhlZQFY2kdkDyOxBiADihAgDANagKkHpHYa0J4ASw02kwlegfqdi145QQTcToBXaMW4wAaAhoMB2gNCQhXCAzCwgpxdMrpO1JnHpHYO0J4BRPaX5/8FGoKFO0VAfquGt1gCmelCmADwg4AE7d7Lsz89mBFKcY7uR9gQIGJwaaFDs2KoIdvT2jDYJZRd1lBrtQVoT4PLzt/WrWqdjdtd0n+ZcFQECj0J1IYB6BU6h8NcAeiRLN1V8lCxZqURaE0AcHGKgjMO0e7CYoca5f9ZzuZvCn
2020-10-22 08:42:51 +03:00
var container = document.getElementById('redoc');
Redoc.hydrate(__redoc_state, container);
2020-10-22 08:42:51 +03:00
</script>
</body>
</html>