]> dgit.raspbian.org Git - git-annex.git/log
git-annex.git
2 years agoavoid using cluster nodes in drop proof when dropping from cluster
Joey Hess [Sun, 23 Jun 2024 10:20:11 +0000 (06:20 -0400)]
avoid using cluster nodes in drop proof when dropping from cluster

This is obviously necessary in order for dropping from a cluster to be able to
drop from all nodes.

It also avoids violating numcopies when a cluster node is a special remote.
If it were used in the drop proof, nothing would prevent the cluster from
dropping from it.

2 years agoupdate
Joey Hess [Sun, 23 Jun 2024 09:26:45 +0000 (05:26 -0400)]
update

2 years agoMerge branch 'master' into proxy
Joey Hess [Thu, 20 Jun 2024 15:20:26 +0000 (11:20 -0400)]
Merge branch 'master' into proxy

2 years agomerge from proxy branch
Joey Hess [Thu, 20 Jun 2024 15:20:16 +0000 (11:20 -0400)]
merge from proxy branch

2 years agoMerge branch 'master' of ssh://git-annex.branchable.com
Joey Hess [Thu, 20 Jun 2024 15:03:30 +0000 (11:03 -0400)]
Merge branch 'master' of ssh://git-annex.branchable.com

2 years agoadd my distribits talk
Joey Hess [Thu, 20 Jun 2024 15:03:19 +0000 (11:03 -0400)]
add my distribits talk

2 years agoclusters documentation
Joey Hess [Thu, 20 Jun 2024 14:57:43 +0000 (10:57 -0400)]
clusters documentation

2 years agowording
Joey Hess [Thu, 20 Jun 2024 14:15:24 +0000 (10:15 -0400)]
wording

2 years agoworking PUT fanout to multiple remotes for clusters
Joey Hess [Thu, 20 Jun 2024 14:04:26 +0000 (10:04 -0400)]
working PUT fanout to multiple remotes for clusters

Still need to check for fencepost errors on resume when
different nodes have different amounts of data.

2 years agoAdded a comment
joris [Thu, 20 Jun 2024 09:58:05 +0000 (09:58 +0000)]
Added a comment

2 years ago(no commit message)
jochen.keil@38b1f86ab65128dab3e62e726403ceee4f5141bf [Wed, 19 Jun 2024 15:46:26 +0000 (15:46 +0000)]

2 years agomore on proxying special remotes
Joey Hess [Wed, 19 Jun 2024 10:40:19 +0000 (06:40 -0400)]
more on proxying special remotes

2 years agotowards a design for proxying to special remotes
Joey Hess [Wed, 19 Jun 2024 10:15:03 +0000 (06:15 -0400)]
towards a design for proxying to special remotes

2 years agobe quiet when reading cluster and proxy information at startup
Joey Hess [Wed, 19 Jun 2024 01:31:32 +0000 (21:31 -0400)]
be quiet when reading cluster and proxy information at startup

I had a transfer of 3 files fail like this:

git-annex: transferrer protocol error: "(recording state in git...)"

The remote had stalldetection enabled, although I didn't see it stall.
So git-annex transferrer would have been started up. I guess that
one of these new git-annex branch reads, that happens early, caused
that message due to perhaps an uncommitted git-annex branch change.

Since the transferrer speaks a protocol over stdout, it needs to be
prevented from outputting other messages to stdout. Interestingly,
startupAnnex is run after prepRunCommand, so if a command requests quiet
output it would already be quiet. But the transferrer does not, instead
it calls Annex.setOutput SerializedOutput in its start action.

2 years agoallow proxying to remotes that are nodes of clusters
Joey Hess [Tue, 18 Jun 2024 21:02:23 +0000 (17:02 -0400)]
allow proxying to remotes that are nodes of clusters

fixes reversion in ca08f3fcc2ca6d203fa1a323986f7f86bd342e3d

2 years agoP2P protocol version 2, adding SUCCESS-PLUS and ALREADY-HAVE-PLUS
Joey Hess [Tue, 18 Jun 2024 16:07:01 +0000 (12:07 -0400)]
P2P protocol version 2, adding SUCCESS-PLUS and ALREADY-HAVE-PLUS

Client side support for SUCCESS-PLUS and ALREADY-HAVE-PLUS
is complete, when a PUT stores to additional repositories
than the expected on, the location log is updated with the
additional UUIDs that contain the content.

