Commit graph

34907 commits

Author SHA1 Message Date
Joey Hess
cf7e6835ca
comment 2024-10-22 13:54:54 -04:00
Joey Hess
6a78f245ad
comment 2024-10-22 13:36:31 -04:00
Joey Hess
8ef0c7836a
remove warnings about tuning being experimental 2024-10-22 13:27:25 -04:00
Joey Hess
f54c5260e4
followup and close 2024-10-22 13:25:46 -04:00
Joey Hess
6396926375
close old xmpp bug 2024-10-22 13:19:04 -04:00
Joey Hess
027a9f0849
Merge branch 'master' of ssh://git-annex.branchable.com 2024-10-22 13:04:37 -04:00
Joey Hess
a0f1fbb613
pondering 2024-10-22 11:37:43 -04:00
Joey Hess
ed679f2a51
add missing space 2024-10-22 11:12:12 -04:00
Joey Hess
7dde035ac8
planning 2024-10-22 11:09:47 -04:00
matrss
e0227d1d28 Added a comment 2024-10-22 14:44:10 +00:00
matrss
d33e4c8435 Added a comment: Re: rclone remote config in special remote 2024-10-22 14:13:53 +00:00
Joey Hess
8baccda98f
Merge branch 'master' into streamproxy 2024-10-22 09:49:28 -04:00
Joey Hess
3bbad88314
response 2024-10-21 19:25:42 -04:00
Joey Hess
9270b8d180
Merge branch 'master' of ssh://git-annex.branchable.com 2024-10-21 16:04:47 -04:00
Joey Hess
bdf3a4747f
adjust: Allow any order of options when combining --hide-missing with options like --unlock.
optparse-applicative made this hard, the naive implementation this had
before didn't let --hide-missing come after --unlock. And just adding
additional <|> with --hide-missing coming after --unlock didn't work
either. So need to get some options and then combine them.
2024-10-21 16:03:39 -04:00
Joey Hess
4c1b3ca6bb
comment 2024-10-21 15:07:19 -04:00
Joey Hess
371360a9bb
response 2024-10-21 15:03:55 -04:00
matrss
49a57bf25f Added a comment 2024-10-21 16:32:18 +00:00
Joey Hess
66e1b66fad
comment 2024-10-21 12:08:56 -04:00
Joey Hess
378e878d1e
comment 2024-10-21 11:39:27 -04:00
Joey Hess
028b4a9203
comment 2024-10-21 11:32:02 -04:00
Joey Hess
952442fdc4
comment 2024-10-21 11:24:50 -04:00
Joey Hess
98ad05a07b
Merge branch 'master' of ssh://git-annex.branchable.com 2024-10-21 10:41:51 -04:00
Joey Hess
5ce388cd94
response 2024-10-21 10:40:51 -04:00
git-annex@3fb6b72405b924a12d8319f01d0fdb908a3c551e
c45822852c 2024-10-21 14:14:18 +00:00
git-annex@3fb6b72405b924a12d8319f01d0fdb908a3c551e
3953b880e9 2024-10-21 14:12:31 +00:00
Joey Hess
b8d6b7c848
Merge branch 'master' of ssh://git-annex.branchable.com 2024-10-21 10:03:32 -04:00
Joey Hess
de138c642b
p2phttp: Allow unauthenticated users to lock content by default
* p2phttp: Allow unauthenticated users to lock content by default.
* p2phttp: Added --unauth-nolocking option to prevent unauthenticated
  users from locking content.

The rationalle for this is that locking is not really a write operation, so
makes sense to allow in a repository that only allows read-only access. Not
supporting locking in that situation will prevent the user from dropping
content from a special remote they control in cases where the other copy of
the content is on the p2phttp server.

Also, when p2phttp is configured to also allow authenticated access,
lockcontent was resulting in a password prompt for users who had no way to
authenticate. And there is no good way to distinguish between the two types
of users client side.

--unauth-nolocking anticipates that this might be abused, and seems better
than disabling unauthenticated access entirely if a server is being
attacked. It may be that rate limiting locking by IP address or similar
would be an effective measure in such a situation. Or just limiting the
number of locks by anonymous users that can be live at any one time. Since
the impact of such an DOS attempt is limited to preventing dropping content
from the server, it seems not a very appealing target anyway.
2024-10-21 10:02:12 -04:00
git-annex@3fb6b72405b924a12d8319f01d0fdb908a3c551e
60c123dd9d 2024-10-21 13:10:52 +00:00
Joey Hess
87c88025d1
comment 2024-10-19 17:53:28 -04:00
Joey Hess
e9771ff45c
tag 2024-10-19 17:13:26 -04:00
Joey Hess
82e91b380a
add GITMANIFEST to parseKeyVariety
git-remote-annex: Fix bug that prevented using it with external special
remotes, leading to protocol error messages involving "GITMANIFEST".
2024-10-19 17:12:23 -04:00
Joey Hess
bbc2d47782
comment 2024-10-19 16:43:35 -04:00
yarikoptic
93534b6a94 Added a comment 2024-10-18 20:31:21 +00:00
matrss
4a810c56b2 Added a comment 2024-10-18 16:56:46 +00:00
Joey Hess
a3d1d3bcb6
comments 2024-10-18 12:04:48 -04:00
Joey Hess
d5b59ecba9
clarification on 403 2024-10-18 11:05:41 -04:00
Joey Hess
69f8c41492
comment 2024-10-18 10:28:49 -04:00
Joey Hess
8c7047fc77
Merge branch 'master' into streamproxy 2024-10-18 10:18:59 -04:00
Joey Hess
14336b9660
fix build on windows
Utility.OpenFile is posix only
2024-10-18 10:17:07 -04:00
yarikoptic
fbe4530989 Added a comment 2024-10-18 13:10:38 +00:00
yarikoptic
0784ca2339 report on windows FTBFS 2024-10-18 13:04:49 +00:00
yarikoptic
899f822270 Added a comment 2024-10-18 13:01:25 +00:00
Joey Hess
fdf8b64d7e
comment 2024-10-17 20:56:31 -04:00
yarikoptic
facde8bf85 removed 2024-10-17 22:08:32 +00:00
yarikoptic
e584ad6f24 Added a comment 2024-10-17 21:44:50 +00:00
yarikoptic
96f8297ab1 Added a comment 2024-10-17 21:44:17 +00:00
yarikoptic
2b42622727 Added a comment 2024-10-17 21:44:04 +00:00
mih
b642800d8c Tag with project ID 2024-10-17 20:26:08 +00:00
yarikoptic
f0a86bc223 Added a comment 2024-10-17 18:37:57 +00:00
Joey Hess
3c75e333c5
comment 2024-10-17 14:05:20 -04:00
yarikoptic
c738920d19 Added a comment 2024-10-17 17:04:07 +00:00
Joey Hess
0629219617
p2phttp combining unauth and auth options
p2phttp: Support serving unauthenticated users while requesting
authentication for operations that need it. Eg, --unauth-readonly can be
combined with --authenv.

Drop locking currently needs authentication so it will prompt for that.
That still needs to be addressed somehow.
2024-10-17 11:10:28 -04:00
Joey Hess
4e59828f4c
response 2024-10-17 10:10:26 -04:00
Joey Hess
b387ffef33
Merge branch 'master' of ssh://git-annex.branchable.com 2024-10-17 10:06:25 -04:00
Joey Hess
5adc54eaba
add IMN7 to projects and tag a relevant issue 2024-10-17 10:06:08 -04:00
Joey Hess
6c65de35f0
comment 2024-10-17 10:01:31 -04:00
yarikoptic
1fa10f9427 question about Servant 2024-10-17 13:57:43 +00:00
matrss
8f96f7b16b 2024-10-17 09:39:56 +00:00
matrss
20e7201e5d Make VURL a proper list item 2024-10-17 09:18:04 +00:00
yarikoptic
48fb37388f initial report on divergence in behavior on ACL 2024-10-16 19:13:08 +00:00
yarikoptic
460cdb5623 Added a comment 2024-10-16 18:58:04 +00:00
yarikoptic
bcc243f5b1 make freeze/thaw relative paths 2024-10-16 18:51:45 +00:00
yarikoptic
d672a4ccfe initial report on freeze/thaw exit code ignorance 2024-10-16 18:34:06 +00:00
matrss
287212c40e Added a comment 2024-10-16 12:09:02 +00:00
Joey Hess
c4dfeaef53
streaming uploads 2024-10-15 16:02:19 -04:00
Joey Hess
d9b4bf4224
added retrieveKeyFileInOrder and ORDERED to external special remote protocol
I anticipate lots of external special remote programs will neglect
implementing this. Still, it's the right thing to do to assume that some
of them may write files out of order. Probably most external special
remotes will not be used with a proxy. When someone is using one with a
proxy, they can always get it fixed to send ORDERED.
2024-10-15 15:40:14 -04:00
Joey Hess
835283b862
stream through proxy when using fileRetriever
The problem was that when the proxy requests a key be retrieved to its
own temp file, fileRetriever was retriving it to the key's temp
location, and then moving it at the end, which broke streaming.

