Sites

What a site is, the source URL, URL placeholders, and onboarding clients.

What a site is

A site is a named context, not a tenant or a piece of installed software:

FieldWhat it's for
NameA human-readable label (e.g. a building or region).
TokenThe URL segment clients use to reach this source.
LocationResolves the $LOCATION placeholder.
Default localeResolves the $LANG placeholder.
Repository URLResolves the $REPO_URL placeholder.

The source URL

Every site has its own source URL: https://your-origin/api/<site-token>. Add it on a client exactly like any winget REST source:

winget source add --name kvellman --type Microsoft.Rest --arg "https://your-origin/api/<site-token>"

The API implements the winget Source REST contract directly — no client-side plugin or agent is involved.

Placeholders

An installer URL in a manifest can reference the current site:

PlaceholderResolves from
$REPO_URLThe site's repository URL
$SITEThe site's name
$LOCATIONThe site's location
$LANGThe site's default locale

Example: one manifest, InstallerUrl: $REPO_URL/software/$ARCH/App.msi, resolved for two sites:

  • Site munich with repository URL https://files.munich.internalhttps://files.munich.internal/software/x64/App.msi
  • Site austin with repository URL https://files.austin.internalhttps://files.austin.internal/software/x64/App.msi

Same package, same manifest, the correct file for each location.

Onboarding clients

The admin UI's Instructions page renders the exact winget source add command for a given site — send that link rather than typing the token by hand. To remove a source on a client: winget source remove --name kvellman.

Rotating and revoking tokens

Admin → Site tokens. Add the replacement source on clients before you revoke the old token — revoking breaks every client still using that URL immediately.

What selects a site

Clients select a site purely by the URL they use — there's no separate subnet- or certificate-based selection today. If you need different behaviour per network segment, control that at your reverse proxy or firewall, and give each segment its own site token and URL.

Who can reach it

The site token is an address, not a credential — the winget Source API has to stay reachable without a login, because winget itself sends no authentication. Anyone who can reach the URL can search the source and download its installers. If that's not acceptable for a given site, restrict it at the network layer or your reverse proxy, not by treating the token as secret.