Commit graph

701 commits

Author SHA1 Message Date
Joey Hess
56830af8d8 simpler use of MIN_VERSION checks 2013-03-10 15:43:17 -04:00
Joey Hess
285838633b show build flags on webapp about page 2013-03-09 14:59:38 -04:00
Joey Hess
bf46e6f15d fix warning 2013-03-08 22:25:23 -04:00
Joey Hess
0e508f860a assistant: Sync with all git remotes on startup. 2013-03-08 13:48:27 -04:00
Joey Hess
99989bcc8e logic error 2013-03-07 14:08:50 -04:00
Joey Hess
6e7a43ab61 avoid listing glacier when prompting to set up a transfer repository after xmpp 2013-03-07 13:01:18 -04:00
Joey Hess
265e440d22 avoid queuing transfers that are already queued
I saw this happen in real life, when syncing to a newly added usb drive.
I think it got scanned twice, and files were doubled in the queue.

This could be optimised a little bit more, to only read from the mvar
once, rather than twice.
2013-03-07 12:35:42 -04:00
Joey Hess
243e99717d empty buddy list when client is connecting
This is not perfect, because on loss of connection, we do not currently
immediately detect it and stop the client. It has to time out, and then
the buddy list will clear.

The NetWatcher should detect disconnects too..
2013-03-07 03:50:21 -04:00
Joey Hess
90e4708890 remove xa
I have a theory that some google xmpp servers don't send prsense for xa
clients, while others do. Seeing some weird lack of presence messages
sometimes there.
2013-03-07 03:35:47 -04:00
Joey Hess
ade57af9e5 add alerts while performing xmpp git push/pull 2013-03-07 02:38:57 -04:00
Joey Hess
57b601e384 assistant: Fix syncing after XMPP pairing.
A missing uuid broke this, and also caused a UI glitch in the webapp's
remote list.
2013-03-06 22:18:44 -04:00
Joey Hess
f8c2dc82d8 show when not connected to xmpp server 2013-03-06 22:02:47 -04:00
Joey Hess
c16adc25c4 assistant: XMPP git pull and push requests are cached and sent when presence of a new client is detected.
Noticed that, At startup or network reconnect, git push messages were sent,
often before presence info has been gathered, so were not sent to any
buddies.

To fix this, keep track of which buddies have seen such messages,
and when new presence is received from a buddy that has not yet seen it,
resend.

This is done only for push initiation messages, so very little data needs
to be stored.
2013-03-06 21:38:01 -04:00
Joey Hess
d76e281de0 todo 2013-03-06 18:40:07 -04:00
Joey Hess
060119fdc4 better xmpp debugging 2013-03-06 18:28:34 -04:00
Joey Hess
aaec2cbf03 avoid false alert about syncing with xmpp remote 2013-03-06 17:54:45 -04:00
Joey Hess
1340b9f493 avoid too early scanning for xmppremotes 2013-03-06 17:43:55 -04:00
Joey Hess
cbb6e1fae4 tag xmpp pushes with jid
This fixes the issue mentioned in the last commit.

Turns out just collecting UUID of clients behind a XMPP remote is
insufficient (although I should probably still do it for other reasons),
because a single remote repo might be connected via both XMPP and local
pairing. So a way is needed to know when a push was received from any
client using a given XMPP remote over XMPP, as opposed to via ssh.
2013-03-06 16:29:19 -04:00
Joey Hess
c23ea9e311 assistant: Get back in sync with XMPP remotes after network reconnection, and on startup.
Make manualPull send push requests over XMPP.

When reconnecting with remotes, those that are XMPP remotes cannot
immediately be pulled from and scanned, so instead maintain a set of
(probably) desynced remotes, and put XMPP remotes on it. (This set could be
used in other ways later, if we can detect we're out of sync with other
types of remotes.)

The merger handles detecting when a XMPP push is received from a desynced
remote, and triggers a scan then, if they have in fact diverged.

This has one known bug: A single XMPP remote can have multiple clients
behind it. When this happens, only the UUID of one client is recorded
as the UUID of the XMPP remote. Pushes from the other XMPP clients will not
trigger a scan. If the client whose UUID is expected responds to the push
request, it'll work, but when that client is offline, we're SOL.
2013-03-06 15:09:31 -04:00
Joey Hess
f8f4de45d5 fix pair complete alert combining
The pairing complete alert had been conbining with some other alert, fixed
this and now it's displayed once xmpp pairing is complete on both sides.
2013-03-05 16:23:56 -04:00
Joey Hess
c03fdf5a15 fix password length check to match message 2013-03-05 16:21:13 -04:00
Joey Hess
921f29c004 two types of byName
Clean up from 9769235d6b.
In some cases, looking up a remote by name even though it has no UUID is
desirable. This includes git annex sync, which can operate on remotes
without an annex, and XMPP pairing, which runs addRemote (with calls
byName) before the UUID of the XMPP remote has been configured in git.
2013-03-05 15:43:56 -04:00
Joey Hess
907b0c0d78 better liftAnnex, avoid using runAnnex undefined 2013-03-04 16:36:38 -04:00
Joey Hess
5274713305 webapp: Proceed automatically on from "Configure jabber account" to pairing. 2013-03-04 16:03:24 -04:00
Joey Hess
c908672f3d fix another potential race with the watcher and direct mode
Watcher wants to rewrite symlink to fix it. But in direct mode, the symlink
could be replaced at any time with file content that has finished being
transferred by some other process. So, just don't touch it.