Started implementing PUT fanout to multiple remotes for clusters.
It is untested, and I fear fencepost errors in the relative
offset calculations. And it is missing proxying for the protocol
after DATA.

2 years agoonly proxy to a remote when remote.name.annex-proxy is set
Joey Hess [Tue, 18 Jun 2024 15:43:10 +0000 (11:43 -0400)]
only proxy to a remote when remote.name.annex-proxy is set

Avoids someone writing to proxy.log and gaining access to remotes
of someone else's repository that they were not intended to be able
to proxy to.

2 years agoonly use a remote as a node when git configuration is set
Joey Hess [Tue, 18 Jun 2024 15:37:38 +0000 (11:37 -0400)]
only use a remote as a node when git configuration is set

Avoids someone writing to cluster.log and nominating remotes
of someone else's repository as a cluster.

2 years agocheckpresent support for clusters
Joey Hess [Tue, 18 Jun 2024 15:10:48 +0000 (11:10 -0400)]
checkpresent support for clusters

This assumes that the proxy for a cluster has up-to-date location
logs. If it didn't, it might proxy the checkpresent to a node that no
longer has the content, while some other node still does, and so
it would incorrectly appear that the cluster no longer contains the
content.

Since cluster UUIDs are not stored to location logs,
git-annex fsck --fast when claiming to fix a location log when
that occurred would not cause any problems. And presumably the location
tracking would later get sorted out.

At least usually, changes to the content of nodes goes via the proxy,
and it will update its location logs, so they will be accurate. However,
if there were multiple proxies to the same cluster, or nodes were
accessed directly (or via proxy to the node and not the cluster),
the proxy's location log could certainly be wrong.

(The location log access for GET has the same issues.)

2 years agoinitial, working support for getting from clusters
Joey Hess [Tue, 18 Jun 2024 15:01:10 +0000 (11:01 -0400)]
initial, working support for getting from clusters

Currently tends to put all the load on a single node, which will need to
be improved.

2 years agofactor out Annex.Proxy
Joey Hess [Tue, 18 Jun 2024 14:51:37 +0000 (10:51 -0400)]
factor out Annex.Proxy

2 years agorefactor cluster code into own module
Joey Hess [Tue, 18 Jun 2024 14:36:04 +0000 (10:36 -0400)]
refactor cluster code into own module

2 years agoupdate
Joey Hess [Tue, 18 Jun 2024 14:08:15 +0000 (10:08 -0400)]
update

2 years agooriginal report / question
yarikoptic [Tue, 18 Jun 2024 13:57:23 +0000 (13:57 +0000)]
original report / question

2 years agoProxySelector data type
Joey Hess [Mon, 17 Jun 2024 23:19:15 +0000 (19:19 -0400)]
ProxySelector data type

2 years agopreparing for cluster node selection
Joey Hess [Mon, 17 Jun 2024 19:51:10 +0000 (15:51 -0400)]
preparing for cluster node selection

Support selecting what remote to proxy for each top-level P2P protocol
message.

This only needs to be extended now to support fanout to multiple
nodes for PUT and REMOVE, and with a remote that fails for
LOCKCONTENT and UNLOCKCONTENT.

But a good first step would be to implement CHECKPRESENT and GET for
clusters. Both should select a node that actually does have the content.
That will allow a cluster to work for GET even when location tracking is
out of date.

2 years agostarted on git-annex-shell cluster support
Joey Hess [Mon, 17 Jun 2024 19:00:11 +0000 (15:00 -0400)]
started on git-annex-shell cluster support

Works down to P2P protocol.

The question now is, how to handle protocol version negotiation for
clusters? Connecting to each node to find their protocol versions and
using the lowest would be too expensive with a lot of nodes. So it seems
that the cluster needs to pick its own protocol version to use with the
client.

Then it can either negotiate that same version with the nodes when
it comes time to use them, or it can translate between multiple protocol
versions. That seems complicated. Thinking it would be ok to refuse to
use a node if it is not able to negotiate the same protocol version with
it as with the client. That will mean that sometimes need nodes to be
upgraded when upgrading the cluster's proxy. But protocol versions
rarely change.

2 years agowork toward supporting proxying to multiple remotes at once
Joey Hess [Mon, 17 Jun 2024 18:14:08 +0000 (14:14 -0400)]
work toward supporting proxying to multiple remotes at once

For eg, upload fanout.

Delay connecting to a remote until it's needed. When there are many
proxied remotes, it would not do for the proxy to connect to each of
them on startup; that could take a long time.

