git-annex.git
2 years agoprogress meter for p2phttp storeKey
Joey Hess [Wed, 24 Jul 2024 16:14:56 +0000 (12:14 -0400)]
progress meter for p2phttp storeKey

2 years agoRemote.Git storeKey works with annex+http urls
Joey Hess [Wed, 24 Jul 2024 16:05:10 +0000 (12:05 -0400)]
Remote.Git storeKey works with annex+http urls

Does not yet update progress meter.

2 years agoupdate
Joey Hess [Wed, 24 Jul 2024 15:13:37 +0000 (11:13 -0400)]
update

2 years agomore generic clientGet
Joey Hess [Wed, 24 Jul 2024 15:10:19 +0000 (11:10 -0400)]
more generic clientGet

2 years agofix slowloris timeout in hashing resume of download of large file
Joey Hess [Wed, 24 Jul 2024 15:03:59 +0000 (11:03 -0400)]
fix slowloris timeout in hashing resume of download of large file

Hash the data that is already present in the file before connecting to
the http server.

2 years agofix meter display on resume
Joey Hess [Wed, 24 Jul 2024 14:28:48 +0000 (10:28 -0400)]
fix meter display on resume

It still needs to be offset, otherwise on resume from 80% it will
display 1%..20%.

Seems that this bug must have affected P2P.Annex as well where it runs
this code, but apparently it didn't affect it in a very user-visible
way. Maybe the transfer log file was updated incorrectly?

2 years agoRemote.Git retrieveKeyFile works with annex+http urls
Joey Hess [Wed, 24 Jul 2024 13:45:14 +0000 (09:45 -0400)]
Remote.Git retrieveKeyFile works with annex+http urls

This includes a bugfix to serveGet, it hung at the end.

2 years agofactor out resumeVerifyFromOffset
Joey Hess [Wed, 24 Jul 2024 13:08:17 +0000 (09:08 -0400)]
factor out resumeVerifyFromOffset

2 years agoavoid needing ifdefs when using P2P.Http.Client
Joey Hess [Wed, 24 Jul 2024 12:33:59 +0000 (08:33 -0400)]
avoid needing ifdefs when using P2P.Http.Client

2 years agoMerge branch 'master' into httpproto
Joey Hess [Wed, 24 Jul 2024 01:17:06 +0000 (21:17 -0400)]
Merge branch 'master' into httpproto

2 years agoPropagate --force to git-annex transferrer
Joey Hess [Wed, 24 Jul 2024 01:16:56 +0000 (21:16 -0400)]
Propagate --force to git-annex transferrer

And other child processes.

2 years agobug
Joey Hess [Wed, 24 Jul 2024 01:02:31 +0000 (21:02 -0400)]
bug

2 years agocache credentials for p2phttp in memory
Joey Hess [Tue, 23 Jul 2024 22:45:02 +0000 (18:45 -0400)]
cache credentials for p2phttp in memory

2 years agoremove uuid from url when calling git credential
Joey Hess [Tue, 23 Jul 2024 22:21:01 +0000 (18:21 -0400)]
remove uuid from url when calling git credential

The user doesn't want to see a uuid in the prompt.

Also, when a http server is proxying, multiple remotes will have the
same base url, and the same password will work for them all.

2 years agouse git credential when p2phttp needs auth
Joey Hess [Tue, 23 Jul 2024 22:11:15 +0000 (18:11 -0400)]
use git credential when p2phttp needs auth

2 years agop2phttp support https
Joey Hess [Tue, 23 Jul 2024 19:37:36 +0000 (15:37 -0400)]
p2phttp support https

2 years agoadd --bind option and listen to both ipv4 and ipv6 by default
Joey Hess [Tue, 23 Jul 2024 19:19:56 +0000 (15:19 -0400)]
add --bind option and listen to both ipv4 and ipv6 by default

2 years agoprotocol version fallback on 404
Joey Hess [Tue, 23 Jul 2024 18:58:49 +0000 (14:58 -0400)]
protocol version fallback on 404

and prettified errors

2 years agoRemote.Git checkpresent works with annex+http urls.
Joey Hess [Tue, 23 Jul 2024 18:31:32 +0000 (14:31 -0400)]
Remote.Git checkpresent works with annex+http urls.

2 years agofactor out http server and client into own modules
Joey Hess [Tue, 23 Jul 2024 18:12:03 +0000 (14:12 -0400)]
factor out http server and client into own modules

