Skip to content

Feature: Admin Control Panel for Server Management #96

Description

@melvincarvalho

Summary

This issue proposes an admin control panel for JavaScriptSolidServer, providing server administrators with a web-based interface for ongoing server management after initial setup. This is complementary to #95 (first-run onboarding wizard).

Based on deep research of industry leaders across self-hosted software, web server control panels, and PaaS platforms, this document outlines recommended features, architecture patterns, and implementation priorities.


Industry Research & Comparative Analysis

Category 1: Self-Hosted Application Admin Panels

Nextcloud

Feature Implementation
Dashboard Customizable widgets showing activity, storage usage, calendar, emails
User Management Create/edit/delete users, group management, quotas, 2FA enforcement
Roles Super Admin (full access) vs Group Admin (limited to assigned groups)
Audit Logging Full audit trail in separate log file, DLP/MDM integration
App Management Enable/disable apps, install from marketplace
Settings Server config, email/SMTP, background jobs, caching

Mastodon

Feature Implementation
Moderation Account actions (freeze, suspend, mark sensitive), appeal system
Federation Domain blocks, blocklist import/export, deliverability control
Roles Owner, Admin, Moderator with granular permissions
Reports Review and resolve user reports with 20-day appeal window
Webhooks Real-time notifications for moderation events (Discord, Slack, IRC)
Spam Prevention Email domain blacklisting, baseline anti-spam measures

Gitea/Forgejo

Feature Implementation
User Controls Disable features per user (SSH keys, GPG, MFA, deletion)
Auth Sources LDAP, OAuth2, SMTP with admin filter for auto-promotion
2FA Enforcement Global requirement options: none, all users, admins only
Repository Admin Adoption/deletion of unadopted repos
CLI Admin gitea admin commands for user creation, password reset

Vaultwarden

Feature Implementation
Admin Access Token-based (Argon2 hashed), disabled by default
Security Pattern Admin panel should never be exposed to internet
IP Restriction Nginx rules to allow only LAN/VPN access
SSO Integration Optional SSO-only mode, disable password login
Self-Disable Remove token after config to disable web access entirely

Matrix Synapse

Feature Implementation
User Management Create, delete, deactivate, lock, erase, shadow ban
Room Management View members/media/permissions, room directory control
Media Management Preview, quarantine, delete, filter by criteria
Moderation Tools Report resolution, Mjolnir bot integration
Protected Users Regexp-based MXID protection (prevent bridge puppet modifications)

Category 2: Web Server Control Panels

cPanel/WHM (Industry Standard)

Feature Implementation
Two-Tier Model WHM (server admin) + cPanel (end-user) separation
Account Management Create/suspend/terminate accounts, resource allocation
Reseller Support Non-root WHM for department/reseller management
SSL Management Self-generated and CA-provided certificates
Security SSL, MFA, IP deny/allow lists

Cockpit (Red Hat)

Feature Implementation
Real-time Dashboard CPU, memory, disk, network graphs
Zero Footprint Runs on-demand via systemd socket activation
Multi-Server Manage multiple servers from single interface
Built-in Terminal Web-based terminal for CLI access
Modular Plugins for Podman, libvirt, storage
Logs Aggregated system logs with search/filter

Webmin

Feature Implementation
110+ Modules System, Servers, Networking, Hardware, Cluster
Extensible Third-party and custom module support
Cluster Management Manage modules/themes/users across multiple servers
Related Projects Virtualmin (web hosting), Usermin (end-user)

Category 3: PaaS Admin Panels

Portainer

Feature Implementation
RBAC Roles Administrator, Environment Admin, Operator, Helpdesk, Standard User
Teams Group users, assign to stacks, per-team container enablement
Ownership Container/resource ownership tracking and transfer
Multi-Environment Manage Docker, Kubernetes, Swarm from one UI

Coolify

Feature Implementation
Unified Dashboard Applications, databases, queues, storage, jobs
Project Organization Production, staging, preview environments
Real-time Terminal Execute commands on servers from browser
Monitoring Deployment, server, disk usage monitoring
Notifications Discord, Telegram, email alerts
Team Collaboration Share projects with role-based permissions

CapRover

Feature Implementation
Cluster Management Docker Swarm-based, add nodes via UI or CLI
Built-in Registry Managed Docker registry or 3rd party
Monitoring NetData integration, GoAccess for logs
One-Click Apps App marketplace with templates

Category 4: Modern Backend Platforms

PocketBase

Feature Implementation
Embedded Dashboard Svelte SPA served at /_/, no separate install
Collection Management Create/edit collections with auto-generated API docs
API Rules Per-collection CRUD rules (public, auth, admin only)
Logs Viewer Searchable, filterable activity logs with syntax highlighting
Single Binary Dashboard embedded in Go binary