2 years agomore specific type
Joey Hess [Mon, 17 Jun 2024 17:04:40 +0000 (13:04 -0400)]
more specific type

2 years agoimprove types
Joey Hess [Mon, 17 Jun 2024 16:44:08 +0000 (12:44 -0400)]
improve types

2 years agoupdate
Joey Hess [Mon, 17 Jun 2024 13:31:44 +0000 (09:31 -0400)]
update

2 years agoMerge branch 'master' into proxy
Joey Hess [Mon, 17 Jun 2024 13:29:34 +0000 (09:29 -0400)]
Merge branch 'master' into proxy

2 years agotab complete special remotes
Joey Hess [Mon, 17 Jun 2024 13:26:03 +0000 (09:26 -0400)]
tab complete special remotes

An oversight..

And with the work in progress proxy and cluster, there
can be additional remotes that are not listed in .git/config, but are
available. Making those more discoverable is another big benefit of
this.

2 years agodon't count clusters as copies, continued
Joey Hess [Sun, 16 Jun 2024 19:07:48 +0000 (15:07 -0400)]
don't count clusters as copies, continued

Handled limitCopies, as well as everything using fromNumCopies and
fromMinCopies.

This should be everything, probably.

Note that, git-annex info displays a count of repositories, which still
includes cluster. I think that's ok. It would be possible to filter out
clusters there, but to the user they're pretty much just another
repository. The numcopies displayed by eg `git-annex info .` does not
include clusters.

2 years agoremove dead nodes when loading the cluster log
Joey Hess [Sun, 16 Jun 2024 18:35:07 +0000 (14:35 -0400)]
remove dead nodes when loading the cluster log

This is to avoid inserting a cluster uuid into the location log when
only dead nodes in the cluster contain the content of a key.

One reason why this is necessary is Remote.keyLocations, which excludes
dead repositories from the list. But there are probably many more.

Implementing this was challenging, because Logs.Location importing
Logs.Cluster which imports Logs.Trust which imports Remote.List resulted
in an import cycle through several other modules.

Resorted to making Logs.Location not import Logs.Cluster, and instead
it assumes that Annex.clusters gets populated when necessary before it's
called.

That's done in Annex.Startup, which is run by the git-annex command
(but not other commands) at early startup in initialized repos. Or,
is run after initialization.

Note that is Remote.Git, it is unable to import Annex.Startup, because
Remote.Git importing Logs.Cluster leads the the same import cycle.
So ensureInitialized is not passed annexStartup in there.

Other commands, like git-annex-shell currently don't run annexStartup
either.

So there are cases where Logs.Location will not see clusters. So it won't add
any cluster UUIDs when loading the log. That's ok, the only reason to do
that is to make display of where objects are located include clusters,
and to make commands like git-annex get --from treat keys as being located
in a cluster. git-annex-shell certainly does not do anything like that,
and I'm pretty sure Remote.Git (and callers to Remote.Git.onLocalRepo)
don't either.

2 years agodon't count clusters as copies
Joey Hess [Sun, 16 Jun 2024 15:34:35 +0000 (11:34 -0400)]
don't count clusters as copies

Since the cluster UUID is inserted into the location log when the
location log lists a node as containing content.

Also avoid trying to lock content on cluster remotes. The cluster nodes
are also proxied, so that content can be locked on individual nodes, and
locking content on a cluster as a whole probably won't be implemented.

And made git-annex whereis use numcopies machinery for displaying its
count, so it won't count cluster UUIDs redundantly to nodes.
Other commands, like git-annex info that also display numcopies
information already used the numcopies machinery.

There is more to be done, fromNumCopies is sometimes used to get a
number that is compared with a list of UUIDs. And limitCopies doesn't
use numcopies machinery.

2 years agoAdded a comment
beryllium@5bc3c32eb8156390f96e363e4ba38976567425ec [Sat, 15 Jun 2024 07:37:07 +0000 (07:37 +0000)]
Added a comment

2 years agoAdded a comment: Grafting? a special remote for tuned migration
beryllium@5bc3c32eb8156390f96e363e4ba38976567425ec [Sat, 15 Jun 2024 00:57:27 +0000 (00:57 +0000)]
Added a comment: Grafting? a special remote for tuned migration

2 years agoinsert cluster UUIDs when loading location logs, and omit when saving
Joey Hess [Fri, 14 Jun 2024 22:06:28 +0000 (18:06 -0400)]
insert cluster UUIDs when loading location logs, and omit when saving

Inline isClusterUUID for speed.

2 years agoremove Logs.Presence imports
Joey Hess [Fri, 14 Jun 2024 21:27:34 +0000 (17:27 -0400)]
remove Logs.Presence imports

When imported along with Logs.Location, it can be an unused import and
it won't warn, due to reexports. The point if this is really to show
that Logs.Presence is not widely used, outside Logs/

2 years agobroke out initcluster
Joey Hess [Fri, 14 Jun 2024 21:13:23 +0000 (17:13 -0400)]
broke out initcluster

One benefit of this is that a typo in annex-cluster-node config won't
init a new cluster.

Also it gets the cluster description set and is consistent with
initremote.

2 years agofogot to add
Joey Hess [Fri, 14 Jun 2024 20:37:17 +0000 (16:37 -0400)]
fogot to add

2 years agoupdate todo list for this month
Joey Hess [Fri, 14 Jun 2024 19:23:43 +0000 (15:23 -0400)]
update todo list for this month

whew that's gonna be a lot

2 years agoadd clusters to proxy log
Joey Hess [Fri, 14 Jun 2024 19:03:20 +0000 (15:03 -0400)]
add clusters to proxy log

Note that it's not defined what will happen if a cluster has the same
name as a remote that has proxying enabled.

2 years agoadd git-annex updatecluster command
Joey Hess [Fri, 14 Jun 2024 18:21:50 +0000 (14:21 -0400)]
add git-annex updatecluster command

Seems to work fine, making the right changes to the git-annex branch.

2 years agoadd git configs for clusters
Joey Hess [Fri, 14 Jun 2024 15:42:32 +0000 (11:42 -0400)]
add git configs for clusters

2 years agocache getClusters in Annex state
Joey Hess [Fri, 14 Jun 2024 15:16:01 +0000 (11:16 -0400)]
cache getClusters in Annex state

2 years agomake cluster UUIDs distinguishable from any other repository UUID
Joey Hess [Fri, 14 Jun 2024 15:07:31 +0000 (11:07 -0400)]
make cluster UUIDs distinguishable from any other repository UUID

A cluster UUID is a version 8 UUID, with first octets 'a' and 'c'.
The rest of the content will be random.

This avoids a class of attack where the UUID of a repository is used as
the UUID of a cluster, which will prevent git-annex from updating
location logs for that repository. I don't know why someone would want
to do that, but let's prevent it.

Also, isClusterUUID make it easy to filter out cluster UUIDs when
writing the location logs.

2 years agoupdate
Joey Hess [Thu, 13 Jun 2024 23:08:04 +0000 (19:08 -0400)]
update

2 years agounique uuid namespace for clusters
Joey Hess [Thu, 13 Jun 2024 21:56:53 +0000 (17:56 -0400)]
unique uuid namespace for clusters

2 years agoimplement cluster.log
Joey Hess [Thu, 13 Jun 2024 20:00:58 +0000 (16:00 -0400)]
implement cluster.log

Not used yet. (Or tested.)

I did consider making the log start with the uuid of the node, followed
by the cluster uuid (or uuids). That would perhaps mean a smaller write
to the git-annex branch when adding a node, but overall the log file
would be larger, and it will be read and cached near to startup on most
git-annex runs.

2 years agocomment
Joey Hess [Thu, 13 Jun 2024 18:30:32 +0000 (14:30 -0400)]
comment

2 years agocomment
Joey Hess [Thu, 13 Jun 2024 17:40:04 +0000 (13:40 -0400)]
comment

2 years agopartial reproducer
Joey Hess [Thu, 13 Jun 2024 17:03:38 +0000 (13:03 -0400)]
partial reproducer

2 years agoupdate
Joey Hess [Thu, 13 Jun 2024 15:44:39 +0000 (11:44 -0400)]
update

2 years agomore cluster thoughts
Joey Hess [Thu, 13 Jun 2024 14:48:31 +0000 (10:48 -0400)]
more cluster thoughts

2 years agoavoided the strangeness of the cluster's proxy location tracking being wrong
Joey Hess [Thu, 13 Jun 2024 14:34:19 +0000 (10:34 -0400)]
avoided the strangeness of the cluster's proxy location tracking being wrong

2 years agoupdate
Joey Hess [Thu, 13 Jun 2024 10:49:36 +0000 (06:49 -0400)]
update

2 years agoMerge branch 'master' of ssh://git-annex.branchable.com
Joey Hess [Thu, 13 Jun 2024 10:44:22 +0000 (06:44 -0400)]
Merge branch 'master' of ssh://git-annex.branchable.com

2 years agocopied over some changes from proxy branch
Joey Hess [Thu, 13 Jun 2024 10:43:59 +0000 (06:43 -0400)]
copied over some changes from proxy branch

2 years agomore thoughts on clusters
Joey Hess [Thu, 13 Jun 2024 10:41:42 +0000 (06:41 -0400)]
more thoughts on clusters

2 years agomore thoughts on clusters
Joey Hess [Wed, 12 Jun 2024 21:30:55 +0000 (17:30 -0400)]
more thoughts on clusters

2 years agoupdate
Joey Hess [Wed, 12 Jun 2024 19:21:23 +0000 (15:21 -0400)]
update

2 years agoavoid git syncing with instantiate proxied remotes
Joey Hess [Wed, 12 Jun 2024 19:10:03 +0000 (15:10 -0400)]
avoid git syncing with instantiate proxied remotes

These remotes have no url configured, so git pull and push will fail.
git-annex sync --content etc can still sync with them otherwise.

Also, avoid git syncing twice with the same url. This is for cases where
a proxied remote has been manually configured and so does have a url.
Or perhaps proxied remotes will get configured like that automatically
later.

2 years agodesigning clusters
Joey Hess [Wed, 12 Jun 2024 18:45:39 +0000 (14:45 -0400)]
designing clusters

2 years agoon cycles
Joey Hess [Wed, 12 Jun 2024 17:52:17 +0000 (13:52 -0400)]
on cycles

2 years agodash is legal in git remote names
Joey Hess [Wed, 12 Jun 2024 17:24:31 +0000 (13:24 -0400)]
dash is legal in git remote names

2 years agowhitespace
Joey Hess [Wed, 12 Jun 2024 17:24:25 +0000 (13:24 -0400)]
whitespace

2 years agoadd missing spaces
Joey Hess [Wed, 12 Jun 2024 17:06:14 +0000 (13:06 -0400)]
add missing spaces

2 years agoupdate
Joey Hess [Wed, 12 Jun 2024 16:37:14 +0000 (12:37 -0400)]
update

2 years agoupdates
Joey Hess [Wed, 12 Jun 2024 15:55:18 +0000 (11:55 -0400)]
updates

2 years agoinherit remote.name.annex-bare
Joey Hess [Wed, 12 Jun 2024 15:53:28 +0000 (11:53 -0400)]
inherit remote.name.annex-bare

Since a proxied remote uses the proxy's git repo, this makes sense.
Although I don't think this config is ever used when accessing a remote
via git-annex-shell.

2 years ago(no commit message)
m.risse@77eac2c22d673d5f10305c0bade738ad74055f92 [Wed, 12 Jun 2024 15:42:42 +0000 (15:42 +0000)]

2 years agoproxy updates location tracking information
Joey Hess [Wed, 12 Jun 2024 15:37:14 +0000 (11:37 -0400)]
proxy updates location tracking information

This does mean a redundant write to the git-annex branch. But,
it means that two clients can be using the same proxy, and after
one sends a file to a proxied remote, the other only has to pull from
the proxy to learn about that. It does not need to pull from every
remote behind the proxy (which it couldn't do anyway as git repo
access is not currently proxied).

Anyway, the overhead of this in git-annex branch writes is no worse
than eg, sending a file to a repository where git-annex assistant
is running, which then sends the file on to a remote, and updates
the git-annex branch then. Indeed, when the assistant also drops
the local copy, that results in more writes to the git-annex branch.

2 years agofinish P2P protocol proxying
Joey Hess [Wed, 12 Jun 2024 14:40:51 +0000 (10:40 -0400)]
finish P2P protocol proxying

CONNECT is not supported by git-annex-shell p2pstdio, but for proxying
to tor-annex remotes, it will be supported, and will make a git pull/push
to a proxied remote work the same with that as it does over ssh,
eg it accesses the proxy's git repo not the proxied remote's git repo.

The p2p protocol docs say that NOTIFYCHANGES is not always supported,
and it looked annoying to implement it for this, and it also seems
pretty useless, so make it be a protocol error. git-annex remotedaemon
will already be getting change notifications from the proxy's git repo,
so there's no need to get additional redundant change notifications for
proxied remotes that would be for changes to the same git repo.

