Skip to content

MiniSharkCraft/AMoon-Eclipse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—
β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β•šβ•β• β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘
β•šβ•β•  β•šβ•β•β•šβ•β•     β•šβ•β• β•šβ•β•β•β•β•β•  β•šβ•β•β•β•β•β•β•šβ•β•  β•šβ•β•β•β•
         E C L I P S E

End-to-End Encrypted Messenger β€” Web Β· Mobile Β· Desktop

License: AGPL v3 Go React Expo


What is AMoon Eclipse?

AMoon Eclipse is a zero-knowledge, end-to-end encrypted messaging platform. The server stores only ciphertext it cannot read. Your private key never leaves your device.

  • Web β€” React 18 + Vite + Tailwind CSS
  • Mobile β€” React Native + Expo (Android & iOS)
  • Desktop β€” Wails v2 (Go + React, single binary β€” no Electron)
  • Backend β€” Go + Chi router + MySQL/MariaDB + WebSocket hub

Every message is encrypted client-side with AES-256-GCM before transmission. The session key is wrapped per-recipient using RSA-2048-OAEP. The server is a blind relay.


Support This Project

If AMoon Eclipse helped you or you want to keep development going:

ko-fi


Security Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  SENDER DEVICE                   β”‚
β”‚                                                  β”‚
β”‚  plaintext ──► AES-256-GCM ──► ciphertext        β”‚
β”‚                      β–²                           β”‚
β”‚           ephemeral session key (random)         β”‚
β”‚                      β”‚                           β”‚
β”‚      RSA-OAEP wrap Γ— N recipients                β”‚
β”‚      sessionKeys = { userId: encryptedKey, … }   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚  { sessionKeys, payload }
                      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚               GO SERVER  (BLIND)                 β”‚
β”‚                                                  β”‚
β”‚  Stores bundle as opaque TEXT in MySQL.          β”‚
β”‚  Forwards via WebSocket hub.                     β”‚
β”‚  Cannot read any message. Zero-knowledge.        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚  same bundle
                      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                RECIPIENT DEVICE                  β”‚
β”‚                                                  β”‚
β”‚  sessionKeys[myId] ──► RSA-OAEP unwrap           β”‚
β”‚                              β–Ό                   β”‚
β”‚             session key ──► AES-256-GCM decrypt  β”‚
β”‚                              β–Ό                   β”‚
β”‚                        plaintext βœ“               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Storage per Platform

Platform Storage Backed by
Web IndexedDB (idb) Browser origin
Desktop (Wails) IndexedDB WebView2 / WebKitGTK
Mobile expo-secure-store Android Keystore / iOS Keychain

Server-side Hardening

  • Scanner auto-ban β€” detects vulnerability probes (.env, .php, wp-admin, etc.), bans IPs after 8 hits in 60 s for 2 hours, serves a honeypot page
  • Rate limiting β€” separate limits for auth, API, and WebSocket
  • Security headers β€” CSP, X-Frame-Options, Referrer-Policy, Permissions-Policy
  • Body size cap β€” 512 KB max
  • Field-level encryption β€” PII (emails) encrypted with AES-256-GCM at rest using a server-side key

Monorepo Structure

amoon-eclipse/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ web/                    # React + Vite + Tailwind
β”‚   β”œβ”€β”€ mobile/                 # React Native + Expo
β”‚   └── desktop/                # Wails v2 (Go + React)
β”‚
└── packages/
    β”œβ”€β”€ common/
    β”‚   └── src/
    β”‚       └── crypto-engine.ts  # Shared E2EE β€” runs on all 3 platforms
    β”‚
    └── server/                 # Go backend
        β”œβ”€β”€ cmd/server/main.go  # Router, middleware, graceful shutdown
        └── internal/
            β”œβ”€β”€ auth/           # Register, login, OAuth, TOTP, key management
            β”œβ”€β”€ messages/       # E2EE message store + WebSocket push
            β”œβ”€β”€ rooms/          # DM and group rooms
            β”œβ”€β”€ friends/        # Friend requests
            β”œβ”€β”€ users/          # Profile, search
            β”œβ”€β”€ notes/          # Self-destructing notes
            β”œβ”€β”€ calls/          # WebRTC TURN credentials (Cloudflare)
            β”œβ”€β”€ blocks/         # User blocking
            β”œβ”€β”€ moderation/     # Chat bans, harassment tracking
            β”œβ”€β”€ pending/        # Pending messages (pre-friend)
            β”œβ”€β”€ ws/             # WebSocket hub (rooms + P2P signaling)
            β”œβ”€β”€ middleware/     # JWT auth, rate limit, scanner ban, security headers
            β”œβ”€β”€ crypto/         # AES-GCM field encryption, HMAC tokens
            β”œβ”€β”€ db/             # MySQL connection + schema
            β”œβ”€β”€ email/          # SMTP mailer
            └── config/         # Env + .env file loader

Features

Feature Status
End-to-end encrypted DM βœ…
End-to-end encrypted group chat βœ…
WebRTC P2P voice/video calls βœ…
Real-time WebSocket delivery βœ…
Friend system βœ…
Pending messages (pre-friend) βœ…
Self-destructing notes βœ…
Google OAuth βœ…
TOTP two-factor authentication βœ…
Passphrase key backup & recovery βœ…
User blocking βœ…
Admin moderation tools βœ…
Web app βœ…
Android / iOS (Expo) βœ…
Desktop β€” Windows / macOS / Linux (Wails) βœ…

Quick Start

Prerequisites

  • Go 1.22+
  • Node.js 20+ and pnpm 9+
  • MySQL 8+ or MariaDB 10.6+

1. Clone & Install

git clone https://github.com/your-org/amoon-eclipse
cd amoon-eclipse
pnpm install

2. Database

CREATE DATABASE amoon CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'amoon'@'%' IDENTIFIED BY 'yourpassword';
GRANT ALL PRIVILEGES ON amoon.* TO 'amoon'@'%';
mysql -u amoon -p amoon < packages/server/internal/db/schema.sql

3. Backend

cd packages/server

Create a .env file:

DB_DSN=amoon:yourpassword@tcp(localhost:3306)/amoon?parseTime=true&charset=utf8mb4
JWT_SECRET=<output of: openssl rand -hex 32>
DB_ENCRYPTION_KEY=<output of: openssl rand -hex 32>
DB_HMAC_KEY=<output of: openssl rand -hex 32>
PORT=8080
BASE_URL=http://localhost:8080
ALLOWED_ORIGINS=http://localhost:5173

# Optional
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
SMTP_HOST=
SMTP_PORT=587
SMTP_USER=
SMTP_PASS=
CF_TURN_TOKEN_ID=
CF_TURN_API_TOKEN=

Build and run:

go build -o amoon-server ./cmd/server/
./amoon-server
# β†’ AMoon Eclipse server running on :8080

4. Web

cd apps/web
echo "VITE_API_URL=http://localhost:8080" > .env.local
pnpm dev

5. Mobile

cd apps/mobile
echo "EXPO_PUBLIC_API_URL=http://YOUR_LOCAL_IP:8080" > .env
npx expo start

6. Desktop (Wails)

# Requires Wails CLI: go install github.com/wailsapp/wails/v2/cmd/wails@latest
cd apps/desktop/wails-app
wails dev

Environment Variables

Variable Required Description
DB_DSN βœ… MySQL DSN
JWT_SECRET βœ… Token signing key
DB_ENCRYPTION_KEY βœ… 64-char hex β€” AES-256 for PII at rest
DB_HMAC_KEY βœ… 64-char hex β€” HMAC for email lookup tokens
PORT β€” HTTP listen port (default: 8080, or P_SERVER_PORT)
BASE_URL β€” Public URL for OAuth redirect URIs
ALLOWED_ORIGINS β€” CORS origins, comma-separated (default: *)
GOOGLE_CLIENT_ID/SECRET β€” Google OAuth
CF_TURN_TOKEN_ID/API_TOKEN β€” Cloudflare TURN for WebRTC
SMTP_* β€” Email (password reset, verification)
FACEBOOK_APP_ID β€” Facebook token verification

The server reads .env from the working directory at startup. Real environment variables always override .env values.


Deployment

Manual (Linux / VPS)

# Cross-compile for Linux
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 \
  go build -o amoon-server ./cmd/server/

# Upload binary + .env to server
scp amoon-server .env user@yourhost:/opt/amoon/

# Run (use systemd, PM2, or your preferred process manager)
cd /opt/amoon && ./amoon-server

Pterodactyl Panel

Works with the Generic Go egg out of the box:

  • Set EXECUTABLE β†’ amoon-server
  • Startup command: ./${EXECUTABLE}
  • Drop a .env file into the container β€” the server loads it automatically
  • PORT falls back to P_SERVER_PORT (Pterodactyl's primary allocation port) if not explicitly set

Contributing

Pull requests are welcome. For major changes please open an issue first to discuss.

  1. Fork the repository
  2. Create a feature branch: git checkout -b feat/my-feature
  3. Commit your changes
  4. Open a Pull Request

Important: Do not break the E2EE bundle format. The packages/common/src/crypto-engine.ts format must remain compatible across Web, Mobile, and Desktop. Any change to encryptMessage / decryptMessage must be reflected on all three platforms.


License

Copyright (C) 2026 AMoon Team & CongMC Dev Team

This project is licensed under the GNU Affero General Public License v3.0. See LICENSE for the full text.

In short: you are free to use, modify, and distribute this software, but any modified version you deploy as a network service must also be released as open source under the same license.


Built with ❀️ by AMoon Team & CongMC Dev Team

The server is blind. The key is yours.

About

πŸ›‘οΈAMoon Eclipse - The Paranoid Chat App Secure Real-time Chat built with Golang & React Native. High-integrity architecture featuring JNI Checksum Verification & HMAC Signing to nuking malicious clones. πŸš€

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors