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.
This commit is contained in:
parent
53000cf06e
commit
06de2ad972
3 changed files with 16 additions and 7 deletions
|
@ -79,7 +79,7 @@ seek o = getAnnexWorkerPool $ \workerpool -> do
|
||||||
mkGetServerMode authenv o
|
mkGetServerMode authenv o
|
||||||
Warp.run (fromIntegral port) (p2pHttpApp st)
|
Warp.run (fromIntegral port) (p2pHttpApp st)
|
||||||
where
|
where
|
||||||
port = fromMaybe 80 (portOption o)
|
port = fromMaybe defaultHttpProtocolPort (portOption o)
|
||||||
|
|
||||||
mkGetServerMode :: M.Map Auth P2P.ServerMode -> Options -> GetServerMode
|
mkGetServerMode :: M.Map Auth P2P.ServerMode -> Options -> GetServerMode
|
||||||
mkGetServerMode _ o _ Nothing
|
mkGetServerMode _ o _ Nothing
|
||||||
|
|
|
@ -43,6 +43,9 @@ import Control.Concurrent.Async
|
||||||
import Control.Concurrent
|
import Control.Concurrent
|
||||||
import System.IO.Unsafe
|
import System.IO.Unsafe
|
||||||
|
|
||||||
|
defaultHttpProtocolPort :: Int
|
||||||
|
defaultHttpProtocolPort = 9417 -- Git protocol is 9418
|
||||||
|
|
||||||
type P2PHttpAPI
|
type P2PHttpAPI
|
||||||
= "git-annex" :> SU :> PV3 :> "key" :> GetAPI
|
= "git-annex" :> SU :> PV3 :> "key" :> GetAPI
|
||||||
:<|> "git-annex" :> SU :> PV2 :> "key" :> GetAPI
|
:<|> "git-annex" :> SU :> PV2 :> "key" :> GetAPI
|
||||||
|
|
|
@ -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
|
convenient way to download the content of any key, by using the path
|
||||||
"/git-annex/$uuid/$key". For example:
|
"/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
|
hello
|
||||||
|
|
||||||
# OPTIONS
|
# 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.
|
threads.
|
||||||
|
|
||||||
Since the webserver itself uses one thread, this needs to be set to
|
Since the webserver itself uses one thread, this needs to be set to
|
||||||
2 or more.
|
2 or more.
|
||||||
|
|
||||||
|
A good choice is one worker per CPU core: `--jobs=cpus`
|
||||||
|
|
||||||
* `--port=N`
|
* `--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`
|
* `--authenv`
|
||||||
|
|
||||||
|
@ -46,7 +51,7 @@ convenient way to download the content of any key, by using the path
|
||||||
environment variables like
|
environment variables like
|
||||||
`GIT_ANNEX_P2PHTTP_PERMISSIONS_alice=readonly`. The value
|
`GIT_ANNEX_P2PHTTP_PERMISSIONS_alice=readonly`. The value
|
||||||
can be either "readonly" or "appendonly". When this is not set,
|
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`
|
* `--authenv-http`
|
||||||
|
|
||||||
|
@ -66,7 +71,8 @@ convenient way to download the content of any key, by using the path
|
||||||
|
|
||||||
* `--wideopen`
|
* `--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.
|
Please think carefully before enabling this option.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue