Commit graph

289 commits

Author SHA1 Message Date
Joey Hess
e59b0a1c88 first pass at alert buttons
They work fine. But I had to go to a lot of trouble to get Yesod to render
routes in a pure function. It may instead make more sense to have each
alert have an assocated IO action, and a single route that runs the IO
action of a given alert id. I just wish I'd realized that before the past
several hours of struggling with something Yesod really doesn't want to
allow.
2012-09-08 19:57:15 -04:00
Joey Hess
317ab14da2 add remote directory to pair request 2012-09-08 15:40:47 -04:00
Joey Hess
5401b9f249 filter out our own pairing requests
Due to being multicast, requests sent by one thread are received by the
listener in another thread.
2012-09-08 15:30:04 -04:00
Joey Hess
61ee1e1660 fix build without pairing support 2012-09-08 15:21:34 -04:00
Joey Hess
0f0c7f8d70 added pair listener thread 2012-09-08 15:07:44 -04:00
Joey Hess
3e070b947a don't pass .local hostname over the wire
The remote computer may not support mDNS. Instead, pass over the uname -a
hostname, and the IP address, and leave best hostname calculation to the
remote side.
2012-09-08 14:23:35 -04:00
Joey Hess
92b1f42730 fix fd leak
also, tested on ipv6.. doesn't work
2012-09-08 13:34:50 -04:00
Joey Hess
3dd4b4058f implement pair request broadcasts
Pair requests are sent on all network interfaces, and contain the best
available hostname to use to contact the host on that interface.

Added a pairing in progress page.

Revert "reduce some boilerplate using ghc extensions", because it caused
overlapping instances for Text.
2012-09-08 13:04:19 -04:00
Joey Hess
0c01348b65 pairing passphrase entry form, validation, etc
Actually 3 forms in one, this handles the initial passphrase entry, and the
confirmation, and also varys wording if the same user or a different user
is confirming.
2012-09-08 02:02:39 -04:00
Joey Hess
3bee6b3c74 yesod skelton and routes for pairing
yet more changes to pairing message data types
2012-09-08 00:27:27 -04:00
Joey Hess
92df8250fa broke out Verifiable to a utility library, and added a quickcheck test 2012-09-07 23:23:52 -04:00
Joey Hess
c12caf0a4e massively simplified the pairing protocol
Only 2 messages are needed to do pairing.

And added a nice Verifiable data type.
2012-09-07 22:58:14 -04:00
Joey Hess
c28b54c469 high-level pairing implementation
Roughed out a data type that models the whole pairing conversation,
and can be serialized to implement it. And a state machine to run
that conversation. Not yet hooked up to any transport such as multicast
UDP.
2012-09-07 18:04:06 -04:00
Joey Hess
a00f1d26bc display errors when any named thread crashes 2012-09-06 14:56:04 -04:00
Joey Hess
d11ded822c display alert for inotify/kqueue errors 2012-09-06 13:56:23 -04:00
Joey Hess
8a796cfa64 improve syncing support for special remotes
Avoid trying to git push/pull to special remotes, but still do transfer
scans of them, after git pull from any other remotes, so we know about
any values that have been placed on them.
2012-09-04 15:56:37 -04:00
Joey Hess
46fd6b54c7 rsync.net configurator tested and 100% working 2012-09-04 15:27:06 -04:00
Joey Hess
b584d96c13 rsync.net configurator display
Doesn't set up the repo yet.
2012-09-03 00:39:55 -04:00
Joey Hess
b6a91d7a4d defer setting up ssh public key until after confirmation 2012-09-02 20:43:32 -04:00
Joey Hess
014974a7da allow making encrypted rsync special remotes
wow, that was easy!
2012-09-02 17:32:24 -04:00
Joey Hess
9f403113dd make bare repo on server
I think this makes sense.. Unless the assistant is running on the server,
the repo won't be updated, so it might as well be bare.

Non-bare repos will be handled by the pairing configurator, later.
2012-09-02 15:30:32 -04:00
Joey Hess
97ce4d24cb adding ssh remote working
Rsync remote still needs work
2012-09-02 15:27:00 -04:00
Joey Hess
6623a51cf9 run sync in background 2012-09-02 15:20:03 -04:00
Joey Hess
e6f61e5ab9 factored out repository creation code and made more generic
for use by other configurators.. probably should be moved to a utility
module somewhere
2012-09-02 15:06:27 -04:00
Joey Hess
93f29997a9 reduce some boilerplate using ghc extensions 2012-09-02 02:07:15 -04:00
Joey Hess
837cd79e4f add ssh confirmation page
also broke out webapp types into a separate module
2012-09-02 00:49:25 -04:00
Joey Hess
53043999ac don't set up authorized_keys during probe 2012-09-01 21:10:40 -04:00
Joey Hess
32ab049f9c ssh connection testing and key setup 2012-09-01 20:37:35 -04:00
Joey Hess
54a492db5f UI for adding a ssh or rsync remote 2012-08-31 18:59:57 -04:00
Joey Hess
86fb1305dc split out local repo configurators 2012-08-31 15:17:12 -04:00
Joey Hess
38a292fd36 preserve bytesComplete when updating a transfer info
Avoids flicker to 0% when resuming a paused transfer.
2012-08-31 13:06:27 -04:00
Joey Hess
8335a7ff7a remove the TChan component from the data structure
The code to maintain that TChan in parallel with the list was buggy,
the two were not always the same. And all that TChan was needed for was
blocking on the next transfer, which can be accomplished just as well by
checking the size and retrying, thanks to STM.

Also, this is faster, and uses less memory. Total win.
2012-08-31 12:59:00 -04:00
Joey Hess
4004baafaf fix alterTransferInfo
don't want to stomp over fields other than the ones being changed
2012-08-31 12:14:16 -04:00
Joey Hess
34aeecb78a fix bug where resuming a transfer also started one queued transfer 2012-08-31 11:47:35 -04:00
Joey Hess
0e205184bb use only one level of exception handling for transfer slot 2012-08-29 21:28:59 -04:00
Joey Hess
ab6e1221ce bug 2012-08-29 18:25:28 -04:00
Joey Hess
5d5b6c8be2 fix repeated pause and resume of a transfer
I had an intuition that throwTo might be blocking because an exception was
caught and the exception handler was running. This seems to be the case,
and is avoided by using try. However, I can't really find anywhere in
throwTo's documentation that justifies this behavior.
2012-08-29 18:02:52 -04:00
Joey Hess
df2473a476 typoe 2012-08-29 17:32:41 -04:00
Joey Hess
8d32d54320 make start button work on queued transfers
When multiple downloads of a key are queued, it starts the first, but leaves the
other downloads in the queue. This ensures that we don't lose a queued
download if the one that got started failed.
2012-08-29 16:30:40 -04:00
Joey Hess
c21a9fe04a more generic 2012-08-29 15:56:47 -04:00
Joey Hess
0842e99637 forgot to update the tchan when dequeuing transfers 2012-08-29 15:46:42 -04:00
Joey Hess
a4fa31ffa1 remove debug print 2012-08-29 15:45:48 -04:00
Joey Hess
99525f8454 when canceling a transfer, also cancel all other downloads of the same key 2012-08-29 15:24:09 -04:00
Joey Hess
9e54355e8b pausing tweaks 2012-08-29 15:13:12 -04:00
Joey Hess
93037580b6 fix resume button
Change alterTransferInfo to not merge in old values, including
transferPaused.
2012-08-29 14:14:57 -04:00
Joey Hess
c59ba80b5b remove debug prints 2012-08-29 14:06:45 -04:00
Joey Hess
d2a4ffe669 got alterTransferInfo and updateTransferInfo mixed up
The poller only alters, to avoid re-adding transfers that get removed.
The watcher updates, to add new transfers.
2012-08-29 14:05:56 -04:00
Joey Hess
07de26ed7b simple transfer queue display cleanup
Don't display redundant queued downloads. The only problem with this is
that it reduces the total number of queued transfers the webapp displays.
2012-08-29 13:41:47 -04:00
Joey Hess
dd697cbd3e avoid failure alerts for temporary transfer failures
Since a failed transfer gets retried until it succeeds, no point in
bothering the user about them.
2012-08-29 13:00:21 -04:00
Joey Hess
0dd7860393 fix a transfers display glitch
Run code that pops off the next queued transfer and adds it to the active
transfer map within an allocated transfer slot, rather than before
allocating a slot. Fixes the transfers display, which had been displaying
the next transfer as a running transfer, while the previous transfer was
still running.
2012-08-28 17:17:09 -04:00