Skip to content

Commit 8f528be

Browse files
committed
Science Commit 5.
1 parent 1ed333a commit 8f528be

66 files changed

Lines changed: 5744 additions & 6 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.idea/awsToolkit.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ bash scripts/status.sh
6868
| StanfordLibrary | `modules/library` | 49214 | `/library` | `source.StanfordLibraryServer` | Stanford Library catalog, resource requests |
6969
| Vietnam | `modules/vietnam` | 49215 | `/vietnam` | `source.VietnamServer` | Ancient Vietnamese fighting styles and languages |
7070
| Emeter | `modules/emeter` | 49216 | `/emeter` | `source.EmeterServer` | E-Meter instruction, calibration, readings |
71+
| SpectrumTandem | `modules/spectrum-tandem` | 49222 | `/spectrum-tandem` | `source.SpectrumTandemServer` | Dolyene spectrum of int discipline, word bank, county precedent |
72+
| Chat | `modules/chat` | 49230 | `/chat` | `source.ChatServer` | Encrypted chat, DH-2048/RSA-2048, federation, file/voice, admin |
73+
| UNCW | `modules/uncw` | 49231 | `/uncw` | `source.UNCWServer` | UNCW Wilmington CS club, colleges, chancellor, files, messaging |
7174
| GrayPortRegistry | `modules/gray` | 9999 | `/gray-registry` | `modules.gray.source.GrayPortRegistryServer` | Port registry (30M ports/block), Bitcoin/Dash payment, AI-gated |
7275
| Gray85Crème | `modules/gray.a85` | 10085 | `/gray85-registry` | `modules.gray.a85.source.Gray85PortRegistryServer` | Crème port registry (85% open, 15% locked at $1000 USD) |
7376
| AE6E66 | `modules/AE6E66` || `/ae6e66` | `source.AE6E66Main` | UK Parliament contact module, DKIM email |
@@ -202,6 +205,9 @@ Java.Web.Server.Telnet.Front.Java.21/
202205
│ ├── library/ StanfordLibrary (port 49214)
203206
│ ├── vietnam/ Vietnam (port 49215)
204207
│ ├── emeter/ Emeter (port 49216)
208+
│ ├── spectrum-tandem/ SpectrumTandem (port 49222)
209+
│ ├── chat/ NWE Chat (port 49230)
210+
│ ├── uncw/ UNCW Wilmington (port 49231)
205211
│ ├── gray/ GrayPortRegistry (port 9999)
206212
│ ├── gray.a85/ Gray85Crème (port 10085)
207213
│ ├── AE6E66/ UK Parliament contact
@@ -236,7 +242,9 @@ Java.Web.Server.Telnet.Front.Java.21/
236242
| 10085 | Gray85 Crème Registry |
237243
| 20000 | Strernary AI inference |
238244
| 49111–49216 | NWE core + signal + modules |
239-
| 49220–49221 | Defined (AI + Protocol Backend) |
245+
| 49220–49222 | Defined (AI + Protocol Backend), SpectrumTandem |
246+
| 49230 | NWE Chat (encrypted, federation) |
247+
| 49231 | UNCW (Wilmington CS, colleges, chancellors) |
240248

241249
**Open all ports:** `sudo bash scripts/ufw-allow-all.sh`
242250

