Skip to content

Support for air-gapped envs for backup sources#125

Draft
AbrilRBS wants to merge 2 commits intomainfrom
rr/backup-sources-upload-air-gap
Draft

Support for air-gapped envs for backup sources#125
AbrilRBS wants to merge 2 commits intomainfrom
rr/backup-sources-upload-air-gap

Conversation

@AbrilRBS
Copy link
Member

No description provided.

@danimtb
Copy link
Member

danimtb commented May 22, 2024

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 <uilianries@gmail.com>
Copy link
Member

@memsharded memsharded left a 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])
Copy link
Member

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")
Copy link
Member

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:
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants