Commit graph

14 commits

Author SHA1 Message Date
Joey Hess
cd8918748b
implement DELEGATE with ephemeral=yes
Factored Annex.DisableRemote out of Command.DisableRemote
2026-04-08 15:21:20 -04:00
Joey Hess
92d7f7d61d
disableremote remove transfer log uuid directories 2026-04-08 14:16:21 -04:00
Joey Hess
aaabaec863
disableremote cred file removal
This includes removing the cred files used to accress P2P peers.

Note that the P2P auth token, which is used to auth incoming
connections, is stored in a cred file, but not one named with the uuid
of a remote, so it will not be deleted by this. Which is as intended,
see commit ddad858a81
2026-04-08 13:16:10 -04:00
Joey Hess
2ca0a141fe
disableremote remove transfer logs
Since the log of a currently running transfer cannot be removed,
it instead errors out when there are currently running transfers.
2026-04-08 12:59:37 -04:00
Joey Hess
70d8ac0baf
don't make disableremote ignore permissions errors 2026-04-08 12:41:33 -04:00
Joey Hess
c25c5dc10d
disableremote remove fsck and export db uuid dirs
For fsck, there is also a fsck state file. When annex.dbdir is set,
the fsck db is stored in that path, but the fsck state file remains
under .git/annex. So, disableremote separately deletes the fsck state
file.

Also, delete the fsck results log file.
2026-04-08 12:37:49 -04:00
Joey Hess
a5e5b316c6
fixme 2026-04-07 11:35:47 -04:00
Joey Hess
da5551b659
disableremote removal from content identifier database
Note that this could cause another process, that is running and getting
content from the remote, to start failing, since the content identifiers
get removed.
2026-04-07 11:26:38 -04:00
Joey Hess
6b0a24545a
disableremote removal from reposizes database
Much of the time, this removal will be pointless because the reposizes
database is updated from the git-annex branch, and so long as the
git-annex branch contains infortmation about the uuid, a later update
of the database will just add back the removed uuid to it.

But, for a private remote, this does clean out its uuid from the
reposizes database. Note that Command.DisableRemote was changed to clean
the private journal before removing from the database.

Note that the removal is done in a single transaction, which is why
it's ok to update the LiveSizeChanges, SizeChanges, and RecentChanges
tables. Other updates that involve those tables are also done
transactionally, and so a concurrent writer will leave things in a
consistent state.

Of course, another process that is running concurrently and updating the
database could lose the race, and so put back the uuid into the
database. I don't think that can be avoided.
2026-04-07 11:03:22 -04:00
Joey Hess
8031e42475
disableremote fsck and export database removal
There are per-uuid fsck and export databases, so disableremote can
remove them only when the remote being disabled is the only remote for
its uuid.

Lock files are also attempted to be removed, since they also contain the
uuid. This may fail on windows since the removal happens while the lock
file is still open? I have not checked. But it seems important to remove
the lock while it's locked, to avoid any race with some other process
that might open the database. If such a process got its own open lock
deleted out from underneath it, that could cause a problem if there is a
third process that also writes to the same database in a race.

Note that, in the case where disableremote is running, and at the same
time another process starts up and wants to write to these databases,
it's possible that it will re-create the database after disableremote
has deleted it. I don't think this can be avoided, and it's seems
very unlikely.
2026-04-07 10:43:05 -04:00
Joey Hess
ddad858a81
remove todo about deleting the P2P auth token
The P2P auth token is used to authenticate incoming connections
from a peer, and just because a p2p remote is being deleted does not
mean that the user intends to prevent that peer from continuing to use
the repository.
2026-04-07 10:09:24 -04:00
Joey Hess
ee625ccb74
disableremote private journal cleanup
Was able to reuse the code that drops dead remotes from the git-annex
branch to filter the remote uuid out of the private journal log files.
This makes me very happy about the design of that code.

Also there is a special case for --sameas to remove the config uuid from
remote.log.
2026-04-06 14:53:04 -04:00
Joey Hess
949931e6e2
basic disableremote
There are several things it ought to delete, but doesn't yet. Still,
it's usable as far as it goes.
2026-04-01 11:56:59 -04:00
Joey Hess
c3c6502024
stub in disableremote command 2026-04-01 10:10:05 -04:00