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

feat: Add local gocryptfs support #1897

Open
wants to merge 26 commits into
base: dev
Choose a base branch
from

Conversation

daviewales
Copy link
Contributor

@daviewales daviewales commented Oct 8, 2024

Blocked by

This is a rebase of Germar Reitze's gocrypt branch on the latest dev branch.

It seems to work, so I thought we should try to merge it as a base for future gocryptfs work.

I've tested backing up a test file, deleting it, then restoring it.

Related to #1734.

@buhtz
Copy link
Member

buhtz commented Oct 8, 2024

Wow that is a big step. Awesome!

Do we need the latest GoCryptFS when running TavisCI? Are there known Issues with gocryptfs from the Ubuntu repos?

@buhtz buhtz added External depends on others/upstream EncFS using the EncFS file system PR: Waiting for review PR won't be merged until review and approval from a member of the maintenance team. labels Oct 8, 2024
@daviewales
Copy link
Contributor Author

I suspect that we don't need the latest version. I tested with the version in the latest Linux Mint, and it seemed to work.

@daviewales
Copy link
Contributor Author

The code fetching the latest version was already in Germar's original branch. I haven't made many changes here, other than fixing merge conflicts.

@buhtz
Copy link
Member

buhtz commented Oct 11, 2024

Please let me know if you prefer me to solve this merge conflicts.

@daviewales
Copy link
Contributor Author

I'll do another rebase, and switch Travis to fetch the packaged version of gocryptfs rather than the latest release while I'm at it.

@daviewales
Copy link
Contributor Author

daviewales commented Oct 15, 2024

I've rebased on the latest dev.
I also added a quick patch to the qt/configure script to include the new qt/manageprofiles directory when installing.

I confirmed that I can still backup a file, delete it, then restore it.

common/gocryptfstools.py Outdated Show resolved Hide resolved
common/gocryptfstools.py Outdated Show resolved Hide resolved
common/gocryptfstools.py Outdated Show resolved Hide resolved
qt/configure Outdated Show resolved Hide resolved
@buhtz
Copy link
Member

buhtz commented Oct 15, 2024

When my refactoring work on the manage profiles dialog is finished I think about a release candidate and release 1.5.3.
After this we can merge your PR, after intense testing of course, and later release it as 1.6.0 somewhere around Christmas or New Year.

@buhtz
Copy link
Member

buhtz commented Oct 15, 2024

FYI: I do plan a 1.5.3 release in the near future. After that release I would target your PR for a 1.6.0 release.

@daviewales
Copy link
Contributor Author

I'll apply the suggestions above when I get a chance. There are also a few lint errors, so I'll fix those up too.

@daviewales
Copy link
Contributor Author

The remaining lint errors are because there is similarity between the encfs and gocryptfs modules... Perhaps this can be ignored?

@buhtz
Copy link
Member

buhtz commented Oct 18, 2024

The remaining lint errors are because there is similarity between the encfs and gocryptfs modules... Perhaps this can be ignored?

Usually I would say "no" and recommend to create a base class to avoid code duplication. But we will remove encfs, so I see no problem to add an ignore clause for pylint.

# pylint: disable=duplicate-code

Not sure if this need to be place in both files.

@daviewales
Copy link
Contributor Author

daviewales commented Oct 18, 2024

Note to self: I need to test setting up a new gocryptfs backup from scratch. I've been tested this branch with one which is already configured.

EDIT: I've tested setting up a new backup profile from scratch, and the dialog needs some tweaking as it's missing a few inputs. I'll update it to match the EncFS local dialog.

@daviewales
Copy link
Contributor Author

daviewales commented Nov 29, 2024

EDIT: I've fixed this in e8a66fa.

When I create a new EncFS local profile, I see these fields:

image

But when I create a new gocryptfs local profile, I see these fields:

image

i.e. the Where to save snapshots field is missing.

Do you know how to make it appear?

@daviewales
Copy link
Contributor Author

Also, I've rebased on the latest dev.

@daviewales
Copy link
Contributor Author

I'm getting the following error when I click 'OK' to finalise creation of a new profile:

DEBUG: [common/config.py:320 Config.checkConfig] Check profile gocryptfs-local
Traceback (most recent call last):
  File "/usr/share/backintime/qt/manageprofiles/__init__.py", line 794, in accept
    if self.validate():
       ^^^^^^^^^^^^^^^
  File "/usr/share/backintime/qt/manageprofiles/__init__.py", line 553, in validate
    if not self.config.setupCron():
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/backintime/common/config.py", line 1468, in setupCron
    self.setupUdev.clean()
  File "/usr/share/backintime/common/tools.py", line 2441, in clean
    self.iface.clean()
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 141, in __call__
    return self._connection.call_blocking(self._named_service,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 634, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 1 matched rules; type="method_call", sender=":1.201" (uid=1000 pid=100353 comm="/usr/bin/python3 -Es /usr/share/backintime/qt/app." label="unconfined") interface="net.launchpad.backintime.serviceHelper.UdevRules" member="clean" error name="(unset)" requested_reply="0" destination=":1.88" (uid=0 pid=16206 comm="/usr/bin/python3 -Es /usr/share/backintime/qt/serv" label="unconfined")

Do you have any thoughts?

@buhtz
Copy link
Member

buhtz commented Nov 30, 2024

Mhm... I am not able to reproduce your dbus related error. But I do see something like this.
image

So I executed the gocryptfs command from the error message directly in the shell:

$ gocryptfs -extpass backintime-askpass -quiet /home/user/Dokumente /home/user/.local/share/backintime/mnt/1CD92332/mountpoint
WARNING: Failed to connect to Udev serviceHelper daemon via D-Bus: org.freedesktop.DBus.Error.Spawn.ChildExited
WARNING: D-Bus message: Launch helper exited with unknown return code 1
WARNING: Udev-based profiles cannot be changed or checked due to Udev serviceHelper connection failure
extpass: password is empty

"password is empty" is the relevant message.

EDIT: Currently I have no idea.

EDIT2: I am assuming for someone who understands DBus your error message would be easy to understand. But for me. ;) What kind of system do you use?

AccessDenied: Rejected send message

?

interface="net.launchpad.backintime.serviceHelper.UdevRules"

Did you tried to setup udev scheduling?

comm="/usr/bin/python3 -Es /usr/share/backintime/qt/serv" label="unconfined")

That is interesting. The file /usr/share/backintime/qt/serv does not exist on my system.

EDIT3: I am assuming we do have two separate problems here. On your system something doesn't work related to DBus. On my system something is wrong with backintime-askpass. Further I am assuming that my problem will occur on your system too if you fix your DBus problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EncFS using the EncFS file system External depends on others/upstream HELP-WANTED Used by 24pullrequests.com to suggest issues High PR: Waiting for review PR won't be merged until review and approval from a member of the maintenance team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants