76 lines
No EOL
2.7 KiB
Markdown
76 lines
No EOL
2.7 KiB
Markdown
# Web OSCAR Chat
|
||
|
||
A small browser chat client for [Open OSCAR Server](https://github.com/mk6i/open-oscar-server). It’s a Node/Express app with a plain HTML/CSS/JS frontend for basic AIM/ICQ-style messaging.
|
||
|
||
## Supported
|
||
|
||
- Sign in with an existing OSCAR screen name/password
|
||
- 1:1 instant messages
|
||
- Buddy list/presence (when provided by server/Web API)
|
||
- Add buddy
|
||
- Group chat join/send/leave via TOC
|
||
- Chat invites (Join/Ignore) via TOC
|
||
- Real-time updates via SSE
|
||
- TOC connection status indicator
|
||
|
||
## Not supported
|
||
|
||
OSCAR has many features this project does not implement yet, including: offline messages, file transfer, buddy icons, away/profile/status messages, typing notifications, blocking/warning management, chat moderation/admin, account registration, encryption, and full user directory/search.
|
||
|
||
## Requirements
|
||
|
||
- Node.js 20.19+
|
||
- Running Open OSCAR Server with Web API and/or TOC access
|
||
|
||
## Setup
|
||
|
||
```bash
|
||
npm install
|
||
cp .env.example .env
|
||
# edit .env
|
||
npm run dev
|
||
# or: npm start
|
||
```
|
||
|
||
Open `http://localhost:3000` (or your configured `PORT`).
|
||
|
||
## Configuration
|
||
|
||
| Variable | Description | Default |
|
||
|---|---|---|
|
||
| `WEBAPI_HOST` | Web API host | `127.0.0.1` |
|
||
| `WEBAPI_PORT` | Web API port | `8081` |
|
||
| `TOC_HOST` | TOC host for IM/chat/invites | unset |
|
||
| `TOC_PORT` | TOC port | `9898` |
|
||
| `MANAGEMENT_HOST` | Management API host (optional user search) | `127.0.0.1` |
|
||
| `MANAGEMENT_PORT` | Management API port | `8080` |
|
||
| `PORT` | App listen port | `3000` |
|
||
| `LISTEN_HOST` | App bind host | `127.0.0.1` |
|
||
| `TRUST_PROXY` | Proxy hops in front of app | `1` |
|
||
| `COOKIE_SECURE` | `auto`/`true`/`false` session cookie | `auto` |
|
||
| `SESSION_MAX_AGE_HOURS` | Session lifetime | `24` |
|
||
| `DEV_ID` | Optional Web API devId/key | unset |
|
||
| `SESSION_SECRET` | Cookie signing secret | required |
|
||
|
||
## Public deployment (nginx)
|
||
|
||
- Bind app to `127.0.0.1` and expose only through HTTPS nginx.
|
||
- Set `TRUST_PROXY=1`, `COOKIE_SECURE=true`, strong `SESSION_SECRET`, and `0600` permissions on `.env`.
|
||
- Nginx should redirect HTTP->HTTPS, set HSTS, forward `X-Forwarded-*`, and disable buffering for SSE:
|
||
|
||
```nginx
|
||
location /api/events {
|
||
proxy_pass http://127.0.0.1:3000;
|
||
proxy_http_version 1.1;
|
||
proxy_set_header Host $host;
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
proxy_set_header X-Forwarded-Proto $scheme;
|
||
proxy_set_header Connection '';
|
||
proxy_buffering off;
|
||
proxy_cache off;
|
||
proxy_read_timeout 1h;
|
||
}
|
||
```
|
||
|
||
- App includes Helmet headers/CSP, JSON-only mutating API checks, Origin checks, and rate limits. Still review before public use.
|
||
- Sessions are in-memory (single process only; restart logs users out). For heavier public use, move to a persistent session store. |