Commit graph

636 commits

Author SHA1 Message Date
Joey Hess
0cac4402ac Android: Avoid passing --clobber to busybox wget. 2014-01-13 14:52:49 -04:00
Joey Hess
7aec957c5b comment 2014-01-07 17:33:38 -04:00
Joey Hess
d8e8128b50 work around a strance change in gpg behavior; needs a trustdb to exist even when using --trust-model=always 2014-01-07 13:20:07 -04:00
Joey Hess
e5b4d447b6 assistant: Start a new git-annex transferkeys process after a network connection change
So that remotes that use a persistent network connection are restarted.

A remote might keep open a long duration network connection, and could
fail to deal well with losing the connection. This is particularly a
concern now that we have external special reotes. An external
special remote that is implemented naively might open the connection only
when PREPARE is sent, and if it loses connection, throw errors on each
request that is made.

(Note that the ssh connection caching should not have this problem; if the
long-duration ssh process loses connection, the named pipe is disconnected
and the next ssh attempt will reconnect. Also, XMPP already deals with
disconnection robustly in its own way.)

There's no way for git-annex to know if a lost network connection actually
affects a given remote, which might have a transfer in process. It does not
make sense to force kill the transferkeys process every time the NetWatcher
detects a change. (Especially because the NetWatcher sometimes polls 1
change per hour.)

In any case, the NetWatcher only detects connection to a network, not
disconnection. So if a transfer is in progress over the network, and the
network goes down, that will need to time out on its own.

An alternate approch that was considered is to use a separate transferkeys
process for each remote, and detect when a request fails, and assume that
means that process is in a failing state and restart it. The problem with
that approach is that if a resource is not available and a remote fails
every time, it degrades to starting a new transferkeys process for every
file transfer, which is too expensive.

Instead, this commit only handles the network reconnection case, and restarts
transferkeys only once the network has reconnected and another transfer needs
to be made. So, a transferkeys process will be reused for 1 hour, or until the
next network connection.

----

The NotificationBroadcaster was rewritten to use TMVars rather than MSampleVars,
to allow checking without blocking if a notification has been received.

----

This commit was sponsored by Tobias Brunner.
2014-01-06 16:03:39 -04:00
Joey Hess
fdcc04096c assistant: Ensure that .ssh/config and .ssh/authorized_keys are not group or world writable when writing to those files, as that can make ssh refuse to use them, if it allows another user to write to them. 2014-01-03 17:44:12 -04:00
Joey Hess
858eb26303 Avoid looping if long-running git cat-file or git hash-object crashes and keeps crashing when restarted. 2014-01-01 21:42:25 -04:00
Joey Hess
b6379bc101 fix 2013-12-30 14:05:07 -04:00
Joey Hess
0cb1a0a605 fix 2013-12-30 13:41:11 -04:00
Joey Hess
52a46585b9 fix build failure in windows code 2013-12-30 13:18:40 -04:00
Joey Hess
3b858ece45 typo 2013-12-29 22:40:23 -04:00
Joey Hess
d6d5b0a6d8 Android: Avoid trying to use Android's own ionice, which does not allow specifying a command to run. Fixes transferring files to/from android and probably a few other things. 2013-12-29 17:32:08 -04:00
Joey Hess
a96118ec55 work around windows insanity that is 97.61% more brain-damaged than normal 2013-12-29 16:25:12 -04:00
Joey Hess
7f6685c16e addurl, importfeed: Sanitize | and some other symbols and special characters. 2013-12-27 17:52:20 -04:00
Joey Hess
6c565ec905 external special remotes mostly implemented (untested)
This has not been tested at all. It compiles!

The only known missing things are support for encryption, and for get/set
of special remote configuration, and of key state. (The latter needs
separate work to add a new per-key log file to store that state.)

Only thing I don't much like is that initremote needs to be passed both
type=external and externaltype=foo. It would be better to have just
type=foo

Most of this is quite straightforward code, that largely wrote itself given
the types. The only tricky parts were:

* Need to lock the remote when using it to eg make a request, because
  in theory git-annex could have multiple threads that each try to use
  a remote at the same time. I don't think that git-annex ever does
  that currently, but better safe than sorry.

* Rather than starting up every external special remote program when
  git-annex starts, they are started only on demand, when first used.
  This will avoid slowdown, especially when running fast git-annex query
  commands. Once started, they keep running until git-annex stops, currently,
  which may not be ideal, but it's hard to know a better time to stop them.

* Bit of a chicken and egg problem with caching the cost of the remote,
  because setting annex-cost in the git config needs the remote to already
  be set up. Managed to finesse that.

This commit was sponsored by Lukas Anzinger.
2013-12-26 18:23:13 -04:00
Joey Hess
5897fb4a86 convert hacky shell linux mklibs code to haskell ; fixing symlink bug
The shell code was nasty, and buggy. New haskell code is much nicer,
and it's easy to do complicated calculations to properly convert possibly
absolute symlinks between libraries into relative links using it.
2013-12-24 13:13:17 -04:00
Joey Hess
3a6e0d1215 assistant: Set StrictHostKeyChecking yes when creating ssh remotes, and add it to the configuration for any ssh remotes previously created by the assistant. This avoids repeated prompts by ssh if the host key changes, instead syncing with such a remote will fail. Closes: #732602 2013-12-20 20:58:36 -04:00
Joey Hess
6e3cc0a228 need to stat symlink 2013-12-18 15:20:26 -04:00
Joey Hess
c99d6a8151 assistant: Fix OSX-specific bug that caused the startup scan to try to follow symlinks to other directories, and add their contents to the annex. 2013-12-18 15:05:29 -04:00
Joey Hess
a168b8de12 switch define used, not android specific 2013-12-18 02:06:15 -04:00
Joey Hess
2fd63f3cfa port transferkeys to windows; make stopping in progress transfers work too (probably)
transferkeys had used special FDs for communication, but that would be
quite annoying to do in Windows.

Instead, use stdin and stdout. But, to avoid commands like rsync stomping
on them and messing up the communications channel, they're duplicated to a
different handle; stdin is replaced with a null handle, and stdout is
replaced with a copy of stderr. This should all work in windows too.

Stopping in progress transfers may work on windows.. if the types unify
anyway. ;) May need some more porting.
2013-12-10 23:19:18 -04:00
Joey Hess
5b0cb642c9 warning 2013-12-10 01:35:27 -04:00
Joey Hess
89b5256f09 missing include 2013-12-10 01:21:39 -04:00
Joey Hess
063a183a61 windows disk free space checking 2013-12-10 01:18:04 -04:00
Joey Hess
0544818e59 squash warning 2013-12-09 17:24:32 -04:00
Joey Hess
472e0e97fe whups 2013-12-06 22:57:54 -04:00
Joey Hess
67df015767 didn't seem to help 2013-12-06 22:53:36 -04:00
Joey Hess
85936392ec fix 2013-12-06 22:38:01 -04:00
Joey Hess
b712e2cf57 try to use build-in yesod socket bind code on windows (mine seems to make t crash) 2013-12-06 22:35:11 -04:00
Joey Hess
00f3781f47 add withSocketsDo to hopefully appease the windows crash report gods 2013-12-06 22:18:58 -04:00
Joey Hess
2fc0330c3b weird DOS CMD shell is weird 2013-12-06 22:07:16 -04:00
Joey Hess
d5a50a0c8b Revert "try different syntax"
This reverts commit 891ca9a75d.
2013-12-06 21:48:35 -04:00
Joey Hess
891ca9a75d try different syntax 2013-12-06 21:37:06 -04:00
Joey Hess
7ac6090088 Revert "don't use writeFileProtected on windows"
This reverts commit c698d34b03.
2013-12-06 21:24:34 -04:00
Joey Hess
c698d34b03 don't use writeFileProtected on windows
This was preventing the webapp from working.
2013-12-06 21:11:17 -04:00
Joey Hess
4d5e0a90ed support for opening urls on windows 2013-12-06 18:18:05 -04:00
Joey Hess
1f2b42a853 oop 2013-12-06 13:59:22 -04:00
Joey Hess
ef1ea499ba oop 2013-12-06 13:56:06 -04:00
Joey Hess
5b5c33e06d pass COLLECT_GCC_OPTIONS 2013-12-06 13:53:58 -04:00
Joey Hess
ffd3e70046 same fix as android for windows getAddrInfo not working 2013-12-05 23:03:54 -04:00
Joey Hess
c077cee44a reorg 2013-12-04 23:09:54 -04:00
Joey Hess
abb0b3103f avoid blocked indefinitely on mvar on windows
by repeatedly reading lines and pausing since cannot do signal foo used on
unix
2013-12-04 17:25:41 -04:00
Joey Hess
0a63ed563f rsync special remote: Fix fallback mode for rsync remotes that use hashDirMixed. Closes: #731142 2013-12-02 12:53:39 -04:00
Joey Hess
0fd6078865 avoid repeatedly searching path to make batch command when running transferkeys 2013-12-01 15:37:51 -04:00
Joey Hess
7fc84717e8 avoid an unncessary use of the shell 2013-12-01 15:01:56 -04:00
Joey Hess
4882a611e5 assistant: Batch jobs are now run with ionice and nocache, when those commands are available. 2013-12-01 14:53:15 -04:00
Joey Hess
46ee2ea2e6 golf 2013-11-25 00:02:48 -04:00
Joey Hess
325f220058 typo 2013-11-24 23:51:25 -04:00
Joey Hess
e2f50f5110 Added support for quvi 0.9. Slightly suboptimal due to limitations in its interface compared with the old version. 2013-11-24 23:44:30 -04:00
Joey Hess
6d23786d96 Avoid misbehavior when addurl is used with quvi 0.9.
In 0.9, -v shows version, rather than controlling verbosity.

Still need to port to 0.9, this just avoids massively confusing addurl when
quvi prints its version and exits successfully, on urls that it cannot be
used with.
2013-11-22 14:12:44 -04:00
Joey Hess
a1f8621efc oops 2013-11-20 13:44:49 -04:00