Directus

Feature Implementation
No-Code UI Safe for non-technical users, no training required
Fine-Grained RBAC Row-level access control per role
Automation (Flows) Event-driven data processing, replace Zapier/Make
Inline Editing Edit content directly on preview pages
White-Label Fully customizable branding

Security Patterns Analysis

Authentication Methods (Industry Comparison)

Software Method Notes
Vaultwarden Token (Argon2 hash) Admin panel disabled by default
Portainer Username/Password + optional 2FA Pre-configured via CLI
Cockpit PAM (system users) No separate auth system
Nextcloud Session-based + 2FA Integrated with user system
PocketBase Superuser accounts Separate from regular users
Mastodon Role-based (Owner/Admin/Mod) Appeals system for actions

Best Practices Identified

  1. Defense in Depth: Multiple security layers (IP restriction + token + 2FA)
  2. Disabled by Default: Admin panel should require explicit enablement
  3. Never Expose to Internet: Recommend LAN/VPN-only access
  4. Separate from User Auth: Admin credentials distinct from regular users
  5. Audit Everything: Log all admin actions with timestamps
  6. Least Privilege: Role-based access with minimal default permissions
  7. Token Rotation: Support for periodic credential rotation

Proposed Admin Panel for JSS

Architecture Options

Option A: Embedded (Recommended for MVP)

┌─────────────────────────────────────────┐
│  JSS Binary                             │
│  ├── Solid Server (existing)            │
│  └── Admin UI (new, served at /.admin)  │
└─────────────────────────────────────────┘
  • Pros: Single deployment, no dependencies, PocketBase model
  • Cons: Larger binary, UI updates require server update

Option B: Separate Service

┌─────────────────┐     ┌─────────────────┐
│  JSS Server     │◄────│  Admin Service  │
│  (port 3000)    │ API │  (port 3001)    │
└─────────────────┘     └─────────────────┘
  • Pros: Independent updates, can disable entirely
  • Cons: More complex deployment, two processes

Option C: Static + API (Hybrid)

┌─────────────────────────────────────────┐
│  JSS Server                             │
│  ├── /.admin/* (static SPA files)       │
│  └── /.admin/api/* (admin endpoints)    │
└─────────────────────────────────────────┘
  • Pros: UI can be updated separately, clean separation
  • Cons: Slightly more complex build process

Proposed Feature Set

Tier 1: MVP (Essential)

Dashboard

┌─────────────────────────────────────────────────────────────┐
│  JSS Admin Dashboard                          [Logout]      │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  Server Status: ● Online        Uptime: 14d 3h 22m         │
│  Version: 0.0.81                Pods: 42                    │
│                                                             │
│  ┌─────────────┐ ┌─────────────┐ ┌─────────────┐           │
│  │ Storage     │ │ Requests    │ │ Active      │           │
│  │ 2.4GB/10GB  │ │ 1.2k/day    │ │ 12 users    │           │
│  └─────────────┘ └─────────────┘ └─────────────┘           │
│                                                             │
│  Recent Activity                                            │
│  ├─ alice created pod "photos"           2 min ago         │
│  ├─ bob uploaded 15 files                5 min ago         │
│  └─ carol registered account             1 hour ago        │
│                                                             │
└─────────────────────────────────────────────────────────────┘

Pod Management

Action Description
List pods Name, owner, creation date, storage used
View pod details Files, ACLs, quota usage
Adjust quota Increase/decrease per-pod storage limit
Delete pod With confirmation, optional data export

User/Account Management (when IdP enabled)

Action Description
List accounts Email, created date, last login, status
Disable/Enable Temporarily disable account access
Reset password Send password reset email
Delete account With pod handling options

Invite Management (when invite-only mode)

Action Description
Generate invites Single or batch, with expiration
List invites Status (unused/used/expired), created by
Revoke invite Cancel unused invite codes

Configuration Viewer

  • Display current configuration (read-only for safety)
  • Show which options came from CLI vs env vs config file
  • Warnings for security issues (e.g., no HTTPS)

Tier 2: Enhanced

Logs Viewer

┌─────────────────────────────────────────────────────────────┐
│  Logs                                    [Filter] [Export]  │
├─────────────────────────────────────────────────────────────┤
│  Level: [All ▼]  Pod: [All ▼]  Date: [Last 24h ▼]         │
├─────────────────────────────────────────────────────────────┤
│  INFO   2024-01-15 10:23:45  GET /alice/profile/card  200  │
│  INFO   2024-01-15 10:23:44  PUT /bob/photos/img.jpg  201  │
│  WARN   2024-01-15 10:23:40  Auth failed: invalid token    │
│  ERROR  2024-01-15 10:22:30  Quota exceeded: carol         │
└─────────────────────────────────────────────────────────────┘

Federation Management (when ActivityPub/Nostr enabled)

Feature Description
ActivityPub stats Followers, following, federated instances
Block instances Domain-level blocks for federation
Nostr relay stats Connected clients, events stored

Backup/Export

Feature Description
Export pod Download pod data as archive
Export config Download current configuration
Backup all Full server backup (data + config)

Tier 3: Advanced

Real-time Monitoring

  • WebSocket-based live updates
  • Connection count, request rate graphs
  • Resource usage (CPU, memory if available)

Multi-Admin Support

  • Multiple admin accounts with roles
  • Audit log of admin actions
  • Admin permission levels (full vs read-only)

Automation/Webhooks

  • Webhook notifications for events (new user, quota exceeded)
  • Integration with Discord, Slack, email

CLI Companion

jss admin users list
jss admin pods list
jss admin invites generate --count 10
jss admin config show
jss admin logs --follow

Security Implementation

Authentication Flow

1. Admin accesses /.admin
2. If no admin token configured → Show "Admin panel disabled" message
3. If token configured → Show login form
4. Validate credentials against ADMIN_TOKEN (Argon2 hashed)
5. Issue session token (short-lived, e.g., 1 hour)
6. All admin API calls require valid session
7. Logout invalidates session

Environment Variables

# Enable admin panel (disabled by default)
JSS_ADMIN_ENABLED=true

# Authentication token (required if enabled)
# Generate with: openssl rand -base64 48
JSS_ADMIN_TOKEN=$argon2id$v=19$m=65536,t=3,p=4$...

# Optional: Restrict to specific IPs
JSS_ADMIN_ALLOWED_IPS=192.168.1.0/24,10.0.0.0/8

# Optional: Change admin path (security through obscurity, not recommended as sole measure)
JSS_ADMIN_PATH=/.secret-admin

# Optional: Require HTTPS for admin access
JSS_ADMIN_REQUIRE_HTTPS=true

Security Checklist

  • Admin panel disabled by default
  • Token stored as Argon2 hash, never plain text
  • Session tokens are short-lived and invalidated on logout
  • Rate limiting on login attempts
  • All admin actions logged with timestamp and IP
  • HTTPS enforcement option
  • IP allowlist support
  • No sensitive data in URL parameters
  • CSRF protection on all mutations

Implementation Difficulty & Priority

Feature Difficulty Priority Dependencies
Admin auth system 35/100 P0 None
Dashboard (read-only) 30/100 P0 Auth
Pod listing 20/100 P0 Auth
Quota management 25/100 P1 Pod listing
Account listing 25/100 P1 Auth, IdP
Invite management 20/100 P1 Auth, IdP
Config viewer 15/100 P1 Auth
Logs viewer 40/100 P2 Auth, logging infrastructure
Federation management 45/100 P2 Auth, AP/Nostr
Real-time monitoring 55/100 P3 Auth, WebSocket
Multi-admin RBAC 60/100 P3 Auth system refactor
Webhooks/Automation 50/100 P3 Event system

Total MVP Estimate: 45-50/100 difficulty


Technology Recommendations

Frontend

Option Pros Cons
Vanilla JS + HTML No build step, tiny size, embedded easily More verbose, less maintainable
Preact React-like, 3KB, good DX Requires build step
Svelte Compiled, small output, great DX (PocketBase uses this) Requires build step
Alpine.js No build, declarative, tiny Less structured for large apps

Recommendation: Alpine.js for MVP (no build step), migrate to Svelte if complexity grows.

Styling

Option Pros Cons
Pico CSS Classless, semantic, tiny (~10KB) Limited customization
Tailwind Flexible, utility-first Requires build, larger
Custom minimal CSS Full control, smallest size More work

Recommendation: Pico CSS for MVP - clean look with zero classes needed.


References

Self-Hosted Software

Web Server Panels

PaaS Platforms

Modern Backends

Security Best Practices


Open Questions

  1. Should admin panel be a separate npm package or embedded in main JSS?
  2. Should we support multiple admin accounts from the start, or single admin for MVP?
  3. Should admin auth integrate with the existing IdP or be completely separate?
  4. What's the minimum viable dashboard - just pod list, or full stats?
  5. Should there be a CLI equivalent for all admin panel actions?

Related Issues

/cc @maintainers

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpluginCould be implemented as a plugin (#206); core/plugin line defined in #564

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions