repos with username password

This commit is contained in:
2026-04-26 19:17:36 +02:00
parent dda00b70ac
commit 345aeaf353
6 changed files with 155 additions and 11 deletions

View File

@@ -201,6 +201,8 @@ def render_repository_index(
<form class="stack" method="post" action="/ui/repos">
<label>Git URL or local path <input name="url" required></label>
<label>Branch <input name="branch" value="main"></label>
<label>Username <input name="access_username" autocomplete="username" placeholder="Optional for private HTTP(S) repos"></label>
<label>Password or access token <input name="access_password" type="password" autocomplete="current-password" placeholder="Used for this Git operation only"></label>
<div class="actions">
<button type="submit">Register</button>
<span data-pending>Registering repository...</span>
@@ -410,12 +412,16 @@ def search_page(
def create_repository_from_form(
url: str = Form(...),
branch: str = Form("main"),
access_username: str = Form(""),
access_password: str = Form(""),
service: RegistryService = Depends(get_service),
):
try:
repository = service.register_repository(
url=url,
branch=branch or "main",
access_username=access_username or None,
access_password=access_password or None,
)
except (RuntimeError, ValueError) as exc:
return render_repository_index(