christianwgd / django_restic_gui

A GUI web application for restic backup
MIT License
8 stars 2 forks source link

Optionally add extra keys to access a remote repo #11

Closed morlandi closed 2 years ago

morlandi commented 2 years ago

Most remote storages require some environmental variables to be set in order to access them; for example, I happen to keep a Restic repo c/o Backblaze B2, as explained here:

https://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html#backblaze-b2

For now, I just added these extra keys as plain text in a TextField ... I'm not sure if django-encrypted-model-fields can be used for TextField or are limited to CharField.

christianwgd commented 2 years ago

Hey, I would suggest using a django native JSONField instead of plain text field. Concerning encryption django-encrypted-model-fields provides a encrypt_str method, we could use for that. Together with both we could build an own "encrypted_extra_keys" field.

I'm a little bit short in time by now, so let me know, if you need some more info...

morlandi commented 2 years ago

Thank you @christianwgd ... +1 for the JSONField ;) I will update the PR in the next few days; no hurry on my side either ;)