Skip to content

Commit 4f7b482

Browse files
committed
Science Commit 5.
1 parent d8c7527 commit 4f7b482

2 files changed

Lines changed: 207 additions & 0 deletions

File tree

configuration/nwe-config.xml

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,4 +915,202 @@
915915
</schedule>
916916
</integrity>
917917

918+
<!-- ═══════════════════════════════════════════════════════════════════════════
919+
PORT SCHEDULE & ACCESS CONTROL
920+
═══════════════════════════════════════════════════════════════════════════
921+
Controls when ports are open (accepting connections) and when they close.
922+
Default: open 24/7/365. Admin can restrict by:
923+
- Days of the week (Mon-Sun)
924+
- Hours of the day (00:00-23:59)
925+
- Months of the year (Jan-Dec)
926+
- City Mayor override (remote XML/JSON endpoint)
927+
928+
Ports automatically OPEN when NWE/modules start and CLOSE when they stop.
929+
This schedule layer adds time-based restrictions ON TOP of runtime state.
930+
931+
A city Mayor can send XML or JSON to the mayor-endpoint to dynamically
932+
control port hours and theme colors for their jurisdiction.
933+
═══════════════════════════════════════════════════════════════════════════ -->
934+
<port-schedule>
935+
<!-- Master switch: enable/disable schedule enforcement -->
936+
<enabled>true</enabled>
937+
938+
<!-- Default policy: OPEN means ports are open unless schedule says otherwise -->
939+
<default-policy>OPEN</default-policy>
940+
941+
<!-- Default schedule: 24/7 (all days, all hours, all months) -->
942+
<default-hours>00:00-23:59</default-hours>
943+
<default-days>Mon,Tue,Wed,Thu,Fri,Sat,Sun</default-days>
944+
<default-months>Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec</default-months>
945+
946+
<!-- Timezone for schedule evaluation -->
947+
<timezone>America/New_York</timezone>
948+
949+
<!-- ── Per-Module Schedule Overrides ─────────────────────────────────── -->
950+
<module-schedules>
951+
<!-- Example: Defined™ restricted to business hours -->
952+
<module id="Defined" port="49220">
953+
<hours>06:00-23:00</hours>
954+
<days>Mon,Tue,Wed,Thu,Fri</days>
955+
<months>Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec</months>
956+
<weekend-hours>08:00-20:00</weekend-hours>
957+
</module>
958+
959+
<!-- All other modules: 24/7 default (no override needed) -->
960+
<module id="SpectrumTandem" port="49222">
961+
<hours>00:00-23:59</hours>
962+
<days>Mon,Tue,Wed,Thu,Fri,Sat,Sun</days>
963+
</module>
964+
<module id="Communicator" port="49230">
965+
<hours>00:00-23:59</hours>
966+
<days>Mon,Tue,Wed,Thu,Fri,Sat,Sun</days>
967+
</module>
968+
<module id="UNCW" port="49231">
969+
<hours>00:00-23:59</hours>
970+
<days>Mon,Tue,Wed,Thu,Fri,Sat,Sun</days>
971+
</module>
972+
<module id="Strernary" port="20000">
973+
<hours>00:00-23:59</hours>
974+
<days>Mon,Tue,Wed,Thu,Fri,Sat,Sun</days>
975+
</module>
976+
<module id="CaliforniaFBI" port="49210">
977+
<hours>00:00-23:59</hours>
978+
<days>Mon,Tue,Wed,Thu,Fri,Sat,Sun</days>
979+
</module>
980+
<module id="CaliforniaCIA" port="49211">
981+
<hours>00:00-23:59</hours>
982+
<days>Mon,Tue,Wed,Thu,Fri,Sat,Sun</days>
983+
</module>
984+
<module id="CaliforniaNSA" port="49212">
985+
<hours>00:00-23:59</hours>
986+
<days>Mon,Tue,Wed,Thu,Fri,Sat,Sun</days>
987+
</module>
988+
<module id="DukeUniversity" port="49213">
989+
<hours>00:00-23:59</hours>
990+
<days>Mon,Tue,Wed,Thu,Fri,Sat,Sun</days>
991+
</module>
992+
<module id="StanfordLibrary" port="49214">
993+
<hours>00:00-23:59</hours>
994+
<days>Mon,Tue,Wed,Thu,Fri,Sat,Sun</days>
995+
</module>
996+
<module id="Vietnam" port="49215">
997+
<hours>00:00-23:59</hours>
998+
<days>Mon,Tue,Wed,Thu,Fri,Sat,Sun</days>
999+
</module>
1000+
<module id="Emeter" port="49216">
1001+
<hours>00:00-23:59</hours>
1002+
<days>Mon,Tue,Wed,Thu,Fri,Sat,Sun</days>
1003+
</module>
1004+
<module id="Futures" port="5000">
1005+
<hours>00:00-23:59</hours>
1006+
<days>Mon,Tue,Wed,Thu,Fri,Sat,Sun</days>
1007+
</module>
1008+
<module id="GrayPortRegistry" port="9999">
1009+
<hours>00:00-23:59</hours>
1010+
<days>Mon,Tue,Wed,Thu,Fri,Sat,Sun</days>
1011+
</module>
1012+
<module id="Gray85Creme" port="10085">
1013+
<hours>00:00-23:59</hours>
1014+
<days>Mon,Tue,Wed,Thu,Fri,Sat,Sun</days>
1015+
</module>
1016+
</module-schedules>
1017+
1018+
<!-- ── Auto Open/Close Behavior ──────────────────────────────────────── -->
1019+
<auto-manage>
1020+
<!-- When NWE starts: open ports in UFW/iptables for scheduled modules -->
1021+
<open-on-start>true</open-on-start>
1022+
<!-- When NWE stops: close all NWE ports in firewall -->
1023+
<close-on-stop>true</close-on-stop>
1024+
<!-- When a module goes offline mid-schedule: close its port -->
1025+
<close-on-module-stop>true</close-on-module-stop>
1026+
<!-- Firewall command (auto-detected: ufw, firewall-cmd, or iptables) -->
1027+
<firewall>auto</firewall>
1028+
</auto-manage>
1029+
1030+
<!-- ── City Mayor Remote Override ───────────────────────────────────────
1031+
A city Mayor's website can send XML or JSON to this endpoint to
1032+
control port hours and theme colors for their jurisdiction.
1033+
1034+
The server polls the mayor-endpoint every poll-interval-minutes.
1035+
If the mayor's server responds with valid XML/JSON, those settings
1036+
override the default schedule for the specified ports.
1037+
1038+
Mayor can control:
1039+
- Which ports are open/closed
1040+
- Operating hours per port
1041+
- Theme colors for the web frontend
1042+
- Custom message/banner
1043+
──────────────────────────────────────────────────────────────────────── -->
1044+
<mayor-override>
1045+
<enabled>false</enabled>
1046+
<poll-interval-minutes>60</poll-interval-minutes>
1047+
<timeout-ms>10000</timeout-ms>
1048+
<max-response-size-kb>64</max-response-size-kb>
1049+
1050+
<!-- Registered mayor endpoints (admin adds these) -->
1051+
<mayors>
1052+
<!-- Example: Durham NC Mayor -->
1053+
<mayor id="durham-nc">
1054+
<city>Durham</city>
1055+
<state>NC</state>
1056+
<endpoint>https://durhamnc.gov/api/nwe-port-schedule</endpoint>
1057+
<format>json</format>
1058+
<auth-header>X-NWE-Mayor-Token</auth-header>
1059+
<trusted>true</trusted>
1060+
<description>City of Durham, NC — Mayor's office port schedule override</description>
1061+
</mayor>
1062+
1063+
<!-- Example: Wilmington NC Mayor (for UNCW module) -->
1064+
<mayor id="wilmington-nc">
1065+
<city>Wilmington</city>
1066+
<state>NC</state>
1067+
<endpoint>https://wilmingtonnc.gov/api/nwe-port-schedule</endpoint>
1068+
<format>xml</format>
1069+
<auth-header>X-NWE-Mayor-Token</auth-header>
1070+
<trusted>true</trusted>
1071+
<description>City of Wilmington, NC — Mayor's office (UNCW jurisdiction)</description>
1072+
</mayor>
1073+
</mayors>
1074+
1075+
<!-- Expected response format (JSON) -->
1076+
<response-schema-json><![CDATA[
1077+
{
1078+
"mayor_id": "durham-nc",
1079+
"city": "Durham",
1080+
"effective_date": "2026-07-16",
1081+
"expires": "2026-08-16",
1082+
"ports": {
1083+
"49222": { "hours": "06:00-22:00", "days": "Mon,Tue,Wed,Thu,Fri,Sat", "status": "open" },
1084+
"49230": { "hours": "00:00-23:59", "days": "Mon,Tue,Wed,Thu,Fri,Sat,Sun", "status": "open" },
1085+
"49231": { "hours": "08:00-20:00", "days": "Mon,Tue,Wed,Thu,Fri", "status": "open" }
1086+
},
1087+
"theme_override": {
1088+
"accent_color": "#1e40af",
1089+
"banner": "City of Durham — Open Service Hours"
1090+
}
1091+
}
1092+
]]></response-schema-json>
1093+
1094+
<!-- Expected response format (XML) -->
1095+
<response-schema-xml><![CDATA[
1096+
<mayor-schedule mayor-id="wilmington-nc" city="Wilmington" effective="2026-07-16" expires="2026-08-16">
1097+
<port id="49231" hours="08:00-22:00" days="Mon,Tue,Wed,Thu,Fri,Sat" status="open"/>
1098+
<port id="49230" hours="00:00-23:59" days="Mon,Tue,Wed,Thu,Fri,Sat,Sun" status="open"/>
1099+
<theme accent-color="#00727A" banner="City of Wilmington — Seahawk Hours"/>
1100+
</mayor-schedule>
1101+
]]></response-schema-xml>
1102+
</mayor-override>
1103+
1104+
<!-- ── Admin Commands for Schedule Management ─────────────────────────── -->
1105+
<admin-commands>
1106+
<command>SCHEDULE_SET|port|hours|days|months</command>
1107+
<command>SCHEDULE_GET|port</command>
1108+
<command>SCHEDULE_RESET|port</command>
1109+
<command>SCHEDULE_MAYOR_ADD|id|city|state|endpoint|format</command>
1110+
<command>SCHEDULE_MAYOR_REMOVE|id</command>
1111+
<command>SCHEDULE_MAYOR_POLL</command>
1112+
<command>SCHEDULE_STATUS</command>
1113+
</admin-commands>
1114+
</port-schedule>
1115+
9181116
</nwe-config>

scripts/preview-styles.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,14 @@
174174
"description": "UNCW Wilmington. CS Club, colleges, chancellors, file sharing, audio, messaging.",
175175
"installer_tech_id": "Max Rupplin",
176176
},
177+
# ── Strernary™ — Cyan/AI Module ───────────────────────────────────────────
178+
"strernary": {
179+
"path": "source/strernary/servlets/servlet/src/main/webapp",
180+
"theme": "Cyan",
181+
"port": 20000,
182+
"description": "Strernary™ Deep Inference. DJL/PyTorch/DistilBERT. ASK, CLASSIFY, TRAIN, RELAY. Port 20000 + Directory 2000.",
183+
"installer_tech_id": "Max Rupplin",
184+
},
177185
}
178186

179187
# ═══════════════════════════════════════════════════════════════════════════════
@@ -212,6 +220,7 @@
212220
.white-red { background: #fff; color: #cc0000; border: 1px solid #cc0000; }
213221
.deep-blue { background: #0a0e1a; color: #6b8aff; border: 1px solid #1e2a4a; }
214222
.seacoast-teal { background: #0a1a1c; color: #00727A; border: 1px solid #1e4a4d; }
223+
.cyan { background: #042f2e; color: #06b6d4; border: 1px solid #0e4f4e; }
215224
.section { margin: 1rem 0; padding: 1rem; background: #1a1a1a; border-radius: 8px; border: 1px solid #333; }
216225
.affirmation { color: #d4af37; font-style: italic; margin: 1rem 0; padding: 1rem; border-left: 3px solid #d4af37; }
217226
code { background: #222; padding: 2px 6px; border-radius: 3px; font-size: 0.9rem; }

0 commit comments

Comments
 (0)