aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-08-27 08:57:08 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-08-27 08:57:08 -0400
commitceb53836b59c9464865d13de38d73b65b388c4e2 (patch)
tree822cd178ab5a9bac2b2b139e225e4f7fc42476c1
parent373c2b890dc41d2e6b0803ea90c4cdb1d14d8d98 (diff)
downloadgrokmirror-ceb53836b59c9464865d13de38d73b65b388c4e2.tar.gz
Don't force url to contain hostname
If we force the url= entry to contain the hostname, his makes it look extra busy on the wwwlisting page. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--grokmirror/pi_indexer.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/grokmirror/pi_indexer.py b/grokmirror/pi_indexer.py
index eff5e7b..0acd402 100644
--- a/grokmirror/pi_indexer.py
+++ b/grokmirror/pi_indexer.py
@@ -102,8 +102,11 @@ def init_pi_inbox(gdir: str, pdir: str, opts) -> bool:
if origins:
# Okay, let's process it
# Generate a config entry
- local_host = opts.local_host.rstrip('/')
- local_url = f'{local_host}/{inboxname}/'
+ if opts.local_toplevel:
+ local_toplevel = opts.local_toplevel.rstrip('/')
+ local_url = f'{local_toplevel}/{inboxname}'
+ else:
+ local_url = inboxname
extraopts = list()
description = None
newsgroup = None
@@ -136,7 +139,8 @@ def init_pi_inbox(gdir: str, pdir: str, opts) -> bool:
break
extraopts.append(('boost', str(boostval)))
- if opt not in {'infourl', 'listid'}:
+ # Can add other options later
+ if opt not in {'listid'}:
continue
extraopts.append((opt, val))
except ValueError:
@@ -326,9 +330,8 @@ def command():
sp = ap.add_subparsers(help='sub-command help', dest='subcmd')
sp_init = sp.add_parser('init', help='Run public-inbox-init+index on repositories passed via stdin')
- sp_init.add_argument('--local-hostname', dest='local_host',
- default='http://localhost/',
- help='URL of the local mirror toplevel')
+ sp_init.add_argument('--local-toplevel', dest='local_toplevel', default='',
+ help='URL of the local mirror toplevel (omit if serving from /)')
sp_init.add_argument('--origin-hostname', dest='origin_host',
default='https://lore.kernel.org/',
help='URL of the origin toplevel serving config files')