]> dgit.raspbian.org Git - git-annex.git/commitdiff
change default port to 9417
authorJoey Hess <joeyh@joeyh.name>
Tue, 23 Jul 2024 00:44:48 +0000 (20:44 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 23 Jul 2024 00:52:17 +0000 (20:52 -0400)
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.

Command/P2PHttp.hs
P2P/Http.hs
doc/git-annex-p2phttp.mdwn

index 5e0e8a172c2d6d08528e39cbb5fb572c780b8129..ce2470baa732034d0e40b964dcd4a4d9d8363a8a 100644 (file)
@@ -79,7 +79,7 @@ seek o = getAnnexWorkerPool $ \workerpool -> do
                        mkGetServerMode authenv o
                Warp.run (fromIntegral port) (p2pHttpApp st)
   where
-       port = fromMaybe 80 (portOption o)
+       port = fromMaybe defaultHttpProtocolPort (portOption o)
 
 mkGetServerMode :: M.Map Auth P2P.ServerMode -> Options -> GetServerMode
 mkGetServerMode _ o _ Nothing
index 9919822f0a12284eaeab29ce2a1f3adccbeeed02..ce1e1a44b254ece2d7ba26c5a570b1abde7e8df1 100644 (file)
@@ -43,6 +43,9 @@ import Control.Concurrent.Async
 import Control.Concurrent
 import System.IO.Unsafe
 
+defaultHttpProtocolPort :: Int
+defaultHttpProtocolPort = 9417 -- Git protocol is 9418
+
 type P2PHttpAPI
        =    "git-annex" :> SU :> PV3 :> "key" :> GetAPI
        :<|> "git-annex" :> SU :> PV2 :> "key" :> GetAPI
index 323ec7006a98904182c4ff3c2fa5a4a4fa160957..3c45c35d241f31365360f91d406014f79e208931 100644 (file)
@@ -16,22 +16,27 @@ As well as serving the git-annex HTTP API, this server provides a
 convenient way to download the content of any key, by using the path
 "/git-annex/$uuid/$key". For example:
 
-       $ curl http://localhost:8080/git-annex/f11773f0-11e1-45b2-9805-06db16768efe/key/SHA256E-s6--5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03
+       $ curl http://localhost:9417/git-annex/f11773f0-11e1-45b2-9805-06db16768efe/key/SHA256E-s6--5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03
        hello
 
 # OPTIONS
 
-* `--jobs=N`
+* `--jobs=N` `-JN`
 
-  Use this or annex.jobs must be set to configure the number of worker
+  This or annex.jobs must be set to configure the number of worker
   threads.
   
   Since the webserver itself uses one thread, this needs to be set to
   2 or more.
 
+  A good choice is one worker per CPU core: `--jobs=cpus`
+
 * `--port=N`
 
-  Port to listen on. Default is port 80.
+  Port to listen on. Default is port 9417.
+
+  It is not recommended to run this command as root in order to
+  use a low port like port 80.
 
 * `--authenv`
 
@@ -46,7 +51,7 @@ convenient way to download the content of any key, by using the path
   environment variables like 
   `GIT_ANNEX_P2PHTTP_PERMISSIONS_alice=readonly`. The value
   can be either "readonly" or "appendonly". When this is not set,
-  the default is to give the user full write access.
+  the default is to give the user full read+write+remove access.
 
 * `--authenv-http`
 
@@ -66,7 +71,8 @@ convenient way to download the content of any key, by using the path
 
 * `--wideopen`
 
-  Gives unauthenticated users full read+write access to the repository.
+  Gives unauthenticated users full read+write+remove access to the
+  repository.
 
   Please think carefully before enabling this option.