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 #2 from gt732/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
gt732 authored Mar 14, 2023
2 parents 79e4d95 + 28c79b4 commit 2fd5e12
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 7 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ WORKDIR /app
# Copy the requirements.txt file to the working directory
COPY requirements.txt .

# Make sure requests is installed
RUN pip install requests

# Install the required Python packages
RUN pip install --no-cache-dir -r requirements.txt

# Copy the entire contents of the app folder to the working directory
COPY app/ .
# Copy the entire app folder to the working directory
COPY app/ /app/

# Copy the startup script to the working directory
COPY startup.sh .
Expand All @@ -21,4 +22,4 @@ COPY startup.sh .
RUN chmod +x startup.sh

# Start the Streamlit app using the startup script
CMD ["/bin/bash", "startup.sh"]
CMD ["/bin/bash", "startup.sh"]
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,30 @@ FortiGPT Troubleshooting Assistant requires no dependencies to be installed. Ins

## Installation

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

Clone the repo
```
docker run -p 8501:8501 -e OPENAI_API_KEY=XXXXXXXXXXXXXXX gt732/fortigpt
git clone https://github.com/gt732/FortiGPT.git
```
Change into the app directory
```
cd FortiGPT/app/
```
Run the docker command. Local volumes allows you to modify the chatgpt prompts and debug commands.
This will be synced to the container.
```
docker run -d \
-p 8501:8501 \
-v $(pwd)/chatgpt_prompts:/app/chatgpt_prompts \
-v $(pwd)/debug_commands:/app/debug_commands \
-e OPENAI_API_KEY=your_api_key \
gt732/fortigpt
```

## Login Screen

![alt text](https://i.imgur.com/p5kirWy.png)
![alt text](https://i.imgur.com/4Je8TrR.png)
## Demo
VPN Phase1 Settings mis-match
![alt text](https://i.imgur.com/CJnhDhJ.png)
Expand Down
18 changes: 18 additions & 0 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ def main():
st.sidebar.write("Please fill in the following information to get started:")
device_type = st.sidebar.selectbox("Device Type", ["FortiGate"])
device_ip = st.sidebar.text_input("Device IP Address")
scheme = st.sidebar.radio(
"HTTP or HTTPS?",
(
"http",
"https",
),
horizontal=True,
)
scheme_port = st.sidebar.text_input(
"HTTP/HTTPS Port",
placeholder="Empty for HTTP Default: 80, HTTPS Default: 443",
)
ssh_port = st.sidebar.text_input("SSH Port", placeholder="Empty for Default: 22")
if not ssh_port:
ssh_port = 22
device_username = st.sidebar.text_input("Device Username")
device_password = st.sidebar.text_input("Device Password", type="password")
# **********************************************************************************************************************
Expand All @@ -34,6 +49,8 @@ def main():
host=device_ip,
username=device_username,
password=device_password,
scheme=scheme,
port=scheme_port,
)
fgt.login()
if fgt.is_connected:
Expand Down Expand Up @@ -151,6 +168,7 @@ def get_phase2_name(vpn_tunnel_name) -> str:
"username": device_username,
"password": device_password,
"fast_cli": False,
"port": ssh_port,
}
try:
with st.spinner("Connecting to device..."):
Expand Down
2 changes: 1 addition & 1 deletion startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
pip install netmiko==3.4.0

# Start the Streamlit app
streamlit run --server.port 8501 app.py
streamlit run --server.port 8501 /app/app.py

0 comments on commit 2fd5e12

Please sign in to comment.