2 years agoa local git remote cannot proxy
Joey Hess [Wed, 12 Jun 2024 14:16:04 +0000 (10:16 -0400)]
a local git remote cannot proxy

Prevent listProxied from listing anything when the proxy remote's
url is a local directory. Proxying does not work in that situation,
because the proxied remotes have the same url, and so git-annex-shell
is not run when accessing them, instead the proxy remote is accessed
directly.

I don't think there is any good way to support this. Even if the instantiated
git repos for the proxied remotes somehow used an url that caused it to use
git-annex-shell to access them, planned features like `git-annex copy --to
proxy` accepting a key and sending it on to nodes behind the proxy would not
work, since git-annex-shell is not used to access the proxy.

So it would need to use something to access the proxy that causes
git-annex-shell to be run and speaks P2P protocol over it. And we have that.
It's a ssh connection to localhost. Of course, it would be possible to
take ssh out of that mix, and swap in something that does not have
encryption overhead and authentication complications, but otherwise
behaves the same as ssh. And if the user wants to do that, GIT_SSH
does exist.

2 years agoproxying to local git remotes works
Joey Hess [Wed, 12 Jun 2024 14:10:11 +0000 (10:10 -0400)]
proxying to local git remotes works

This just happened to work correctly. Rather surprisingly. It turns out
that openP2PSshConnection actually also supports local git remotes,
by just running git-annex-shell with the path to the remote.

Renamed "P2PSsh" to "P2PShell" to make this clear.

2 years agoMerge branch 'master' into proxy
Joey Hess [Wed, 12 Jun 2024 13:49:30 +0000 (09:49 -0400)]
Merge branch 'master' into proxy

2 years agoexpanding on the exporttree=yes design
Joey Hess [Wed, 12 Jun 2024 13:43:59 +0000 (09:43 -0400)]
expanding on the exporttree=yes design

2 years agoTODO for log --key
yarikoptic [Wed, 12 Jun 2024 13:20:29 +0000 (13:20 +0000)]
TODO for log --key

2 years agominimized code duplication due to type checker limitations
Joey Hess [Tue, 11 Jun 2024 21:15:52 +0000 (17:15 -0400)]
minimized code duplication due to type checker limitations

2 years agoproxying PUT now working
Joey Hess [Tue, 11 Jun 2024 20:56:52 +0000 (16:56 -0400)]
proxying PUT now working

The almost identical code duplication between relayDATA and relayDATA'
is very annoying. I tried quite a few things to parameterize them, but
the type checker is having fits when I try it.

2 years agotodo
Joey Hess [Tue, 11 Jun 2024 19:15:58 +0000 (15:15 -0400)]
todo

2 years agoproxying GET now working
Joey Hess [Tue, 11 Jun 2024 19:01:14 +0000 (15:01 -0400)]
proxying GET now working

Memory use is small and constant; receiveBytes returns a lazy bytestring
and it does stream.

Comparing speed of a get of a 500 mb file over proxy from origin-origin,
vs from the same remote over a direct ssh:

joey@darkstar:~/tmp/bench/client>/usr/bin/time git-annex get bigfile --from origin-origin
get bigfile (from origin-origin...)
ok
(recording state in git...)
1.89user 0.67system 0:10.79elapsed 23%CPU (0avgtext+0avgdata 68716maxresident)k
0inputs+984320outputs (0major+10779minor)pagefaults 0swaps

joey@darkstar:~/tmp/bench/client>/usr/bin/time git-annex get bigfile --from direct-ssh
get bigfile (from direct-ssh...)
ok
1.79user 0.63system 0:10.49elapsed 23%CPU (0avgtext+0avgdata 65776maxresident)k
0inputs+1024312outputs (0major+9773minor)pagefaults 0swaps

So the proxy doesn't add much overhead even when run on the same machine as
the client and remote.

Still, piping receiveBytes into sendBytes like this does suggest that the proxy
could be made to use less CPU resouces by using `sendfile()`.

2 years agoset annex.uuid in proxy's Repo
Joey Hess [Tue, 11 Jun 2024 17:40:50 +0000 (13:40 -0400)]
set annex.uuid in proxy's Repo

getRepoUUID looks at that, and was seeing the annex.uuid of the proxy.
Which caused it to unncessarily set the git config. Probably also would
have led to other problems.