modules/chat/README.md

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# NWE Chat™ — Encrypted Communication Module
2+
3+
**NitroWebExpress™ Module**
4+
Author: Maximilian Eric Alexander Rupplin von Keffikon — MEARVK LLC
5+
Installer Tech ID: Max Rupplin
6+
Port: 49230
7+
Database: nwe_chat
8+
Context: /chat
9+
Ethics: We conceal God but do not work for Her.
10+
11+
---
12+
13+
## Purpose
14+
15+
Full-featured encrypted chat server with:
16+
- **Account Management** — Register, login, change username, delete account
17+
- **End-to-End Encryption** — DH-2048 (RFC 3526 Group 14) + RSA-2048 + AES-256-GCM
18+
- **Direct Messaging** — Encrypted user↔user communication
19+
- **Broadcast** — Send to all connected users
20+
- **File Transfer** — Send files up to 25MB with E2E encryption
21+
- **Voice Notes** — Microphone recording up to 120s
22+
- **Federation** — Connect to up to 5 external NWE Chat servers (Max Rupplin design)
23+
- **Rank System** — Concealment 3 at 200+ federated connects, Gold Harvard Certificate at 300+
24+
- **Admin Panel** — User management, ban/unban, logs, IP/Geo tracking
25+
- **Chat Logging** — All messages stored with IPs and timestamps
26+
- **Settings** — Reviewable, settable, revisable in XML and database
27+
28+
---
29+
30+
## Encryption
31+
32+
| Layer | Algorithm | Key Size | Purpose |
33+
|-------|-----------|----------|---------|
34+
| Key Exchange | Diffie-Hellman | 2048-bit | Server↔user session key derivation |
35+
| Public Key | RSA | 2048-bit | User↔user direct message signing/encryption |
36+
| Symmetric | AES-256-GCM | 256-bit | Authenticated bulk data encryption |
37+
38+
DH parameters: RFC 3526 Group 14 (2048-bit MODP).
39+
40+
---
41+
42+
## Federation & Ranks
43+
44+
Users can connect to up to 5 external NWE Chat™ servers (of Max Rupplin's design) by IP or domain.
45+
46+
| Connects | Rank | Reward |
47+
|----------|------|--------|
48+
| 50+ | CONNECTOR | Federation badge |
49+
| 100+ | FEDERATION VETERAN | Veteran status + priority routing |
50+
| 200+ | CONCEALMENT 3 | ★ Elevated encryption tier |
51+
| 300+ | GOLD HARVARD CERTIFICATE | ★★ Gold Letter of Certificate from Harvard. Kids. |
52+
53+
---
54+
55+
## Protocol (Port 49230)
56+
57+
```
58+
telnet localhost 49230
59+
60+
REGISTER|username|password|email → Create account
61+
LOGIN|username|password → Authenticate
62+
ADMIN|password → Enable admin mode
63+
MSG|user|text → Direct message (encrypted)
64+
BROADCAST|text → Send to all
65+
LIST → Online users with geo
66+
HISTORY → Last 30 messages
67+
ENCRYPT|DH → Initiate DH-2048 key exchange
68+
ENCRYPT|RSA → Initiate RSA-2048
69+
ENCRYPT_ACCEPT|pubkey → Complete handshake
70+
ENCRYPT_OFF → Disable encryption
71+
FILE|user|name|size|b64 → Send file
72+
VOICE|user|durationMs|b64 → Send voice note
73+
FEDERATE|host[:port] → Connect to remote server
74+
FEDERATION_STATUS → View rank and servers
75+
CHANGE_USERNAME|new → Change username
76+
DELETE_ACCOUNT → Delete account
77+
STATUS → Module status
78+
QUIT → Disconnect
79+
80+
Admin commands:
81+
ADMIN_USERS → List all users
82+
ADMIN_BAN|user → Ban user
83+
ADMIN_UNBAN|user → Unban user
84+
ADMIN_LOGS → Event log
85+
ADMIN_GEO|user → User IP/geo
86+
ADMIN_IPS → All connected IPs
87+
```
88+
89+
---
90+
91+
## Database Schema (nwe_chat)
92+
93+
- **users** — username, password_hash, salt, email, IPs, geo, admin/ban/delete flags, federation count
94+
- **messages** — sender, receiver, content, type (DM/BROADCAST/FILE/VOICE/SYSTEM), IP, timestamp
95+
- **event_log** — user events (login, register, ban, etc.) with IPs
96+
- **federation_log** — remote server connections per user
97+
- **ranks** — rank awards (CONCEALMENT_3, GOLD_HARVARD_CERTIFICATE)
98+
- **chat_settings** — configurable settings (key/value with updater and timestamp)
99+
100+
---
101+
102+
## Webapp
103+
104+
Deep blue background with rich purple offsets. CD1 button connector in blue for Strernary™/direct port routing.
105+
106+
Pages:
107+
- **index.jsp** — Live chat interface, CD1 connector, file/mic buttons
108+
- **account.jsp** — Register, login, change username, delete account
109+
- **federation.jsp** — Connect to remote servers, rank progression
110+
- **settings.jsp** — Review and revise all settings
111+
- **admin.jsp** — Admin panel (users, ban, geo, logs)
112+
- **status.jsp** — Backend connectivity, protocol reference
113+
114+
---
115+
116+
## Scripts
117+
118+
| Script | Purpose |
119+
|--------|---------|
120+
| `start-backend.sh` | Start TCP backend on port 49230 |
121+
| `shutdown-backend.sh` | Stop TCP backend |
122+
| `start-frontend.sh` | Deploy webapp to Tomcat |
123+
| `shutdown-frontend.sh` | Undeploy webapp |
124+
| `servlets/deploy-local.sh` | Deploy webapp |
125+
| `servlets/setup-db.sh` | Create database and seed settings |
126+
127+
---
128+
129+
## Contact
130+
131+
- GitHub: https://github.com/mearvk/Java.Web.Server.Telnet.Front.Java.21/discussions
132+
- Email: mearvk@mearvk.us | mearvk@outlook.com
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!--
3+
NWE Chat™ Module Configuration
4+
====================================
5+
MEARVK LLC — NitroWebExpress™
6+
Port: 49230
7+
Database: nwe_chat
8+
Context: /chat
9+
Masquerade: enabled
10+
Installer Tech ID: Max Rupplin
11+
Ethics: We conceal God but do not work for Her.
12+
-->
13+
<chat-config>
14+
<server>
15+
<port>49230</port>
16+
<host>localhost</host>
17+
<name>NWE Chat™</name>
18+
<masquerade-aware>true</masquerade-aware>
19+
</server>
20+
21+
<database>
22+
<name>nwe_chat</name>
23+
<host>127.0.0.1</host>
24+
<port>3306</port>
25+
</database>
26+
27+
<webapp>
28+
<context>/chat</context>
29+
<tomcat-port>8080</tomcat-port>
30+
<theme>deep-blue-purple</theme>
31+
</webapp>
32+
33+
<installer>
34+
<tech-id>Max Rupplin</tech-id>
35+
<installed>2026-07-16</installed>
36+
</installer>
37+
38+
<ethics>
39+
<statement>We conceal God but do not work for Her.</statement>
40+
<brand>NWE Chat™</brand>
41+
<official-concern>true</official-concern>
42+
</ethics>
43+
44+
<encryption>
45+
<dh-enabled>true</dh-enabled>
46+
<dh-bits>2048</dh-bits>
47+
<dh-group>RFC 3526 Group 14</dh-group>
48+
<rsa-enabled>true</rsa-enabled>
49+
<rsa-bits>2048</rsa-bits>
50+
<symmetric-cipher>AES-256-GCM</symmetric-cipher>
51+
<user-to-user>true</user-to-user>
52+
<server-to-user>true</server-to-user>
53+
</encryption>
54+
55+
<session>
56+
<timeout-hours>4</timeout-hours>
57+
<max-idle-minutes>60</max-idle-minutes>
58+
</session>
59+
60+
<federation>
61+
<enabled>true</enabled>
62+
<max-servers>5</max-servers>
63+
<concealment-3-threshold>200</concealment-3-threshold>
64+
<gold-cert-threshold>300</gold-cert-threshold>
65+
<probe-timeout-ms>5000</probe-timeout-ms>
66+
<designer>Max Rupplin</designer>
67+
</federation>
68+
69+
<file-transfer>
70+
<enabled>true</enabled>
71+
<max-size-mb>25</max-size-mb>
72+
<allowed-types>*</allowed-types>
73+
</file-transfer>
74+
75+
<voice>
76+
<enabled>true</enabled>
77+
<max-duration-sec>120</max-duration-sec>
78+
<format>opus</format>
79+
</voice>
80+
81+
<admin>
82+
<password-source>chat_settings.admin_password</password-source>
83+
<log-retention-days>365</log-retention-days>
84+
</admin>
85+
86+
<ai-module>
87+
<enabled>true</enabled>
88+
<inference-port>20000</inference-port>
89+
<model>distilbert</model>
90+
<description>Routes geo resolution and search queries through Strernary™ on port 20000.</description>
91+
</ai-module>
92+
93+
<communicator-link>
94+
<enabled>true</enabled>
95+
<port>49199</port>
96+
<description>Integration with existing NWE Communicator server for backward compatibility.</description>
97+
</communicator-link>
98+
99+
<protocol>
100+
<commands>
101+
<command name="REGISTER" args="username|password|email" description="Create a new account"/>
102+
<command name="LOGIN" args="username|password" description="Authenticate"/>
103+
<command name="ADMIN" args="password" description="Enable admin mode"/>
104+
<command name="MSG" args="targetUser|message" description="Direct message (encrypted)"/>
105+
<command name="BROADCAST" args="message" description="Send to all users"/>
106+
<command name="LIST" args="" description="List online users with geo"/>
107+
<command name="HISTORY" args="" description="Last 30 messages"/>
108+
<command name="ENCRYPT" args="DH|RSA" description="Initiate key exchange"/>
109+
<command name="ENCRYPT_ACCEPT" args="peerPublicKey" description="Complete handshake"/>
110+
<command name="ENCRYPT_OFF" args="" description="Disable encryption"/>
111+
<command name="FILE" args="user|name|size|b64" description="Send file"/>
112+
<command name="VOICE" args="user|durationMs|b64audio" description="Send voice note"/>
113+
<command name="FEDERATE" args="host[:port]" description="Connect to remote Chat server"/>
114+
<command name="FEDERATION_STATUS" args="" description="View federation stats"/>
115+
<command name="CHANGE_USERNAME" args="newUsername" description="Change username"/>
116+
<command name="DELETE_ACCOUNT" args="" description="Mark account for deletion"/>
117+
<command name="STATUS" args="" description="Module status"/>
118+
<command name="HELP" args="" description="Command list"/>
119+
<command name="QUIT" args="" description="Disconnect"/>
120+
</commands>
121+
<admin-commands>
122+
<command name="ADMIN_USERS" description="List all users with details"/>
123+
<command name="ADMIN_BAN" args="username" description="Ban a user"/>
124+
<command name="ADMIN_UNBAN" args="username" description="Unban a user"/>
125+
<command name="ADMIN_LOGS" description="View event log"/>
126+
<command name="ADMIN_GEO" args="username" description="View user geo/IP"/>
127+
<command name="ADMIN_IPS" description="View all connected IPs"/>
128+
</admin-commands>
129+
</protocol>
130+
</chat-config>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
# ═══════════════════════════════════════════════════════════════════════════════════
3+
# NitroWebExpress™ — Chat Deploy Local
4+
# Usage: bash modules/chat/servlets/deploy-local.sh [tomcat_home]
5+
# ═══════════════════════════════════════════════════════════════════════════════════
6+
set -e
7+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
8+
TOMCAT_HOME="${1:-${CATALINA_HOME:-/opt/apache-tomcat-11.0.2}}"
9+
NWE_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)"
10+
11+
source "$NWE_ROOT/scripts/deploy-functions.sh" 2>/dev/null || true
12+
13+
if type nwe_deploy_module &>/dev/null; then
14+
nwe_deploy_module "NWE Chat" "chat" \
15+
"$SCRIPT_DIR/servlet/src/main/webapp" \
16+
"" \
17+
"$TOMCAT_HOME" "$NWE_ROOT"
18+
else
19+
DEPLOY_DIR="$TOMCAT_HOME/webapps/chat"
20+
echo "[*] Deploying NWE Chat™ to $DEPLOY_DIR"
21+
rm -rf "$DEPLOY_DIR"
22+
mkdir -p "$DEPLOY_DIR/WEB-INF/lib"
23+
cp -r "$SCRIPT_DIR/servlet/src/main/webapp/"* "$DEPLOY_DIR/"
24+
JDBC_JAR=$(find "$NWE_ROOT/jars/mysql" -name "mysql-connector-j*.jar" -type f 2>/dev/null | head -1)
25+
[ -n "$JDBC_JAR" ] && cp "$JDBC_JAR" "$DEPLOY_DIR/WEB-INF/lib/"
26+
chown -R tomcat:tomcat "$DEPLOY_DIR" 2>/dev/null || true
27+
echo "[OK] NWE Chat deployed at /chat"
28+
fi
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
5+
version="6.0">
6+
7+
<display-name>NWE Chat</display-name>
8+
9+
<welcome-file-list>
10+
<welcome-file>index.jsp</welcome-file>
11+
</welcome-file-list>
12+
13+
<security-constraint>
14+
<web-resource-collection>
15+
<web-resource-name>Protected</web-resource-name>
16+
<url-pattern>/WEB-INF/*</url-pattern>
17+
</web-resource-collection>
18+
<auth-constraint/>
19+
</security-constraint>
20+
21+
<session-config>
22+
<session-timeout>240</session-timeout>
23+
<cookie-config><http-only>true</http-only><secure>true</secure></cookie-config>
24+
</session-config>
25+
26+
<error-page><error-code>404</error-code><location>/index.jsp</location></error-page>
27+
<error-page><error-code>500</error-code><location>/index.jsp</location></error-page>
28+
</web-app>

0 commit comments

Comments
 (0)