-
Notifications
You must be signed in to change notification settings - Fork 27
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
Support for air-gapped envs for backup sources #125
base: main
Are you sure you want to change the base?
Conversation
I think a bit of context is needed in the description of the PR and a test with an example os usage will be nice as well if possible (maybe it is difficult to mock). Otherwise, an example for documentation |
Co-authored-by: Uilian Ries <[email protected]>
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.
I think I was reading this wrong. This is intended to be done after the user has manually downloaded and verified the file checksum, isn't it?
Otherwise, do we want to provide the possibility to download it too from a URL?
Though maybe if we want this, it would be 2 commands:
- 1 command download + verify checksum (this wouldn't be necessary for Linux/OSX users, though Windows bare users might benefit? Probably not worth
- 1 command for upload
json.dump({"references": {args.reference: [args.url] if args.url else []}, | ||
"timestamp": timestamp_now()}, f) | ||
|
||
conan_api.upload.upload_backup_sources([new_path, json_path]) |
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.
This will silently return if url = config.get("core.sources:upload_url", check_type=str)
is not defined. Most likely we want to check this and error?
This command will upload the backup sources of a package to the server. | ||
""" | ||
parser.add_argument("reference", help="Reference of the package to backup") | ||
parser.add_argument("path", help="Path to source files for this reference") |
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.
Provide the possibility to download it too from a URL?
if not os.path.isfile(args.path): | ||
raise ConanException(f"File not found: {args.path}") | ||
|
||
with open(args.path, "rb") as f: |
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.
I'd say to include the checksum input and verification as well? Not just read the local one, could be tampered?
No description provided.