FWIW, I audited the rest of the assistant for places where it removes
files, and the rest is ok. I have not audited the rest of git-annex.
2013-03-04 15:09:32 -04:00
Joey Hess
1d388d5579 fixed the race breaking moving files from archive in direct mode
assistant: Fix bug in direct mode that could occur when a symlink is moved
out of an archive directory, and resulted in the file not being set to
direct mode when it was transferred.

The bug was that the direct mode mapping was not up-to-date when the
transferrer finished. So, finding no direct mode place to store the object,
it was put into .git/annex in indirect mode.

To fix this, just make the watcher update the direct mode mapping to
include the new file before it starts the transfer. (Seems we don't need to
update it to remove the old file if the link was moved, because the direct
mode code will notice it's not present and the mapping gets updated for its
removal later.)

The reason this was a race, and was probably not seen often is because
the committer came along and updated the direct mode mapping as part of
adding the moved symlink. But when the file was sufficiently small or
the remote sufficiently fast, this could happen after the transfer
finished.
2013-03-04 14:25:22 -04:00
Joey Hess
a238e58365 cleanup 2013-03-03 23:27:17 -04:00
Joey Hess
6cc0d93bd6 fix year 2013-03-03 23:20:47 -04:00
Joey Hess
08bdea7e52 webapp: New preferences page allows enabling/disabling debug logging at runtime, as well as configuring numcopies and diskreserve. 2013-03-03 17:07:27 -04:00
Joey Hess
724711e4b7 fix 2013-03-03 15:18:24 -04:00
Joey Hess
53318d6ef1 webapp: fix display of paused local repo 2013-03-03 14:55:25 -04:00
Joey Hess
789ca15012 better prevention of auto repack
Looking through the git sources (documentation is unclear),
it seems commit doesn't ever trigger git-gc, mostly fetching and merging
seems to. I cannot easily override the setting in all those places, so
instead set gc.auto in git config when initializing a repository with
the assistant.

This does mean that the user cannot set gc.auto=0 and completely avoid
repacks, as the assistant does it daily. But, it only does it after there
are 100x the default number of loose objects, so this is probably not going
to be too annoying.
2013-03-03 14:20:07 -04:00
Joey Hess
6dea43831e assistant: Prevent automatic commits from causing git-gc runs, as that can make things quite slow. Instead, git-gc --auto is run once a day. (This can be disabled by the usual gc.auto=0 setting.) 2013-03-03 13:44:35 -04:00
Joey Hess
0c13d3065e git subcommand cleanup
Pass subcommand as a regular param, which allows passing git parameters
like -c before it. This was already done in the pipeing set of functions,
but not the command running set.
2013-03-03 13:39:07 -04:00
Joey Hess
cc5db38a1e typo 2013-03-01 16:58:19 -04:00
Joey Hess
7a8833c81d remove excess log rotation; openLog rotates 2013-03-01 16:56:56 -04:00
Joey Hess
0d4b513ec2 assistant: Fix dropping content when a file is moved to an archive directory.
A transfer is queued, but if the file has already been transferred to the
remote before, the transfer is skipped. In this case, it needs to perform
any actions it would normally take after finishing the transfer, like
dropping the local object.
2013-03-01 16:46:36 -04:00
Joey Hess
4d33423067 assistant: Avoid noise in logs from git commit about typechanged files in direct mode repositories. 2013-03-01 16:21:29 -04:00
Joey Hess
a733271a9c add additional debug info about reasons for drops 2013-03-01 15:58:44 -04:00
Joey Hess
46c9cbeb1e add additional debug info about reasons for transfers 2013-03-01 15:23:59 -04:00
Joey Hess
1865b28094 assistant: Logs are rotated to avoid them using too much disk space.
This cannot completely guard against a runaway log event, and only runs
every hour anyway, but it should avoid most problems with very
long-running, active assistants using up too much space.
2013-03-01 13:30:48 -04:00
Joey Hess
2894ba5860 webapp: Only show up to 10 queued transfers.
The transfer queue can grow larger than 10 when queueing transfers for
files that were just received, as well as requeueing failed transfers.
I probably need to do some work to prevent that, as it could use a lot of
RAM. But for now, cap the number of displayed transfers in the webapp, to
avoid flooding the browser.
2013-02-28 15:51:53 -04:00
Joey Hess
a582463cb9 no template haskell here any longer 2013-02-28 02:21:43 -04:00
Joey Hess
95a244d9c4 work around yesod bug that causes a warning
I think this is fixed in newer versions of yesod, so this commit can be
reverted when dropping support for Debian wheezy.
2013-02-27 18:31:59 -04:00
Joey Hess
cbd53b4a8c Makefile now builds using cabal, taking advantage of cabal's automatic detection of appropriate build flags.
The only thing lost is ./ghci

Speed: make fast used to take 20 seconds here, when rebuilding from
touching Command/Unused.hs. With cabal, it's 29 seconds.
2013-02-27 02:39:22 -04:00
Joey Hess
9d6fd5b927 webapp: Display any error message from git init if it fails to create a repository. 2013-02-26 13:04:37 -04:00
Joey Hess
08854afa10 fix inverted logic 2013-02-22 17:01:48 -04:00
Joey Hess
2a4dad8bd4 remove debug prints 2013-02-19 23:18:15 -04:00
Joey Hess
e598b78a69 webapp: Can now add a new local repository, and make it sync with the main local repository. 2013-02-18 20:37:26 -04:00
Joey Hess
127463e577 webapp: Allow creating repositories on filesystems that lack support for symlinks. 2013-02-18 12:54:41 -04:00