mirror of
https://github.com/J3vb/OwnCord.git
synced 2026-09-03 03:50:00 +03:00
6eba99923333e19758c5ba9df0013ebdf824f716
Server: - Add Let's Encrypt (ACME) TLS mode with autocert, HTTP-01 challenges on :80, and automatic certificate renewal (tls.mode: "acme" in config.yaml) - Add ASCII art startup banner with server info and endpoint URLs - Fix CSP blocking admin panel inline styles/scripts (per-route override) - Suppress TLS handshake error noise in console output - Fix TOCTOU race in invite consumption (atomic UPDATE with row-count check) - Fix sendMsg mutex race condition (hold lock for entire send) - Fix permission override formula (deny-first, allow-wins) - Fix voice join parsing channelID before permission check - Add session expiry check at WebSocket auth and periodic revalidation - Add message length limit (4000 chars) and emoji length validation (32 bytes) - Add file size enforcement in storage after io.Copy - Add checksum URL validation in updater - Add backup path traversal protection (BackupToSafe) - Add self-modification guard in admin handlePatchUser - Fix admin ownerOnlyMiddleware to use context user instead of re-auth - Remove redundant startup log lines (banner shows same info) - Add periodic expired session cleanup (15-min ticker) - Add permissions package with bitfield constants and EffectivePerms - Add rate limiter cleanup goroutine to prevent unbounded growth - Add auth helpers (IsEffectivelyBanned, IsSessionExpired) - Add WebSocket origin validation Client: - Add TOFU certificate trust service - Add receive loop error handling - Fix redundant else-if in OnChatMessage
OwnCord
Self-hosted Windows chat platform with voice, video, and an admin panel.
Features
- Real-time text chat with threads and reactions
- Voice and video channels (WebRTC)
- Role-based permissions with custom roles
- File sharing with inline previews
- Full-text message search
- Web-based admin panel
- Invite-only registration
- TLS encryption (self-signed or custom cert)
Quick Start
- Download the latest release from GitHub Releases
- Run
chatserver.exe— generatesconfig.yamlon first run - Open
https://localhost:8443/adminto access the admin panel - Generate an invite code, share it with friends
- Friends download
OwnCord.Client.exeand connect using your server address
Building from Source
Server
cd Server
go build -o chatserver.exe -ldflags "-s -w -X main.version=1.0.0" .
Client
dotnet publish Client/OwnCord.Client/OwnCord.Client.csproj -c Release -r win-x64 --self-contained -p:PublishSingleFile=true
Architecture
OwnCord consists of a Go server and a WPF/.NET 8 desktop client. The server handles all business logic, storage, and real-time communication. Clients connect over WebSocket for chat events, REST for history and uploads, and WebRTC for voice/video.
┌─────────────────────┐ ┌─────────────────────┐
│ OwnCord Client │ │ OwnCord Server │
│ (WPF / .NET 8) │ │ (Go) │
│ │ │ │
│ ┌───────────────┐ │ WSS │ ┌───────────────┐ │
│ │ Chat UI │──┼────────►│ │ WebSocket Hub│ │
│ └───────────────┘ │ │ └───────────────┘ │
│ ┌───────────────┐ │ HTTPS │ ┌───────────────┐ │
│ │ REST Client │──┼────────►│ │ REST API │ │
│ └───────────────┘ │ │ └───────────────┘ │
│ ┌───────────────┐ │ WebRTC │ ┌───────────────┐ │
│ │ Voice/Video │──┼────────►│ │ TURN/STUN │ │
│ └───────────────┘ │ │ └───────────────┘ │
└─────────────────────┘ │ ┌───────────────┐ │
│ │ SQLite DB │ │
│ └───────────────┘ │
└─────────────────────┘
Documentation
License
MIT
Languages
TypeScript
48.7%
Go
44%
JavaScript
2.2%
Rust
2.1%
CSS
1.4%
Other
1.5%