OpenVibe.Media

part 2

text · 20 views · 3 unique · 2026-03-15 05:41:30 · raw

i want you to go through and make sure user ips cant be pulled from dev tools or something without changing the functionity of anything else


4 previous messages
I went through the client-visible paths and fixed the real IP leak without changing normal user functionality.

Public canvas responses were exposing raw DB rows, so any viewer could inspect ip_address in dev tools from /api/game/canvas/state and /api/game/canvas/history. I fixed that in canvas-service.js by adding server-side sanitizers for tiles, actions, and snapshots before anything is serialized back to the browser.
Canvas tiles and action history still keep IPs server-side for rate limiting, abuse detection, bans, and rollback logic, but the browser now only gets the safe fields it actually needs like x, y, color_index, user_id, username, and timestamps.
Snapshot listings no longer expose raw board_data back to the client, which also prevents old snapshot payloads from leaking historical IP data through dev tools.
New snapshots are now created from sanitized tile data, so future snapshots won’t embed client IPs at all.
I did not strip IPs from staff-only moderation features that actually need them, like canvas IP bans and the canvas IP heatmap, so moderation functionality stays intact.
Validation:

Syntax checks passed for canvas-service.js, canvas-routes.js, and canvas.js.
I did not do a full live server boot in this turn because the local install/runtime environment is still blocked by the dependency issue from earlier.
Net result: regular users should no longer be able to pull other users’ IPs from the canvas APIs in dev tools, while moderation/server-side abuse controls keep working.


give me the exact files changed and a description again

Exact Files Changed

New: codex-memory.md — checkpoint/memory file summarizing the implementation state.
New: server/auth/permissions.js — centralized capability/staff permission logic for admin, global mod, channel owner, and channel mod roles.
Updated: server/auth/auth.js — added staff/global-mod aware auth middleware.
Updated: server/auth/routes.js — auth endpoints now return user plus capabilities.
Updated: server/db/database.js — added channel moderation helpers/tables support, moderation logging helpers, and fixed channel VOD/clip default visibility saving.
Updated: server/db/schema.sql — added schema for channel moderators, channel moderation settings, moderation actions, and updated role compatibility.
New: server/admin/mod-routes.js — new non-admin staff moderation API under /api/mod/*.
New: server/admin/channel-mod-routes.js — new channel-owner/channel-mod API under /api/channels/*.
Updated: server/admin/routes.js — cleaned up admin/global-mod handling and added moderation action logging.
Updated: server/chat/chat-server.js — enforced channel moderation settings, improved rate limiting, and tightened chat moderation behavior.
New: server/game/canvas-service.js — full persistent collaborative canvas backend, moderation logic, snapshots, bans, overrides, rollbacks, and privacy-safe serialization for public payloads.
New: server/game/canvas-server.js — realtime /ws/canvas websocket service for tile sync and presence.
New: server/game/canvas-routes.js — canvas HTTP API for board state, placement, staff actions, and admin controls.
Updated: server/index.js — mounted the new staff/channel/canvas routes and canvas websocket integration.
Updated: public/js/app.js — preserved capabilities on auth, exposed staff nav properly, and routed /game to canvas and /game/adventure to the original game.
Updated: public/index.html — renamed admin UI copy to staff, added new scripts, and changed nav label from Admin to Staff.
New: public/js/canvas.js — new collaborative canvas frontend and game hub behavior.
New: public/js/staff-console.js — role-aware staff console frontend for admins and global mods.
New: public/js/dashboard-moderation.js — dashboard moderation UI for channel owners and channel moderators.
Updated: public/js/chat.js — switched staff chat tools to capability-aware moderation endpoints and updated mod/global-mod badge handling.
Updated: public/css/style.css — styling for staff console and dashboard moderation UI.
Updated: public/css/game.css — styling for the new game hub and collaborative canvas layout.
Description

Added a proper capability-based staff system so admin and global_mod have different frontend/backend behavior instead of both being funneled through admin-only flows.
Fixed auth response consistency so capabilities survive login, registration, and refresh instead of being lost on the frontend.
Added real channel moderation infrastructure with channel moderators, channel moderation settings, moderation logs, channel chat search, and channel message deletion.
Tightened chat moderation so stream/channel rules are actually enforced server-side, including slowmode, account-age gating, followers-only, link controls, caps limits, and anon restrictions.
Built a new persistent r/place-style collaborative canvas game with a 512x512 board, 32-color palette, live sync, click painting, arrow-key cursor movement, space/enter placement, pan/zoom, hover metadata, recent activity, and live presence.
Kept the original HoboGame intact and moved it under /game/adventure, while /game now acts as the canvas-first game hub.
Added full canvas moderation/admin tooling including site staff actions, region locks, bans, rollbacks, snapshots, board freeze/read-only mode, wipe, and user overrides.
Added missing frontend UI for staff moderation and channel moderation so the new backend routes are actually usable.
Hardened privacy so regular users cannot pull canvas IP data from browser dev tools; IPs still exist server-side for moderation/rate-limiting, but public canvas responses are now sanitized before being sent to clients.