To avoid a cycle when Remote.Git uses the client.

2 years agostarted wiring p2phttp into Remote.Git
Joey Hess [Tue, 23 Jul 2024 17:53:10 +0000 (13:53 -0400)]
started wiring p2phttp into Remote.Git

but we have a cycle, ugh

2 years agorequire a valid uuid at the end of an annex+http url
Joey Hess [Tue, 23 Jul 2024 16:30:27 +0000 (12:30 -0400)]
require a valid uuid at the end of an annex+http url

2 years agoadd remoteAnnexP2PHttpUrl to RemoveGitConfig
Joey Hess [Tue, 23 Jul 2024 13:55:14 +0000 (09:55 -0400)]
add remoteAnnexP2PHttpUrl to RemoveGitConfig

This is always parsed, when building without servant, a Baseurl is not
generated, and users of it will need to fail.

2 years agostarting support for remote.name.annexUrl set to annex+http
Joey Hess [Tue, 23 Jul 2024 13:12:21 +0000 (09:12 -0400)]
starting support for remote.name.annexUrl set to annex+http

In this case, Remote.Git should not use that url for all access to
the repository. It will only be used for annex operations, which isn't
done yet.

2 years agoupdate servant build flag
Joey Hess [Tue, 23 Jul 2024 12:53:56 +0000 (08:53 -0400)]
update servant build flag

make it work when building w/o assistant

2 years agoupdate
Joey Hess [Tue, 23 Jul 2024 12:53:52 +0000 (08:53 -0400)]
update

2 years agoannex+http urls
Joey Hess [Tue, 23 Jul 2024 12:42:33 +0000 (08:42 -0400)]
annex+http urls

2 years agorefactor
Joey Hess [Tue, 23 Jul 2024 01:19:32 +0000 (21:19 -0400)]
refactor

2 years agofix build
Joey Hess [Tue, 23 Jul 2024 01:19:20 +0000 (21:19 -0400)]
fix build

2 years agoupdate
Joey Hess [Tue, 23 Jul 2024 00:59:45 +0000 (20:59 -0400)]
update

2 years agochange default port to 9417
Joey Hess [Tue, 23 Jul 2024 00:44:48 +0000 (20:44 -0400)]
change default port to 9417

Port 80 would need root, not a good idea, so pick something that might
work by default.

9418 is git protocol's port. 9419 is used by something, but nothing
known uses 9417, so it's as good a default as any.

2 years agoexit cleanly on eg, failure to bind socket
Joey Hess [Tue, 23 Jul 2024 00:37:37 +0000 (20:37 -0400)]
exit cleanly on eg, failure to bind socket

2 years agoP2P protocol is finalized
Joey Hess [Mon, 22 Jul 2024 23:50:08 +0000 (19:50 -0400)]
P2P protocol is finalized

2 years agomake keeplocked client UUID optional
Joey Hess [Mon, 22 Jul 2024 23:48:54 +0000 (19:48 -0400)]
make keeplocked client UUID optional

It's not used, but it makes the protocol simpler if this parameter can
always be sent.

2 years agolocking over http basically working
Joey Hess [Mon, 22 Jul 2024 23:44:26 +0000 (19:44 -0400)]
locking over http basically working

2 years agomake serveKeepLocked check auth just to be safe
Joey Hess [Mon, 22 Jul 2024 23:15:52 +0000 (19:15 -0400)]
make serveKeepLocked check auth just to be safe

2 years agoimplement clientLockContent
Joey Hess [Mon, 22 Jul 2024 22:55:12 +0000 (18:55 -0400)]
implement clientLockContent

2 years agoimplemented serveLockContent (untested)
Joey Hess [Mon, 22 Jul 2024 21:36:56 +0000 (17:36 -0400)]
implemented serveLockContent (untested)

2 years agoimprove clientKeepLocked
Joey Hess [Mon, 22 Jul 2024 20:56:44 +0000 (16:56 -0400)]
improve clientKeepLocked

2 years agovariable name
Joey Hess [Mon, 22 Jul 2024 20:50:11 +0000 (16:50 -0400)]
variable name

2 years agorefactor
Joey Hess [Mon, 22 Jul 2024 20:49:05 +0000 (16:49 -0400)]
refactor

2 years agofinished clientGet validity checking
Joey Hess [Mon, 22 Jul 2024 20:31:39 +0000 (16:31 -0400)]
finished clientGet validity checking

2 years agoimprove clientGet types
Joey Hess [Mon, 22 Jul 2024 20:23:08 +0000 (16:23 -0400)]
improve clientGet types

2 years agofix TMVar left full crash affecting servePutOffset
Joey Hess [Mon, 22 Jul 2024 19:48:46 +0000 (15:48 -0400)]
fix TMVar left full crash affecting servePutOffset

Problem is that whatever is reading from the TMVar may not have read
from it yet before the client writes the next thing to it.

2 years agoimplemented servePutOffset and clientPutOffset
Joey Hess [Mon, 22 Jul 2024 19:02:08 +0000 (15:02 -0400)]
implemented servePutOffset and clientPutOffset

But, it's buggy: the server hangs without processing the VALIDITY,
and I can't seem to work out why. As far as I can see, storefile
is getting as far as running the validitycheck, which is supposed to
read that, but never does.

This is especially strange because what seems like the same protocol
doesn't hang when servePut runs it. This made me think that it needed
to use inAnnexWorker to be more like servePut, but that didn't help.

Another small problem with this is that it does create an empty
.git/annex/tmp/ file for the key. Since this will usually be used in
combination with servePut, that doesn't seem worth worrying about much.

2 years agofix crash in servePut when client sends from too high offset
Joey Hess [Mon, 22 Jul 2024 17:12:15 +0000 (13:12 -0400)]
fix crash in servePut when client sends from too high offset

Have to consume all the content from the client, but force an Invalid
result, so it will just get discarded.

2 years agoclientPut seeking to offset
Joey Hess [Mon, 22 Jul 2024 16:50:21 +0000 (12:50 -0400)]
clientPut seeking to offset

2 years agoavoid padding in servePut
Joey Hess [Mon, 22 Jul 2024 16:30:30 +0000 (12:30 -0400)]
avoid padding in servePut

This means that when the client sends a truncated data to indicate
invalidity, DATA is not passed the full expected data. That leaves the
P2P connection in a state where it cannot be reused. While so far, they
are not reused, they will be later when proxies are supported. So, have
to close the P2P connection in this situation.

2 years agoavoid padding in clientPut
Joey Hess [Mon, 22 Jul 2024 15:47:24 +0000 (11:47 -0400)]
avoid padding in clientPut

Instead truncate when necessary to indicate invalid content was sent.
Very similar to how serveGet handles it.

2 years agofix releasing of p2p connection
Joey Hess [Mon, 22 Jul 2024 15:26:22 +0000 (11:26 -0400)]
fix releasing of p2p connection

2 years agoavoid padding content in serveGet
Joey Hess [Mon, 22 Jul 2024 15:19:52 +0000 (11:19 -0400)]
avoid padding content in serveGet

Always truncate instead. The padding risked something not noticing the
content was bad and getting a file that was corrupted in a novel way
with the padding "X" at the end. A truncated file is better.

2 years agoservePut and clientPut implementation
Joey Hess [Mon, 22 Jul 2024 14:20:18 +0000 (10:20 -0400)]
servePut and clientPut implementation

Made the data-length header required even for v0. This simplifies the
implementation, and doesn't preclude extra verification being done for
v0.

The connectionWaitVar is an ugly hack. In servePut, nothing waits
on the waitvar, and I could not find a good way to make anything wait on
it.

2 years agoAdded a comment: git-annex for managing music
adehnert [Sun, 21 Jul 2024 19:08:45 +0000 (19:08 +0000)]
Added a comment: git-annex for managing music

2 years ago(no commit message)
adehnert [Sun, 21 Jul 2024 18:17:25 +0000 (18:17 +0000)]

2 years ago(no commit message)
adehnert [Sun, 21 Jul 2024 18:17:11 +0000 (18:17 +0000)]

2 years ago(no commit message)
adehnert [Sun, 21 Jul 2024 18:15:11 +0000 (18:15 +0000)]

2 years ago(no commit message)
adehnert [Sun, 21 Jul 2024 18:14:28 +0000 (18:14 +0000)]

2 years ago(no commit message)
adehnert [Sun, 21 Jul 2024 18:14:03 +0000 (18:14 +0000)]

2 years agoAdded a comment
m.risse@77eac2c22d673d5f10305c0bade738ad74055f92 [Sun, 21 Jul 2024 12:38:12 +0000 (12:38 +0000)]
Added a comment

