Merge branch 'master' into assistant

This commit is contained in:
Joey Hess 2012-08-03 10:20:27 -04:00
commit 48d9e65dee
25 changed files with 306 additions and 5 deletions

View file

@ -0,0 +1,12 @@
[[!comment format=mdwn
username="http://smcv.pseudorandom.co.uk/"
nickname="smcv"
subject="comment 5"
date="2012-07-31T09:58:13Z"
content="""
It's `org.gtk` because gvfs, GLib and Gtk are all products of gtk.org (there is no separate glib.org).
It's `Private` because the gvfs developers don't consider its D-Bus interface to be stable API, I believe. The official API for it is the C API in GIO, part of GLib.
To poll for changes to /proc/mounts on Linux, you open it for reading and poll() for POLLERR (not sure why it gets to be different, but it is). See gio/gunixmounts.c in recent GLib.
"""]]

View file

@ -0,0 +1,37 @@
Started work on the interface displayed when the webapp is started
with no existing git-annex repository. All this needs to do is walk the user
through setting up a repository, as simply as possible.
A tricky part of this is that most of git-annex runs in the Annex monad,
which requires a git-annex repository. Luckily, much of the webapp
does not run in Annex, and it was pretty easy to work around the parts that
do. Dodged a bullet there.
There will, however, be a tricky transition from this first run webapp,
to a normally fully running git-annex assistant and webapp. I think the
first webapp will have to start up all the normal threads once it makes the
repository, and then redirect the user's web browser to the full webapp.
Anyway, the UI I've made is very simple: A single prompt, for the
directory where the repository should go. With, eventually, tab completion,
sanity checking (putting the repository in "/" is not good, and making it
all of "$HOME" is probably unwise).
[[!img screenshot/firstrun.png]]
Ideally most users will accept the default, which will be something
like `/home/username/Desktop/Annex`, and be through this step in seconds.
Suggestions for a good default directory name appreciated.. Putting it on a
folder that will appear on the desktop seems like a good idea, when there's
a Desktop directory. I'm unsure if I should name it something specific like
"GitAnnex", or something generic like "Synced".
Time for the first of probably many polls!
What should the default directory name used by the git-annex assistant be?
[[!poll open=no 19 "Annex" 7 "GitAnnex" 10 "Synced" 0 "AutoSynced" 1 "Shared" 10 "something lowercase!" 1 "CowboyNeal" 1 "Annexbox"]]
(Note: This is a wiki. You can edit this page to add your own
[[ikiwiki/directive/poll]] options!)

View file

@ -0,0 +1,8 @@
[[!comment format=mdwn
username="http://nico.kaiser.me/"
nickname="Nico Kaiser"
subject="Directory location"
date="2012-08-01T07:51:36Z"
content="""
I don't think the Annex directory (or whatever it will be called  \"Annex\" seems like a good choice in my opinion) should be inside the \"Desktop\" folder by default. All other xdg-user-dirs (Documents, Downloads, etc.) are in $HOME, and i think Desktop should not be cluttered with folders.
"""]]

View file

@ -0,0 +1,12 @@
[[!comment format=mdwn
username="http://joeyh.name/"
ip="4.154.3.236"
subject="comment 2"
date="2012-08-01T14:04:08Z"
content="""
Hmm, my thought on putting it under Desktop is that'll let me install git-annex and tell my mom (really!) that files dragged to there are shared. Don't the other xdg directories get used as default save/open locations for things like word processors, so not need to be on the desktop?
Although that may not be necessary. I've realized I can, at least on linux, easily make a button on the webapp that pops open the directory in the desktop's file manager.
I guess another way of looking at the question is: Where does dropbox put its folder?
"""]]

View file

@ -0,0 +1,14 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawllHWUwOT-UVe5bGkk8G87bpeRAzy-5T7w"
nickname="Rick"
subject="Folder location"
date="2012-08-01T14:18:21Z"
content="""
I'm of two minds about where the Annex folder should be.
For beginners, the desktop is ideal. No doubt about it. And more experienced users can override the default path during the install.
On the other hand, many of the other 'synced folder' services place their folder in the user's home. Both Dropbox and Skydrive do this. It's where I'd put it for consistency, and to keep my desktop free of clutter.
It's a close call, but if push came to shove, I'd probably go with the user home folder.
"""]]

View file

@ -0,0 +1,20 @@
Based on the results of yesterday's poll, the WebApp defaults to
`~/Desktop/annex` when run in the home directory. If there's no `Desktop`
directory, it uses just `~/annex`. And if run from some other place than
the home directory, it assumes you want to use cwd. Of course, you can
change this default, but I think it's a good one for most use cases.
----
My work today has all been on making **one second** of the total lifetime
of the WebApp work. It's the very tricky second in between clicking on
"Make repository" and being redirected to a WebApp running in your new
repository. The trickiness involves threads, and MVars, and
multiple web servers, and I don't want to go into details here.
I'd rather forget. ;-)
Anyway, it works; you can run "git annex webapp" and be walked right
through to having a usable repository! Now I need to see about adding
that to the desktop menus, and making "git annex webapp", when run a second
time, remembering where your repository is. I'll use
`~/.config/git-annex/repository` for storing that.

View file

@ -0,0 +1,8 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawl9sYlePmv1xK-VvjBdN-5doOa_Xw-jH4U"
nickname="Richard"
subject="comment 1"
date="2012-08-01T21:19:03Z"
content="""
Please use `$XDG_CONFIG_HOME` and fall back to `~/.config` if that's not defined.
"""]]

View file

@ -0,0 +1,8 @@
[[!comment format=mdwn
username="http://piotr.ozarowski.pl/"
nickname="POX"
subject="XDG"
date="2012-08-02T10:30:55Z"
content="""
same for XDG_DESKTOP_DIR (for pl_PL ~/.config/user-dirs.dirs file contains XDG_DESKTOP_DIR=\"$HOME/Pulpit\" instead of Desktop)
"""]]

View file

@ -0,0 +1,34 @@
Now installing git-annex automatically generates a freedesktop.org .desktop
file, and installs it, either system-wide (root) or locally (user). So
`Menu -> Internet -> Git Annex` will start up the web app.
(I don't entirely like putting it on the Internet menu, but the
Accessories menu is not any better (and much more crowded here),
and there's really no menu where it entirely fits.)
I generated that file by writing a generic library to deal with
freedesktop.org desktop files and locations. Which seemed like overkill at
the time, but then I found myself continuing to use that library. Funny how
that happens.
So, there's also another .desktop file that's used to autostart the
`git-annex assistant` daemon when the user logs into the desktop.
This even works when git-annex is installed to the ugly non-PATH location
`.cabal/bin/git-annex` by Cabal! To make that work, it records the path
the binary is at to a freedesktop.org data file, at install time.
---
That should all work in Gnome, KDE, XFCE, etc. Not Mac OSX I'm guessing...
---
Also today, I added a sidebar notification when the assistant notices new
files. To make that work well, I implemented merging of related sidebar
action notifications, so the effect is that there's one notification that
collectes a list of recently added files, and transient notifications that
show up if a really big file is taking a while to checksum.
I'm pleased that the notification interface is at a point where I was able
to implement all that, entirely in pure functional code.

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View file

@ -20,6 +20,7 @@ The webapp is a web server that displays a shiny interface.
* progress bars for each file
* drag and drop to reorder
* cancel and pause
* button to open file browser on repo (`xdg-open $DIR`)
* keep it usable w/o javascript, and accessible to blind, etc
## other features
@ -29,14 +30,17 @@ The webapp is a web server that displays a shiny interface.
* Display any relevant warning messages. One is the `inotify max_user_watches`
exceeded message.
## first start
* make git repo **done**
* generate a nice description like "joey@hostname Desktop/annex"
* record repository that was made, and use it next time run
* write a pid file, to prevent more than one first-start process running
at once
## implementation
* possibly lose the ugly auth= token past the first page,
and use a client-side session. It could be encrypted using the token
as the `encryptKey`. Note: Would need to set the session duration
to infinite (how?)
* Fix notification handle leakage on pages other than the main page.
The javascript should use AJAX to request handles, that way
they won't be allocated at all in noscript.
* Hook up notificaton close button to a callback that removes the notification
from the list. Otherwise reloading brings them back.