So, plumb through the path where the key is being retrieved to.
2024-10-15 14:29:06 -04:00
yarikoptic
6eb32468bc initial report on not all files being saved 2024-10-15 18:15:16 +00:00
Joey Hess
c6c794a27d
comment 2024-10-15 13:27:27 -04:00
Joey Hess
c1b0348307
Merge branch 'master' of ssh://git-annex.branchable.com 2024-10-15 12:27:01 -04:00
Joey Hess
930c078965
working in streamproxy branch 2024-10-15 12:26:53 -04:00
Joey Hess
edaed18e4c
Sped up proxied downloads from special remotes, by streaming
Currently works for special remotes that don't use fileRetriever. Ones that
do will download to another filename and rename it into place, defeating
the streaming.

This actually benchmarks slightly slower when getting a large file from
a fast proxied special remote. However, when the proxied special remote
is slow, it will be a big win.
2024-10-15 12:25:15 -04:00
Joey Hess
57ac43e4f1
update 2024-10-15 10:31:42 -04:00
matrss
c7155366c7 Added a comment 2024-10-14 12:21:54 +00:00
matrss
872d97eb2a Added a comment 2024-10-14 12:01:40 +00:00
Joey Hess
9574e3a8bb
Merge branch 'master' of ssh://git-annex.branchable.com 2024-10-12 10:57:52 -04:00
Spencer
10b6539174 Added a comment: [FR] Remote Settings for All Clones 2024-10-09 23:10:17 +00:00
annex@9cc004f218c318a28099ff2645959be0fcbc6d94
4404cc4c8b Added a comment: Support for importtree 2024-10-09 06:42:40 +00:00
matrss
4e5dcf4207 2024-10-08 07:22:39 +00:00
Spencer
cbc88a878f 2024-10-08 03:58:55 +00:00
Spencer
0f7ba08e95 2024-10-08 03:31:05 +00:00
Spencer
d87d725b1c Correction: rclonelayout=lower is not synonymous with the directory remote, directory is. 2024-10-07 21:26:42 +00:00
Spencer
ae09255c05 Added a comment: How to Clone? 2024-10-07 20:00:24 +00:00
Joey Hess
8baa43ee12
tried a blind alley on streaming special remote download via proxy
This didn't work. In case I want to revisit, here's what I tried.

diff --git a/Annex/Proxy.hs b/Annex/Proxy.hs
index 48222872c1..e4e526d3dd 100644
--- a/Annex/Proxy.hs
+++ b/Annex/Proxy.hs
@@ -26,16 +26,21 @@ import Logs.UUID
 import Logs.Location
 import Utility.Tmp.Dir
 import Utility.Metered
+import Utility.ThreadScheduler
+import Utility.OpenFd
 import Git.Types
 import qualified Database.Export as Export

 import Control.Concurrent.STM
 import Control.Concurrent.Async
+import Control.Concurrent.MVar
 import qualified Data.ByteString as B
+import qualified Data.ByteString as BS
 import qualified Data.ByteString.Lazy as L
 import qualified System.FilePath.ByteString as P
 import qualified Data.Map as M
 import qualified Data.Set as S
+import System.IO.Unsafe

 proxyRemoteSide :: ProtocolVersion -> Bypass -> Remote -> Annex RemoteSide
 proxyRemoteSide clientmaxversion bypass r
@@ -240,21 +245,99 @@ proxySpecialRemote protoversion r ihdl ohdl owaitv oclosedv mexportdb = go
 		writeVerifyChunk iv h b
 		storetofile iv h (n - fromIntegral (B.length b)) bs

-	proxyget offset af k = withproxytmpfile k $ \tmpfile -> do
+	proxyget offset af k = withproxytmpfile k $ \tmpfile ->
+		let retrieve = tryNonAsync $ Remote.retrieveKeyFile r k af
+			(fromRawFilePath tmpfile) nullMeterUpdate vc
+		in case fromKey keySize k of
+			Just size | size > 0 -> do
+				cancelv <- liftIO newEmptyMVar
+				donev <- liftIO newEmptyMVar
+				streamer <- liftIO $ async $
+					streamdata offset tmpfile size cancelv donev
+				retrieve >>= \case
+					Right _ -> liftIO $ do
+						putMVar donev ()
+						wait streamer
+					Left err -> liftIO $ do
+						putMVar cancelv ()
+						wait streamer
+						propagateerror err
+			_ -> retrieve >>= \case
+				Right _ -> liftIO $ senddata offset tmpfile
+				Left err -> liftIO $ propagateerror err
+	  where
 		-- Don't verify the content from the remote,
 		-- because the client will do its own verification.
-		let vc = Remote.NoVerify
-		tryNonAsync (Remote.retrieveKeyFile r k af (fromRawFilePath tmpfile) nullMeterUpdate vc) >>= \case
-			Right _ -> liftIO $ senddata offset tmpfile
-			Left err -> liftIO $ propagateerror err
+		vc = Remote.NoVerify

+	streamdata (Offset offset) f size cancelv donev = do
+		sendlen offset size
+		waitforfile
+		x <- tryNonAsync $ do
+			fd <- openFdWithMode f ReadOnly Nothing defaultFileFlags
+			h <- fdToHandle fd
+			hSeek h AbsoluteSeek offset
+			senddata' h (getcontents size)
+		case x of
+			Left err -> do
+				throwM err
+			Right res -> return res
+	  where
+		-- The file doesn't exist at the start.
+		-- Wait for some data to be written to it as well,
+		-- in case an empty file is first created and then
+		-- overwritten. When there is an offset, wait for
+		-- the file to get that large. Note that this is not used
+		-- when the size is 0.
+		waitforfile = tryNonAsync (fromIntegral <$> getFileSize f) >>= \case
+			Right sz | sz > 0 && sz >= offset -> return ()
+			_ -> ifM (isEmptyMVar cancelv)
+				( do
+					threadDelaySeconds (Seconds 1)
+					waitforfile
+				, do
+					return ()
+				)
+
+		getcontents n h = unsafeInterleaveIO $ do
+			isdone <- isEmptyMVar donev <||> isEmptyMVar cancelv
+			c <- BS.hGet h defaultChunkSize
+			let n' = n - fromIntegral (BS.length c)
+			let c' = L.fromChunks [BS.take (fromIntegral n) c]
+			if BS.null c
+				then if isdone
+					then return mempty
+					else do
+						-- Wait for more data to be
+						-- written to the file.
+						threadDelaySeconds (Seconds 1)
+						getcontents n h
+				else if n' > 0
+					then do
+						-- unsafeInterleaveIO causes
+						-- this to be deferred until
+						-- data is read from the lazy
+						-- ByteString.
+						cs <- getcontents n' h
+						return $ L.append c' cs
+					else return c'
+
 	senddata (Offset offset) f = do
 		size <- fromIntegral <$> getFileSize f
-		let n = max 0 (size - offset)
-		sendmessage $ DATA (Len n)
+		sendlen offset size
 		withBinaryFile (fromRawFilePath f) ReadMode $ \h -> do
 			hSeek h AbsoluteSeek offset
-			sendbs =<< L.hGetContents h
+			senddata' h L.hGetContents
+
+	senddata' h getcontents = do
+			sendbs =<< getcontents h
 			-- Important to keep the handle open until
 			-- the client responds. The bytestring
 			-- could still be lazily streaming out to
@@ -272,6 +355,11 @@ proxySpecialRemote protoversion r ihdl ohdl owaitv oclosedv mexportdb = go
 				Just FAILURE -> return ()
 				Just _ -> giveup "protocol error"
 				Nothing -> return ()
+
+	sendlen offset size = do
+		let n = max 0 (size - offset)
+		sendmessage $ DATA (Len n)
+

 {- Check if this repository can proxy for a specified remote uuid,
  - and if so enable proxying for it. -}
2024-10-07 15:12:09 -04:00
Spencer
cb196337f4 additional question of spaces in URL 2024-10-07 19:10:19 +00:00
Spencer
abd56608cf 2024-10-07 19:02:17 +00:00
matrss
f650627b23 2024-10-07 14:40:19 +00:00
matrss
b0a6301cde Added a comment 2024-10-07 14:12:23 +00:00
Joey Hess
b501d23f9b
update 2024-10-07 10:06:12 -04:00
matrss
6b6ec39997 2024-10-07 13:59:56 +00:00
sng@353ca358075d9aa328f60a5439a3cee10f8301fe
b57677251b Added a comment 2024-10-06 21:42:13 +00:00
matrss
19f7b0e7d4 2024-10-02 15:07:54 +00:00
matrss
470bd1f441 2024-10-02 14:51:58 +00:00
matrss
4a794ce0ba 2024-10-02 14:42:37 +00:00
yarikoptic
13580427c8 filing an issue on yt-dlp not used for some reason 2024-10-01 21:01:40 +00:00
Joey Hess
f3403e9691
add news item for git-annex 10.20240927 2024-09-30 19:16:06 -04:00
brendan.ward@a2e11ad27f6b2fa2c556aea6811496e0d95dd0da
191e84d82a 2024-09-30 20:54:14 +00:00
mike@2d6d71f56ce2a992244350475251df87c26fe351
7b5dda33e0 removed 2024-09-27 12:18:59 +00:00
mike@2d6d71f56ce2a992244350475251df87c26fe351
39e02528f0 Added a comment: corruption using git-annex-remote-rclone 2024-09-27 12:18:41 +00:00