2 years agoAdded a comment: `git annex sync --ff-only`
adehnert [Sun, 21 Jul 2024 01:04:44 +0000 (01:04 +0000)]
Added a comment: `git annex sync --ff-only`

2 years agoAdded a comment: Also Serveo.net
nobodyinperson [Fri, 19 Jul 2024 15:21:19 +0000 (15:21 +0000)]
Added a comment: Also Serveo.net

2 years agoAdded a comment
kdm9 [Fri, 19 Jul 2024 13:11:05 +0000 (13:11 +0000)]
Added a comment

2 years ago(no commit message)
m.risse@77eac2c22d673d5f10305c0bade738ad74055f92 [Fri, 19 Jul 2024 12:12:56 +0000 (12:12 +0000)]

2 years agoAdded a comment
m.risse@77eac2c22d673d5f10305c0bade738ad74055f92 [Fri, 19 Jul 2024 08:26:31 +0000 (08:26 +0000)]
Added a comment

2 years agoAdded a comment
m.risse@77eac2c22d673d5f10305c0bade738ad74055f92 [Wed, 17 Jul 2024 14:07:32 +0000 (14:07 +0000)]
Added a comment

2 years agoreporting FTBFS on windows
yarikoptic [Tue, 16 Jul 2024 15:58:50 +0000 (15:58 +0000)]
reporting FTBFS on windows

2 years ago(no commit message)
m.risse@77eac2c22d673d5f10305c0bade738ad74055f92 [Tue, 16 Jul 2024 15:42:54 +0000 (15:42 +0000)]

2 years ago(no commit message)
mih [Tue, 16 Jul 2024 15:02:46 +0000 (15:02 +0000)]

2 years agoAdded a comment
m.risse@77eac2c22d673d5f10305c0bade738ad74055f92 [Tue, 16 Jul 2024 09:21:54 +0000 (09:21 +0000)]
Added a comment

2 years agoAdded a comment
nobodyinperson [Mon, 15 Jul 2024 18:32:36 +0000 (18:32 +0000)]
Added a comment

2 years agoAdded a comment
m.risse@77eac2c22d673d5f10305c0bade738ad74055f92 [Mon, 15 Jul 2024 15:18:28 +0000 (15:18 +0000)]
Added a comment

2 years ago(no commit message)
m.risse@77eac2c22d673d5f10305c0bade738ad74055f92 [Mon, 15 Jul 2024 14:57:26 +0000 (14:57 +0000)]

2 years agoAdded a comment
xentac [Fri, 12 Jul 2024 23:49:33 +0000 (23:49 +0000)]
Added a comment

2 years ago(no commit message)
xentac [Fri, 12 Jul 2024 23:37:36 +0000 (23:37 +0000)]

2 years ago(no commit message)
ashton@37fa3fec6d2eef022a3491c85362a34141fbf0db [Fri, 12 Jul 2024 08:11:56 +0000 (08:11 +0000)]

2 years ago(no commit message)
ashton@37fa3fec6d2eef022a3491c85362a34141fbf0db [Fri, 12 Jul 2024 08:11:30 +0000 (08:11 +0000)]

2 years ago(no commit message)
ashton@37fa3fec6d2eef022a3491c85362a34141fbf0db [Fri, 12 Jul 2024 08:08:22 +0000 (08:08 +0000)]

2 years agoonly base64 non-utf8
Joey Hess [Thu, 11 Jul 2024 19:47:16 +0000 (15:47 -0400)]
only base64 non-utf8

2 years agoupdate deps
Joey Hess [Thu, 11 Jul 2024 18:51:45 +0000 (14:51 -0400)]
update deps

2 years agouse worker pool in withLocalP2PConnections
Joey Hess [Thu, 11 Jul 2024 18:37:52 +0000 (14:37 -0400)]
use worker pool in withLocalP2PConnections

This allows multiple clients to be handled at the same time.

2 years agoswitch HTTP P2P protocol to base64url
Joey Hess [Thu, 11 Jul 2024 16:31:41 +0000 (12:31 -0400)]
switch HTTP P2P protocol to base64url

Base64 can include '/', and with UUIDs and keys both used in routes,
the encoding needs to avoid that. Use base64url everywhere in the HTTP
protocol for consistency.

2 years agoroughed in servePut
Joey Hess [Thu, 11 Jul 2024 16:20:07 +0000 (12:20 -0400)]
roughed in servePut

2 years agooops, 2 datalength headers for put route
Joey Hess [Thu, 11 Jul 2024 16:12:33 +0000 (12:12 -0400)]
oops, 2 datalength headers for put route

2 years agouse DataLength
Joey Hess [Thu, 11 Jul 2024 15:57:55 +0000 (11:57 -0400)]
use DataLength

2 years agosimplify
Joey Hess [Thu, 11 Jul 2024 15:50:44 +0000 (11:50 -0400)]
simplify

2 years agoserveGet invalidation
Joey Hess [Thu, 11 Jul 2024 15:42:32 +0000 (11:42 -0400)]
serveGet invalidation

2 years agoimplement generic get server
Joey Hess [Thu, 11 Jul 2024 15:26:03 +0000 (11:26 -0400)]
implement generic get server

2 years agomove serveruuid into routes
Joey Hess [Thu, 11 Jul 2024 15:19:20 +0000 (11:19 -0400)]
move serveruuid into routes

In particular the generic get route needs it, so that when a single http
server is serving multiple repositories, it knows what repository to
use.

2 years agofix serveGet early handle close
Joey Hess [Thu, 11 Jul 2024 13:55:17 +0000 (09:55 -0400)]
fix serveGet early handle close

Needed that waitv after all..

2 years agofix annexworker shutdown on early client disconnect
Joey Hess [Thu, 11 Jul 2024 13:15:52 +0000 (09:15 -0400)]
fix annexworker shutdown on early client disconnect

2 years agocleanup
Joey Hess [Thu, 11 Jul 2024 11:56:55 +0000 (07:56 -0400)]
cleanup

2 years agofix serveGet hang
Joey Hess [Thu, 11 Jul 2024 11:46:52 +0000 (07:46 -0400)]
fix serveGet hang

This came down to SendBytes waiting on the waitv. Nothing ever filled
it.

Only Annex.Proxy needs the waitv, and it handles filling it. So make it
optional.

2 years ago(no commit message)
benjamin.poldrack@d09ccff6d42dd20277610b59867cf7462927b8e3 [Thu, 11 Jul 2024 07:47:27 +0000 (07:47 +0000)]

2 years ago(no commit message)
benjamin.poldrack@d09ccff6d42dd20277610b59867cf7462927b8e3 [Thu, 11 Jul 2024 07:23:30 +0000 (07:23 +0000)]

2 years agoa little progress on serveGet hang
Joey Hess [Wed, 10 Jul 2024 21:48:48 +0000 (17:48 -0400)]
a little progress on serveGet hang

Now it gets to the validity checker, but it seems it never runs it.

2 years agoupdate
Joey Hess [Wed, 10 Jul 2024 20:10:08 +0000 (16:10 -0400)]
update

2 years agoimplemented serveGet and clientGet
Joey Hess [Wed, 10 Jul 2024 20:06:39 +0000 (16:06 -0400)]
implemented serveGet and clientGet

Both are only at bare proof of concept stage. Still need to deal with
signaling validity and invalidity, and checking it.

And there's a bad bug: After -JN*2 requests, another request hangs!

So, I think it's failing to free up the Annex worker and end of request
lifetime.

Perhaps I need to use this:

https://docs.servant.dev/en/stable/cookbook/managed-resource/ManagedResource.html

2 years agoadd Annex worker pool to P2PHttp
Joey Hess [Wed, 10 Jul 2024 16:19:47 +0000 (12:19 -0400)]
add Annex worker pool to P2PHttp

This will be needed for get and store, since those need to run Annex
actions.

withLocalP2PConnections will also probably use it.

2 years agoimplement gettimestamp
Joey Hess [Wed, 10 Jul 2024 14:23:10 +0000 (10:23 -0400)]
implement gettimestamp

2 years agoimplement remove-before
Joey Hess [Wed, 10 Jul 2024 14:03:26 +0000 (10:03 -0400)]
implement remove-before

The reason to use removeBeforeRemoteEndTime is twofold.

First, removeBefore sends two protocol commands. Currently, the HTTP
protocol runner only supports sending a single command per invocation.

Secondly, the http server gets a monotonic timestamp from the client. So
translating back to a POSIXTime would be annoying.

The timestamp flow with a proxy will be:

- client gets timestamp, which gets the monotonic timestamp from the
  proxied remote via the proxy. The timestamp is currently not
  proxied when there is a single proxy.
- client calls remove-before
- http server calls removeBeforeRemoteEndTime which sends REMOVE-BEFORE
  to the proxied remote.