vorta
vorta copied to clipboard
Fix freeze when opening repo on unsupported URL scheme.
It seems like not all file explorers respect the supported scheme property, that's why Vorta shouldn't rely on that. However currently Vorta will freeze when opening an unsupported scheme like smb or sftp. This should be fixed. A small error message should be displayed in the dialog instead.
You can open smb:// and other URLs when adding a repository although borg only supports normal paths (file scheme) and the ssh scheme. This is because vorta is missing to set the supported schemes attribute.
See https://doc.qt.io/qt-5/qfiledialog.html#supportedSchemes-prop
Originally posted by @ThomasWaldmann in https://github.com/borgbase/vorta/issues/1628#issuecomment-1459041597
@real-yfprojects @ThomasWaldmann Would dialog.setSupportedSchemes(["file", "ssh"]) work?
I think so.
Not sure whether the file dialog will be able to let you "select" a ssh: url somehow, but we can try.
What it for sure won't do, is the special ssh: path styles borg uses to indicate current directory and home directory on the server, usually ssh:// urls always give absolute paths only.
Not sure whether the file dialog will be able to let you "select" a ssh: url somehow, but we can try.
I was thinking that there might be a file selector somewhere out there that allows just that, so why not tell it that vorta supports ssh://.
What it for sure won't do, is the special ssh: path styles borg uses to indicate current directory and home directory on the server, usually ssh:// urls always give absolute paths only.
Are normal ssh: paths supported by borg?
ssh://user@host:port/some/abs/path is the usual and supported form.
ssh://user@host:port/./some/rel/path and ssh://user@host:port/~/some/home/path is supported by borg, but likely nowhere else.
So should we just allow the local path to be added using the dialog box and leave the ssh to be filled manually?
@real-yfprojects so I just add dialog.setSupportedSchemes(["file", "ssh"]) and merge it right?
@i1sm3ky i guess this needs trying interactively. try it before any change, check how the dialogue behaves and what it offers (esp. considering non-file: stuff), then change the schemes and try again how it behaves.
this is platform dependent, so try on all platforms you have access to.
@i1sm3ky i guess this needs trying interactively. try it before any change, check how the dialogue behaves and what it offers (esp. considering non-file: stuff), then change the schemes and try again how it behaves.
this is platform dependent, so try on all platforms you have access to.
Ok, I'll test that and work on it accordingly.
I tested it for local repos on MacOS Ventura 13.2.1 and it worked without any errors for both the cases(with and without the schemes). Unfortunately I can't figure out a way to test it for ssh and smb. Is there a way to test it for smb and ssh(without a paid host like borgbase) on the same machine?
Also while installing Borg, I faced some issues as I'm using a m1 chip and wasn't able to install the arm version. I had to install it using Rosetta 2 on x86_64 architecture. I think an update on https://vorta.borgbase.com/install/macos/ instructing on how to install it for m1 would be good.
There is nothing you need to "test" for smb except that:
- before your modification you can select "smb:" stuff somehow
- after your modification it will not let you choose "smb:" stuff any more
For ssh, you could run a sshd on localhost or some other (e.g. linux) machine you have access to.
borgbase has a for-free offer btw.
borg runs fine (and natively, without rosetta) on apple silicon, I have a MBA M1 myself.
for vorta, it is a bit more difficult, but it also can be compiled for apple silicon, see #727 about that.
You should be able to use a VM or a different machine to set up a test smb share and test ssh access.
before your modification you can select "smb:" stuff somehow after your modification it will not let you choose "smb:" stuff any more
Ya I kinda was asking for how can I do that as I didn't have another machine with me at that point of time. But I'll use one of my friends to test.
For ssh, you could run a sshd on localhost or some other (e.g. linux) machine you have access to. borgbase has a for-free offer btw.
Ok I'll look more into that. Thanks ;)
borg runs fine (and natively, without rosetta) on apple silicon, I have a MBA M1 myself.
Ok... Maybe there was something wrong on my end.
You should be able to use a VM or a different machine to set up a test smb share and test ssh access.
I tried that with a VM but was unable to do so, I'll try it once again.
I just tried on my MBA and I was not able to get a "smb:" URL result from the file dialogue (when adding a new repo):
- either I click on the "world" icon, then it just gives me a ssh: prototype url to edit (no file dialogue)
- or i click on the "folder" icon, then I can select misc simple paths from the filesystem (not: URLs) using the file dialogue
- even when trying to select a SMB share via the file dialogue, the SMB server needs to be "connected" first and that will result in the share being mounted below `/Volumes/..." and it will also just result in a normal fs path (not an URL).
- i was not able to select something from the SMB server without "connecting" (mounting) it first.
I could not discover any way to select a ssh: URL via the file dialogue.
So, as far as macOS and smb: / ssh: is concerned, I did not find the problem we are trying to "solve" here.
vorta 0.8.10 borg 1.2.3 macOS Ventura
I did not find the problem we are trying to "solve" here.
The guy in #1628 used Gnome and Fedora 37.
i was not able to select something from the SMB server without "connecting" (mounting) it first.
Yes same, I was able to use a mounted server but was not able to select a smb:// or a URL by itself on mac.
The guy in #1628 used Gnome and Fedora 37.
Yeah I'll try on those to see if I can reproduce the issue and does the fix work.
Sorry, I had my exams so I was unable to work on the issue.
I got one of my friend's pc to test.
While testing, I found some more issues-
- When selecting ssh from the file dialog it also froze vorta
- Manually typing the ssh or smb in the text field, both gave error:
Unable to add your repository
Unfortunately I was not able to check with the fix enabled as I'm having some issues with linux. I'll try to resolve the issue and test the fix tomorrow.
I think it may also be a issue with Flatpak. It uses Sandboxing to increase security, On their site they have mentioned - by default, applications that are run with Flatpak have extremely limited access to the host environment. This includes: no access to the network.
And I also would love to know what would be the chances of getting GSOC under your mentorship. I am really looking forward to work more with you guys. What should be my next step and how should I apply to GSOC for your organisation? @real-yfprojects @m3nu @ThomasWaldmann Any help or recommendations would really be appreciated. :)
Edit: And when should I apply?
And I also would love to know what would be the chances of getting GSOC under your mentorship. I am really looking forward to work more with you guys. What should be my next step and how should I apply to GSOC for your organisation?
Chances are good. You can find information about our application process on our GSoC wiki page. You have already completed steps one to three.
- When selecting ssh from the file dialog it also froze vorta
What file manager / dialog allows you to select ssh urls?
- Manually typing the ssh or smb in the text field, both gave error:
Unable to add your repository
A valid ssh address to a borg repository should work. The behaviour regarding smb is expected.
Chances are good. You can find information about our application process on our GSoC wiki page. You have already completed steps one to three.
Yeah Thanks :) I have read that earlier, I'll again have look into that and apply shortly. One more thing, if I send you the application before uploading to google, could any of you please check it once and tell me the corrections if any is need?
What file manager / dialog allows you to select
sshurls?
The default Fedora one.
A valid ssh address to a borg repository should work.
It didn't in my case.
One more thing, if I send you the application before uploading to google, could any of you please check it once and tell me the corrections if any is need?
Yes, that is the recommended procedure. This is also laid out on the linked page.
Yes, that is the recommended procedure. This is also laid out on the linked page.
Yup, Thanks again ;)
I think regarding the file dialog, We should only allow local files to be selected and ssh and other supported URLs could be added using the text box itself. So only allowing local files to be selected using the file dialog by adding dialog.setSupportedSchemes(["file", ]) should get us the expected functionality we are looking for. I'll just check it once and confirm in about half an hour or so.
Setting dialog.setSupportedSchemes(["file", ]) didn't helped either. I was still able to select ssh and smb URLs from the file dialog.
I tried on Ubuntu as well, it took the ssh URL as sftp URLs and didn't prevent me from selecting a file over a network. And on Ubuntu, I didn't really found a way to select smb file from the file dialog by default, the file dialog didn't had the connect to a network tab on there.
Edit- Another solution would be to check for substrings containing unsupported URL types in the selected URL and pushing a QMessageBox informing the user about the supported URL types.
If the file dialogues are misbehaved and do not respect parameters given:
- a bug should be filed at the respective projects
- we could just not use the file dialogue - typing in a fs path or a ssh:// URL isn't that hard and preferable to a file dialogue crashing/hanging vorta just because the user clicked on something unexpected.
- we could just not use the file dialogue - typing in a fs path or a ssh:// URL isn't that hard and preferable to a file dialogue crashing/hanging vorta just because the user clicked on something unexpected.
This would make for a very bad UX though. Vorta shouldn't crash/freeze instead.
So should I work on a prototype for the unsupported MessageBox?
So should I work on a prototype for the unsupported MessageBox?
I think we don't need a messagebox. We already have a label for showing errors in the add repo dialog.
I think we don't need a messagebox. We already have a label for showing errors in the add repo dialog.
So instead of a messagebox, we should just check the URL and put the warning if needed in the label?
BTW, not sure how repo validation is actually implemented, but maybe some code from borg could be copied for that purpose (maybe later, in a separate PR).