webapp: Added --port option, and annex.port config

The getSocket comment that mentioned using ":port"
in the hostname seems to have been incorrect or be out of date.
After all, the bug report came when the user first tried doing that,
and it didn't work.

Sponsored-by: the NIH-funded NICEMAN (ReproNim TR&D3) project
This commit is contained in:
Joey Hess 2024-01-25 14:08:36 -04:00
parent d54f2ccae1
commit 8e9ee31621
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
13 changed files with 90 additions and 29 deletions

View file

@ -19,3 +19,5 @@ git-annex version: 10.20230126
[[!meta author=yoh]]
[[!tag projects/repronim]]
> [[done]] --[[Joey]]

View file

@ -0,0 +1,22 @@
[[!comment format=mdwn
username="joey"
subject="""comment 4"""
date="2024-01-25T17:29:08Z"
content="""
I found an old todo about the same thing,
[[todo/Make_webapp_port_configurable]].
The idea there was, they were using docker and wanted to open only a
specific port selected for the webapp. So basically the same kind of thing.
I think that this should be a separate --port option, to avoid needing to
try to parse something that may be an ipv6 address or hostname, or
whatever.
I don't think that using --port should prevent the webapp from needing
the `?auth=' part of the url, as output when using --listen.
Probably it does not make sense to use --port without also using --listen,
but if the user does use it, I don't think --port needs to output the url
the way --listen does.
"""]]

View file

@ -0,0 +1,7 @@
[[!comment format=mdwn
username="joey"
subject="""comment 5"""
date="2024-01-25T18:06:15Z"
content="""
Implemented --port.
"""]]

View file

@ -21,7 +21,8 @@ it opens a browser window.
* `--listen=address`
Useful for using the webapp on a remote computer. This makes the webapp
listen on the specified IP address.
listen on the specified IP address. (Or on the address that a specified
hostname resolves to.)
This disables running a local web browser, and outputs the url you
can use to open the webapp.
@ -29,6 +30,11 @@ it opens a browser window.
Set annex.listen in the git config to make the webapp always
listen on an IP address.
* `--port=number`
Use this option to specify a port for the webapp.
By default, the webapp picks an unused port.
* Also the [[git-annex-common-options]](1) can be used.
# USING HTTPS

View file

@ -2040,6 +2040,11 @@ Remotes are configured using these settings in `.git/config`.
The default is localhost. Can be either an IP address,
or a hostname that resolves to the desired address.
* `annex.port`
Configures which port address the webapp listens on.
The default is to pick an unused port.
# CONFIGURATION VIA .gitattributes
The key-value backend used when adding a new file to the annex can be

View file

@ -39,9 +39,4 @@ dependency versions: aws-0.20 bloomfilter-2.0.1.0 cryptonite-0.25 DAV-1.3.3 feed
### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
git annex seems awesome with the little bit of testing I've done. It seems like the perfect tool for what I want to accomplish. Thanks!
> I don't think this necessarily makes sense, but there is an active bug
> report about the same thing at
> [[bugs/webapp_--listen_port_is_not_used__63__]]
>
> So, closing this old todo to keep discussion in one place. [[done]]
> --[[Joey]]
> [[done]] via --port option --[[Joey]]