Commit graph

1185 commits

Author SHA1 Message Date
Joey Hess
e864c8d033 blind enabling gcrypt repos on rsync.net
This pulls off quite a nice trick: When given a path on rsync.net, it
determines if it is an encrypted git repository that the user has
the key to decrypt, and merges with it. This is works even when
the local repository had no idea that the gcrypt remote exists!

(As previously done with local drives.)

This commit sponsored by Pedro Côrte-Real
2013-09-27 16:21:56 -04:00
Joey Hess
b58bb4c8c1 refactor 2013-09-27 01:19:56 -04:00
Joey Hess
5bd5e604ad remove another sum type that was only needed to work around a bug in old yesod
And the bug is only a warning message at compile time..
2013-09-27 00:35:37 -04:00
Joey Hess
1f5611a1ca remove workaround for old yesod bug 2013-09-27 00:31:12 -04:00
Joey Hess
7665773593 refactor 2013-09-27 00:27:59 -04:00
Joey Hess
1550759220 enabling rsync.net gcrypt repos
Still need to detect when the user is trying to create a repo
that already exists, and jump to the enabling code.
2013-09-26 23:47:30 -04:00
Joey Hess
6b24730179 check if gcrypt is installed 2013-09-26 18:42:54 -04:00
Joey Hess
735ed3b822 prep for enabling remotre gcrypt repos in webapp 2013-09-26 17:26:13 -04:00
Joey Hess
588494cbce webapp: Support storing encrypted git repositories on rsync.net.
Does not yet support re-enabling such a repository though.

This commit was sponsored by Jan Pieper.
2013-09-26 16:43:00 -04:00
Joey Hess
109f2ccc8a refactor 2013-09-26 12:40:19 -04:00
Joey Hess
98fc7e8a19 add, import, assistant: Better preserve the mtime of symlinks, when when adding content that gets deduplicated.
Note that this turned out to remove a syscall, not add any expense.
Otherwise, I would not have done it.
2013-09-25 16:07:11 -04:00
Joey Hess
4dc4a9a385 assistant: Clear the list of failed transfers when doing a full transfer scan. This prevents repeated retries to download files that are not available, or are not referenced by the current git tree.
This is motivated by a user report that the assistant was repeatedly
retrying transfers of files that had been deleted (in direct mode, so
removing the only copy).

Note that the glacier code retries failed transfers after a while to retry
downloads that have aged long enough to be available. This is ok; if we're
doing a full transfer scan we'll retry on every file that is still in the
git tree.

Also note that this makes the assistant less likely to get every file
referenced by old revs of the git tree. Not something the assistant tries
to ensure anyway, so I feel this is acceptable.
2013-09-25 11:46:17 -04:00
Joey Hess
4c954661a1 git-annex-shell: Added support for operating inside gcrypt repositories.
* Note that the layout of gcrypt repositories has changed, and
  if you created one you must manually upgrade it.
  See http://git-annex.branchable.com/upgrades/gcrypt/
2013-09-24 17:25:47 -04:00
Joey Hess
a143ab4451 remove odd utf-8 whitespace
broke the EvilSplicer on C locale
2013-09-23 13:58:03 -04:00
Joey Hess
3bd05c27d2 work around evilsplicer bug
Really simple TH splices are printed in a way it doesn't parse.
2013-09-20 12:19:55 -04:00
Joey Hess
e8e209f4e5 better probing for gcrypt repositories using new --check option
Now can tell if a repo uses gcrypt or not, and whether it's decryptable
with the current gpg keys.

This closes the hole that undecryptable gcrypt repos could have before been
combined into the repo in encrypted mode.
2013-09-19 12:53:24 -04:00
Joey Hess
8062f6337f webapp: support adding existing gcrypt special remotes from removable drives
When adding a removable drive, it's now detected if the drive contains
a gcrypt special remote, and that's all handled nicely. This includes
fetching the git-annex branch from the gcrypt repo in order to find
out how to set up the special remote.

Note that gcrypt repos that are not git-annex special remotes are not
supported. It will attempt to detect such a gcrypt repo and refuse
to use it. (But this is hard to do any may fail; see
https://github.com/blake2-ppc/git-remote-gcrypt/issues/6)

The problem with supporting regular gcrypt repos is that we don't know
what the gcrypt.participants setting is intended to be for the repo.
So even if we can decrypt it, if we push changes to it they might not be
visible to other participants.

Anyway, encrypted sneakernet (or mailnet) is now fully possible with the
git-annex assistant! Assuming that the gpg key distribution is handled
somehow, which the assistant doesn't yet help with.

This commit was sponsored by Navishkar Rao.
2013-09-18 15:55:31 -04:00
Joey Hess
3d88559e58 webapp: Show encryption information when editing a remote. 2013-09-17 20:02:42 -04:00
Joey Hess
9de189e788 webapp gpg key generation
Now the webapp can generate a gpg key that is dedicated for use by
git-annex. Since the key is single use, much of the complexity of
generating gpg keys is avoided.

Note that the key has no password, because gpg-agent is not available
everywhere the assistant is installed. This is not a big security problem
because the key is going to live on the same disk as the git annex
repository, so an attacker with access to it can look directly in the
repository to see the same files that get stored in the encrypted
repository on the removable drive.

There is no provision yet for backing up keys.

This commit sponsored by Robert Beaty.
2013-09-17 15:36:15 -04:00
Joey Hess
1ba7737335 fix modals 2013-09-16 16:46:00 -04:00
Joey Hess
490aa67d10 check if git-remote-gcrypt is installed 2013-09-16 16:35:27 -04:00
Joey Hess
b37aad6c06 webapp: Initial support for setting up encrypted removable drives.
No support yet for generating new gpg keys.
No support yet for adding existing encrypted repos from removable drives.
2013-09-16 16:07:27 -04:00
Joey Hess
f53526501d commit immediately when adding removable drive repo
I noticed that adding a removable drive repo, then trying to add the same
drive again resulted in the question about whether repos should be
combined. This was because the uuid.log was not updated. Which happened
because the new uuid did not get committed on the removable drive.
This fixes that.
2013-09-16 14:56:19 -04:00
Joey Hess
5fe49b98f8 Support hot-swapping of removable drives containing gcrypt repositories.
To support this, a core.gcrypt-id is stored by git-annex inside the git
config of a local gcrypt repository, when setting it up.

That is compared with the remote's cached gcrypt-id. When different, a
drive has been changed. git-annex then looks up the remote config for
the uuid mapped from the core.gcrypt-id, and tweaks the configuration
appropriately. When there is no known config for the uuid, it will refuse to
use the remote.
2013-09-12 15:54:35 -04:00
Joey Hess
b64f5baf2d sync: support gcrypt 2013-09-09 10:02:15 -04:00
Joey Hess
7c1a9cdeb9 partially complete gcrypt remote (local send done; rest not)
This is a git-remote-gcrypt encrypted special remote. Only sending files
in to the remote works, and only for local repositories.

Most of the work so far has involved making initremote work. A particular
problem is that remote setup in this case needs to generate its own uuid,
derivied from the gcrypt-id. That required some larger changes in the code
to support.

For ssh remotes, this will probably just reuse Remote.Rsync's code, so
should be easy enough. And for downloading from a web remote, I will need
to factor out the part of Remote.Git that does that.

One particular thing that will need work is supporting hot-swapping a local
gcrypt remote. I think it needs to store the gcrypt-id in the git config of the
local remote, so that it can check it every time, and compare with the
cached annex-uuid for the remote. If there is a mismatch, it can change
both the cached annex-uuid and the gcrypt-id. That should work, and I laid
some groundwork for it by already reading the remote's config when it's
local. (Also needed for other reasons.)

This commit was sponsored by Daniel Callahan.
2013-09-07 18:38:00 -04:00
Joey Hess
9dc2373977 only retry every 60 seconds
Retying every second is a bit much, especially given the current leak
https://github.com/audreyt/network-multicast/issues/4
2013-08-24 14:37:34 -04:00
Joey Hess
8587485994 clarify notifyNetMessagerRestart 2013-08-24 13:49:04 -04:00
Joey Hess
b191d5c595 gitignore support for the assistant and watcher
Requires git 1.8.4 or newer. When it's installed, a background
git check-ignore process is run, and used to efficiently check ignores
whenever a new file is added.

Thanks to Adam Spiers, for getting the necessary support into git for this.

A complication is what to do about files that are gitignored but have
been checked into git anyway. git commands assume the ignore has been
overridden in this case, and not need any more overriding to commit a
changed version.

However, for the assistant to do the same, it would have to run git ls-files
to check if the ignored file is in git. This is somewhat expensive. Or it
could use the running git-cat-file process to query the file that way,
but that requires transferring the whole file content over a pipe, so it
can be quite expensive too, for files that are not git-annex
symlinks.

Now imagine if the user knows that a file or directory tree will be getting
frequent changes, and doesn't want the assistant to sync it, so gitignores
it. The assistant could overload the system with repeated ls-files checks!

So, I've decided that the assistant will not automatically commit changes
to files that are gitignored. This is a tradeoff. Hopefully it won't be a
problem to adjust .gitignore settings to not ignore files you want the
assistant to autocommit, or to manually git annex add files that are listed
in .gitignore.

(This could be revisited if git-annex gets access to an interface to check
the content of the index w/o forking a git command. This could be libgit2,
or perhaps a separate git cat-file --batch-check process, so it wouldn't
need to ship over the whole file content.)

This commit was sponsored by Francois Marier. Thanks!
2013-08-02 20:37:03 -04:00
Joey Hess
672cfc3923 better git version checking 2013-08-02 18:32:26 -04:00
Joey Hess
eba74e3940 fix build with old yesod 2013-08-02 12:32:16 -04:00
Joey Hess
d1ed337035 webapp: Improve handling of remotes whose setup has stalled.
This includes recovery from the ssh-agent problem that led to many reporting
http://git-annex.branchable.com/bugs/Internal_Server_Error:_Unknown_UUID/
(Including fixing up .ssh/config to set IdentitiesOnly.)

Remotes that have no known uuid are now displayed in the webapp as
"unfinished". There's a link to check their status, and if the remote
has been set annex-ignore, a retry button can be used to unset that and
try again to set up the remote.

As this bug has shown, the process of adding a ssh remote has some failure
modes that are not really ideal. It would certianly be better if, when
setting up a ssh remote it would detect if it's failed to get the UUID,
and handle that in the remote setup process, rather than waiting until
later and handling it this way.

However, that's hard to do, particularly for local pairing, since the
PairListener runs as a background thread. The best it could do is pop up an
alert if there's a problem. This solution is not much different.

Also, this solution handles cases where the user has gotten their repo into
a mess manually and let's the assistant help with cleaning it up.

This commit was sponsored by Chia Shee Liang. Thanks!
2013-07-31 16:36:29 -04:00
Joey Hess
ab62ae357a hide NoUUID remotes from repolist
A ssh remote will breifly have NoUUID when it's just being set up and
git-annex-shell has not yet been queried for the UUID. So it doesn't make
sense to display any kind of error message in this case. The UI doesn't
work when there's NoUUID, and it can even crash the ajax long polling code.
So hiding NoUUID repositories is the right thing to do.

I've tested and the automatic refresh of the repolist causes the remote
to show up as soon as a UUID is recorded, when doing local pairing, and
when adding a ssh remote.
2013-07-31 14:31:05 -04:00
Joey Hess
cbfdf3ab21 set IdentitiesOnly
When setting up a dedicated ssh key to access the annex on a host,
set IdentitiesOnly to prevent the ssh-agent from forcing use of a different
ssh key.

That behavior could result in unncessary password prompts. I remember
getting a message or two from people who got deluged with password
prompts and I couldn't at the time see why.

Also, it would prevent git-annex-shell from being run on the remote host,
when git-annex was installed there by unpacking the standalone tarball,
since the authorized_keys line for the dedicated ssh key, which sets
up calling git-annex-shell when it's not in path, wouldn't be used.

This fixes
http://git-annex.branchable.com/bugs/Internal_Server_Error:_Unknown_UUID
but I've not closed that bug yet since I should still:

1. Investigate why the ssh remote got set up despite being so broken.
2. Make the webapp not handle the NoUUID state in such an ugly way.
3. Possibly add code to fix up systems that encountered the problem.
   Although since it requires changes to .ssh/config this may be one for
   the release notes.

Thanks to TJ for pointing me in the right direction to understand what
was happening here.
2013-07-31 13:30:49 -04:00
Joey Hess
869c638b82 assistant: Fix bug that caused it to stall when adding a very large number of files at once (around 5 thousand).
This bug was introduced in 82a6db8fe8,
which improved handling of adding very large numbers of files by ensuring
that a minimum number of max size commits (5000 files each) were done.

I accidentially made it wait for another change to appear after such a max
size commit, even if a lot of queued changes were already accumulated.
That resulted in a stall when it got to the end. Now fixed to not wait
any longer than necessary to ensure the watcher has had time to wake back
up after the max size commit.

This commit was sponsored by Michael Linksvayer. Thanks!
2013-07-27 17:42:18 -04:00
Joey Hess
2d7b4517ab got hdevtools working again
Fix comment to not make cpp unhappy
2013-07-27 13:00:49 -04:00
Joey Hess
ec4d974dcf assistant: Fix deadlock that could occur when adding a lot of files at once in indirect mode.
This is a laziness problem. Despite the bang pattern on newfiles, the list
was not being fully evaluated before cleanup was called. Moving cleanup out
to after the list is actually used fixes this.

More evidence that I should be using ResourceT or pipes, if any was needed.
2013-07-26 18:42:22 -04:00
Joey Hess
97f3aecb17 assistant: Fix NetWatcher to not sync with remotes that have remote.<name>.annex-sync set to false.
This affected both the hourly NetWatcherFallback thread and the syncing
when network connection is detected.

It was a reversion of sorts, introduced in
8861e270be, when annex-ignore was changed to
not control git syncing. I forgot to make it check annex-sync at that
point.
2013-07-26 16:54:20 -04:00
Joey Hess
6967f539d0 add status tag to all presence messages
Necessary for push messages to not override the previously sent tag.
2013-07-25 14:58:30 -04:00
Joey Hess
54e0bd55b4 fun with exec 2013-07-23 17:31:51 -04:00
Joey Hess
0962c43bf7 fix build 2013-07-23 13:40:27 -04:00
Joey Hess
5c82c99c76 webapp: When creating a repository on a removable drive, set core.fsyncobjectfiles, to help prevent data loss when the drive is yanked. 2013-07-23 13:38:05 -04:00
Joey Hess
381637e4c8 Add status message to XMPP presence tag, to identify to others that the client is a git-annex client.
I only added this to the presense messages that are really intended for
presence. The ones used for tunneling git etc don't have the tag, because
that would waste bandwidth.
2013-07-23 12:41:41 -04:00
Joey Hess
780efc775c When an XMPP server has SRV records, try them, but don't then fall back to the regular host if they all fail.
gmail.com has some XMPP SRV records, but does not itself respond to XMPP
traffic, although it does accept connections on port 5222. So if a user
entered the wrong password, it would try all the SRVs and fall back to
trying gmail, and hang at that point.

This seems the right thing to do, not just a workaround.
2013-07-20 21:18:55 -04:00
Joey Hess
9fc1448947 webapp: Differentiate between creating a new S3/Glacier/WebDav remote, and initializing an existing remote. When creating a new remote, avoid conflicts with other existing (or deleted) remotes with the same name. 2013-07-20 18:15:16 -04:00
Joey Hess
dba1e29949 webapp: Better display of added files. 2013-07-10 15:37:40 -04:00
Joey Hess
00e6663128 linux standalone auto-install icons 2013-07-09 20:50:41 -04:00
Joey Hess
19b8bcbe30 Install XDG desktop icon files.
The icon files will be installed when running make install or cabal
install. Did not try to run update-icon-caches, since I think it's debian
specific, and dh_icons will take care of that for the Debian package.

Using the favicon as a 16x16 icon. At 24x24 the svg displays pretty well,
although the dotted lines are rather faint. The svg is ok at all higher
resolutions.

The standalone linux build auto-installs the desktop and autostart files
when run. I have not made it auto-install the icon file too, because
a) that would take more work to include them in the tarball and find them
b) it would need to be an install to ~/.icons/, and I don't know if that
   really works!
