Feed settings¶
Feed settings are stored in the feed, in a file named sleet.settings.json. They turn feed features on and off for everyone who writes to the feed. They're separate from the configuration in sleet.json, which only says where the feed is and how to sign in.
Manage settings¶
Use the feed-settings command:
# Show all settings
sleet feed-settings --get-all
# Change a setting
sleet feed-settings --set badgesenabled:true
# Remove a setting, which restores its default
sleet feed-settings --unset badgesenabled
Keys aren't case-sensitive. Sleet doesn't check key names, so a misspelled key is saved and has no effect. Run --get-all after a change to check it.
feed-settings always ends with Run 'recreate' to rebuild the feed with the new settings. Only some settings need recreate. The table below says when each one takes effect.
Settings¶
| Key | Default | When it takes effect |
|---|---|---|
catalogenabled |
false |
After recreate. |
catalogpagesize |
1024 |
On the next push. |
symbolsfeedenabled |
false |
After recreate. |
badgesenabled |
false |
On the next push. Run recreate to add badges for packages already on the feed. |
externalsearch |
Not set | Right away. |
retentionmaxstableversions |
Not set | On the next push. |
retentionmaxprereleaseversions |
Not set | On the next push. |
retentiongroupbyfirstprereleaselabelcount |
Not set | On the next push. |
recreate doesn't work on local feeds whose baseURI is different from path. For those feeds, use rebuild a local feed without recreate wherever this page says to run recreate.
catalogenabled¶
When true, Sleet keeps a catalog: a log of every package added to or removed from the feed, in the NuGet catalog format. Tools that copy or mirror feeds can read it. NuGet doesn't need it to restore packages, and it adds files to every push.
To turn it on for a new feed, run sleet init --with-catalog before the first push. For an existing feed, set catalogenabled:true and run recreate. recreate adds the catalog to index.json, and adds the packages already on the feed to it. See enable catalog or symbols on an existing feed.
catalogpagesize¶
The number of entries in each catalog page. Sleet starts a new page when the latest one is full. Only used when the catalog is on.
symbolsfeedenabled¶
When true, the feed has a symbol server. Sleet accepts .symbols.nupkg files, and indexes the .dll and .pdb files in packages under symbols/. When false, push skips symbol packages with a warning.
To turn it on for a new feed, run sleet init --with-symbols before the first push. For an existing feed, set symbolsfeedenabled:true and run recreate, so that index.json lists the symbol server and existing packages are indexed.
badgesenabled¶
When true, push and delete update the version badge files under badges/. Badges are off on new feeds. After you turn them on, run recreate to create badges for the packages that are already on the feed.
externalsearch¶
The URL of an external search service. When you set it, Sleet points the search resource in index.json to that URL right away. Unset it to go back to the built-in static search:
sleet feed-settings --set externalsearch:https://search.example.com/query
sleet feed-settings --unset externalsearch
recreate keeps the external search URL. init doesn't, see settings and init.
Retention settings¶
These keys control package retention, which deletes old versions on each push:
| Key | Description |
|---|---|
retentionmaxstableversions |
The number of stable versions to keep for each package id. |
retentionmaxprereleaseversions |
The number of prerelease versions to keep for each package id. |
retentiongroupbyfirstprereleaselabelcount |
Groups prerelease versions by their first n release labels, and keeps retentionmaxprereleaseversions in each group. |
Retention only runs when both limits are set and greater than 0. Use the retention settings command to change them, since it sets all three keys at once:
Settings and init¶
init writes sleet.settings.json. If you run it on a feed that already has settings, it:
- Sets
catalogenabledandsymbolsfeedenabledto match the--with-catalogand--with-symbolsoptions, which are off unless you pass them. - Points search back to the static search file, even if
externalsearchis set. Runfeed-settings --set externalsearch:<url>again to fix it. - Keeps
badgesenabled,catalogpagesize, and the retention settings. - Removes keys that Sleet doesn't know.
Only run init on a new feed. recreate keeps all settings.