← Back to team overview

ubuntu-phone team mailing list archive

Re: Syncthing

 

Interesting can of worms Neil... I can only hope that there's some over-arching plan happening with file sync, though I have a suspicion it's more of an afterthought. See what happens in the coming months. In the mean-time, I think we should push ahead with the openapp store. Couple points and questions:

1. Why would you need to rebuild and repackage syncthing from source to
   get it into the openapp store? Isn't it set-up for hacking projects?
   Seems like syncthing would work fine unconfined - isn't this just a
   matter of changing the manifest file when building it?
2. If it's more difficult for whatever reason, I still think it's worth
   it. That 'hole' your speaking of sounds similar to others I keep
   hearing about being closed - hasn't happened yet, deal with it when
   it does. If nothing else, Tweakgeek would make it usable until we
   find something else.
3. I don't think implementing a splash screen would effect lifecycle
   management - in essence syncthing displays one now, it just happens
   to be the icon, a black background, and the loading sign on
   start-up. All a splash screen does is add a small image and some
   background colors. The image could be text, letting people know
   what's happening, etc. Happy to work on this with you.
4. Packaging a separate webapp should be really easy, and I don't think
   it will break the application lifecycle hole you're using. In
   essence, we're just packaging 2 separate apps together in one click
   package, they would run independently of each other. Also happy to
   help with this. I think 2 separate apps in the store doesn't make sense.
5. Background data usage - that's a doozy, and I don't have any
   suggestions about fixing that. At the moment, swiping the syncthing
   screen away kills the program - it could be worth having a
   disclaimer on the splash screen to warn people. I'd imagine battery
   life would also suffer. Another reason to have it in the openapp
   store - if someone's installing apps from there, they're up for
   experimenting. Food for thought.

All up we're talking about a hack to work around a feature that's not implemented yet - file syncing. Here's hoping this hits Ubuntu Touch at some point! Until then, happy to work on a 'hackable solution' with you.

Cheers,

Mitchell



On 16/12/15 22:29, Neil McPhail wrote:
On Tue, December 15, 2015 11:26 pm, Mitchell Reese wrote:
Hi Neil, it's Mitchell Reese here - I'm a Ubuntu Touch user in
Australia. Thanks for publishing and keeping up to date your syncthing
app - its great to see this on Ubuntu Touch! File sync is one area that
needs more work - due to apparmour restrictions, this severely limits
any solutions not baked into the system.

That said, syncthing is close to being a workable solution for people to
use. Unfortunately because of the way symlinks are handled in Ubuntu
Touch, it doesn't work to simply have everything (music, documents,
etc.) under the default syncthing folder, and link them to other parts
of the system. Also it doesn't currently work for the reverse - keeping
files elsewhere and linking them into the default syncthing directory.
Have tried playing around with the syncthing config file, but no luck.
The best solution I found was to symlink the default sync file to
/home/phablet/Sync. Great for transferring files between devices, but
not great for anything else.

So, until a better solution is implemented at the system level to make
file syncing easier, I think the best option would be to publish
syncthing as an unconfined app to the open store. This would then have
the option of installing in the default directory, but syncing anywhere
on the device. Would you be interested in this?

Lastly, here are a couple of really easy ways to make this app easier to
use:

  1. Create a splash screen that tells the user what they need to do,
     etc. This in effect would spring up when running the binary, and
     stay up while it was active.
  2. Create a webapp pointing to the GUI, that would install alongside
     the binary. This could then be opened by  the user anytime they
     needed a gui.

There are other, more elegant options, but the above two easy for me to
implement - I'm happy to do this if you'd like to work together. If
you're able to get an unconfined version of your app happening, I'm
happy to organise a splash screen & webapp for the GUI.

All the best Neil, and thanks again for your work.

Mitchell


Hi Mitchell. Good to hear from you!

File synching is a real problem, isn't it? From my point of view, I want
to get back to the level of functionality I had on Android with Ubuntu One
Sync, where my camera photos would be there on my desktops whenever I
switched them on. There are several hurdles to this:

1) File paths/confinement
- There isn't a way for a non-blessed user like me to get an app in the
normal store with added file read/write paths or an unconfined profile
and, as you've found out, symlinks aren't an answer. I've been battling
for months to get a version of my Baldur's Gate app into the store which
can read from the SD card, and have faced a brick wall from the platform
devs.

The Open Store would be a way forward. It would require a fair bit more
work, though, as, at present, I simply package the upstream pre-rolled
syncthing binary in a click package. I don't take any steps to verify the
source. The pre-rolled binary is statically linked, which makes it ideal
for a click package. If I was to submit to the Open App store, I'd
probably have to build/maintain from source and package the linked libs as
well. I'm happy to do that, if it is worth the effort. However, see
below...

2) App Lifecycle
Currently, Syncthing exploits a flaw in the platform app lifecycle
management, where an app can continue to run in the background if it
doesn't create a GUI. I am promised/threatened on a monthly basis that
this flaw is going to be closed "soon", which would kill background
sync'ing and make the app fairly useless.

I think "unconfined" apps are still subject to the same lifecycle
management. I don't know if there is any way to tweak the manifest.json to
request special permission to run in the background. The only other
workaround I'm aware of it to use something like TweakGeek to prevent the
app from being killed/suspended, but that is _another_ hoop for a user to
jump through.

This is why I haven't implemented any splash screen, to date. I'm not sure
how to do that whilst keeping the app out of the clutches of lifecycle
management.

A webapp frontend would be viable, whether as a separate package, or a
second app within the same click. The latter would be preferable but,
again, I don't know if that would pull the background app into lifecycle
management. One to experiment with, I think.

Do you have any thoughts/experience of this?

3) Background data usage

I don't think there is an easy way for an app to switch off network
activity when switching from WiFi to 3G/LTE. This could be a major issue
if we automatically sync a Pictures directory, for example. In the UK,
many people are on monthly contracts with data allowances of 250--500MB,
which could easily be used up with a few photos/videos. Excess data
charges (and especially roaming charges) can be frightening. Until I can
find a way to control data activity on 3G, I am reluctant to make the app
too user-friendly or automatic.

I think this needs some level of platform support, although it may be
possible to accomplish with an unconfined app using dbus.

---

I'd be keen to hear your thoughts about this. It would be great to have a
functional sync solution. Perhaps you might want to forward this
converation to the mailing list, for wider discussion about the issues?
I'm happy for my response to be public.

If you want to move forward, I can have a look at building syncthing from
source for the Open App store when we get past the festive period.

Cheers and best wishes

NMP



Follow ups