2013-07-09 19:56:30 -04:00
Joey Hess
b6d857da08 fix build 2013-07-08 12:53:08 -04:00
Joey Hess
57f5c9f41a webapp: Fix authorized_keys line added when setting up a rsync remote on a server that also supports git-annex, to not force running git-annex-shell. 2013-07-08 12:51:07 -04:00
Joey Hess
96ded21ae5 fix display of expected sequence number 2013-07-08 12:31:32 -04:00
Joey Hess
d84a000e92 detect system with no dot in FQDN, where git commit will fail, and workaround
Sigh, git is so *fragile*. Or rather, across the set of systems that use
git-annex, where are no many horribly broken systems..
2013-07-05 12:24:28 -04:00
Joey Hess
7a7e426352 moved AssociatedFile definition 2013-07-04 02:36:02 -04:00
Joey Hess
1b395dcb76 webapp: Fix ssh setup with nonstandard port, broken in last release. 2013-07-02 15:46:02 -04:00
Joey Hess
ff4f008591 clean up build warnings with yesod 1.2, while still building with 1.1 2013-06-27 01:15:28 -04:00
Joey Hess
f1fe8edbbb webapp: Fix bug setting up ssh repo if the user enters "~/" at the start of the path. 2013-06-25 15:43:46 -04:00
Joey Hess
c8e6947693 webapp: Ensure that ssh keys generated for different directories on a server are always different. 2013-06-25 15:31:04 -04:00
Joey Hess
10072157cb webapp: Fix bug when setting up a remote ssh repo repeatedly on the same server.
The ssh setup first runs ssh to the real hostname, to probe if a ssh key is
needed. If one is, it generates a mangled hostname that uses a key. This
mangled hostname was being used to ssh into the server to set up the key.
But if the server already had the key set up, and it was locked down, the
setup would fail. This changes it to use the real hostname when sshing in
to set up the key, which avoids the problem.

Note that it will redundantly set up the key on the ssh server. But it's
the same key; the ssh key generation code uses the key if it already
exists.
2013-06-25 14:46:20 -04:00
Joey Hess
ce9be5ec14 fix crash in drop scan when there are no associated files
maximum is partial, so need to ensure the list is not empty.

This lack of associated files would most likely be a problem -- and fsck
fixes it. It could also occur legitimately due to a race.
2013-06-24 12:44:51 -04:00
Joey Hess
5e48aa4d4b assistant: Daily sanity check thread is run niced. 2013-06-21 13:29:42 -04:00
Joey Hess
9b61d6a82b fix warning building w/o xmpp 2013-06-20 22:25:45 -04:00
Joey Hess
6e309b63f8 assistant: On Linux, the expensive transfer scan is run niced.
This is a compromise. I would like to nice every thread except for the
webapp thread, but it's not practical to do so. That would need every
thread to run as a bound thread, which could add significant overhead.
And any forkIO would escape the nice level.
2013-06-20 22:25:41 -04:00
Joey Hess
e8827c29c6 Make field readonly, not disabled
Working on Windows horriblness all day sure did nice things to my mood,
didn't it?
2013-06-18 17:08:37 -04:00
Joey Hess
f651b87bbd revert broken change that prevented saving changes to local repo
People who get annoyed at not being able to edit "here" can send me a
patch, I don't have time for this nonsense.
2013-06-18 17:02:58 -04:00
Joey Hess
fa1c1e0f65 annex.debug can now be set to enable debug logging by default. The webapp's debugging check box does this. 2013-06-17 20:41:27 -04:00
Joey Hess
0527c74c0f assistant: In direct mode, objects are now only dropped when all associated files are unwanted. This avoids a repreated drop/get loop of a file that has a copy in an archive directory, and a copy not in an archive directory. (Indirect mode still has some buggy behavior in this area, since it does not keep track of associated files.) Closes: #712060 2013-06-15 14:44:43 -04:00
Joey Hess
c9f3082b99 disable text field for repository name for current repository 2013-06-13 13:38:46 -04:00
Joey Hess
81d6f96cd9 sanity check 2013-06-11 23:12:01 -04:00
Joey Hess
c7b493fecb log local pairing messages received when debugging is enabled 2013-06-11 00:25:44 -04:00
Joey Hess
680d3b5120 webapp: When the user switches to display a different repository, that repository becomes the default repository to be displayed next time the webapp gets started. 2013-06-11 00:06:06 -04:00
Joey Hess
768f7c87f2 display any illegal character found in ssh comment 2013-06-10 23:55:54 -04:00
Joey Hess
c46b263fde Android: Make the "Open webapp" menu item open the just created repository when a new repo is made. 2013-06-10 23:55:53 -04:00
Joey Hess
0b11c71740 Android: Add .thumbnails to .gitignore when setting up a camera repository. 2013-06-10 17:10:12 -04:00
Joey Hess
b42fe2283a remove unnecessary haskell extensions 2013-06-04 21:13:20 -04:00
Joey Hess
1198b5444d now builds with both yesod 1.2 and 1.1 2013-06-03 18:14:22 -04:00
Joey Hess
31753bad46 add liftH shim between yesod versions, to avoid needing zillions of ifdefs 2013-06-03 13:51:54 -04:00
Joey Hess
79fd677805 WIP yesod 1.2 2013-06-03 11:25:23 -04:00
Joey Hess
853ec68253 avoid debug logging unknown xmpp messages, which may contain sensative information 2013-05-27 15:00:07 -04:00
Joey Hess
d8d46c3ba3 when xmpp connection fails, show the host(s) it tried to connect to 2013-05-27 14:36:20 -04:00
Joey Hess
5a678244e2 avoid duplicate srv lookup when testing xmpp 2013-05-27 13:48:24 -04:00
Joey Hess
c15a0b796e 3 more fd leaks 2013-05-26 21:27:44 -04:00
Joey Hess
c092b4fc16 XMPP: Fix a file descriptor leak. 2013-05-26 20:49:16 -04:00
Joey Hess
bd8f358e6d typo 2013-05-26 17:12:03 -04:00
Joey Hess
f857c44b45 avoid redundant CanPush messages with different shas being queued up 2013-05-26 17:09:23 -04:00
Joey Hess
ed4febb170 remove debug print 2013-05-25 00:02:39 -04:00
Joey Hess
99324eac9a XMPP: Send pings and use them to detect when contact with the server is lost.
I noticed that when my modem hung up and redialed, my xmpp client was left
sending messages into the void. This will also handle any idle
disconnection issues.
2013-05-22 17:03:46 -04:00
Joey Hess
4effef3176 fix minor memory leak caused by recent CanPush change
Putting the UUID in meant that equivilant CanPush messages no longer are ==
2013-05-22 15:47:06 -04:00
Joey Hess
e2b67e0bc4 add two long-running XMPP push threads, no more inversion of control
I hope this will be easier to reason about, and less buggy. It was
certianly easier to write!

An immediate benefit is that with a traversable queue of push requests to
select from, the threads can be a lot fairer about choosing which client to
service next.
2013-05-22 15:13:31 -04:00
Joey Hess
cc68b340ff avoid building up a lot of threads all waiting for their chance to run a push
Only 2 threads are needed, one running, and one waiting to push something
new. Any more is redundant and wasteful.
2013-05-22 00:27:12 -04:00
Joey Hess
6e04194e84 perhaps this fixes the stall tbd 2013-05-21 21:40:37 -04:00
Joey Hess
a600471a23 include HEAD in CanPush shas 2013-05-21 20:04:38 -04:00
Joey Hess
08c03b2af3 XMPP: Avoid redundant and unncessary pushes. Note that this breaks compatibility with previous versions of git-annex, which will refuse to accept any XMPP pushes from this version. 2013-05-21 18:24:29 -04:00
Joey Hess
9efde46cdd per-client inboxes for push messages
This will avoid losing any messages received from 1 client when a push
involving another client is running.

Additionally, the handling of push initiation is improved,
it's no longer allowed to run multiples of the same type of push to
the same client.

Still stalls sometimes :(
2013-05-21 11:08:08 -04:00
Joey Hess
14d96b8e06 XMPP: Be better at responding to CanPush messages when busy with something else.
Observed: With 2 xmpp clients, one would sometimes stop responding
to CanPush messages. Often it was in the middle of a receive-pack
of its own (or was waiting for a failed one to time out).

Now these are always immediately responded to, which is fine; the point
of CanPush is to find out if there's another client out there that's
interested in our push.

Also, in queueNetPushMessage, queue push initiation messages when
we're already running the side of the push they would initiate.
Before, these messages were sent into the netMessagesPush channel,
which was wrong. The xmpp send-pack and receive-pack code discarded
such messages.

This still doesn't make XMPP push 100% robust. In testing, I am seeing
it sometimes try to run two send-packs, or two receive-packs at once
to the same client (probably because the client sent two requests).

Also, I'm seeing rather a lot of cases where it stalls out until it
runs into the 120 second timeout and cancels a push.

And finally, there seems to be a bug in runPush. I have logs that
show it running its setup action, but never its cleanup action.
How is this possible given its use of E.bracket? Either some exception
is finding its way through, or the action somehow stalls forever.
When this happens, one of the 2 clients stops syncing.
2013-05-21 00:59:38 -04:00
Joey Hess
230aed671f XMPP: Ignore duplicate messages received when pushing. 2013-05-20 21:58:59 -04:00
Joey Hess
345ee4f37c Switch to MonadCatchIO-transformers for better handling of state while catching exceptions.
As seen in this bug report, the lifted exception handling using the StateT
monad throws away state changes when an action throws an exception.
http://git-annex.branchable.com/bugs/git_annex_fork_bombs_on_gpg_file/
  .. Which can result in cached values being redundantly calculated, or other
     possibly worse bugs when the annex state gets out of sync with reality.

This switches from a StateT AnnexState to a ReaderT (MVar AnnexState).
All changes to the state go via the MVar. So when an Annex action is
running inside an exception handler, and it makes some changes, they
immediately go into affect in the MVar. If it then throws an exception
(or even crashes its thread!), the state changes are still in effect.

The MonadCatchIO-transformers change is actually only incidental.
I could have kept on using lifted-base for the exception handling.
However, I'd have needed to write a new instance of MonadBaseControl
for the new monad.. and I didn't write the old instance.. I begged Bas
and he kindly sent it to me. Happily, MonadCatchIO-transformers is
able to derive a MonadCatchIO instance for my monad.

This is a deep level change. It passes the test suite! What could it break?

Well.. The most likely breakage would be to code that runs an Annex action
in an exception handler, and *wants* state changes to be thrown away.
Perhaps the state changes leaves the state inconsistent, or wrong. Since
there are relatively few places in git-annex that catch exceptions in the
Annex monad, and the AnnexState is generally just used to cache calculated
data, this is unlikely to be a problem.

Oh yeah, this change also makes Assistant.Types.ThreadedMonad a bit
redundant. It's now entirely possible to run concurrent Annex actions in
different threads, all sharing access to the same state! The ThreadedMonad
just adds some extra work on top of that, with its own MVar, and avoids
such actions possibly stepping on one-another's toes. I have not gotten
rid of it, but might try that later. Being able to run concurrent Annex
actions would simplify parts of the Assistant code.
2013-05-19 14:16:36 -04:00
Joey Hess
b8e5b9c645 test suite passes in direct mode
This fixes a bug with git annex add in direct mode. If some files already
existed in the tree pointing at the same key as a file that was just added,
and their content was not present, add neglected to copy the content to
those files.

I also changed the behavior of moveAnnex slightly: When content is moved
into the annex in direct mode, it does not overwrite any content already
present in direct mode files. That content may be modified after all.
2013-05-17 15:59:37 -04:00
Joey Hess
25a8d4b11c rename module 2013-05-12 19:19:28 -04:00
Joey Hess
92910f5107 fix build 2013-05-12 19:13:38 -04:00
Joey Hess
1e2ddcb68a use setCurrentDirectory
On POSIX, this just calls changeWorkingDirectory.
2013-05-11 19:14:30 -04:00
Joey Hess
18bdff3fae clean up from windows porting 2013-05-11 18:23:41 -04:00
Joey Hess
7c2a90b0e8 fix for Android 2013-05-09 15:23:40 -04:00
Joey Hess
d63a0a77f2 fix build w/o DAV 2013-05-08 12:20:10 -04:00
Joey Hess
69bd8d0462 fix android build 2013-05-06 16:45:49 -04:00
Joey Hess
749c197947 fix use of wrong shebang when android is installing git-annex-shell wrapper on server 2013-05-06 15:58:13 -04:00
Joey Hess
ad6fee422a fix warning 2013-05-04 16:36:51 -04:00
Joey Hess
001d82f953 fix warning 2013-05-04 16:35:54 -04:00
Joey Hess
d35132810a Got removable media mount detection working on Android.
Bionic has an amusing stub for `getmntent` that prints out
"FIX ME! implement getmntent()"

But, `/proc/mounts` is there, so I just parse it.
2013-05-04 16:19:25 -04:00
Joey Hess
d994f35937 disable hostname validation and canonicalization on android 2013-05-04 14:26:49 -04:00
Joey Hess
33334bfe2e added special camera repository to start screen for android 2013-05-03 15:21:31 -04:00
Joey Hess
ce47f4cb20 --listen is not supported on Android 2013-05-02 16:47:42 -04:00
Joey Hess
e92f04f9cc build fix for -XMPP 2013-05-02 13:04:49 -04:00
Joey Hess
d9e288b0fd fix build with S3 disabled (for Android) 2013-05-01 13:27:51 -04:00
Joey Hess
50a8ea4cdc avoid auto-accepting pair requests from friends already paired with
Unless the request is for repo uuid we already know. This way, if A1 pairs
with friend B1, and B1 pairs with device B2, then B1 can request A1 pair
with it and no confirmation is needed. (In future, may want to try to do
that automatically, to make a more robust network.)
2013-04-30 17:38:58 -04:00
Joey Hess
e363cefcb3 assistant: Fix bug that could cause incoming pushes to not get merged into the local tree.
Observed that the pushed refs were received, but not merged into master.
The merger never saw an add event for these refs. Either git is not writing
to a new file and renaming it into place, or the inotify code didn't notice
that. Changed it to also watch for modify events and that seems to have
fixed it!
2013-04-30 16:37:13 -04:00
Joey Hess
e06a4e12b5 more xmpp debugging 2013-04-30 15:56:33 -04:00
Joey Hess
017f62654f stop using UltDest, doesn't seem to reliably work 2013-04-30 15:21:49 -04:00
Joey Hess
df88c51334 add uuid to all xmpp messages
(Except for the actual streaming of receive-pack through XMPP, which
can only run once we've gotten an appropriate uuid in a push initiation
message.)

Pushes are now only initiated when the initiation message comes from a
known uuid. This allows multiple distinct repositories to use the same xmpp
address.

Note: This probably breaks initial push after xmpp pairing, because at that
point we may not know about the paired uuid, and so reject the push from
it. It won't break in simple cases, because the annex-uuid of the remote
is checked. However, when there are multiple clients behind a single xmpp
address, only uuid of the first is recorded in annex-uuid, and so any
pushes from the others will be rejected (unless the first remote pushes their
uuids to us beforehand.
2013-04-30 13:22:55 -04:00
Joey Hess
c3498042fd webapp: Now automatically fills in any creds used by an existing remote when creating a new remote of the same type. Done for Internet Archive, S3, Glacier, and Box.com remotes. 2013-04-27 15:16:06 -04:00
Joey Hess
85d83e7756 To enable an existing special remote, the new enableremote command must be used. The initremote command now is used only to create new special remotes. 2013-04-26 18:22:52 -04:00
Joey Hess
8a7e059f54 fix build w/o s3 2013-04-26 16:12:23 -04:00
Joey Hess
440d6e331f tweak
This works around a bug in the EvilSplicer
2013-04-26 15:20:31 -04:00
Joey Hess
b4f4ed7d93 fix build with newer yesod 2013-04-26 15:06:18 -04:00
Joey Hess
8603109294 allow configuring the preferreddir 2013-04-26 13:01:06 -04:00
Joey Hess
867cba52a0 better default collections 2013-04-26 01:46:07 -04:00
Joey Hess
0ae8c82c53 per-IA-item content directories 2013-04-25 23:44:55 -04:00
Joey Hess
e3ea36174b webapp: Display some additional information about a repository on its edit page. 2013-04-25 16:42:17 -04:00
Joey Hess
8284b310a7 support enabling IA repositories 2013-04-25 13:14:49 -04:00
Joey Hess
2810807ca5 Internet Archive!
* Add public repository group.
* webapp: Can now set up Internet Archive repositories.

TODO: Enabling IA repositories.
2013-04-25 12:23:36 -04:00
Joey Hess
362ed9f0e3 use DList for the transfer queue
Some nice efficiency gains here for list appending, although mostly
the small size of the transfer queue makes them irrelivant.
2013-04-25 01:33:44 -04:00
Joey Hess
c6da464051 use a DList for the deferred downloads queue 2013-04-25 01:26:23 -04:00
Joey Hess
82a6db8fe8 committer tweak to wait for Watcher to resume after a max-size commit
Without this, a very large batch add has commits of sizes approx
5000, 2500, 1250, etc down to 10, and then starts over at 5000.
This fixes it so it's 5000+ every time.
2013-04-25 00:48:09 -04:00
Joey Hess
a9081ae473 optimise direct mode startup scan
A recent change made existing symlinks be re-staged. That does not need to
be done during the startup scan though.
2013-04-24 21:20:29 -04:00
Joey Hess
46529c0129 assistant: Sanitize XMPP presence information logged for debugging. 2013-04-24 21:13:10 -04:00
Joey Hess
ebee93a837 get rid of need to run pre-commit hook when assistant commits in direct mode
That hook updates associated file bookkeeping info for direct mode.
But, everything already called addAssociatedFile when adding/changing a
file. It only needed to also call removeAssociatedFile when deleting a file,
or a directory.

This should make bulk adds faster, by some possibly significant amount.
Bulk removals may be a little slower, since it has to use catKeyFile now
on each removed file, but will still be faster than adds.
2013-04-24 18:04:59 -04:00
Joey Hess
cb575cbe91 fix bda237f14a
Converted back to the wrong type, oops.
2013-04-24 17:50:11 -04:00
Joey Hess
b8e45ec9d7 refactoring and minor performance tweak 2013-04-24 17:46:46 -04:00
Joey Hess
7fa2d255da remove last use of TSet 2013-04-24 17:16:04 -04:00
Joey Hess
cd7055631f batch commit every 5 thousand changes, not 10 thousand
There's a tradeoff between making less frequent commits, and
needing to use memory to store all the changes that are coming
in. At 10 thousand, it needs 150 mb of memory. 5 thousand drops
that down to 90 mb or so.

This also turns out to have significant imact on total run time.
I benchmarked 10k changes taking 27 minutes. But two 5k batches
took only 21 minutes.
2013-04-24 16:40:35 -04:00
Joey Hess
bda237f14a convert PendingAddChange back to Change when an add fails
If an add failed, we should lose the KeySource, since it, presumably,
differs due to a change that was made to the file.

(The locked down file is already deleted.)
2013-04-24 16:29:25 -04:00
Joey Hess
76431520e4 use TList for ChangePool 2013-04-24 16:13:22 -04:00
Joey Hess
a929e6641a show one alert when bulk adding files
Turns out that a lot of the time spent in a bulk add was just updating the
add alert to rotate through each file that was added. Showing one alert
makes for a significant speedup.

Also, when the webapp is open, this makes it take quite a lot less cpu
during bulk adds.

Also, it lets the user know when a bulk add happened, which is sorta
nice..
2013-04-24 13:04:46 -04:00
Joey Hess
01bedb54c6 improve display of multiline messages in alerts
This better handles error messages formatted for console display, by
adding a <br> after each line.

Hmm, I wonder if it'd be worth pulling in a markdown formatter, and running
the messages through it?
2013-04-24 11:45:41 -04:00
Joey Hess
e72f0b2898 only show latest warning, rather than combining warning alerts
In the case of the inotify limit warning, particularly, if it happens once
it will be happening repeatedly, and so combining alerts resulted in a
much too large alert message that took up a lot of memory and was too
large for the webapp to display.
2013-04-24 11:27:30 -04:00
Joey Hess
ca72b1ac7b assistant: when an add fails, requeue it for later
See analysis in bug report for one way this could happen.
2013-04-23 18:23:04 -04:00
Joey Hess
daecfd5bd7 more efficient data type for ChangeChan
Making this a tset of lists of Changes, rather than a tset of Changes
makes refilling it, in batch mode, much more efficient. Rather than needing
to add every Change it's collected one at a time, it can add them in one
fast batch operation.

It would be more efficient yet to use a Set, but that would need an Eq
instance for InodeCache.
2013-04-23 14:54:54 -04:00
Joey Hess
2c42e70f6c rename module 2013-04-23 11:38:52 -04:00
Joey Hess
8a2d1988d3 expose Control.Monad.join
I think I've been looking for that function for some time.
Ie, I remember wanting to collapse Just Nothing to Nothing.
2013-04-22 20:24:53 -04:00
Joey Hess
450baa02e9 assistant: When built with git before 1.8.0, use git remote rm to delete a remote. Newer git uses git remote remove. 2013-04-22 16:53:09 -04:00
Joey Hess
e92a207df5 webapp: When told to add a git repository on a remote server, and the repository already exists as a non-bare repository, use it, rather than initializing a bare repository in the same directory. 2013-04-22 16:21:37 -04:00
Joey Hess
9cb223a8b3 Detect systems that have no user name set in GECOS, and also don't have user.name set in git config, and put in a workaround so that commits to the git-annex branch (and the assistant) will still succeed despite git not liking the system configuration. 2013-04-22 15:36:34 -04:00
Joey Hess
8861e270be sync, assistant: Sync with remotes that have annex-ignore set
This is so git remotes on servers without git-annex installed can be used
to keep clients' git repos in sync.

This is a behavior change, but since annex-sync can be set to disable
syncing with a remote, I think it's acceptable.
2013-04-22 14:57:09 -04:00
Joey Hess
1579c98d4d fix osx build 2013-04-22 11:24:48 -04:00
Joey Hess
8df5be7804 fix build with xmpp enabled but not local pairing 2013-04-21 13:24:56 -04:00
Joey Hess
580f22f45d forgot to commit this new file 2013-04-20 19:27:36 -04:00
Joey Hess
844e772910 fix warnings 2013-04-20 19:25:50 -04:00
Joey Hess
70e251547e fix menu file installation directory 2013-04-20 19:02:14 -04:00
Joey Hess
4ddf9b7467 webapp: Don't default to making repository in cwd when started from within a directory containing a git-annex file (eg, standalone tarball directory). 2013-04-20 18:53:04 -04:00
Joey Hess
780ed8ebf1 fix warning 2013-04-20 18:52:46 -04:00
Joey Hess
d2e92e2494 Install FDO desktop menu file when webapp is started in standalone mode. 2013-04-20 18:48:05 -04:00
Joey Hess
090a69f00c assistant: Work around misfeature in git 1.8.2 that makes git commit --alow-empty -m "" run an editor.
See http://git-annex.branchable.com/bugs/assistant_hangs_during_commit/
2013-04-18 16:27:17 -04:00
Joey Hess
824c95376a refactor static route definition -- android webapp build fix
Incidentially should work around the last problem that prevented the webapp
building on Android. (Except for a few places I need to clean up after
hand-fixing the spliced TH code.)
2013-04-17 01:37:08 -04:00
Joey Hess
eeaf471f2f minor tweak to fix a build issue when TH is splices 2013-04-16 22:46:20 -04:00
Joey Hess
c1b682cb8f another no-xmpp fix 2013-04-16 19:30:09 -04:00
Joey Hess
d0336a9475 build fix for no xmpp 2013-04-16 19:19:30 -04:00
Joey Hess
7956177445 webapp: Include the repository directory in the mangled hostname and ssh key name, so that a locked down ssh key for one repository is not re-used when setting up additional repositories on the same server. 2013-04-16 13:49:39 -04:00
Joey Hess
21f93de33c use git-annex for ssh directory name 2013-04-14 20:00:32 -04:00
Joey Hess
aca9e4f0b4 random ssh keys (╯°□°)╯︵ ┻━┻ gnome-keyring
assistant: Work around horrible, terrible, very bad behavior of
gnome-keyring, by not storing special-purpose ssh keys in ~/.ssh/*.pub.

Apparently gnome-keyring apparently will load and indiscriminately use such
keys in some cases, even if they are not using any of the standard ssh key
names. Instead store the keys in ~/.ssh/annex/, which gnome-keyring will
not check.

Note that neither I nor #debian-devel were able to quite reproduce this
problem, but I believe it exists, and that this fixes it. And it certianly
won't hurt anything..
2013-04-14 15:34:59 -04:00
Joey Hess
11d106a18c turn on PackageImports globally
This will make it easier to use the Evil Splicer, when it needs to add
package qualified imports

And there's no real downside.
2013-04-13 18:12:44 -04:00
Joey Hess
dbb791a13b avoid warning 2013-04-13 15:46:24 -04:00
Joey Hess
2c365b8b74 remove debug 2013-04-11 16:36:45 -04:00
Joey Hess
1eb3fff787 addurl: Register transfer so the webapp can see it.
* addurl: Register transfer so the webapp can see it.
* addurl: Automatically retry downloads that fail, as long as some
  additional content was downloaded.
2013-04-11 16:14:17 -04:00
Joey Hess
04a27ad926 assistant: Bug fix to avoid annexing the files that git uses to stand in for symlinks on FAT and other filesystem not supporting symlinks.
also, blog for the day..
2013-04-10 19:57:26 -04:00
Joey Hess
271a919d14 assistant: Added sequence numbers to XMPP git push packets. (Not yet used.)
For backwards compatability, "" is treated as "0" sequence number.

--debug will show xmpp sequence numbers now, but they are not otherwise
used.
2013-04-10 18:39:56 -04:00
Joey Hess
b40e8fc5da display alert in webapp when assistant shuts down
and remove any activity alerts
2013-04-10 17:52:04 -04:00
Joey Hess
d8f8aa6921 assistant: Stop any transfers the assistant initiated on shutdown. 2013-04-10 17:38:53 -04:00
Joey Hess
1c36af163c animate syncing and other activity icons 2013-04-08 22:54:02 -04:00
Joey Hess
740ec66dcf webapp: When a repository's group is changed, rescan for transfers. 2013-04-08 16:45:12 -04:00
Joey Hess
1f1cddbaa7 syncNewRemote is not only used for new remotes; rename to syncRemote 2013-04-08 15:43:43 -04:00
Joey Hess
5e2e4347a3 webapp: New --listen= option allows running the webapp on one computer and connecting to it from another.
Does not yet use HTTPS. I'd need to generate a certificate, and I'm not
sure what's the best way to do that.
2013-04-08 15:04:35 -04:00
guilhem
00fc21bfec Generate ciphers with a better entropy.
Unless highRandomQuality=false (or --fast) is set, use Libgcypt's
'GCRY_VERY_STRONG_RANDOM' level by default for cipher generation, like
it's done for OpenPGP key generation.

On the assistant side, the random quality is left to the old (lower)
level, in order not to scare the user with an enless page load due to
the blocking PRNG waiting for IO actions.
2013-04-06 16:09:51 -04:00
Joey Hess
602baae12e Bugfix: Direct mode no longer repeatedly checksums duplicated files.
Fixed by storing a list of cached inodes for a key, instead of just one.

Backwards compatability note: An old git-annex version will fail to parse
an inode cache file that has been written by a new version, and has
multiple items. It will succees if just one. So old git-annexes will have
even worse behavior when there are duplicated files, if that is possible.
I don't think it will be a problem. (Famous last words.)

Also, note that it doesn't expire old and unused inode caches for a key.
It would be possible to add this if needed; just look through the
associated files for a key and if there are more cached inodes, throw out
any not corresponding to associated files. Unless a file is being copied
repeatedly and the old copy deleted, this lack of expiry should not be a
problem.
2013-04-06 16:07:25 -04:00
Joey Hess
f1b0a4b404 Use lower case hash directories for storing files on crippled filesystems, same as is already done for bare repositories.
* since this is a crippled filesystem anyway, git-annex doesn't use
  symlinks on it
* so there's no reason to use the mixed case hash directories that we're
  stuck using to avoid breaking everyone's symlinks to the content
* so we can do what is already done for all bare repos, and make non-bare
  repos on crippled filesystems use the all-lower case hash directories
* which are, happily, all 3 letters long, so they cannot conflict with
  mixed case hash directories
* so I was able to 100% fix this and even resuming `git annex add` in the
  test case will recover and it will all just work.
2013-04-04 15:46:33 -04:00
Joey Hess
6dec76ad92 fix warning 2013-04-04 01:52:07 -04:00
Joey Hess
d4d9645ef5 fix odd warning 2013-04-04 01:50:36 -04:00
Joey Hess
8b329c0317 refactor alert button creation code 2013-04-04 01:48:26 -04:00
Joey Hess
89dd5aeb95 display repos that are being cleaned out before removal in repolist 2013-04-03 21:58:08 -04:00
Joey Hess
a886c3b56d drop down menu for each repository with edit, disable, delete 2013-04-03 21:28:21 -04:00
Joey Hess
37d7da4de8 streamline deletion process and improve UI 2013-04-03 20:54:53 -04:00
Joey Hess
2c3aeec19b check for unused keys on an unwanted remote, and move them off, before deleting it 2013-04-03 19:03:16 -04:00
Joey Hess
021c564319 clean up urlrenderer handling when the webapp is not built 2013-04-03 17:48:54 -04:00
Joey Hess
9a5f421768 detect when unwanted remote is empty and remove it
Needs fixes to build when the webapp is disabled.
2013-04-03 17:01:40 -04:00
Joey Hess
8a5b397ac4 hlint 2013-04-03 03:52:41 -04:00
Joey Hess
47950cdf31 more efficient uuid to remote lookup 2013-04-02 16:39:11 -04:00
Joey Hess
6e7842475b convert "./file" from inotify to just "file"
This just prettifies some display.
2013-04-02 16:20:23 -04:00
Joey Hess
69a80a9a4d avoid queuing transfers that are currently running 2013-04-02 16:17:06 -04:00
Joey Hess
1f4fe92f61 avoid queuing transfer that is already queued, with a different associated file 2013-04-02 16:04:49 -04:00
Joey Hess
0f6a6f2a8b avoid queueing uploads to remotes that already have the content 2013-04-02 15:51:58 -04:00
Joey Hess
38d61f934d Update working tree files fully atomically
This avoids commit churn by the assistant when eg,
replacing a file with a symlink.

But, just as importantly, it prevents the working tree being left with a
deleted file if git-annex, or perhaps the whole system, crashes at the
wrong time.

(It also probably avoids confusing displays in file managers.)
2013-04-02 15:02:00 -04:00
Joey Hess
8c52b20cc7 optimise last commit
Rather than re-adding a direct mode file unnecessarily when it's not
changed, just re-stage the symlink.
2013-04-02 12:58:56 -04:00
Joey Hess
31cbde8190 assistant: Fix bug that could cause direct mode files to be unstaged from git.
My test case for this bug is to have the assistant running and syncing to
a remote, and create a file in the annex. Then at the command line run
git annex drop. The assistant sees that the file is gone, sees it's a wanted
file, and downloads it from the remote.

With a directory special remote and a small file, I was seeing around 1
time in 3, a race where the file got unstaged from git after it got
downloaded.

Looking at what direct mode content managing code does in this case, it
deletes the symlink, and then adds the file content back. It would be
possible, sometimes, to avoid removing the symlink and do this atomically.
And I probably should.. but in some cases, particularly where the file
needs to be run through `cp` (multiple direct mode files with same
content), there's no way to atomically replace the symlink with the
content.

Anyway, the bug turns out to be something that the watcher does right for
indirect mode, but not for direct mode. When it got an add event, it
checked to see if this was a new file, or one we've already added. In the
latter case, no add event was queued. But that means that only the rm event
is queued, and so it unstages the file.

Fixed by queueing an add event even when the file is already in git.

Tested by running hundreds of drops in a loop; file remained staged.
2013-04-02 12:45:31 -04:00
Joey Hess
d888fb6a4b move content from remote when user asks to delete it 2013-03-31 19:00:43 -04:00
Joey Hess
0eeb8d0508 fix dropping files from untrusted repositories
An off-by-one prevented the assistant ever dropping files from untrusted
repositories.
2013-03-31 18:39:49 -04:00
Joey Hess
c57baaaa30 webapp: Added UI to delete repositories. Closes: #689847 2013-03-31 16:38:05 -04:00
Joey Hess
5771cfce02 assistant: Check small files into git directly. 2013-03-29 16:54:59 -04:00
Joey Hess
67e817c6a1 New annex.largefiles setting, which configures which files git annex add and the assistant add to the annex.
I would have sort of liked to put this in .gitattributes, but it seems
it does not support multi-word attribute values. Also, making this a single
config setting makes it easy to only parse the expression once.

A natural next step would be to make the assistant `git add` files that
are not annex.largefiles. OTOH, I don't think `git annex add` should
`git add` such files, because git-annex command line tools are
not in the business of wrapping git command line tools.
2013-03-29 16:17:13 -04:00
Joey Hess
6fa0d0ecc8 webapp: Run ssh server probes in a way that will work when the login shell is a monstrosity that should have died 25 years ago, such as csh. 2013-03-29 13:09:30 -04:00
Joey Hess
6eb8440052 typo 2013-03-28 17:11:53 -04:00
Joey Hess
577128e9b8 avoid removing a transfer being made by another process
When another process is running a transfer, if we try to run a dup it'll
fail, and we should not remove the transfer from the transfer display.
2013-03-28 15:16:45 -04:00
Joey Hess
5870f713f0 update comment 2013-03-28 15:03:51 -04:00
Joey Hess
24d1ec760d avoid showing web special remote in sync alert 2013-03-28 14:51:39 -04:00
Joey Hess
4ef6e8fed5 improve wording 2013-03-27 15:46:08 -04:00
Joey Hess
1d0b692198 webapp: Fix a race that sometimes caused alerts or other notifications to be missed if they occurred while a page was loading.
When a page is loaded, the javascript requests an notification url, and
does long polling on the url to be informed of changes. But if a change
occured before the notification url was requested, it would not be notified
of that change, and so the page display would not update.

I fixed this by *always* updating the page display after it gets
the notification url. This is extra work, but the overhead is not noticable
in the other overhead of loading a page.

(A nicer way would be to somehow record the version of a page initially
loaded, and then compare it with the current version when getting the
notification url, and only force an update if it's changed. But getting
the "version" of the different parts of the page that use long polling
is difficult.)
2013-03-27 14:56:20 -04:00
Joey Hess
a87e046049 avoid displaying alert when syncing only to removable drives and all not attached 2013-03-27 14:25:49 -04:00
Joey Hess
f8707b6d3b fix inverted logic in filtering failed remotes 2013-03-27 14:19:10 -04:00
Joey Hess
3ef6b6a200 fix build with xmpp and w/o webapp 2013-03-24 18:55:19 -04:00
Joey Hess
9e8e1ee1ba better word wrapping 2013-03-20 18:21:43 -04:00
Joey Hess
bfb63ea521 adding removable drive improvements 2013-03-20 16:47:15 -04:00
Joey Hess
2c26bd1c65 2 minor fixes to transferkeys, otherwise it was perfect 1st time!
Needed to send a trailing NUL to end a request, and set the read handle
non-blocking.

Also, set fileSystemEncoding on all handles, since there's a filename in
there.
2013-03-20 13:24:35 -04:00
Joey Hess
b6d691aff7 maintain pools of running transferkeys processes (untested) 2013-03-19 18:46:29 -04:00
Joey Hess
bb284cd980 move display of transfer scan in progress to transfers section of dashboard
This way it's only visible when transfers are not running, which is about
what a user would expect.
2013-03-19 13:03:41 -04:00
Joey Hess
a30768cf7f new alert while scanning
Like the old one, but does not mention which remotes are scanned.
I think this is less confusing, as it does not imply the remotes
were somehow accessed (which they are not; inaccessible remotes
can be scanned.)
2013-03-18 23:15:48 -04:00
Joey Hess
aadb9069b3 deal with transferkey crashing
If transferkey crashes or even fails to run, the TransferWatcher will not
see the transfer info file be created, so will not remove the transfer
from the list of active transfers. This causes the list to grow
continually, and all active transfers are displayed in the webapp. So, put
in a guard.

I assume that transferkey will not exit 0 while neglecting to clean up.
2013-03-18 22:58:14 -04:00
Joey Hess
29d603b72a ensure 2013-03-18 22:41:16 -04:00
Joey Hess
b543842a7f optimisation for transfers to drives that are not plugged in
Rather than forking a git-annex transferkey only to have it fail,
just immediately record the failed transfer (so when the drive is plugged
in, the scan will retry it).
2013-03-18 20:40:24 -04:00
Joey Hess
4ce25e8986 don't show sync failure for drive that's not plugged in 2013-03-18 20:21:19 -04:00
Joey Hess
243bda3c52 add commas to remote list 2013-03-18 19:11:46 -04:00
Joey Hess
78c1cf5564 webapp: Force wrap long filenames in transfer display. 2013-03-18 19:09:05 -04:00
Joey Hess
cdb21649d0 webapp: Improved alerts displayed when syncing with remotes, and when syncing with a remote fails. 2013-03-18 17:23:47 -04:00
Joey Hess
69cc8e83ce minor robustness fixes in repo cost reordering code 2013-03-18 13:13:33 -04:00
Joey Hess
705cb5a84a cleanup import 2013-03-18 12:48:36 -04:00
Joey Hess
1d4ba882b3 redirect to FirstRepositoryR
This makes the new POST form work, since otherwise it would
try to POST ConfigurationR, which is not supported.
2013-03-18 12:47:44 -04:00
Joey Hess
069473872f unify two similar alerts 2013-03-18 12:17:33 -04:00
Joey Hess
35a0ae334c assistant: Fix OSX bug that prevented committing changed files to a repository when in indirect mode. 2013-03-17 17:01:43 -04:00
Joey Hess
746ffa773a assistant: Avoid syncing with annex-ignored remotes when reconnecting to the network, or connecting a drive. 2013-03-17 15:59:03 -04:00
Joey Hess
69cc00c5fc remove debug print 2013-03-17 15:44:14 -04:00
Joey Hess
0400c5f596 fix redirect from XMPP prompt to pairing pages 2013-03-16 19:19:58 -04:00
Joey Hess
4c0642a70d stop abusing UltDest here, just get Referer header by hand 2013-03-16 19:00:11 -04:00
Joey Hess
140774a8c8 webapp: Switch all forms to POST. 2013-03-16 18:48:26 -04:00
Joey Hess
db2fe522ba xmpp: Re-enable XA flag, since disabling it did not turn out to help with the problems Google Talk has with not always sending presence messages to clients. 2013-03-16 16:00:37 -04:00
Joey Hess
55f20ae099 xmpp: send a presence query when there's an important message to send
This may work around google talk's horrible presence handling, in which
clients often don't learn about other clients, at least when using the same
account. This way, every time we start a git push over xmpp, we'll waste
bandwidth asking clients to please try again to identify themselves.
2013-03-16 15:36:47 -04:00
Joey Hess
e3354cf19c xmpp: --debug now enables a sanitized dump of the XMPP protocol
So I can debug these damn google talk presence issues.
2013-03-16 15:29:51 -04:00
Joey Hess
996e899acc webapp: Encourage user to install git-annex on a server when adding a ssh server, rather than just funneling them through to rsync. 2013-03-16 12:58:59 -04:00
Joey Hess
c94c99942b make liftAnnex and liftAssistant polymorphic, like liftIO 2013-03-16 00:19:56 -04:00
Joey Hess
449520a573 add globallyAvailable to remotes 2013-03-15 19:16:13 -04:00
Joey Hess
54c480b416 clear cloud repo nudge when one is created 2013-03-15 18:12:45 -04:00
Joey Hess
77c82de4ea webapp: Display an alert when there are XMPP remotes, and a cloud transfer repository needs to be configured. 2013-03-15 17:52:41 -04:00
Joey Hess
39e979fb65 webapp: Improved UI for pairing your own devices together using XMPP. 2013-03-15 15:19:07 -04:00
Joey Hess
48d9a3182f reorg templates 2013-03-15 12:47:41 -04:00
Joey Hess
9cf4701a8f no longer need webapp state storage! excellent 2013-03-15 01:01:25 -04:00