-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new: added --source argument to agent init (ENG-99) #10
Conversation
…s from github repositories and ZIP archives in general
ENG-99 CLI - Agent templates per strike
Given the unique requirements of strikes, we might want to let the user select from some docker base images to use for their agent (or maybe suggest them from the server) based on tools that might be required. For example, certain dangerous-capabilities zones might benefit from having tools like mongo or psql. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
Currently checking on how easy it might be to get access to private repos with authentication through various means.
I did come across https://github.com/jelmer/dulwich, which might be a more well-supported library than GitPython if we wanted to add it the ability to clone local repos from SSH paths using everyone's default ssh config.
Going to try and avoid adding too much complexity with maybe just some web token auth primitives. I'll keep you posted.
i specifically avoided using gitpython or similar because: do we really want to clone the whole repo, with the whole .git folder, the logs, diffs, commits and whatnot? |
feat: Extend agent source github mechanics
): | ||
print(":key: Accessed private repository") | ||
source_dir = download_and_unzip_archive( | ||
github_repo.api_zip_url, headers={"Authorization": f"Bearer {github_access_token.token}"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monoxgas ooooooooooooooooo, now I get it :D github_repo.api_zip_url
FTW!
@monoxgas love the github_repo.api_zip_url solution! this PR looks ready to merge, wdyt? |
Let's GOOO |
username/repository
(github repository partial string) -> will downloadhttps://github.com/username/repository/archive/refs/heads/main.zip
https://github.com/username/repository
(full github url) -> will downloadhttps://github.com/username/repository/archive/refs/heads/main.zip
https://example.com/custom.zip
-> will download as is if full URL to a zip archive.Unzipping should be safe from path traversal attacks.
install_template
/install_template_from_dir
in order to perform validation (at least a Dockerfile is required for a template) and handle nested folders correctly (there was a bug).install_template
/install_template_from_dir
to handle non text files properly.Closes ENG-99