Simplify paskia init to rp-id/rp-name only
Only rp-id and rp-name are essential bootstrap-time configuration; origins and auth hosts are set up afterwards via the admin interface. Removes --origin/--auth-host from init and from devserver, and the now-unused hostutil.validate_auth_host.
This commit is contained in:
+1
-25
@@ -167,10 +167,6 @@ def ensure_database(rp_ids: list[str], args: argparse.Namespace, listen: str) ->
|
||||
cmd.extend(["--rp-id", rp_id])
|
||||
if args.rp_name:
|
||||
cmd.extend(["--rp-name", args.rp_name])
|
||||
if args.auth_host:
|
||||
cmd.extend(["--auth-host", args.auth_host])
|
||||
for origin in _split_multi(args.origins):
|
||||
cmd.extend(["--origin", origin])
|
||||
|
||||
logger.info(">>> paskia init (first run)")
|
||||
proc = subprocess.run(cmd, check=False) # noqa: S603
|
||||
@@ -199,24 +195,13 @@ async def run_devserver(args: argparse.Namespace, remaining: list[str]) -> None:
|
||||
os.environ["PASKIA_VITE_URL"] = viteurl
|
||||
os.environ["PASKIA_BACKEND_URL"] = backurl
|
||||
os.environ["PASKIA_DEV"] = "1"
|
||||
if args.auth_host:
|
||||
os.environ["PASKIA_AUTH_HOST"] = args.auth_host
|
||||
|
||||
async with ProcessGroup() as pg:
|
||||
# Start Caddy first if requested (needs to bind ports)
|
||||
if args.caddy:
|
||||
caddy_origins = []
|
||||
if args.auth_host:
|
||||
auth_host = args.auth_host
|
||||
if "://" not in auth_host:
|
||||
auth_host = f"https://{auth_host}"
|
||||
caddy_origins.append(auth_host)
|
||||
for rp_id in rp_ids:
|
||||
caddy_origins.append(f"https://{rp_id}")
|
||||
for origin in _split_multi(args.origins):
|
||||
if "://" not in origin:
|
||||
origin = f"https://{origin}"
|
||||
caddy_origins.append(origin)
|
||||
seen: set = set()
|
||||
caddy_origins = [x for x in caddy_origins if not (x in seen or seen.add(x))]
|
||||
caddy_proc = await run_caddy(caddy_origins, viteurl, backurl)
|
||||
@@ -251,20 +236,11 @@ def main():
|
||||
"--rp-id",
|
||||
action="append",
|
||||
help="Relying Party ID(s) for first-run bootstrap (default: localhost). "
|
||||
"Repeatable and comma-separated; the bootstrap name/host options apply to the first.",
|
||||
"Repeatable and comma-separated.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--rp-name", help="Relying Party name of the first domain (bootstrap only)"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--origin",
|
||||
action="append",
|
||||
dest="origins",
|
||||
help="Allowed origin(s), bootstrap only",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--auth-host", help="Dedicated auth host for the first domain (bootstrap only)"
|
||||
)
|
||||
args, remaining = parser.parse_known_args()
|
||||
|
||||
with suppress(KeyboardInterrupt):
|
||||
|
||||
Reference in New Issue
Block a user