Skip to content
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

Databases: add support for zip archiving #97

Merged
merged 7 commits into from
Jun 30, 2021

Conversation

Akarys42
Copy link
Contributor

@Akarys42 Akarys42 commented Jun 9, 2021

Closes #87

This commit adds support for recursively storing a local file as a Zip file.

Copy link
Owner

@lemonsaurus lemonsaurus left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, Akarys!

A few problems:

  • Handler is not well enough documented. Please add some block comments explaining what you're doing.
  • I'm not sure about calling this storage type zip. Sure, we're zipping the backup, but we're storing it locally. So I would argue that semantically, it makes more sense for the storage type to be something like "local storage". The fact that we zip it is an implementation detail.

blackbox/handlers/databases/zip.py Outdated Show resolved Hide resolved
blackbox/handlers/databases/zip.py Outdated Show resolved Hide resolved
@Akarys42 Akarys42 requested a review from lemonsaurus June 9, 2021 11:50
Copy link
Owner

@lemonsaurus lemonsaurus left a comment

Choose a reason for hiding this comment

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

Getting closer.

README.md Outdated
@@ -277,7 +277,7 @@ databases:

## Databases

Right now, this app supports **MongoDB**, **PostgreSQL 13**, **MariaDB**, **Redis** and **Zip archiving**. If
Right now, this app supports **MongoDB**, **PostgreSQL 13**, **MariaDB**, **Redis** and **LocalStorage archiving**. If
Copy link
Owner

Choose a reason for hiding this comment

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

this feels weird, and may be confused with localStorage, the HTML5 feature.

Let's just make it local storage archiving without capital letters.

README.md Outdated
@@ -371,14 +371,21 @@ Identifiers can be any string of your choosing.
port: "6379"
```

### Zip archiving
### Local Storage
Copy link
Owner

Choose a reason for hiding this comment

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

let's do Local storage here.

elif file.is_dir():
directories.append(file)
for file in path.rglob("*"):
if file.is_file():
Copy link
Owner

Choose a reason for hiding this comment

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

this line irks me a bit. why did we name the variable file if we have to check to make sure it is a file? that's why my suggestion had subpath, but I'm open to other more "zoomed out" alternatives. I just don't think we should name something file and then check if it's a file.

@Akarys42 Akarys42 force-pushed the zip-files branch 2 times, most recently from 787587e to 75f293e Compare June 10, 2021 13:52
@Akarys42 Akarys42 changed the title Zip: add support for zip archiving Databases: add support for zip archiving Jun 23, 2021
Copy link
Owner

@lemonsaurus lemonsaurus left a comment

Choose a reason for hiding this comment

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

Looks viable. Let's gooo. :shipit:

@lemonsaurus lemonsaurus merged commit 82a8c45 into lemonsaurus:main Jun 30, 2021
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.

Database: Zip folder archiving
2 participants