Commit graph

324 commits

Author SHA1 Message Date
M. Ajmal Moochingal
23b6e5868d
Using prepared statements for SQL queries. (#2257)
* using prepared statements for sql query for fixing sql injection

* returning error in getChat instead of logging
2022-10-28 12:32:42 -07:00
Matthew Donoughe
10055664bb
add tests for webhook events (#2180)
* add tests for webhook events

* atomic.Uint32 is not in Go 1.18
2022-10-09 22:55:54 -07:00
Gabe Kangas
99d034b1a5
Replace -> ReplaceAll 2022-09-21 10:24:16 -07:00
Matt Owens
5dafdb479d
Sanitize user submitted values before logging (#2134)
* strip line breaks from user-submitted values before logging

* finish comment
2022-09-21 10:03:16 -07:00
Gabe Kangas
20e6b87a35
Remove package-comments rule 2022-08-26 19:30:35 -07:00
Gabe Kangas
d32d741abf
Limit chat display names to 30 characters. Closes #1919 2022-08-14 18:09:16 -07:00
Gabe Kangas
0470403b71
Function has been re-exported for use 2022-08-03 11:30:06 -07:00
Gabe Kangas
b2b77f5eb9
Fix creating table indexes 2022-08-03 10:31:14 -07:00
Gabe Kangas
5d34279862
Add util for ungraceful sql execs 2022-08-03 10:31:11 -07:00
Gabe Kangas
eda62a91dc
Messages table fixes to improve query performance (#2026)
* Move to yaml sqlc config

* Add util for ungraceful sql execs

* Fix messages schema + add indexes

* Add migration to drop+recreate messages table

* Create index only if does not exist

* Fix typo

* Unexport function
2022-08-03 10:21:55 -07:00
Gabe Kangas
c40eaa47e9
Force origin test to always pass. Closes #2003 2022-08-02 13:04:23 -07:00
cr0ax
f4392a9e6f
Use a custom http client when connecting to aws (#1945)
Signed-off-by: Christian Burke <cr0ax64@gmail.com>
2022-06-11 18:21:11 -07:00
Meisam
482e1a705a
clarify the message for registered usernames (#1909) 2022-05-16 13:05:00 -07:00
Gabe Kangas
21b82ebb2c
Fix invalid field name 2022-05-08 15:28:06 -07:00
Gabe Kangas
2c47ddeef0
Optimize chat history query. Helps #1890 2022-05-01 00:07:33 -07:00
Gabe Kangas
b6d575a286
Set value on cache miss 2022-04-30 23:16:08 -07:00
Gabe Kangas
e6804d0233
Fix cache warming not firing. Closes #1889 2022-04-30 23:15:57 -07:00
Gabe Kangas
339d596fd3
Reduce the amount of chat backlog we keep. 2022-04-29 18:30:54 -07:00
Gabe Kangas
b2b791b365
Migrate forbidden and suggested usernames list to string slice. Closes #1873 2022-04-25 14:31:29 -07:00
Gabe Kangas
529cba84fd
Refactor migration to loop over each user instead of bulk inserts 2022-04-23 18:12:59 -07:00
Gabe Kangas
514fd17ed9
Access token migration 2022-04-23 18:12:58 -07:00
Gabe Kangas
f173b8deca
do not make migration failure fatal temporarily 2022-04-21 21:05:49 -07:00
Gabe Kangas
b835de2dc4
IndieAuth support (#1811)
* Able to authenticate user against IndieAuth. For #1273

* WIP server indieauth endpoint. For https://github.com/owncast/owncast/issues/1272

* Add migration to remove access tokens from user

* Add authenticated bool to user for display purposes

* Add indieauth modal and auth flair to display names. For #1273

* Validate URLs and display errors

* Renames, cleanups

* Handle relative auth endpoint paths. Add error handling for missing redirects.

* Disallow using display names in use by registered users. Closes #1810

* Verify code verifier via code challenge on callback

* Use relative path to authorization_endpoint

* Post-rebase fixes

* Use a timestamp instead of a bool for authenticated

* Propertly handle and display error in modal

* Use auth'ed timestamp to derive authenticated flag to display in chat

* don't redirect unless a URL is present

avoids redirecting to `undefined` if there was an error

* improve error message if owncast server URL isn't set

* fix IndieAuth PKCE implementation

use SHA256 instead of SHA1, generates a longer code verifier (must be 43-128 chars long), fixes URL-safe SHA256 encoding

* return real profile data for IndieAuth response

* check the code verifier in the IndieAuth server

* Linting

* Add new chat settings modal anad split up indieauth ui

* Remove logging error

* Update the IndieAuth modal UI. For #1273

* Add IndieAuth repsonse error checking

* Disable IndieAuth client if server URL is not set.

* Add explicit error messages for specific error types

* Fix bad logic

* Return OAuth-keyed error responses for indieauth server

* Display IndieAuth error in plain text with link to return to main page

* Remove redundant check

* Add additional detail to error

* Hide IndieAuth details behind disclosure details

* Break out migration into two steps because some people have been runing dev in production

* Add auth option to user dropdown

Co-authored-by: Aaron Parecki <aaron@parecki.com>
2022-04-21 14:55:26 -07:00
funkyhippo
79ca6e04f3
Eliminate client close deadlocks. (#1833) 2022-04-15 19:30:05 -07:00
Gabe Kangas
e46f8e2a66
Troubleshoot misskey follows
Store the original follow request object and use it for approvals.
Closes #1690
2022-04-08 13:33:30 -07:00
Gabe Kangas
4a17f30da8
Outbound live stream notifications (#1663)
* First pass at browser, discord, twilio notifications

* Commit updated Javascript packages

* Remove twilio notification support

* Email notifications/smtp support

* Fix Firefox notification support, remove chrome checks

* WIP more email work

* Add support for twitter notifications

* Add stream title to discord and twitter notifications

* Update notification registration modal

* Fix hide/show email section

* Commit updated API documentation

* Commit updated Javascript packages

* Fix post-rebase missing var

* Remove unused var

* Handle unsubscribe errors for browser push

* Standardize email config prop names

* Allow overriding go live email template

* Some notifications cleanup

* Commit updated Javascript packages

* Remove email/smtp/mailjet support

* Remove more references to email notifications

Co-authored-by: Owncast <owncast@owncast.online>
2022-03-18 13:33:23 -07:00
Gabe Kangas
d1e39c4c1e
Force uniqueness with previews and logos on the fediverse. Closes #1777 and closes #1776 2022-03-17 13:22:44 -07:00
Lerk
f5a5ac006a
Add videotoolbox codec (#1771)
* add videotoolbox codec

* add -realtime flag for medium and below quality

* add quality level to extra arguments

* use variant flags instead of extra arguments

* add videotoolbox test

* fix test
2022-03-15 00:55:06 -07:00
Gabe Kangas
a8167dc9e0
Fix tests after segment filename change 2022-03-10 14:20:44 -08:00
Gabe Kangas
b9a597299f
Simplify segment filenames. Closes #1778
Remove the seconds as an identifier to allow for segments to be written
more than one per second.
2022-03-10 14:14:02 -08:00
David
9983ef2794
[fix] improve custom emoji validation (#1772) 2022-03-08 13:03:37 -08:00
Lerk
a7687c861e
Fix "invalid cross-device link" error when running on a different filesystem (#1769)
* fix cross-device rename errors

* fallback to copy instead of always using it

* use tmp dir in data folder

* recreate tmp dir at startup
2022-03-07 16:30:40 -08:00
Gabe Kangas
e0a75d5d54
Add support for established chat user mode. #1587 (#1681)
* Add support for established user mode. #1587

* Tweak tests

* Tweak tests

* Update test

* Fix test.
2022-03-06 23:26:24 -08:00
Gabe Kangas
19b9a8bdf6
Add support for IP-based bans (#1703)
* Add support for IP-based bans. Closes #1534

* Linter cleanup
2022-03-06 20:34:49 -08:00
Gabe Kangas
78c27ddbdd
Add an icon for bot messages. Closes #1172 (#1729) 2022-03-06 20:09:55 -08:00
Gabe Kangas
98fce01b52
Add support for active viewer details API. Closes #1477 (#1747) 2022-03-06 17:31:47 -08:00
Gabe Kangas
92041c4c23
Add Prometheus for some Owncast metrics (#1744)
* Add Prometheus for some Owncast metrics. Closes #1303

* Wrap prometheus metrics endpoint in admin middleware
2022-03-06 17:26:52 -08:00
Gabe Kangas
d24ddc2b0a
Add support for and use socket host override. (#1682)
* Add support for and use socket host override. Closes #1378

* Fix embeds with the new websocket constructor
2022-03-06 17:11:51 -08:00
Gabe Kangas
d5a6267b1f
Add support to disable chat join messages. Closes #1582 (#1743) 2022-03-05 22:34:06 -08:00
Gabe Kangas
6796998124
Remove unnecessary var data in log messages. Closes #1640 2022-02-25 15:22:52 -08:00
Gabe Kangas
f69463f536
Remove period 2022-01-31 16:03:26 -08:00
Gabe Kangas
3f974ce7db
Remove references to config file. #1697 2022-01-31 16:01:34 -08:00
Gabe Kangas
f272542e40
Persistent HTTP connections seem to work now. Re-enabling. 2022-01-27 20:22:04 -08:00
Gabe Kangas
0d77856cb9
Simplify saving segments to disk 2022-01-27 20:14:19 -08:00
Gabe Kangas
8bc40486f8
Quiet, linter 2022-01-27 14:58:31 -08:00
Gabe Kangas
e0cb7c9fe4
Simplify appending the offline segment to playlist 2022-01-27 14:34:25 -08:00
Gabe Kangas
e4b1217af8
Do not return clientID in chat history API. Closes #1547 2022-01-25 20:13:41 -08:00
Gabe Kangas
88b20803b7
Add missing link to chat payload. Closes #1692 2022-01-24 14:56:32 -08:00
Gabe Kangas
3b0dafba9a
Return error in API response. Return all fields in message+user query 2022-01-18 15:38:23 -08:00
Gabe Kangas
44cb952c29
Increase the timeout buffer so viewer count doesn't jump around when not pinging 2022-01-12 21:03:50 -08:00