Moderation & Admin Dashboard
Relevant source files
The following files were used as context for generating this wiki page:
The Moderation and Admin Dashboard is a restricted administrative interface for managing PuppyPad platform safety, user accounts, and server health. It enables authorized moderators to review reports, manage user bans, feature specific sites, and monitor system-wide statistics.
Access to this dashboard is strictly limited to users whose email addresses are defined in the ADMIN_EMAILS environment variable. An account gains administrative privileges only if its email is in this list and has been verified.
Sources: PLAN.md:46-51, src/server.js:33-35, README.md:104-106
Administrative Authentication and Security
PuppyPad enforces administrative security through email-based verification rather than site names to prevent name squatting. The system uses a __Host-sid session cookie to prevent member subdomains from reading or overwriting administrative sessions.
The application checks for admin rights using the isAdmin helper, which matches the user's confirmed email against the ADMIN_EMAILS set.
Sources: src/server.js:140-140, PLAN.md:46-51, src/server.js:463-463
Reporting and Automatic Flagging
Users report problematic sites via a public report form. Additionally, the system automatically flags content that resembles phishing or malicious activity.
Automated Phishing Detection
When a member saves or uploads HTML, JS, or SVG files, the autoFlag function scans the content for phishing signals. If signals are detected, it creates an "Auto-flag" report in the moderation queue and notifies the abuse email.
| Signal Type | Description |
|---|---|
| Password Fields | Detection of <input type="password"> in member HTML. |
| Card Fields | Detection of credit card input patterns. |
| Brand Impersonation | Use of large brand names in the <title> tag. |
| Crypto Miners | Scanning for known cryptocurrency mining script patterns. |
Sources: src/server.js:80-91, PLAN.md:104-109, README.md:155-159
Report Processing Flow
Sources: src/server.js:888-900, src/views.js:520-530
Moderation Controls
Moderators possess three primary levels of enforcement for site management.
Ban and Restore
Moderators can "Take down" a site, which sets the banned flag in the database. A banned site is offline, and visitors see a 410 Gone page. The moderator provides a ban_reason shown to the member. Restoring a site removes the ban and triggers a new screenshot request.
Sources: src/server.js:915-927, src/views.js:534-539
Account Deletion
Moderators can permanently delete a user account and all associated files. This action:
- Removes user rows from the database.
- Deletes the site directory on disk.
- Deletes the site screenshot.
- Places the site name in the
released_nameshold for 90 days.
Sources: src/server.js:154-162, src/server.js:911-914
Staff Picks and Site of the Week
Moderators manage platform discovery by featuring sites on the home page.
- Site of the Week (SOTW): A single site featured globally.
- Staff Picks: A curated list of recommended sites.
Sites must be live (verified and not banned) to be featured.
Sources: src/server.js:870-887, src/views.js:540-546
Audit Logging
The system maintains an admin_log table that records every administrative action. This log tracks the moderator's username, the action performed (e.g., "take down", "restore", "upgrade"), the target site, and additional details. The dashboard displays the 100 most recent entries.
Sources: src/server.js:847-849, PLAN.md:123-125, src/views.js:555-559
Server Version and Upgrades
The Admin Dashboard provides an interface for managing server upgrades. It interacts with scripts/upgrade-watch.sh on the host machine via the data/upgrade/ directory.
Upgrade State Machine
The dashboard displays the current version, identifies if a new release is available, and allows the admin to trigger a backup and upgrade process.
Sources: src/server.js:858-868, src/views.js:495-515, README.md:87-100
Platform Statistics
The dashboard provides real-time visibility into platform usage and growth.
| Metric | Source/Logic |
|---|---|
| Total Members | Count of all rows in the users table. |
| Banned Count | Count of users where banned = 1. |
| Open Reports | Count of reports where status = 'open'. |
| Signups per Day | Aggregate of new accounts over the last 14 days. |
| Disk/Bandwidth | Individual site disk usage and UTC daily bandwidth consumption. |
Sources: src/server.js:853-857, src/views.js:519-521, src/views.js:551-554
The Moderation & Admin Dashboard serves as the central control point for maintaining PuppyPad as a safe and stable environment for user homepages. By centralizing reporting, enforcement, and server management, it allows a small team to effectively oversee thousands of member sites.
Sources: PLAN.md:46-51, README.md:151-164