hbons / SparkleShare

Share and collaborate by syncing with any Git repository instantly. Linux, macOS, and Windows.
https://sparkleshare.org
Other
4.88k stars 576 forks source link

GitLab URI scheme with : instead of / for projects crashes SparkleShare #1861

Open mairin opened 6 years ago

mairin commented 6 years ago

What happened:

I'm connecting to a gitlab hosted on an internal network, git@hostname.redhat.com:project/project.git is the format, but the sparkleshare add repo UI doesn't seem to like how it uses : instead of / and tries to prepend a / to the :

I tried to manually add the repo thinking it was just a UI thing I could get around. I went into ~/.config/org.sparkleshare.SparkleShare and edited project.xml, adding the gitlab repo with the above URI scheme.

I also tried adding a GitHub project, then changing the URL in the .git/config in the repo dir and leaving the github URL in projects.xml - no luck. Once I change the URL to that format in projects.xml, it crashes.

What I expected to happen:

To be able to sync a git repo with the format git@hostname.redhat.com:project/project.git

This happens when:

  1. I try to add the URL in the "sync remote project..." wizard (UI won't allow it)
  2. I turn SS off and add the URL manually in projects.xml and restart SparkleShare

Crash log (OS: Fedora 28)

 duffy  ~  flatpak run org.sparkleshare.SparkleShare 08:21:06 Environment | SparkleShare 3.28.0 (Flatpak) 08:21:06 Environment | Git LFS 2.4.0 08:21:06 Environment | Git 2.17.0 08:21:06 Environment | GNOME (Linux 4.17.3.200) 08:21:06 Cmd | gio set "/home/duffy/SparkleShare" metadata::custom-icon-name org.sparkleshare.SparkleShare 08:21:06 Environment | GTK+ 3.22.30

(process:3): GLib-GIO-CRITICAL **: 08:21:06.552: g_application_get_is_remote: assertion 'application->priv->is_registered' failed 08:21:06 Environment | Status Icon: AppIndicator Gtk-Message: 08:21:06.596: Failed to load module "pk-gtk-module" Gtk-Message: 08:21:06.598: Failed to load module "pk-gtk-module" 08:21:06 | Wrote crash report to /home/duffy/SparkleShare/crash_report.txt [ERROR] FATAL UNHANDLED EXCEPTION: System.UriFormatException: Invalid URI: The URI scheme is not valid. at System.Uri.CreateThis (System.String uri, System.Boolean dontEscape, System.UriKind uriKind) [0x00090] in :0 at System.Uri..ctor (System.String uriString) [0x00017] in :0 at Sparkles.SparkleFolder.get_FullPath () [0x00049] in :0 at SparkleShare.BaseController.RemoveDeletedRepositories () [0x00027] in :0 at SparkleShare.BaseController.CheckRepositories () [0x00019] in :0 at SparkleShare.BaseController.m__F () [0x00007] in :0 at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00017] in :0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x0008d] in :0 at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in :0 at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00031] in :0 at System.Threading.ThreadHelper.ThreadStart () [0x0000b] in :0 Gtk-Message: 08:21:06.782: Failed to load module "pk-gtk-module" Gtk-Message: 08:21:06.787: Failed to load module "pk-gtk-module"

dsakurai commented 5 years ago

Same with the gitlab.com server from SparkleShare on latest Arch Linux.

dsakurai commented 5 years ago

Same with the gitlab.com server from SparkleShare on latest Arch Linux.

I got it working for Gitlab. I forgot to add the Computer ID, aka the SSH key, which is used specifically by SparkleShare. (See for example here on how.)

I then simply leave the "Address" box as is, while putting my /username/project.git in the "Remote Path" box. That is...

Address Remote Path
ssh://git@gitlab.com/ /username/project.git

Hopefully this solves the original problem as reported by @mairin, too.

Bottom line, it was my bad. I'm asking myself how a user could avoid this problem in the future. Though I think the current UI is amazingly user friendly, let me give you some feedback below.

A message like "don't forget to register your Compter ID as a ssh public key" in the beginning of "Sync Remote Project..." wizard may help a person like me solve the problem.

I poorly suspected it's a bug in SparkleShare since the Address box above showed the SSH protocol, which gave me the impression that Gitlab (or Github) is not compatible (because their web interface only shows the https and git protocols).

hbons commented 5 years ago

@dsakurai thanks for your feedback. :)

You're right this should be a lot clearer. Some of this UI refresh work has already started in the feature/wizard branch if you want to try that out.

mandarvaze commented 2 years ago

Last comment ☝️is more than 18 months old. Is there a new UI as mentioned above ?