Commit Graph

342 Commits

Author SHA1 Message Date
037f71a9f5 Profile Webhook: Support profile headlines (On PTO) 2025-06-20 14:08:20 -07:00
d08c57c2a8 Debugger detector: repeat loop when low risk 2025-06-16 20:12:26 -07:00
1e2066eb46 Debugger analytics: include window resize event 2025-06-16 13:28:17 -07:00
ae50a4f5c4 Adjust debugger timeout threshold 2025-06-15 20:49:59 -07:00
fc546bf7ef Analytics included in devtools detection report 2025-06-15 12:44:49 -07:00
7044cc5888 Update error message wording 2025-06-14 20:44:49 -07:00
fdef3dafdc VideoFeed: Hide video temporarily on window resize 2025-06-14 14:57:04 -07:00
33d91ddcda Refactor debugger 2025-06-14 14:03:11 -07:00
c41fd3f2a0 Detect and panic when browser dev tools are opened 2025-06-14 13:41:08 -07:00
e7a099895a Tweak watermark tamper detection 2025-06-14 12:59:04 -07:00
30fabd33ba Show operator icons on messages 2025-06-13 17:19:43 -07:00
467965d097 Improve webcam QR code tampering detection 2025-06-13 16:25:19 -07:00
05444dcc15 Tweak QR code animation and Explicit button
* Explicit button: outline it in blue to reflect that your camera is
  currently blue. Solid red continues to mean your camera is red.
* Tweak the QR code opacity to be less obtrusive.
2025-06-03 19:25:21 -07:00
2305ff54db Setting to Opt-Out of QR Code Watermark
* Add a NoWatermark video flag so users can opt-out of the QR code being
  shown over their webcam when others watch their video.
* The setting can be found in the Chat Settings 'Camera' tab, and must be
  opted in (default is to protect cameras with watermarks).
* Update the About page and QR code info modal with instructions.
2025-06-01 11:59:21 -07:00
4179cba30a Debug Channel logging for 'Unwatch' SFX bug
A user reported that they hear the 'Unwatch' sound effect play more
often than they should, including when his camera isn't even active.

Only the BareRTC unwatch command makes the page play that sound effect,
so some debug messages will post in the Debug Log channel to check if I
hear the sound effect.
2025-05-29 20:33:47 -07:00
750c609854 Webcam QR Code Tweaks + Misc
* Adjust the animation settings on QR code videos, to be more translucent
  most of the time but occasionally flash white and strong
* Alert Modal: Allow some alerts to be dismissed by clicking on the
  background curtain, e.g. for the QR code explanation or the Close DMs
  explanation.
2025-05-29 17:49:16 -07:00
bcf1e0bdb4 NPE fix 2025-05-29 16:08:13 -07:00
b884a81bba Fix null pointer exception on SendPing for non-JWT users 2025-05-29 16:02:11 -07:00
dd951ba69d Amend JWT Endpoint to Update Logged-In User's Settings
* Add an admin /api/amend-jwt endpoint that allows your main website to post
  an updated JWT token for a user who may already be logged into chat.
* It allows for updating a logged-in user's nickname, profile picture URL,
  username, chat moderation rules, etc. without them needing to exit and
  rejoin the chat room.
2025-05-29 15:27:14 -07:00
c5e3ffe09b Safety feature to detect webcam watermark being removed 2025-05-14 20:27:04 -07:00
43993d5b01 CSS tweaks on video mute buttons 2025-05-14 17:55:49 -07:00
d5100bae59 Popup alert to explain QR codes over webcams 2025-05-14 17:22:58 -07:00
d08a429fb8 BareBot: Set channelID variable to the current channel 2025-05-07 20:19:33 -07:00
25f4fcba0d Spam Detection for Hyperlinks on DMs
Add spam detection in case a user copy/pastes a hyperlink to everybody
on chat via their DMs:

* If the same link is copied to many different people within a time
  window, the user can be kicked from the chat room with a warning.
* The server remembers rate limits by username, so if they log back in
  and continue to spam the same links, they instead receive a temporary
  chat ban.
* The spam threshold, time window and ban hours are configurable in the
  BareRTC settings.toml.

Other fixes:

* The front-end will send a "me" update with its current status and
  video setting in the 'onLoggedIn' handler. This should help alleviate
  rough server reboots when a ton of idle users are online, so they
  don't spam "me" updates to correct their status once the WhoLists
  begin to roll in.
2025-05-02 21:35:48 -07:00
3145dde107 Invite to watch my webcam
* Add a feature where a webcam broadcaster may manually invite others on
  chat to watch, even if normally the other person would not be allowed.
  For example, it will bypass the mutual webcam requirement setting and
  allow the invited user to watch even if their own camera is not on.
* The button appears in Profile Modals and in the overflow menu on the
  MessageBox component.
2025-03-30 15:33:58 -07:00
16924a5ff5 Refactor WebRTC and Webcam Feature into Vue Mixin
* Move all WebRTC and webcam-related functionality from App.vue into an
  external Vue mixin.
* Centralize the stand-alone functions videoIconClass and
  videoButtonClass into the new WebRTC mixin, which is called by
  WhoListRow and MessageBox.
2025-03-30 13:50:01 -07:00
f1d55abb66 Replace window.alert with modalAlert on Ignore Unsolicited DMs 2025-03-29 17:32:28 -07:00
927d798bc7 Video Button in MessageBox + Various Improvements
MessageBox Improvements (Card Style):

* Rearrange the buttons by the username (Send DM, Mute, Takeback) by putting the
  lesser used options into a drop-down overflow menu to make room for adding a
  Video button, to easily see someone's webcam when they are broadcasting or to
  see if you are already watching it.
    * The visible buttons now are: Send DMs, Open Video, and Overflow.
    * The Overflow menu contains: Mute, Takeback, Hide Message
    * If the user is not on video, only DMs and Overflow buttons are shown.
* Spell out the word "Translate" on the Google Translate button, as a lot of
  users were not aware of what that button did.

MessageBox Improvements (Compact style):

* The Video button is added in between the current Overflow Menu and Emojis

Other Improvements:

* On the MessageBox, when a user is offline, their display name will be crossed
  out and their avatar image is turned to grayscale.
* On your DMs List: offline users will also have grayscale avatars.
2025-03-28 21:50:47 -07:00
2268209998 Chrome drag/drop bug: skip DOM update on dragenter
On Chromium, if the DOM is updated during a dragenter event (e.g. to
display the drop zone div), the browser will immediately fire dragleave
as well which leads to a rapid flickering effect.
2025-03-27 22:21:00 -07:00
e090841b03 Profile card for previously offline users 2025-03-22 22:22:24 -07:00
09da9fa23d Don't send WhoList within 15 seconds of server start
To help alleviate rocky chat server reboots, WhoList messages will be
withheld in the first 15 seconds from server start.

When a lot of chatters were online during a reboot (e.g. 50 or more),
they would all try and reconnect after 5 seconds and each login was
broadcasting Who List updates to everybody else logged in. With the
surge of logins in a short time, these WhoList messages would fill up
the buffers of each recipient, kicking them offline for being too slow
to keep up with messages; only for that recipient to reconnect again.
The average user may have experienced 2 or 3 disconnects when the chat
server reboots.

To help alleviate the spam of messages being sent out:

* Presence messages are withheld for the first 30 seconds ("has joined
  the room" notifications)
* Now, WhoList messages are withheld for the first 15 seconds.

After 16 seconds of uptime, the server will send a WhoList to everybody
currently online to catch them up.

To accommodate this, the front-end will show a spinner and say "Waiting
for Who List..." when the page is connected but no WhoList has been
received yet. Under normal operation, this spinner won't be visible
beyond a brief moment as a WhoList is normally sent upon joining the
chat.
2025-03-21 20:49:26 -07:00
3180d2ddf9 Gentle nudge NSFW feature
In profile cards, show a prompt to regular users to remind a user to
mark their camera as Explicit, when the camera is blue and is currently
being watched by the current user.

Under the hood, this sends a 'react' message with a msgID of -451 and
the target's username as the react message. Updated chat pages will look
for this reaction and show a nice reminder in chat, if the user's camera
is blue and they have at least 2 watchers. Old page versions at
deployment time will simply ignore these react messages.
2025-03-18 10:57:04 -07:00
b2e7f383b5 Chatbot: Avoid upvoting a negative or possibly mean emoji 2025-03-17 18:09:58 -07:00
23a73620b9 Switch to mattn/go-sqlite3
Instead of the pure Go implementation of SQLite, swap in the cgo library
from mattn/go-sqlite3. On local testing this cuts the SQL query times in
half for the History modal (from 400ms per page to 150ms) and may
improve performance in production.
2025-03-17 17:58:03 -07:00
89dd40f77f Refactor SQL query for DMs History modal
The ORDER BY timestamp on the DMs Username History endpoint was causing
SQLite to do a full table scan by timestamp instead of indexing on
channel ID. So, instead, we fetch the distinct channel IDs for the
current user and add them to an IN clause on the main query (instead of
a LIKE clause), which causes the index to use the channel_id instead of
timestamp. This may improve CPU performance and speed on this endpoint.
2025-03-17 17:38:37 -07:00
ce47fc18c2 Kick modal with reason + Show logged-in date in profile card 2025-03-17 16:54:39 -07:00
f88672559d Update sort options: Sort by blue cameras 2025-03-16 13:38:48 -07:00
c6d3acb735 Tweak cooldownTTL on the preempt boot rate limiter 2025-03-12 22:32:19 -07:00
066993a68e NonExplicit Cams can not watch Explicit cams 2025-03-12 21:20:49 -07:00
8a1b609d13 Revise the NonExplicit Video Setting
For the broadcaster:

* Turning on the NonExplicit option will be mutually exclusive to the
  Explicit option: the Explicit option is unset and the checkbox
  disabled, and the Explicit button will not be usable while the
  NonExplicit setting is active.

For watchers:

* Respect the NonExplicit setting of other cams you have open while your
  own camera is marked as Explicit.
* The NonExplicit video button is \ out on the Who List and will present
  an error message that they don't want your cam to be red when watching
  theirs.
* When your cam toggles to become Explicit, close any videos you have
  open with NonExplicit broadcasters.
2025-03-12 21:11:54 -07:00
df4dd6a2b3 Rate limit pre-emptive boots of users not even watching your cam 2025-03-12 19:21:32 -07:00
3ddb321bf4 Safety for the operator-only hidden status 2025-03-11 21:31:40 -07:00
5f1b282c65 Remove Profile Card button to pre-emptively boot from camera 2025-03-11 21:02:08 -07:00
7dc935c6de Send site report on kick action 2025-03-09 16:33:05 -07:00
2e718e15a6 Echo: Skip messages sent by blocked usernames 2025-03-09 15:52:34 -07:00
c910e5786a Bugfix on empty echo message 2025-02-17 22:15:37 -08:00
71aa77fc7a Go mod tidy 2025-02-17 22:09:22 -08:00
885adda156 Echo Public Channel Messages
Add a feature where recent public channel messages can be echoed back to
newly joining users when they enter the chat room.

* Configure in settings.toml with EchoMessagesOnJoin. 0 = disable storage.
* Messages are stored in RAM and lost on a server reboot.
* A buffer of recent public messages per channel can be kept, e.g. for the
  10 most recent messages.
* The settings can be reloaded with /reconfigure and the message buffers
  will rebalance on the next message sent.
* When a new user logs in, a new "echo" message is sent that contains all
  of the echoed messages on a "messages" list, in one WebSocket packet.
* Echoed messages are put above the ChatServer welcome messages.
* If a message is taken back, it's removed from the echo message buffer.

Other Changes

* Don't broadcast Presence messages within 30 seconds of the server boot, to
  lessen a flood of messages when a lot of users were connected at reboot.
* Change the default "Join messages" setting on front-end to hide them in
  public channels.
* For the admin buttons in ProfileModal, use the AlertModal instead of native
  browser prompts.
2025-02-17 22:08:25 -08:00
859e9dee5b Send admin reports on /nsfw command + Fixes
* On the /nsfw command, BareRTC will issue an admin report to your main website
  so you have visibility into when this command is used.
* On the server side, fix the "Open" command so it will prevent webcams from
  connecting if the offerer had been Booted by the answerer, in addition to the
  previous blocks about Mute and Block. Admin users can still connect always.
* Add a debug command `/watch username` to manually open somebody's camera on
  chat. Note: the chat server enforces the permission to actually do so.
* Remove the /debug-dangerous-force-deadlock admin command.
2025-02-17 12:50:06 -08:00
74a756d1ef History Modal + Dark Detector Fixes
* Add a History button under the DMs where an authenticated JWT user can page
  through the usernames they have stored history with, to bring up those DMs
  even if their chat partner is not currently online.
* Try some fixes to the dark video detector to see if it reduces false
  positives: wait for the canplaythrough video event to fire before beginning
  the dark detection. Also, increase the threshold so dark frames need to be
  seen 5 times in a row instead of twice before cutting the camera.
2025-02-14 18:12:39 -08:00