Commit graph

1114 commits

Author SHA1 Message Date
Joey Hess
ff912832c0 reorganize osx app, so it can be put in PATH
Move all the binaries and libraries under a bundle/ subdirectory;
so when it's in PATH only git-annex, runshell, and git-annex-webapp
will be available.
2013-03-20 14:01:05 -04:00
Joey Hess
77209ee784 update 2013-03-20 13:26:54 -04:00
Joey Hess
e9048ecec8 get, copy, move: Display an error message when an identical transfer is already in progress, rather than failing with no indication why. 2013-03-19 13:56:20 -04:00
Joey Hess
a5dded0401 assistant: The ConfigMonitor left one zombie behind each time it checked for changes, now fixed. 2013-03-18 22:09:51 -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
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
140774a8c8 webapp: Switch all forms to POST. 2013-03-16 18:48:26 -04:00
Joey Hess
17c9ff576d Fix several bugs caused by a bad Ord instance for Remote.
A long time ago I made Remote be an instance of the Ord typeclass, with an
implementation that compared the costs of Remotes. That seemed like a good
idea at the time, as it saved typing.. But at the time I was still making
custom Read and Show instances too. I've since learned that this is *not* a
good idea, and neither is making custom Ord instances, without deep thought
about the possible sets of values in a type. Haskell typeclasses are not a
toy.

This Ord instance came around and bit me when I put Remotes into a Set,
because now remotes with the same cost appeared to be in the Set even if
they were not. Also affected putting Remotes into a Map.

Rarely does a bug go this deep. I've fixed it comprehensively, first
removing the Ord instance entirely, and fixing the places that wanted to
order remotes by cost to do it explicitly. Then adding back an Ord instance
that is much more sane. Also by checking the rest of the Ord instances in
the code base (which were all ok).

While doing that, I found lots of places that kept remotes in Maps and
Sets. All of it was probably subtly broken in one way or another before
this fix, but it would be hard to say exactly how the bugs would
manifest.
2013-03-16 17:43:42 -04:00
Joey Hess
6314be1e3c map: Combine duplicate repositories, for a nicer looking map. 2013-03-16 16:31:59 -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
79f10b75c1 Add incrementalbackup repository group. 2013-03-16 11:17:53 -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
810a06b771 webapp: Repository list is now included in the dashboard, and other UI tweaks. 2013-03-15 00:34:42 -04:00
Joey Hess
874c29c77b clean up license file 2013-03-14 16:52:28 -04:00
Joey Hess
7dcf33a164 prep release 2013-03-14 15:32:10 -04:00
Joey Hess
99dc302d06 webapp: Repository costs can be configured by dragging repositories around in the repository list. 2013-03-14 13:12:27 -04:00
Joey Hess
b9b5c3991c drag and drop repo list (doesn't yet actually change cost settings) 2013-03-13 22:47:16 -04:00
Joey Hess
581fe0644f proof of concept remote reordering UI (needs to be changed to use drag and drop) 2013-03-13 17:59:33 -04:00
Joey Hess
9b657a2ccc webapp: Set locally paired repositories to a lower cost than other network remotes. 2013-03-13 14:10:29 -04:00
Joey Hess
02facde154 assistant: Be smarter about avoiding unncessary transfers.
Just before starting a transfer, do one last check that it's still
preferred content.

I was just doing this for uploads, as part of the smarter flood filling
bug, but realized it's also possible for a download that was preferred
content to change to not be before the download begins, so check that too.
2013-03-13 13:36:02 -04:00
Joey Hess
e18d610ff8 typo 2013-03-12 16:44:23 -04:00
Joey Hess
f7de51e8b6 Bugfix: Fix bug in inode cache sentinal check, which broke copying to local repos if the repo being copied from had moved to a different filesystem or otherwise changed all its inodes' 2013-03-12 16:41:54 -04:00
Joey Hess
652abf3eaf reorg 2013-03-12 08:24:18 -04:00
Joey Hess
3f96da9b50 reorg 2013-03-12 08:23:59 -04:00
Joey Hess
2c05c85437 webapp: DTRT when told to create a git repo that already exists. 2013-03-12 08:09:31 -04:00
Joey Hess
796f1d806f assistant: Fix ~/.ssh/git-annex-shell wrapper to work when the ssh key does not force a command.
Without a forced command, SSH_ORIGINAL_COMMAND is not set.
So instead, in this case, run $@
2013-03-12 07:12:39 -04:00
Joey Hess
de6f74ac88 addurl: Add --relaxed option. 2013-03-11 19:55:01 -04:00
Joey Hess
14fcfced48 detect directory rename and wait up to 1 second to get all the changes 2013-03-11 15:24:13 -04:00
Joey Hess
61c5e8736c detect renames during commit, and .. um, do nothing special because it's lunch time
But I'm well set up to fast-track direct mode adds for renames now.
2013-03-11 12:56:47 -04:00
Joey Hess
6d6aa13df5 Added remote.<name>.annex-gnupg-options setting. Thanks, guilhem for the patch. 2013-03-11 09:49:52 -04:00
Joey Hess
baf226e313 status: Can now be run with a directory path to show only the status of that directory, rather than the whole annex. 2013-03-11 01:22:56 -04:00
Joey Hess
0ecd05c28d addurl url escaping foo
* addurl: Escape invalid characters in urls, rather than failing to
  use an invalid url.
* addurl: Properly handle url-escaped characters in file:// urls.
2013-03-10 23:00:33 -04:00
Joey Hess
2762ab03b4 assistant: generate better commits for renames 2013-03-10 22:10:26 -04:00
Joey Hess
3816c6c82a add back cabal-install (for Makefile) 2013-03-10 20:16:57 -04:00
Joey Hess
a3eac50fe9 bugfix: drop --from an unavailable remote no longer updates the location log, incorrectly, to say the remote does not have the key.
The comments correctly noted that the remote could drop the key and
yet False be returned due to some problem that occurred afterwards.
For example, if it's a network remote, it could drop the key just
as the network goes down, and so things timeout and a nonzero exit
from ssh is propigated through and False returned.

However... Most of the time, this scenario will not have happened.
False will mean the remote was not available or could not drop the key
at all.

So, instead of assuming the worst, just trust the status we have.

If we get it wrong, and the scenario above happened, our location
log will think the remote has the key. But the remote's location
log (assuming it has one) will know it dropped it, and the next sync
will regain consistency.

For a special remote, with no location log, our location log will be wrong,
but this is no different than the situation where someone else dropped
the key from the remote and we've not synced with them. The standard
paranoia about not trusting the location log to be the last word about
whether a remote has a key will save us from these situations. Ie,
if we try to drop the file, we'll actively check the remote,
and determine the inconsistency then.
2013-03-10 19:15:53 -04:00
Joey Hess
65a4c7966f moved transfer queueing out of watcher and into committer
This cleaned up the code quite a bit; now the committer just looks at the
Change to see if it's a change that needs to have a transfer queued for it.
If I later want to add dropping keys for files that were removed, or
something like that, this should make it straightforward.

This also fixes a bug. In direct mode, moving a file out of an archive
directory failed to start a transfer to get its content. The problem
was that the file had not been committed to git yet, and so the transfer
code didn't want to touch it, since fileKey failed to get its key.
Only starting transfers after a commit avoids this problem.
2013-03-10 18:16:03 -04:00
Joey Hess
3e32bb41f6 webapp: Work around bug in Warp's slowloris attack prevention code, that caused regular browsers to stall when they reuse a connection after leaving it idle for 30 seconds. (See https://github.com/yesodweb/wai/issues/146) 2013-03-09 14:57:48 -04:00
Joey Hess
a2d94bd627 Switch from using regex-compat to regex-tdfa, as the C regex library is rather buggy. 2013-03-08 15:29:01 -04:00
Joey Hess
0e508f860a assistant: Sync with all git remotes on startup. 2013-03-08 13:48:27 -04:00
Joey Hess
ea672b7c77 Bugfix: git annex add, when ran without any file or directory specified, should add files in the current directory, but not act on unlocked files elsewhere in the tree. 2013-03-07 19:03:06 -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
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
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
974d075108 Run ssh with -T to avoid tty allocation and any login scripts that may do undesired things with it. 2013-03-04 23:36:07 -04:00
Joey Hess
9769235d6b Bugfix: If the UUID of a remote is not known, prevent --from, --to, and other ways of specifying remotes by name from selecting it, since it is not possible to sanely use it.
For example, copy --to such a remote would send the file, but as NoUUID was
its uuid, no location log update was done. And drop --from such a remote
would not do anything, because NoUUID is not listed in the location log..
2013-03-04 21:32:57 -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
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
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
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
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
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
8cfbef6a91 finish removing fast flag 2013-02-28 16:10:37 -04:00
Joey Hess
843df51f06 use Setup.hs rather than depending on cabal-install
Based on a patch from Peter Simons
2013-02-28 16:08:11 -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
c11aa969e5 Android: Enable test suite. 2013-02-27 23:26:14 -04:00
Joey Hess
0151f42cdf Stop depending on testpack. 2013-02-27 23:23:41 -04:00
Joey Hess
497f81db79 install fix 2013-02-27 17:25:00 -04:00
Joey Hess
b63b8e1b5f need build-dep on cabal-install 2013-02-27 16:37:35 -04:00
Joey Hess
f5676104f8 cleanup 2013-02-27 15:53:19 -04:00
Joey Hess
d1dbf266f6 embed test suite into git annex; available by running: git annex test
I have seen some other programs do this, and think it's pretty cool. Means
you can test wherever it's deployed, as well as at build time.

My other reason for doing it is less happy. Cabal's handling of test suites
sucks, requiring duplicated info, and even when that's done, it fails to
preprocess hsc files here. Building it in avoids that and avoids having
to explicitly tell cabal to enable test suites, which would then make it
link the test executable every time, which is unnecessarily slow.

This also has the benefit that now "make fast test" does a max speed build
and tests it.
2013-02-27 15:38:21 -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
b117efc19b deal with http-conduit changing a data type
Pity that the library does not provide a function to extract the status
code from the StatusCodeException, so when they had to add a new field, it
breaks every single place that does it.
2013-02-27 00:07:28 -04:00
Joey Hess
2d9c046dea annex.version is now set to 4 for direct mode repositories
To avoid old versions of git-annex getting confused.

There is no upgrade required though.
We switch back to 3 when going from direct to indirect.
2013-02-26 15:13:10 -04:00
Joey Hess
3b92c279e8 copy: Update location log when no copy was performed, if the location log was out of date. 2013-02-26 14:39:37 -04:00
Joey Hess
7df2861d67 fix * glob matching files in subdirectories 2013-02-26 14:35:39 -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
8d9c2afd89 Additional GIT_DIR support bugfixes. May actually work now.
Two fixes. First, and most importantly, relax the isLinkToAnnex check
to only look for /annex/objects/, not [^|/].git/annex/objects. If
GIT_DIR is used with a detached work tree, the git directory is
not necessarily named .git.

There are important caveats with doing that at all, since git-annex will
make symlinks that point at GIT_DIR, which means that the relative path
between GIT_DIR and GIT_WORK_TREE needs to remain stable across all clones
of the repository.

----

The other fix is just fixing crazy and wrong code that, when GIT_DIR is
set, expects to still find a git repository in the path below the work
tree, and uses some of its configuration, and some of GIT_DIR. What was I
thinking, and why can't I seem to get this code right?
2013-02-23 12:41:22 -04:00
Joey Hess
a7a1bcd1d6 Avoid passing -p to rsync, to interoperate with crippled filesystems.
In general, git-annex does not try to preserve file permissions. For
example, they don't round trip through special remotes. So it's ok to not
preserve them for git remotes either.

On crippled filesystems, rsync has been observed failing after the file
was transferred because it couldn't set some permission or other.
2013-02-22 15:23:29 -04:00
Joey Hess
0adb05cd28 update 2013-02-20 14:14:14 -04:00
Joey Hess
af1da07302 Direct mode: Fix support for adding a modified file.
Adding a file that is already annexed, but has been modified, was broken in
direct mode.

This fix makes the new content be added. It does have the problem that
re-running `git annex add` will checksum and re-add the content repeatedly,
until it's committed. This happens because the key associated with the file
does not change until the new one gets committed, so it keeps thinking the
file has changed.
2013-02-20 13:37:46 -04:00
Joey Hess
624e34649f Direct mode: Support filesystems like FAT which can change their inodes each time they are mounted. 2013-02-19 17:31:03 -04:00
Joey Hess
0f4cc559a7 Android: Support ssh connection caching. 2013-02-19 14:57:45 -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
15fd867398 add openssh to Android
This build still needs some work to look in $HOME/.ssh
rather than relying on pwent info.
2013-02-18 18:50:28 -04:00
Joey Hess
127463e577 webapp: Allow creating repositories on filesystems that lack support for symlinks. 2013-02-18 12:54:41 -04:00
Joey Hess
d7c93b8913 fully support core.symlinks=false in all relevant symlink handling code
Refactored annex link code into nice clean new library.

Audited and dealt with calls to createSymbolicLink.
Remaining calls are all safe, because:

Annex/Link.hs:  ( liftIO $ createSymbolicLink linktarget file
  only when core.symlinks=true
Assistant/WebApp/Configurators/Local.hs:                createSymbolicLink link link
  test if symlinks can be made
Command/Fix.hs: liftIO $ createSymbolicLink link file
  command only works in indirect mode
Command/FromKey.hs:     liftIO $ createSymbolicLink link file
  command only works in indirect mode
Command/Indirect.hs:                    liftIO $ createSymbolicLink l f
  refuses to run if core.symlinks=false
Init.hs:                createSymbolicLink f f2
  test if symlinks can be made
Remote/Directory.hs:    go [file] = catchBoolIO $ createSymbolicLink file f >> return True
  fast key linking; catches failure to make symlink and falls back to copy
Remote/Git.hs:          liftIO $ catchBoolIO $ createSymbolicLink loc file >> return True
  ditto
Upgrade/V1.hs:                          liftIO $ createSymbolicLink link f
  v1 repos could not be on a filesystem w/o symlinks

Audited and dealt with calls to readSymbolicLink.
Remaining calls are all safe, because:

Annex/Link.hs:		( liftIO $ catchMaybeIO $ readSymbolicLink file
  only when core.symlinks=true
Assistant/Threads/Watcher.hs:		ifM ((==) (Just link) <$> liftIO (catchMaybeIO $ readSymbolicLink file))
  code that fixes real symlinks when inotify sees them
  It's ok to not fix psdueo-symlinks.
Assistant/Threads/Watcher.hs:		mlink <- liftIO (catchMaybeIO $ readSymbolicLink file)
  ditto
Command/Fix.hs:	stopUnless ((/=) (Just link) <$> liftIO (catchMaybeIO $ readSymbolicLink file)) $ do
  command only works in indirect mode
Upgrade/V1.hs:	getsymlink = takeFileName <$> readSymbolicLink file
  v1 repos could not be on a filesystem w/o symlinks

Audited and dealt with calls to isSymbolicLink.
(Typically used with getSymbolicLinkStatus, but that is just used because
getFileStatus is not as robust; it also works on pseudolinks.)
Remaining calls are all safe, because:

Assistant/Threads/SanityChecker.hs:                             | isSymbolicLink s -> addsymlink file ms
  only handles staging of symlinks that were somehow not staged
  (might need to be updated to support pseudolinks, but this is
  only a belt-and-suspenders check anyway, and I've never seen the code run)
Command/Add.hs:         if isSymbolicLink s || not (isRegularFile s)
  avoids adding symlinks to the annex, so not relevant
Command/Indirect.hs:                            | isSymbolicLink s -> void $ flip whenAnnexed f $
  only allowed on systems that support symlinks
Command/Indirect.hs:            whenM (liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus f) $ do
  ditto
Seek.hs:notSymlink f = liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus f
  used to find unlocked files, only relevant in indirect mode
Utility/FSEvents.hs:                    | Files.isSymbolicLink s = runhook addSymlinkHook $ Just s
Utility/FSEvents.hs:                                            | Files.isSymbolicLink s ->
Utility/INotify.hs:                             | Files.isSymbolicLink s ->
Utility/INotify.hs:                     checkfiletype Files.isSymbolicLink addSymlinkHook f
Utility/Kqueue.hs:              | Files.isSymbolicLink s = callhook addSymlinkHook (Just s) change
  all above are lower-level, not relevant

Audited and dealt with calls to isSymLink.
Remaining calls are all safe, because:

Annex/Direct.hs:			| isSymLink (getmode item) =
  This is looking at git diff-tree objects, not files on disk
Command/Unused.hs:		| isSymLink (LsTree.mode l) = do
  This is looking at git ls-tree, not file on disk
Utility/FileMode.hs:isSymLink :: FileMode -> Bool
Utility/FileMode.hs:isSymLink = checkMode symbolicLinkMode
  low-level

Done!!
2013-02-17 16:43:14 -04:00
Joey Hess
8c90875455 phony standalone 2013-02-16 10:45:13 -04:00
Joey Hess
63ce1a4f71 prep release 2013-02-16 10:26:49 -04:00
Joey Hess
55069f0fab update for reversion 2013-02-15 16:39:11 -04:00
Joey Hess
4da932a48f improve 2013-02-15 13:53:28 -04:00
Joey Hess
0d0034b9d7 add standalone target 2013-02-14 18:51:30 -04:00
Joey Hess
7ce30b534f add: Improved detection of files that are modified while being added.
In indirect mode, now checks the inode cache to detect changes to a file.
Note that a file can still be changed if a process has it open for write,
after landing in the annex.

In direct mode, some checking of the inode cache was done before, but
from a much later point, so fewer modifications could be detected. Now it's
as good as indirect mode.

On crippled filesystems, no lock down is done before starting to add a
file, so checking the inode cache is the only protection we have.
2013-02-14 16:54:36 -04:00
Joey Hess
47477b2807 crippled filesystem support, probing and initial support
git annex init probes for crippled filesystems, and sets direct mode, as
well as `annex.crippledfilesystem`.

Avoid manipulating permissions of files on crippled filesystems.
That would likely cause an exception to be thrown.

Very basic support in Command.Add for cripped filesystems; avoids the lock
down entirely since doing it needs both permissions and hard links.
Will make this better soon.
2013-02-14 14:15:26 -04:00
Joey Hess
521398cc3d Now uses the Haskell Glob library, rather than pcre-light, avoiding the need to install libpcre. Currently done only for Cabal or when the Makefile is made to use -DWITH_GLOB 2013-02-11 11:47:53 -04:00
Joey Hess
f202d997f4 Now uses the Haskell uuid library, rather than needing a uuid program.
Been meaning to do this for some time; Android port was last straw.

Note that newer versions of the uuid library have a Data.UUID.V4 that
generates random UUIDs slightly more cleanly, but Debian has an old version
of the library, so I do it slightly round-about.
2013-02-10 14:52:54 -04:00
Joey Hess
6a9dd21795 prep release 2013-02-07 12:59:02 -04:00
Joey Hess
57780cb3a4 Clean up direct mode cache and mapping info when dropping keys.
These files were left behind, and made getKeysPresent find keys that were
not present. It would be expensive to make getKeysPresent check that the
actual key files are present (it just lists the directories). But that's not
needed if we just clean up the stale cache and mapping files.

To handle systems that were in direct mode and got switched back with stale
direct mode files, made cleanObjectLoc remove all files in the key's directory.

git annex unused will still list keys that are gone but for which the stale
direct mode files exists. To deal with that, made dropunused remove the key's
directory even if the key does not seem to be present.
2013-02-07 08:28:40 -04:00
Joey Hess
b1de99c1d4 uninit, unannex --fast: If hard link creation fails, fall back to slow mode. 2013-02-06 14:02:18 -04:00
Joey Hess
547d7745fb pre-commit: Update direct mode mappings.
Making the pre-commit hook look at git diff-index to find changed direct
mode files and update the mappings works pretty well.

One case where it does not work is when a file is git annex added, and then
git rmed, and then this is committed. That's a no-op commit, so the hook
probably doesn't even run, and it certianly never notices that the file
was deleted, so the mapping will still have the original filename in it.

For this and other reasons, it's important that the mappings still be
treated as possibly inconsistent.

Also, the assistant now allows the pre-commit hook to run when in direct
mode, so the mappings also get updated there.
2013-02-06 12:44:19 -04:00
Joey Hess
af3a25ee03 Deal with stale mappings for deleted file in direct mode.
The most common way for a mapping to be stale is when a file was deleted,
or renamed. Nothing updates the mappings for deletions yet.
But they can also become stale in other ways. For example a file can
be modified.

So, the mapping is not trusted to be consistent. When we get a key,
only replace symlinks that still point to that key with its content.
When we drop a key, only put back symlinks for files that still have
the direct mode content.
2013-02-05 16:48:00 -04:00
Joey Hess
b19c2e6122 assistant: Fix location log when adding new file in direct mode. 2013-02-05 13:41:48 -04:00
Joey Hess
a8bb2749b2 assistant: Ignore .DS_Store on OSX. 2013-01-28 15:13:22 +11:00
Joey Hess
5cd152b8a9 annex.autocommit
New setting, can be used to disable autocommit of changed files by the
assistant, while it still does data syncing and other tasks.

Also wired into webapp UI
2013-01-27 22:43:05 +11:00
Joey Hess
d3d791c7e7 addurl --fast: Use curl, rather than haskell HTTP library, to support https. 2013-01-27 09:30:53 +11:00
Joey Hess
9ba8abffc6 depend on both wget and curl
wget is used due to having better progress output, but curl is used
in some cases where wget is not appropriate.
2013-01-27 08:48:16 +11:00
Joey Hess
20d927d530 Adjust debian package to only build-depend on DAV on architectures where it is available. 2013-01-27 08:07:22 +11:00
Joey Hess
76ddf9b6d3 webapp: Now allows restarting any threads that crash. 2013-01-26 17:09:33 +11:00
Joey Hess
1713ed95f7 use async to track and manage threads 2013-01-26 14:14:32 +11:00
Joey Hess
869ad4729e finalizing release 2013-01-24 13:33:21 +11:00
Joey Hess
b3e670f785 note 2013-01-21 04:21:42 -04:00
Joey Hess
6a067e5c28 manual and source repository groups 2013-01-21 04:18:46 -04:00
Joey Hess
672f8b5b83 fsck: Detect and fix consistency errors in direct mode mapping files. 2013-01-19 14:11:23 -04:00
Joey Hess
5c58e9c101 Avoid filename encoding errors when writing direct mode mappings. 2013-01-18 12:26:45 -04:00
Joey Hess
bbf0e74f72 Fix direct mode mapping code to always store direct mode filenames relative to the top of the repository, even when operating inside a subdirectory. 2013-01-18 12:20:08 -04:00
Joey Hess
49f4ba297c sync: Automatic merge conflict resolution now stages deleted files. 2013-01-17 21:19:00 -04:00
Joey Hess
a75946fc6f Depend on git 1.7.7.6 for --no-edit. Closes: #698399 2013-01-17 21:00:05 -04:00
Joey Hess
0214e0fb17 union merge bugfix
Union merges involving two or more repositories could sometimes result in
data from one repository getting lost. This could result in the location
log data becoming wrong, and fsck being needed to fix it.

NB: I audited for any other occurrences of this problem. There are other
places than union merge where multiple changes are fed into update-index
in a stream, but they all involve working copy files being staged, or their
deletion being staged, and in this case it's fine for the later changes
to override the earlier ones.
2013-01-16 21:31:06 -04:00
Joey Hess
88df952243 Deal with incompatability in gpg2, which caused prompts for encryption passphrases rather than using the supplied --passphrase-fd. 2013-01-16 15:27:46 -04:00
Joey Hess
13aaf69cdb webapp: Fix crash adding removable drive that has an annex directory in it that is not a git repository. 2013-01-15 16:43:44 -04:00
Joey Hess
d5cce8f262 wording 2013-01-15 14:48:13 -04:00
Joey Hess
e15cca7db8 webapp: Now has a page to view the log, accessed from the control menu. 2013-01-15 13:52:35 -04:00
Joey Hess
d7ca6fb856 webapp: Now always logs to .git/annex/daemon.log
It used to not log to daemon.log when a repository was first created, and
when starting the webapp. Now both do. Redirecting stdout and stderr to the
log is tricky when starting the webapp, because the web browser may want to
communicate with the user. (Either a console web browser, or web.browser = echo)
This is handled by restoring the original fds when running the browser.
2013-01-15 13:34:59 -04:00
Joey Hess
a707d69e77 webapp: Avoid an error if a transfer is stopped just as it finishes. Closes: #698184 2013-01-14 19:04:58 -04:00
Joey Hess
5a9f8acb99 webapp: More adjustments to longpoll code to deal with changes in variable quoting in different versions of shakespeare-js. 2013-01-14 18:35:33 -04:00
Joey Hess
31bbd0339f reword to avoid lintian false error 2013-01-14 16:11:08 -04:00
Joey Hess
757e5a219e releasing version 3.20130114 2013-01-14 16:10:25 -04:00
Joey Hess
f51ad2a00c assistant: Avoid committer crashing if a file is deleted at the wrong instant. 2013-01-14 15:02:13 -04:00
Joey Hess
0d2ac184b5 webapp: Avoid illegal characters in hostname when creating S3 or Glacier remote. 2013-01-14 12:54:29 -04:00
Joey Hess
85c564ea94 In direct mode, files with the same key are no longer hardlinked, as that would cause a surprising behavior if modifying one, where the other would also change. 2013-01-14 11:56:37 -04:00
Joey Hess
dbdfb5a8ec copyright update 2013-01-12 13:27:48 -04:00
Joey Hess
18a6935e42 safe recv-key in direct mode
Checks the key's size and checksum. This is sorta expensive, but it avoids
needing to add another round-trip to the protocol.
2013-01-11 16:03:45 -04:00
Joey Hess
2afe821440 update 2013-01-11 12:35:37 -04:00
Joey Hess
d22d06a84a assistant: Support new gvfs dbus names used in Gnome 3.6. (untested) 2013-01-10 15:06:08 -04:00
Joey Hess
c548a6a39c webapp: Adjust longpoll code to work with recent versions of shakespeare-js.
A while ago I added code to support recent versions of shakespeare-js,
(commit fe11b3a940). But it seems that resulted
in quoting of all strings inserted into javascript files, which means it's
now impossible to do the type of metaprogramming that longpolling.julius
relied on. I have found another way to accomplish the same thing without
needing to generate unique function names. Hopefully it's portable.

Opinion of shakespeare-js now at rock bottom. One of these days, this
needs to be redone to use Fay.
2013-01-09 23:47:24 -04:00
Joey Hess
6f7ae84650 webapp: Use IP address, rather than localhost
since some systems may have configuration problems or other issues that
prevent web browsers from connecting to the right localhost IP for the
webapp.

Tested on both ipv4 and ipv6 localhost. Url for the latter looks like:
http://[::1]:50676
2013-01-09 23:18:00 -04:00
Joey Hess
bc6a59e3c6 webapp: Repo switcher filters out repos that do not exist any more (or are on a drive that's not mounted). 2013-01-09 19:00:28 -04:00
Joey Hess
2e11a6013b drop: Suggest using git annex move when numcopies prevents dropping a file. 2013-01-09 18:53:59 -04:00
Joey Hess
1bc49b7158 Special remotes now all rollback storage of keys that get modified during the transfer, which can happen in direct mode. 2013-01-09 18:42:29 -04:00
Joey Hess
174867b846 blog for yesterday 2013-01-08 12:41:09 -04:00
Joey Hess
a06340a111 releasing version 3.20130107 2013-01-07 13:24:31 -04:00
Joey Hess
248090064d addurl in direct mode 2013-01-06 17:34:44 -04:00
Joey Hess
858ad6783b add works in direct mode
Also, changed sync to no longer automatically add files in direct mode.
That was only necessary before because add didn't work.
2013-01-06 17:24:22 -04:00
Joey Hess
9d3e571f77 support fsck in direct mode 2013-01-06 15:42:49 -04:00
Joey Hess
909f67443f Fix transferring files to special remotes in direct mode. 2013-01-06 14:29:01 -04:00
Joey Hess
e457be7631 direct: Avoid hardlinking symlinks that point to the same content when the content is not present. 2013-01-06 13:57:53 -04:00
Joey Hess
13d2fffb2d assistant: Detect when system is not configured with a user name, and set environment to prevent git from failing. 2013-01-06 13:34:08 -04:00
Joey Hess
b68eee625f More commands work in direct mode repositories: find, whereis, move, copy, drop, log.
These started working, for free, once lookupFile supported direct mode.

yay!!
2013-01-05 17:17:04 -04:00
Joey Hess
1cdf2b923d assistant: Make expensive transfer scan work fully in direct mode.
The expensive scan uses lookupFile, but in direct mode, that doesn't work
for files that are present. So the scan was not finding things that are
present that need to be uploaded. (It did find things not present that
needed to be downloaded.)

Now lookupFile also works in direct mode. Note that it still prefers
symlinks on disk to info committed to git, in direct mode. This is
necessary to make things like Assistant.Threads.Watcher.onAddSymlink
work correctly, when given a new symlink not yet checked into git (or
replacing a file checked into git).
2013-01-05 15:57:53 -04:00
Joey Hess
bf1981f60e committer: Fix a file handle leak. 2013-01-05 13:42:31 -04:00
Joey Hess
bad9b6761d restart UI
Browser behavior is not ideal; a new tab is opened on restart.
Browsers won't let me redirect to a file:// so I cannot use the old tab.
2013-01-03 18:50:30 -04:00
Joey Hess
de2e287133 webapp: Add UI to stop assistant.
Would like to also have restart UI, but that's rather harder to do,
seems it'd need to start another copy of the webapp, and redirect the
browser to its new url, but running two assistants in the same repo at
the same time isn't good.
2013-01-03 15:24:21 -04:00
Joey Hess
c3ae2d2e30 releasing version 3.20130102 2013-01-02 15:25:06 -04:00