From 82349dbe31d30e338c810278333f4f6b586117eb Mon Sep 17 00:00:00 2001 From: X9 Dev Date: Thu, 16 Apr 2026 11:28:28 +0200 Subject: [PATCH] Add install command box and fix Forgejo API proxy on landing page - nginx.conf: add /forgejo-api/ proxy location to xetup-forgejo:3000 - index.html: add install command box (irm xetup.x9.cz/get.ps1 | iex) with one-click copy button; remove broken API token from JS - get.ps1: PowerShell installer that fetches latest release URL and runs exe Co-Authored-By: Claude Sonnet 4.6 --- web/get.ps1 | 18 ++++++++++++++++++ web/index.html | 48 +++++++++++++++++++++++++++++++++++++++++++----- web/nginx.conf | 10 ++++++++++ 3 files changed, 71 insertions(+), 5 deletions(-) create mode 100644 web/get.ps1 diff --git a/web/get.ps1 b/web/get.ps1 new file mode 100644 index 0000000..0a0d8c1 --- /dev/null +++ b/web/get.ps1 @@ -0,0 +1,18 @@ +# xetup installer - downloads and launches the latest release +# Usage: irm xetup.x9.cz/get.ps1 | iex + +$api = 'https://xetup.x9.cz/forgejo-api/repos/x9/xetup/releases?limit=1' + +try { + $rel = (Invoke-RestMethod -Uri $api -UseBasicParsing)[0] + $asset = $rel.assets | Where-Object { $_.name -eq 'xetup.exe' } | Select-Object -First 1 + if (-not $asset) { Write-Error "xetup.exe not found in latest release"; exit 1 } + + $out = "$env:TEMP\xetup.exe" + Write-Host "Downloading xetup $($rel.tag_name)..." + Invoke-WebRequest -Uri $asset.browser_download_url -OutFile $out -UseBasicParsing + Write-Host "Launching..." + Start-Process -FilePath $out -Verb RunAs +} catch { + Write-Error "Failed: $_" +} diff --git a/web/index.html b/web/index.html index e16cf71..b2caf95 100644 --- a/web/index.html +++ b/web/index.html @@ -92,6 +92,28 @@ } .btn-secondary:hover { background: var(--card); } + /* ---- INSTALL COMMAND ---- */ + .install-box { + margin-bottom: 1.5rem; + display: flex; align-items: center; gap: 0; + background: #0d1117; border: 1px solid var(--border); + border-radius: 10px; overflow: hidden; + font-size: .88rem; max-width: 520px; width: 100%; + } + .install-box code { + flex: 1; padding: .65rem 1rem; + font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; + color: var(--blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + } + .install-box button { + padding: .65rem .9rem; background: var(--card); + border: none; border-left: 1px solid var(--border); + color: var(--muted); cursor: pointer; font-size: .8rem; + transition: color .15s, background .15s; white-space: nowrap; + } + .install-box button:hover { background: var(--accent); color: #fff; } + .install-box button.copied { color: var(--green); } + /* ---- DOWNLOAD STRIP ---- */ .download-strip { margin-bottom: 3.5rem; @@ -155,6 +177,11 @@ Git repozitar +
+ irm xetup.x9.cz/get.ps1 | iex + +
+