Removes forced min-height on auth layout so the login card doesn't stretch unnecessarily. |
||
|---|---|---|
| assets | ||
| .gitignore | ||
| .htaccess | ||
| action.php | ||
| admin.css | ||
| admin.js | ||
| AI_DISCLOSURE.md | ||
| bart-info.php | ||
| config.example.php | ||
| CONTRIBUTING.md | ||
| index.php | ||
| lib.php | ||
| lib_gotify.php | ||
| LICENSE | ||
| login.php | ||
| logout.php | ||
| README.md | ||
| SECURITY.md | ||
| user-menu.php | ||
Oscar Admin
A standalone, web-based admin dashboard for Open OSCAR Server (AIM/ICQ OSCAR protocol).
Oscar Admin provides a clean UI for day-to-day server administration: users, sessions, chat rooms, messaging, directory, BART assets, buddy lists (feedbag), audit logs, and a raw Management API console.
Status: Active. The admin panel is intended to be deployed alongside Open OSCAR Server, but this repository is standalone and does not require changes to the server source.
Features
- Secure login - OSCAR screen name + math anti-spam challenge + one-time code sent via OSCAR IM.
- Anti-enumeration - Allowed and non-allowed screen names get the same login flow/UI.
- Optional Gotify delivery - Per-user Gotify URL/token settings; login codes can be sent through Gotify when configured. 100% optional.
- Overview - Version, online sessions, users, and room counts.
- User management - List/search, create/delete, details, suspend/unsuspend, bot flag, password reset, buddy icon, active sessions.
- Session management - List active sessions, inspect details, kick sessions.
- Chat rooms - List public/private rooms, create/delete public rooms.
- Messaging - Send IM/popup through the system account (feature availability depends on server version).
- Directory - Category/keyword CRUD and AIM directory entries.
- BART / Buddy Art - Type catalog, browse assets, upload/hash/preview/delete, feedbag BART item set/remove, and a built-in info guide.
- Buddy List / Feedbag - User-friendly group/buddy management and linked accounts.
- Audit log - Local log of admin actions.
- API Console - Raw Management API requests for advanced/debug use.
Requirements
- PHP 8.1+ with
curlandsessionextensions enabled. - A web server capable of running PHP (nginx + PHP-FPM, Apache, Caddy+php-fpm, etc.).
- An Open OSCAR Server instance with the Management API enabled.
- A system OSCAR account on that server (used to send login codes/messages).
Quick Start
-
Clone the repo
git clone https://github.com/<your-org>/oscar-admin.git cd oscar-admin -
Create config
cp config.example.php config.php -
Edit
config.php- Add allowed admin screen names to
admin_users. - Set
system_screen_nameandsystem_password(an existing OSCAR account). - Set
mgmt_api_host/mgmt_api_portto your private Management API endpoint. - Optionally enable Gotify (
gotify_enabled => true).
- Add allowed admin screen names to
-
Serve with PHP
For local testing:
php -S 127.0.0.1:8081Open
http://127.0.0.1:8081/login.php.For production, use nginx/Apache + PHP-FPM behind HTTPS.
Configuration
See config.example.php for all options. Key settings:
| Setting | Purpose |
|---|---|
admin_users |
OSCAR screen names allowed to sign in |
system_screen_name / system_password |
OSCAR account used to send login codes/messages |
mgmt_api_host / mgmt_api_port |
Private Open OSCAR Management API endpoint |
gotify_enabled |
Enables optional Gotify addon |
gotify_url / gotify_token |
Optional global Gotify fallback (per-user settings preferred) |
app_secret |
Optional secret for encrypting sensitive stored values (Gotify tokens) |
shared_style_path |
Base CSS path (defaults to bundled assets/style.css) |
Gotify (Optional)
Gotify support is a 100% optional addon (lib_gotify.php). The panel works without it.
- Set
gotify_enabled => trueinconfig.php. - Sign in to the admin dashboard.
- Open the top-right user menu and save your Gotify URL/token.
- Use Test to verify delivery.
If a Gotify URL/token is saved for a user, login codes are sent through Gotify for that user. Clear settings to disable Gotify delivery for that account.
Per-user Gotify settings are stored in gotify-users.php (gitignored). Tokens are encrypted at rest; the file is written as PHP with restrictive permissions to reduce accidental exposure. Set app_secret in config.php for an explicit encryption key.
Deployment / Hardening
Keep the Management API private
The OSCAR Management API is powerful. Bind it to 127.0.0.1 or a trusted private network and do not expose it publicly.
Protect sensitive files
Do not serve or commit:
config.php- secrets and configaudit.log- admin action loggotify-users.php- per-user Gotify tokens/URLs
Serve over HTTPS and consider an IP allowlist/VPN/auth proxy. The examples below include sensitive-file denies; adjust paths, PHP-FPM socket, and TLS settings for your system.
Nginx example: subdomain
Use this when Oscar Admin is the document root for a dedicated host like admin.example.com:
server {
listen 443 ssl http2;
server_name admin.example.com;
root /var/www/oscar-admin;
index index.php;
# TLS config omitted for brevity
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# Deny sensitive/internal files
location ~* ^/(config\.php|config\.example\.php|lib\.php|lib_gotify\.php|user-menu\.php|gotify-users\.php|gotify-users\.json|audit\.log|README\.md|SECURITY\.md|CONTRIBUTING\.md|AI_DISCLOSURE\.md|LICENSE|\.gitignore|\.htaccess)$ {
deny all;
return 404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
}
}
Nginx example: subpath
Use this when serving Oscar Admin under a path like https://example.com/admin/:
location = /admin {
return 301 /admin/;
}
location /admin/ {
alias /var/www/oscar-admin/;
index index.php;
# Deny sensitive/internal files
location ~* ^/admin/(config\.php|config\.example\.php|lib\.php|lib_gotify\.php|user-menu\.php|gotify-users\.php|gotify-users\.json|audit\.log|README\.md|SECURITY\.md|CONTRIBUTING\.md|AI_DISCLOSURE\.md|LICENSE|\.gitignore|\.htaccess)$ {
deny all;
return 404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
}
}
SEO / discoverability
The login page is intentionally indexable and includes basic SEO metadata plus a source-repo link to help people find the project. If you do not want the login page indexed, edit login.php and change the admin_page(...) SEO options:
], [
'indexable' => false, // was true
// 'description' => '...',
// 'repo_url' => 'https://git.claytonia.net/Clarth/oscar-admin',
]);
Authenticated dashboard pages remain noindex,nofollow by default.
Project Structure
.
├── action.php # Authenticated JSON action endpoint (dashboard -> Management API)
├── admin.css # Admin-specific styles
├── admin.js # Dashboard client behavior
├── assets/
│ └── style.css # Bundled base stylesheet
├── bart-info.php # BART/Buddy Art help page
├── config.example.php # Configuration template
├── index.php # Dashboard UI
├── lib.php # Shared helpers: config/session/auth/API/audit/page shell
├── lib_gotify.php # Optional Gotify addon
├── login.php # Login flow (math challenge + OSCAR/Gotify OTP)
├── logout.php # CSRF-protected logout
└── user-menu.php # User menu / per-user Gotify settings
Runtime files (gitignored): config.php, audit.log, gotify-users.php.
Security
See SECURITY.md for vulnerability reporting and deployment guidance.
AI Disclosure
Parts of this project were created and maintained with assistance from AI coding tools. See AI_DISCLOSURE.md.
Contributing
Contributions are welcome. Please read CONTRIBUTING.md before opening a PR.