Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #8 from gt732/chatbot
Browse files Browse the repository at this point in the history
Chatbot
  • Loading branch information
gt732 authored Apr 2, 2023
2 parents 844387f + 41a89f5 commit 78e579b
Show file tree
Hide file tree
Showing 35 changed files with 3,715 additions and 3,270 deletions.
141 changes: 141 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
bin/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
lib64
include/
include
.include/
alembic/
alembic
/fastapi/fortigate-vector.pkl

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

#db
db/FortiFetch.db

29 changes: 0 additions & 29 deletions Dockerfile

This file was deleted.

34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# FortiGPT
![alt text](https://i.imgur.com/benUs5x.png)

FortiGPT Troubleshooting Assistant is a web app that helps network administrators troubleshoot common networking issues using natural language processing. This app uses the FortiGate API and SSH to gather debug commands and sends them to the ChatGPT API for analysis. The app then provides troubleshooting advice based on the analysis results.
FortiGPT Troubleshooting Assistant is a web app that helps network administrators troubleshoot common networking issues using natural language processing. This app uses the FortiGate API and SSH to gather debug commands and sends them to the ChatGPT API for analysis. The app then provides troubleshooting advice based on the analysis results. Additionally, there is a chatbot available that enables you to use a LLM combined with the documentation.

# Tested on Fortigate 7.2.4 VM
## The app uses ReactJS for frontend and NodeJS/Express for backend

## Getting Started

Expand All @@ -16,40 +15,43 @@ To use FortiGPT Troubleshooting Assistant, simply select a problem category (e.g
- Routing - BGP Down
- VPN - VPN Down
- Network - Interfaces
- ChatMode

## Future Development
- If the community expresses interest in this tool, I will incorporate additional categories and problem types.
If the community expresses interest in this tool, I will incorporate additional categories and problem types.

## Requirements

FortiGPT Troubleshooting Assistant requires no dependencies to be installed. Instead, it can be run as a Docker container.
FortiGPT Troubleshooting Assistant requires no dependencies to be installed. Instead, it can be run as a Docker container using docker compose.

## Installation

To run FortiGPT Troubleshooting Assistant, simply follow the steps below:

## Docker
## Docker Compose


Run the docker command to download the image and simply browse to the container
Copy the docker-compose file from the repo and run docker compose up. Make sure to modify the env with your openai api key.
If you want to build the images locally, clone the repo and use the docker-compose-dev file.
```
docker run \
-p 5005:5005 \
-e OPENAI_API_KEY=your-api-key \
gt732/fortigpt-react
docker compose up
```

## Login Screen

![alt text](https://i.imgur.com/0iEmaGU.png)
## Demo
- VPN Phase1 pre-share key mis-match
ChatMode
![alt text](https://i.imgur.com/TNT8NAY.png)

![alt text](https://i.imgur.com/6HUbVjF.png)

![alt text](https://i.imgur.com/PJHikTK.png)

VPN Phase1 pre-share key mis-match
![alt text](https://i.imgur.com/gew7aza.png)

- Debug Flow
Debug Flow
![alt text](https://i.imgur.com/BErqcs5.png)

- BGP Down
BGP Down
![alt test](https://i.imgur.com/0k5XH4i.png)
## Contributing
Contributions are welcome! To contribute to FortiGPT Troubleshooting Assistant, simply fork the GitHub repository and submit a pull request with your changes.
Expand Down
11 changes: 11 additions & 0 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:18.15-alpine3.16 as builder
WORKDIR /app
COPY ./package.json ./
RUN npm i
COPY . .
RUN npm run build

FROM nginx
EXPOSE 3000
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/build /usr/share/nginx/html
9 changes: 9 additions & 0 deletions client/nginx/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
server{
listen 3000;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
}
Loading

0 comments on commit 78e579b

Please sign in to comment.