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