Skip to content

Conversation

@JPaja
Copy link

@JPaja JPaja commented May 3, 2025

Option to ignore file checksum in case physical files gets removed while file cache still exists in database

local_file_sha1sum = hash_file(lf)

if local_file_sha1sum == remote_file_sha1sum:
if not "checksum" in ignore and local_file_sha1sum == remote_file_sha1sum:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think should probably be called sha1sum since we don't technically use the checksum string but otherwise I'm okay with this

@ColdHeat
Copy link
Member

Just to make sure the intention for this is to force a reupload of the file to the server right?

@ColdHeat
Copy link
Member

Okay I assume that this is for a situation where the file reference in the database is correct but the file itself needs to be reuploaded. I think this is okay but I imagine a better solution would be something like --force

@JPaja
Copy link
Author

JPaja commented Dec 16, 2025

Yeah. I think issue i had was that I cleaned my s3 bucket but ctfd assumed that I still had the files uploaded.

@ColdHeat
Copy link
Member

ColdHeat commented Dec 16, 2025

@JPaja looks like I don't have permissions to edit your branch. Here's what I think this change should look like:

                        # Allow users to specify sha1sum in ignore to force reuploads
                        if "sha1sum" not in ignore:
                            if local_file_sha1sum == remote_file_sha1sum:
                                continue

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.

2 participants