@@ -174,7 +174,7 @@ def configure_model(config):
174174 { BOLD } Which AI model provider do you want to use?{ RESET }
175175
176176 { CYAN } 1{ RESET } Ollama { DIM } (free, local, private — recommended for getting started){ RESET }
177- { CYAN } 2{ RESET } Anthropic { DIM } (Claude models — best quality){ RESET }
177+ { CYAN } 2{ RESET } Anthropic { DIM } (best quality){ RESET }
178178 { CYAN } 3{ RESET } OpenAI { DIM } (GPT models){ RESET }
179179 { CYAN } 4{ RESET } NVIDIA { DIM } (NVIDIA AI endpoints){ RESET }
180180 { CYAN } 5{ RESET } Google { DIM } (Gemini models){ RESET }
@@ -339,6 +339,77 @@ def configure_security(config):
339339 success ("Blocking on CRITICAL findings only" )
340340
341341
342+ def configure_communications (config ):
343+ """Set up notification and communication channels."""
344+ print (f"""
345+ { BOLD } How should 0pnMatrx reach you?{ RESET }
346+ { DIM } Select your preferred notification channels.{ RESET }
347+ { DIM } You can configure multiple channels.{ RESET }
348+ """ )
349+
350+ channels = {}
351+
352+ # Telegram
353+ use_telegram = ask ("Enable Telegram notifications?" , default = "no" , options = ["yes" , "no" ])
354+ if use_telegram .lower () == "yes" :
355+ bot_token = ask ("Telegram Bot Token (from @BotFather)" )
356+ chat_id = ask ("Telegram Chat ID" )
357+ if bot_token and chat_id :
358+ channels ["telegram" ] = {
359+ "enabled" : True ,
360+ "bot_token" : bot_token ,
361+ "chat_id" : chat_id ,
362+ }
363+ success ("Telegram configured" )
364+
365+ # Discord
366+ use_discord = ask ("Enable Discord notifications?" , default = "no" , options = ["yes" , "no" ])
367+ if use_discord .lower () == "yes" :
368+ webhook_url = ask ("Discord Webhook URL" )
369+ if webhook_url :
370+ channels ["discord" ] = {
371+ "enabled" : True ,
372+ "webhook_url" : webhook_url ,
373+ }
374+ success ("Discord configured" )
375+
376+ # Email
377+ use_email = ask ("Enable email notifications?" , default = "no" , options = ["yes" , "no" ])
378+ if use_email .lower () == "yes" :
379+ smtp_host = ask ("SMTP host" , default = "smtp.gmail.com" )
380+ smtp_port = ask ("SMTP port" , default = "587" )
381+ smtp_user = ask ("SMTP username (email address)" )
382+ smtp_pass = ask ("SMTP password or app password" )
383+ to_addr = ask ("Send notifications to (email)" , default = smtp_user )
384+ if smtp_user :
385+ channels ["email" ] = {
386+ "enabled" : True ,
387+ "smtp_host" : smtp_host ,
388+ "smtp_port" : int (smtp_port ),
389+ "smtp_user" : smtp_user ,
390+ "smtp_pass" : smtp_pass ,
391+ "to" : to_addr ,
392+ }
393+ success ("Email configured" )
394+
395+ # Webhooks
396+ use_webhook = ask ("Enable custom webhook notifications?" , default = "no" , options = ["yes" , "no" ])
397+ if use_webhook .lower () == "yes" :
398+ url = ask ("Webhook URL (POST)" )
399+ if url :
400+ channels ["webhook" ] = {
401+ "enabled" : True ,
402+ "url" : url ,
403+ }
404+ success ("Webhook configured" )
405+
406+ if not channels :
407+ info ("No notification channels configured. You can add them later in openmatrix.config.json" )
408+ channels ["none" ] = True
409+
410+ config ["communications" ] = channels
411+
412+
342413def configure_extras (config ):
343414 """Optional extras: timezone, memory."""
344415 tz = ask ("Timezone" , default = "America/Los_Angeles" )
@@ -429,7 +500,7 @@ def main():
429500 print (f" { DIM } Press Enter to accept defaults shown in [brackets].{ RESET } " )
430501 print (f" { DIM } You can re-run this anytime to change settings.{ RESET } " )
431502
432- total = 8
503+ total = 9
433504 config = {
434505 "platform" : "0pnMatrx" ,
435506 "database" : {"path" : "data/0pnmatrx.db" },
@@ -459,12 +530,16 @@ def main():
459530 step (6 , total , "Gateway Server" )
460531 configure_gateway (config )
461532
462- # Step 7: Security
463- step (7 , total , "Security Settings" )
533+ # Step 7: Communications
534+ step (7 , total , "Communication Channels" )
535+ configure_communications (config )
536+
537+ # Step 8: Security
538+ step (8 , total , "Security Settings" )
464539 configure_security (config )
465540
466- # Step 8 : Extras
467- step (8 , total , "Final Settings" )
541+ # Step 9 : Extras
542+ step (9 , total , "Final Settings" )
468543 configure_extras (config )
469544
470545 # Write and verify
0 commit comments