add_url_formats.py 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import os
  2. file_path = "generate_docs.py"
  3. if os.path.exists(file_path):
  4. with open(file_path, "r", encoding="utf-8", errors="replace") as f:
  5. content = f.read()
  6. # Create the URL_Formats string insertion
  7. url_formats_code = """ "URL_Formats.md": \"\"\"# $Id$
  8. # Local Food AI - Network Connection URL Directory
  9. This runbook catalogs the specific network formats and port endpoints required to access the application and monitoring servers across different loopback, hostname, and address protocols.
  10. ## 1. Localhost Format (Loopback)
  11. - **Streamlit Web Application UI**: `http://localhost:100` *(via Nginx)* or `http://localhost:8522` *(direct)*
  12. - **Zabbix Web UI Console**: `http://localhost:8101`
  13. - **Airflow Webserver DAG UI**: `http://localhost:8102`
  14. - **Ollama AI Local Engine**: `http://localhost:11434`
  15. - **SearXNG Meta-Search API**: `http://localhost:8105`
  16. - **MySQL Database Server**: `localhost:3326` *(direct SQL connection)*
  17. ## 2. Hostname Format (assuming Hostname is `XYZZYX`)
  18. - **Streamlit Web Application UI**: `http://XYZZYX:100` or `http://XYZZYX:8522`
  19. - **Zabbix Web UI Console**: `http://XYZZYX:8101`
  20. - **Airflow Webserver DAG UI**: `http://XYZZYX:8102`
  21. - **Ollama AI Local Engine**: `http://XYZZYX:11434`
  22. - **SearXNG Meta-Search API**: `http://XYZZYX:8105`
  23. - **MySQL Database Server**: `XYZZYX:3326`
  24. ## 3. IPv4 Format (assuming Local Host IP is `192.168.1.50`)
  25. - **Streamlit Web Application UI**: `http://192.168.1.50:100` or `http://192.168.1.50:8522` *(loopback: `http://127.0.0.1:100`)*
  26. - **Zabbix Web UI Console**: `http://192.168.1.50:8101` *(loopback: `http://127.0.0.1:8101`)*
  27. - **Airflow Webserver DAG UI**: `http://192.168.1.50:8102` *(loopback: `http://127.0.0.1:8102`)*
  28. - **Ollama AI Local Engine**: `http://192.168.1.50:11434` *(loopback: `http://127.0.0.1:11434`)*
  29. - **SearXNG Meta-Search API**: `http://192.168.1.50:8105` *(loopback: `http://127.0.0.1:8105`)*
  30. - **MySQL Database Server**: `192.168.1.50:3326` *(loopback: `127.0.0.1:3326`)*
  31. ## 4. IPv6 Format (using loopback `[::1]` or link-local address)
  32. - **Streamlit Web Application UI**: `http://[::1]:100` or `http://[::1]:8522`
  33. - **Zabbix Web UI Console**: `http://[::1]:8101`
  34. - **Airflow Webserver DAG UI**: `http://[::1]:8102`
  35. - **Ollama AI Local Engine**: `http://[::1]:11434`
  36. - **SearXNG Meta-Search API**: `http://[::1]:8105`
  37. - **MySQL Database Server**: `[::1]:3326`
  38. \"\"\",
  39. """
  40. # Insert it right before Final_Report.md
  41. content = content.replace(' "Final_Report.md": """# $Id$', url_formats_code + ' "Final_Report.md": """# $Id$')
  42. with open(file_path, "w", encoding="utf-8") as f:
  43. f.write(content)
  44. print("Added URL_Formats.md to generate_docs.py")