2 years agoAdded a comment
yarikoptic [Tue, 11 Jun 2024 17:36:51 +0000 (17:36 +0000)]
Added a comment

2 years agoupdate
Joey Hess [Tue, 11 Jun 2024 17:22:03 +0000 (13:22 -0400)]
update

2 years agoMerge branch 'master' of ssh://git-annex.branchable.com
Joey Hess [Tue, 11 Jun 2024 17:08:45 +0000 (13:08 -0400)]
Merge branch 'master' of ssh://git-annex.branchable.com

2 years agoMerge branch 'master' into proxy
Joey Hess [Tue, 11 Jun 2024 17:08:23 +0000 (13:08 -0400)]
Merge branch 'master' into proxy

2 years agoupdate
Joey Hess [Tue, 11 Jun 2024 17:07:53 +0000 (13:07 -0400)]
update

2 years agoenable proxying for git-annex-shell p2pstdio
Joey Hess [Tue, 11 Jun 2024 17:07:04 +0000 (13:07 -0400)]
enable proxying for git-annex-shell p2pstdio

2 years agoimplement simple proxy actions (untested)
Joey Hess [Tue, 11 Jun 2024 16:05:44 +0000 (12:05 -0400)]
implement simple proxy actions (untested)

Still need to implement GET and PUT, and will implement CONNECT and
NOTIFYCHANGE for completeness.

All ServerMode checking is implemented for the proxy.

There are two possible approaches for how the proxy sends back messages
from the remote to the client. One would be to have a background thread
that reads messages and sends them back as they come in. The other,
which is being implemented so far, is to read messages from the remote
at points where it is expected to send them, and relay back to the
client before reading the next message from the client. At this point,
I'm unsure which approach would be better.

The need for proxynoresponse to be used by UNLOCKCONTENT, for example,
builds protocol knowledge into the proxy which it would not need with
the other method.

2 years agofactor out helper functions
Joey Hess [Tue, 11 Jun 2024 16:04:58 +0000 (12:04 -0400)]
factor out helper functions

These will be used by the proxy, which needs to check the ServerMode in
the same way.

2 years agorefactoring
Joey Hess [Tue, 11 Jun 2024 14:20:11 +0000 (10:20 -0400)]
refactoring

2 years ago(no commit message)
NewUser [Tue, 11 Jun 2024 13:31:01 +0000 (13:31 +0000)]

2 years agostarted implementing git-annex-shell proxy
Joey Hess [Mon, 10 Jun 2024 22:01:36 +0000 (18:01 -0400)]
started implementing git-annex-shell proxy

So far, it negotiates VERSION with both parties. This is a tricky dance.

Untested.

2 years agocorrect AUTH-SUCCESS and AUTH-FAILURE
Joey Hess [Mon, 10 Jun 2024 19:05:41 +0000 (15:05 -0400)]
correct AUTH-SUCCESS and AUTH-FAILURE

It's AUTH_SUCCESS internally in git-annex, but the line based
serialization uses AUTH-SUCCESS.

2 years agoremove dead code
Joey Hess [Mon, 10 Jun 2024 18:28:58 +0000 (14:28 -0400)]
remove dead code

2 years agoMerge branch 'master' into proxy
Joey Hess [Mon, 10 Jun 2024 18:26:18 +0000 (14:26 -0400)]
Merge branch 'master' into proxy

2 years agogit-annex-shell: block relay requests
Joey Hess [Mon, 10 Jun 2024 17:53:28 +0000 (13:53 -0400)]
git-annex-shell: block relay requests

connRepo is only used when relaying git upload-pack and receive-pack.
That's only supposed to be used when git-annex-remotedaemon is serving
git-remote-tor-annex connections over tor. But, it was always set, and
so could be used in other places possibly.

Fixed by making connRepo optional in the P2P protocol interface.

In Command.EnableTor, it's not needed, because it only speaks the
protocol in order to check that it's able to connect back to itself via
the hidden service. So changed that to pass Nothing rather than the git
repo.

In Remote.Helper.Ssh, it's connecting to git-annex-shell p2pstdio,
so is making the requests, so will never need connRepo.

In git-annex-shell p2pstdio, it was accepting git upload-pack and
receive-pack requests over the P2P protocol, even though nothing sent
them. This is arguably a security hole, particularly if the user has
set environment variables like GIT_ANNEX_SHELL_LIMITED to prevent
git push/pull via git-annex-shell.