Преглед изворни кода

feat: add-repo instructions on homepage and repo pages (usm add-repo instead of curl)

clanker пре 1 недеља
родитељ
комит
d6e0011553
4 измењених фајлова са 9 додато и 9 уклоњено
  1. 2 2
      README.md
  2. 2 2
      src/PackagesState.vala
  3. 3 3
      src/pages/home.html
  4. 2 2
      src/pages/repo.html

+ 2 - 2
README.md

@@ -10,11 +10,11 @@ fetch from a repository host.
 
 | Endpoint | Purpose |
 |---|---|
-| `GET /` | Overview: every repository (name, summary, package count, total size), per-repo add-repository instructions, the global install-USM block, and a combined package table with repo badges + server-side search across all repositories |
+| `GET /` | Overview: every repository (name, summary, package count, total size), per-repo add-repository instructions (`sudo usm add-repo <repo.usmr URL>`), the global install-USM block, and a combined package table with repo badges + server-side search across all repositories |
 | `GET /repo/{name}` | Single-repo browse: that repository's overview card, instructions and package table, search scoped to it |
 | `GET /repo/{name}/package/{file}` | Package detail: manifest fields read out of the `.usmc` (licences, flags, provides/depends tables), sha512, on-disk size/mtime, download button |
 | `GET /repo/{name}/PACKAGES.usml` | That repository's listing streamed **verbatim** (`application/json`) |
-| `GET /repo/{name}/repo.usmr` | A rewritten copy of the `.usmr` with its embedded `url` replaced by the derived base + `repo/{name}/` |
+| `GET /repo/{name}/repo.usmr` | A rewritten copy of the `.usmr` with its embedded `url` replaced by the derived base + `repo/{name}/` — the URL `sudo usm add-repo` consumes |
 | `GET /repo/{name}/{file}.usmc` | Package archives streamed from that repository's `public/` (`application/octet-stream`, exact content-length) |
 | `GET /install-usm.sh` | The configured installer script (`installer.path` mode only), served by the root-level catch-all |
 

+ 2 - 2
src/PackagesState.vala

@@ -99,8 +99,8 @@ namespace UsmWeb {
                     key_fingerprint = fingerprint(repo.key.to_hex()),
                     base_uri = base_uri + "repo/" + repo.name + "/",
                     usmr_href = base_uri + "repo/" + repo.name + "/repo.usmr",
-                    repos_d_snippet = "curl -fsSL -o /etc/usm/repos.d/%s.usmr %srepo/%s/repo.usmr"
-                        .printf(repo.name, base_uri, repo.name)
+                    repos_d_snippet = "sudo usm add-repo %srepo/%s/repo.usmr"
+                        .printf(base_uri, repo.name)
                 });
                 total_bytes += repo_bytes;
                 total_count += repo_count;

+ 3 - 3
src/pages/home.html

@@ -38,12 +38,12 @@
                 <p>Point USM at this repository — its URI is
                     <code class="mono" stm-text="repo.base_uri">…</code></p>
                 <ol class="steps">
-                    <li>Download the signed repository definition:
+                    <li>The signed repository definition:
                         <a class="mono" stm-attribute.href="repo.usmr_href"
                            stm-text="repo.usmr_href">repo.usmr</a></li>
-                    <li>Drop it into your repos.d:</li>
+                    <li>Add it with USM:</li>
                 </ol>
-                <pre class="mono snippet"><code stm-text="repo.repos_d_snippet"></code></pre>
+                <pre class="mono snippet"><code stm-text="'sudo usm add-repo ' + repo.usmr_href"></code></pre>
                 <p class="hint">Signing-key fingerprint:
                     <span class="mono fingerprint" stm-text="repo.key_fingerprint">—</span></p>
                 <p class="hint">Browse the repository's

+ 2 - 2
src/pages/repo.html

@@ -38,10 +38,10 @@
             <p>Point USM at this repository — its URI is
                 <code class="mono" stm-text="packages.base_uri">…</code></p>
             <ol class="steps">
-                <li>Download the signed repository definition:
+                <li>The signed repository definition:
                     <a class="mono" stm-attribute.href="packages.usmr_href"
                        stm-text="packages.usmr_href">repo.usmr</a></li>
-                <li>Drop it into your repos.d:</li>
+                <li>Add it with USM:</li>
             </ol>
             <pre class="mono snippet"><code stm-text="packages.repos_d_snippet"></code></pre>
             <p class="hint">Then <code class="mono">usm repository list</code> should show