Skip to content

Commit

Permalink
Updated Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
retr0reg committed Jan 30, 2024
1 parent 96f0e71 commit c1da7c3
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: AutoGDB Installation
on: [push]

jobs:
install-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Clone and Install AutoGDB
run: |
git clone https://github.com/retr0reg/AutoGDB.git
cd AutoGDB
python3 -m pip install -r requirements.txt
- name: Run chat.py
run: |
python3 chat.py --unit-test
2 changes: 1 addition & 1 deletion autogdb_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
OPENAI_API_BASE = os.getenv("OPENAI_API_BASE", default="https://api.openai.com/v1")
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
if not OPENAI_API_KEY:
raise Exception("Please create an api_key.py file with your personal OPENAI_API_KEY and OPENAI_API_BASE variables or set the environment variables."):
raise Exception("Please create an api_key.py file with your personal OPENAI_API_KEY and OPENAI_API_BASE variables or set the environment variables.")

# Main execution point of the script.
if __name__ == "__main__":
Expand Down
16 changes: 15 additions & 1 deletion src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def parsing():
prog='AutoGDB',
description='Enable GPT in your reversing job with GDB.',
)
parser.add_argument('--unit-test',help='Test if AutoGDB is installed successfully', action='store_true')
parser.add_argument('--serverless',help='Run AutoGDB without bulit-in server',dest='serverless', action='store_true')
parser.add_argument('--clue',help='Possible provided clues or helpful description of this challenge?', dest='clue')
parser.add_argument('--clean-history',help='Clear previous commandline history of AutoGDB.', action='store_true')
Expand Down Expand Up @@ -143,6 +144,16 @@ def await_until_connection(autogdb: AutoGDB):
time.sleep(5)
progress.update(task, advance=0.1)

def unit_test():
ip = 'localhost'
port = 5000
autogdb_server = AutoGDBServer(ip,port,logger=lo)

autogdb_server.start_uvicorn()
time.sleep(5)
autogdb_server.exit()


def setup(args):

USER_OPENAI_API_KEY, USER_OPENAI_API_BASE = check_for_keys()
Expand All @@ -153,13 +164,16 @@ def setup(args):
autogdb = AutoGDB(server=ip, port=port)
autogdb_server = AutoGDBServer(ip,port,logger=lo)


history_manager.load_history()
if args.clean_history:
history_manager.clear_history()
lo.info("History cleaned!\n")
exit()

if args.unit_test:
unit_test()
exit(0)

if args.serverless:
name=''
path=''
Expand Down

0 comments on commit c1da7c3

Please sign in to comment.