From eb8628ad075907e61cd255fe76c0d0452f05c1f6 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" appsettings.json
",id:"appsettingsjson",level:3},{value:"IIS server options",id:"iis-server-options",level:2},{value:"Health Endpoint",id:"health-endpoint",level:2},{value:"Maximum package size",id:"maximum-package-size",level:2},{value:"Statistics",id:"statistics",level:2},{value:"Load secrets from files",id:"load-secrets-from-files",level:2},{value:"Docker Compose example",id:"docker-compose-example",level:3}];function d(e){const n={a:"a",admonition:"admonition",br:"br",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"configuration",children:"Configuration"}),"\n",(0,i.jsxs)(n.p,{children:["You can modify BaGetter's configurations by editing the ",(0,i.jsx)(n.code,{children:"appsettings.json"})," file."]}),"\n",(0,i.jsx)(n.h2,{id:"require-an-api-key",children:"Require an API key"}),"\n",(0,i.jsxs)(n.p,{children:["You can require that users provide a password, called an API key, to publish packages.\nTo do so, you can insert the desired API key in the ",(0,i.jsx)(n.code,{children:"ApiKey"})," field."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n "ApiKey": "NUGET-SERVER-API-KEY",\n ...\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"Users will now have to provide the API key to push packages:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-shell",children:"dotnet nuget push -s http://localhost:5000/v3/index.json -k NUGET-SERVER-API-KEY package.1.0.0.nupkg\n"})}),"\n",(0,i.jsx)(n.h2,{id:"enable-read-through-caching",children:"Enable read-through caching"}),"\n",(0,i.jsx)(n.p,{children:"Read-through caching lets you index packages from an upstream source. You can use read-through\ncaching to:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["Speed up your builds if restores from ",(0,i.jsx)(n.a,{href:"https://nuget.org",children:"nuget.org"})," are slow"]}),"\n",(0,i.jsx)(n.li,{children:"Enable package restores in offline scenarios"}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["The following ",(0,i.jsx)(n.code,{children:"Mirror"})," setting configures BaGetter to index packages from ",(0,i.jsx)(n.a,{href:"https://nuget.org",children:"nuget.org"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n ...\n\n "Mirror": {\n "Enabled": true,\n "PackageSource": "https://api.nuget.org/v3/index.json"\n },\n\n ...\n}\n'})}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"PackageSource"})," is the value of the ",(0,i.jsx)(n.a,{href:"https://docs.microsoft.com/nuget/api/service-index",children:"NuGet service index"}),"."]})}),"\n",(0,i.jsx)(n.h2,{id:"enable-package-hard-deletions",children:"Enable package hard deletions"}),"\n",(0,i.jsxs)(n.p,{children:["To prevent the ",(0,i.jsx)(n.a,{href:"https://blog.npmjs.org/post/141577284765/kik-left-pad-and-npm",children:'"left pad" problem'}),",\nBaGetter's default configuration doesn't allow package deletions. Whenever BaGetter receives a package deletion\nrequest, it will instead \"unlist\" the package. An unlisted package is undiscoverable but can still be\ndownloaded if you know the package's id and version. You can override this behavior by setting the\n",(0,i.jsx)(n.code,{children:"PackageDeletionBehavior"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n ...\n\n "PackageDeletionBehavior": "HardDelete",\n\n ...\n}\n'})}),"\n",(0,i.jsx)(n.h2,{id:"enable-package-overwrites",children:"Enable package overwrites"}),"\n",(0,i.jsxs)(n.p,{children:["Normally, BaGetter will reject a package upload if the id and version are already taken. This is to maintain the ",(0,i.jsx)(n.a,{href:"https://learn.microsoft.com/azure/devops/artifacts/artifacts-key-concepts?view=azure-devops#immutability",children:"immutability of semantically versioned packages"}),"."]}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsx)(n.p,{children:"NuGet clients cache packages on multiple levels, so overwriting a package can lead to unexpected behavior.\nA client may have a cached version of the package that is different from the one on the server.\nMake sure that everyone involved is aware of the implications of overwriting packages."})}),"\n",(0,i.jsxs)(n.p,{children:["You can configure BaGetter to overwrite the already existing package by setting ",(0,i.jsx)(n.code,{children:"AllowPackageOverwrites"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n ...\n\n "AllowPackageOverwrites": "true",\n\n ...\n}\n'})}),"\n",(0,i.jsxs)(n.p,{children:["To allow pre-release versions to be overwritten but not stable releases, set ",(0,i.jsx)(n.code,{children:"AllowPackageOverwrites"})," to ",(0,i.jsx)(n.code,{children:"PrereleaseOnly"}),"."]}),"\n",(0,i.jsx)(n.p,{children:'Pushing a package with a pre-release version like "3.1.0-SNAPSHOT" will overwrite the existing "3.1.0-SNAPSHOT" package, but pushing a "3.1.0" package will fail if a "3.1.0" package already exists.'}),"\n",(0,i.jsx)(n.h2,{id:"private-feeds",children:"Private feeds"}),"\n",(0,i.jsx)(n.p,{children:"A private feed requires users to authenticate before accessing packages."}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsxs)(n.p,{children:["Private feeds are not supported at this time! See ",(0,i.jsx)(n.a,{href:"https://github.com/loic-sharma/BaGet/pull/69",children:"this pull request"})," for more information."]})}),"\n",(0,i.jsx)(n.h2,{id:"database-configuration",children:"Database configuration"}),"\n",(0,i.jsx)(n.p,{children:"BaGetter supports multiple database engines for storing package information:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["MySQL: ",(0,i.jsx)(n.code,{children:"MySql"})]}),"\n",(0,i.jsxs)(n.li,{children:["SQLite: ",(0,i.jsx)(n.code,{children:"Sqlite"})]}),"\n",(0,i.jsxs)(n.li,{children:["SQL Server: ",(0,i.jsx)(n.code,{children:"SqlServer"})]}),"\n",(0,i.jsxs)(n.li,{children:["PostgreSQL: ",(0,i.jsx)(n.code,{children:"PostgreSql"})]}),"\n",(0,i.jsxs)(n.li,{children:["Azure Table Storage: ",(0,i.jsx)(n.code,{children:"AzureTable"})]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["Each database engine requires a connection string to configure the connection. Please refer to ",(0,i.jsx)(n.a,{href:"https://www.connectionstrings.com/",children:"ConnectionStrings.com"})," to learn how to create the proper connection string for each database engine."]}),"\n",(0,i.jsxs)(n.p,{children:["You may configure the chosen database engine either using environment variables or by editing the ",(0,i.jsx)(n.code,{children:"appsettings.json"})," file."]}),"\n",(0,i.jsx)(n.h3,{id:"environment-variables",children:"Environment Variables"}),"\n",(0,i.jsx)(n.p,{children:"There are two environment variables related to database configuration. These are:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Database__Type"}),": The database engine to use, this should be one of the strings from the above list such as ",(0,i.jsx)(n.code,{children:"PostgreSql"})," or ",(0,i.jsx)(n.code,{children:"Sqlite"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Database__ConnectionString"}),": The connection string for your database engine."]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"appsettingsjson",children:(0,i.jsx)(n.code,{children:"appsettings.json"})}),"\n",(0,i.jsxs)(n.p,{children:["The database settings are located under the ",(0,i.jsx)(n.code,{children:"Database"})," key in the ",(0,i.jsx)(n.code,{children:"appsettings.json"})," configuration file:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n ...\n\n "Database": {\n "Type": "Sqlite",\n "ConnectionString": "Data Source=bagetter.db"\n },\n\n ...\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"There are two settings related to the database configuration:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Type"}),": The database engine to use, this should be one of the strings from the above list such as ",(0,i.jsx)(n.code,{children:"PostgreSql"})," or ",(0,i.jsx)(n.code,{children:"Sqlite"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"ConnectionString"}),": The connection string for your database engine."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"iis-server-options",children:"IIS server options"}),"\n",(0,i.jsxs)(n.p,{children:["IIS Server options can be configured under the ",(0,i.jsx)(n.code,{children:"IISServerOptions"})," key. The available options are detailed at ",(0,i.jsx)(n.a,{href:"https://docs.microsoft.com/dotnet/api/microsoft.aspnetcore.builder.iisserveroptions",children:"docs.microsoft.com"})]}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsxs)(n.p,{children:["If not specified, the ",(0,i.jsx)(n.code,{children:"MaxRequestBodySize"})," in BaGetter defaults to 250MB (262144000 bytes), rather than the ASP.NET Core default of 30MB."]})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n ...\n\n "IISServerOptions": {\n "MaxRequestBodySize": 262144000\n },\n\n ...\n}\n'})}),"\n",(0,i.jsx)(n.h2,{id:"health-endpoint",children:"Health Endpoint"}),"\n",(0,i.jsxs)(n.p,{children:["A health endpoint is exposed at ",(0,i.jsx)(n.code,{children:"/health"})," that returns 200 OK or 503 Service Unavailable and always includes a json object listing the current status of the application:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n "Status": "Healthy",\n "Sqlite": "Healthy",\n ...\n}\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The services can be omitted by setting the ",(0,i.jsx)(n.code,{children:"Statistics:ListConfiguredServices"})," to false, in which case only the ",(0,i.jsx)(n.code,{children:"Status"})," property is returned in the json object."]}),"\n",(0,i.jsx)(n.p,{children:'This path and the name of the "Status" property are configurable if needed:'}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n ...\n\n "HealthCheck": {\n "Path": "/healthz",\n "StatusPropertyName": "Status"\n },\n\n ...\n}\n'})}),"\n",(0,i.jsx)(n.h2,{id:"maximum-package-size",children:"Maximum package size"}),"\n",(0,i.jsxs)(n.p,{children:["The max package size default to 8GiB and can be configured using the ",(0,i.jsx)(n.code,{children:"MaxPackageSizeGiB"})," setting. The NuGet gallery currently has a 250MB limit, which is enough for most packages.\nThis can be useful if you are hosting a private feed and need to host large packages that include chocolatey installers, machine learning models, etc."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n ...\n\n "MaxPackageSizeGiB": 8,\n\n ...\n}\n'})}),"\n",(0,i.jsx)(n.h2,{id:"statistics",children:"Statistics"}),"\n",(0,i.jsxs)(n.p,{children:["On the application's statistics page the currently used services and overall package and version counts are listed.\nYou can hide or show this page by modifying the ",(0,i.jsx)(n.code,{children:"EnableStatisticsPage"})," configuration.",(0,i.jsx)(n.br,{}),"\n","If you set ",(0,i.jsx)(n.code,{children:"ListConfiguredServices"})," to ",(0,i.jsx)(n.code,{children:"false"})," the currently used services for database and storage (such as ",(0,i.jsx)(n.code,{children:"Sqlite"}),") are omitted on the stats page:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n ...\n\n "Statistics": {\n "EnableStatisticsPage": true,\n "ListConfiguredServices": false\n },\n\n ...\n}\n'})}),"\n",(0,i.jsx)(n.h2,{id:"load-secrets-from-files",children:"Load secrets from files"}),"\n",(0,i.jsxs)(n.p,{children:["Mostly useful when running containerised (e.g. using Docker, Podman, Kubernetes, etc), the application will look for files named in the same pattern as environment variables under ",(0,i.jsx)(n.code,{children:"/run/secrets"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-shell",children:"/run/secrets/Database__ConnectionString\n"})}),"\n",(0,i.jsx)(n.p,{children:"This allows for sensitive values to be provided individually to the application, typically by bind-mounting files."}),"\n",(0,i.jsx)(n.h3,{id:"docker-compose-example",children:"Docker Compose example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"version: '2'\n\nservices:\n bagetter:\n image: bagetter/bagetter:latest\n volumes:\n # Single file mounted for API key\n - ./secrets/api-key.txt:/run/secrets/ApiKey:ro\n - ./data:/srv/baget\n environment:\n - Database__ConnectionString=Data Source=/srv/baget/bagetter.db\n - Database__Type=Sqlite\n - Mirror__Enabled=false\n - Storage__Type=FileSystem\n - Storage__Path=/srv/baget/packages\n"})}),"\n",(0,i.jsx)(n.p,{children:"Aditional documentation for secrets:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://docs.docker.com/compose/use-secrets",children:"How to use secrets in Docker Compose"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://docs.docker.com/engine/swarm/secrets",children:"Docker Swarm secrets"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://kubernetes.io/docs/concepts/configuration/secret",children:"Kubernetes secrets"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://docs.microsoft.com/aspnet/core/fundamentals/configuration/#key-per-file-configuration-provider",children:"ASP.NET Core Documentation"})}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,a.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>o,a:()=>r});var i=s(7294);const a={},t=i.createContext(a);function r(e){const n=i.useContext(t);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:r(e.components),i.createElement(t.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/9ed00105.3e27619b.js b/assets/js/9ed00105.3e27619b.js
deleted file mode 100644
index d96b4d2..0000000
--- a/assets/js/9ed00105.3e27619b.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunkba_getter=self.webpackChunkba_getter||[]).push([[4],{8373:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>r,default:()=>h,frontMatter:()=>a,metadata:()=>o,toc:()=>l});var i=s(5893),t=s(1151);const a={},r="Configuration",o={id:"configuration",title:"Configuration",description:"You can modify BaGetter's configurations by editing the appsettings.json file.",source:"@site/docs/configuration.md",sourceDirName:".",slug:"/configuration",permalink:"/docs/configuration",draft:!1,unlisted:!1,editUrl:"https://github.com/bagetter/BaGetter/tree/main/docs/docs/configuration.md",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"Run BaGetter on your Computer",permalink:"/docs/Installation/local"},next:{title:"Artifactory",permalink:"/docs/vs/artifactory"}},c={},l=[{value:"Require an API key",id:"require-an-api-key",level:2},{value:"Enable read-through caching",id:"enable-read-through-caching",level:2},{value:"Enable package hard deletions",id:"enable-package-hard-deletions",level:2},{value:"Enable package overwrites",id:"enable-package-overwrites",level:2},{value:"Private feeds",id:"private-feeds",level:2},{value:"Database configuration",id:"database-configuration",level:2},{value:"Environment Variables",id:"environment-variables",level:3},{value:"appsettings.json
",id:"appsettingsjson",level:3},{value:"IIS server options",id:"iis-server-options",level:2},{value:"Health Endpoint",id:"health-endpoint",level:2},{value:"Maximum package size",id:"maximum-package-size",level:2},{value:"Statistics",id:"statistics",level:2},{value:"Load secrets from files",id:"load-secrets-from-files",level:2},{value:"Docker Compose example",id:"docker-compose-example",level:3}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"configuration",children:"Configuration"}),"\n",(0,i.jsxs)(n.p,{children:["You can modify BaGetter's configurations by editing the ",(0,i.jsx)(n.code,{children:"appsettings.json"})," file."]}),"\n",(0,i.jsx)(n.h2,{id:"require-an-api-key",children:"Require an API key"}),"\n",(0,i.jsxs)(n.p,{children:["You can require that users provide a password, called an API key, to publish packages.\nTo do so, you can insert the desired API key in the ",(0,i.jsx)(n.code,{children:"ApiKey"})," field."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n "ApiKey": "NUGET-SERVER-API-KEY",\n ...\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"Users will now have to provide the API key to push packages:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-shell",children:"dotnet nuget push -s http://localhost:5000/v3/index.json -k NUGET-SERVER-API-KEY package.1.0.0.nupkg\n"})}),"\n",(0,i.jsx)(n.h2,{id:"enable-read-through-caching",children:"Enable read-through caching"}),"\n",(0,i.jsx)(n.p,{children:"Read-through caching lets you index packages from an upstream source. You can use read-through\ncaching to:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["Speed up your builds if restores from ",(0,i.jsx)(n.a,{href:"https://nuget.org",children:"nuget.org"})," are slow"]}),"\n",(0,i.jsx)(n.li,{children:"Enable package restores in offline scenarios"}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["The following ",(0,i.jsx)(n.code,{children:"Mirror"})," setting configures BaGetter to index packages from ",(0,i.jsx)(n.a,{href:"https://nuget.org",children:"nuget.org"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n ...\n\n "Mirror": {\n "Enabled": true,\n "PackageSource": "https://api.nuget.org/v3/index.json"\n },\n\n ...\n}\n'})}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"PackageSource"})," is the value of the ",(0,i.jsx)(n.a,{href:"https://docs.microsoft.com/nuget/api/service-index",children:"NuGet service index"}),"."]})}),"\n",(0,i.jsx)(n.h2,{id:"enable-package-hard-deletions",children:"Enable package hard deletions"}),"\n",(0,i.jsxs)(n.p,{children:["To prevent the ",(0,i.jsx)(n.a,{href:"https://blog.npmjs.org/post/141577284765/kik-left-pad-and-npm",children:'"left pad" problem'}),",\nBaGetter's default configuration doesn't allow package deletions. Whenever BaGetter receives a package deletion\nrequest, it will instead \"unlist\" the package. An unlisted package is undiscoverable but can still be\ndownloaded if you know the package's id and version. You can override this behavior by setting the\n",(0,i.jsx)(n.code,{children:"PackageDeletionBehavior"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n ...\n\n "PackageDeletionBehavior": "HardDelete",\n\n ...\n}\n'})}),"\n",(0,i.jsx)(n.h2,{id:"enable-package-overwrites",children:"Enable package overwrites"}),"\n",(0,i.jsxs)(n.p,{children:["Normally, BaGetter will reject a package upload if the id and version are already taken. This is to maintain the ",(0,i.jsx)(n.a,{href:"https://learn.microsoft.com/azure/devops/artifacts/artifacts-key-concepts?view=azure-devops#immutability",children:"immutability of semantically versioned packages"}),"."]}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsx)(n.p,{children:"NuGet clients cache packages on multiple levels, so overwriting a package can lead to unexpected behavior.\nA client may have a cached version of the package that is different from the one on the server.\nMake sure that everyone involved is aware of the implications of overwriting packages."})}),"\n",(0,i.jsxs)(n.p,{children:["You can configure BaGetter to overwrite the already existing package by setting ",(0,i.jsx)(n.code,{children:"AllowPackageOverwrites"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n ...\n\n "AllowPackageOverwrites": "true",\n\n ...\n}\n'})}),"\n",(0,i.jsxs)(n.p,{children:["To allow pre-release versions to be overwritten but not stable releases, set ",(0,i.jsx)(n.code,{children:"AllowPackageOverwrites"})," to ",(0,i.jsx)(n.code,{children:"PrereleaseOnly"}),"."]}),"\n",(0,i.jsx)(n.p,{children:'Pushing a package with a pre-release version like "3.1.0-SNAPSHOT" will overwrite the existing "3.1.0-SNAPSHOT" package, but pushing a "3.1.0" package will fail if a "3.1.0" package already exists.'}),"\n",(0,i.jsx)(n.h2,{id:"private-feeds",children:"Private feeds"}),"\n",(0,i.jsx)(n.p,{children:"A private feed requires users to authenticate before accessing packages."}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsxs)(n.p,{children:["Private feeds are not supported at this time! See ",(0,i.jsx)(n.a,{href:"https://github.com/loic-sharma/BaGet/pull/69",children:"this pull request"})," for more information."]})}),"\n",(0,i.jsx)(n.h2,{id:"database-configuration",children:"Database configuration"}),"\n",(0,i.jsx)(n.p,{children:"BaGetter supports multiple database engines for storing package information:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["MySQL: ",(0,i.jsx)(n.code,{children:"MySql"})]}),"\n",(0,i.jsxs)(n.li,{children:["SQLite: ",(0,i.jsx)(n.code,{children:"Sqlite"})]}),"\n",(0,i.jsxs)(n.li,{children:["SQL Server: ",(0,i.jsx)(n.code,{children:"SqlServer"})]}),"\n",(0,i.jsxs)(n.li,{children:["PostgreSQL: ",(0,i.jsx)(n.code,{children:"PostgreSql"})]}),"\n",(0,i.jsxs)(n.li,{children:["Azure Table Storage: ",(0,i.jsx)(n.code,{children:"AzureTable"})]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["Each database engine requires a connection string to configure the connection. Please refer to ",(0,i.jsx)(n.a,{href:"https://www.connectionstrings.com/",children:"ConnectionStrings.com"})," to learn how to create the proper connection string for each database engine."]}),"\n",(0,i.jsxs)(n.p,{children:["You may configure the chosen database engine either using environment variables or by editing the ",(0,i.jsx)(n.code,{children:"appsettings.json"})," file."]}),"\n",(0,i.jsx)(n.h3,{id:"environment-variables",children:"Environment Variables"}),"\n",(0,i.jsx)(n.p,{children:"There are two environment variables related to database configuration. These are:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Database__Type"}),": The database engine to use, this should be one of the strings from the above list such as ",(0,i.jsx)(n.code,{children:"PostgreSql"})," or ",(0,i.jsx)(n.code,{children:"Sqlite"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Database__ConnectionString"}),": The connection string for your database engine."]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"appsettingsjson",children:(0,i.jsx)(n.code,{children:"appsettings.json"})}),"\n",(0,i.jsxs)(n.p,{children:["The database settings are located under the ",(0,i.jsx)(n.code,{children:"Database"})," key in the ",(0,i.jsx)(n.code,{children:"appsettings.json"})," configuration file:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n ...\n\n "Database": {\n "Type": "Sqlite",\n "ConnectionString": "Data Source=bagetter.db"\n },\n\n ...\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"There are two settings related to the database configuration:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Type"}),": The database engine to use, this should be one of the strings from the above list such as ",(0,i.jsx)(n.code,{children:"PostgreSql"})," or ",(0,i.jsx)(n.code,{children:"Sqlite"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"ConnectionString"}),": The connection string for your database engine."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"iis-server-options",children:"IIS server options"}),"\n",(0,i.jsxs)(n.p,{children:["IIS Server options can be configured under the ",(0,i.jsx)(n.code,{children:"IISServerOptions"})," key. The available options are detailed at ",(0,i.jsx)(n.a,{href:"https://docs.microsoft.com/dotnet/api/microsoft.aspnetcore.builder.iisserveroptions",children:"docs.microsoft.com"})]}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsxs)(n.p,{children:["If not specified, the ",(0,i.jsx)(n.code,{children:"MaxRequestBodySize"})," in BaGetter defaults to 250MB (262144000 bytes), rather than the ASP.NET Core default of 30MB."]})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n ...\n\n "IISServerOptions": {\n "MaxRequestBodySize": 262144000\n },\n\n ...\n}\n'})}),"\n",(0,i.jsx)(n.h2,{id:"health-endpoint",children:"Health Endpoint"}),"\n",(0,i.jsxs)(n.p,{children:["A health endpoint is exposed at ",(0,i.jsx)(n.code,{children:"/health"})," that returns 200 OK or 503 Service Unavailable and always includes a json object listing the current status of the application:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n "Status": "Healthy",\n "Sqlite": "Healthy",\n ...\n}\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The services can be omitted by setting the ",(0,i.jsx)(n.code,{children:"Statistics:ListConfiguredServices"})," to false, in which case only the ",(0,i.jsx)(n.code,{children:"Status"})," property is returned in the json object."]}),"\n",(0,i.jsx)(n.p,{children:'This path and the name of the "Status" property are configurable if needed:'}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n ...\n\n "HealthCheck": {\n "Path": "/healthz",\n "StatusPropertyName": "Status"\n },\n\n ...\n}\n'})}),"\n",(0,i.jsx)(n.h2,{id:"maximum-package-size",children:"Maximum package size"}),"\n",(0,i.jsxs)(n.p,{children:["The max package size default to 8GiB and can be configured using the ",(0,i.jsx)(n.code,{children:"MaxPackageSizeGiB"})," setting. The NuGet gallery currently has a 250MB limit, which is enough for most packages.\nThis can be useful if you are hosting a private feed and need to host large packages that include chocolatey installers, machine learning models, etc."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n ...\n\n "MaxPackageSizeGiB": 8,\n\n ...\n}\n'})}),"\n",(0,i.jsx)(n.h2,{id:"statistics",children:"Statistics"}),"\n",(0,i.jsxs)(n.p,{children:["On the application's statistics page the currently used services are listed.\nYou can hide or show this part by modifying the ",(0,i.jsx)(n.code,{children:"EnableStatisticsPage"})," configuration:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n ...\n\n "Statistics": {\n "EnableStatisticsPage": false,\n "ListConfiguredServices": false\n },\n\n ...\n}\n'})}),"\n",(0,i.jsxs)(n.p,{children:["If you set ",(0,i.jsx)(n.code,{children:"ListConfiguredServices"})," to ",(0,i.jsx)(n.code,{children:"true"})," the currently used services for database and storage are shown on the stats page."]}),"\n",(0,i.jsx)(n.h2,{id:"load-secrets-from-files",children:"Load secrets from files"}),"\n",(0,i.jsxs)(n.p,{children:["Mostly useful when running containerised (e.g. using Docker, Podman, Kubernetes, etc), the application will look for files named in the same pattern as environment variables under ",(0,i.jsx)(n.code,{children:"/run/secrets"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-shell",children:"/run/secrets/Database__ConnectionString\n"})}),"\n",(0,i.jsx)(n.p,{children:"This allows for sensitive values to be provided individually to the application, typically by bind-mounting files."}),"\n",(0,i.jsx)(n.h3,{id:"docker-compose-example",children:"Docker Compose example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"version: '2'\n\nservices:\n bagetter:\n image: bagetter/bagetter:latest\n volumes:\n # Single file mounted for API key\n - ./secrets/api-key.txt:/run/secrets/ApiKey:ro\n - ./data:/srv/baget\n environment:\n - Database__ConnectionString=Data Source=/srv/baget/bagetter.db\n - Database__Type=Sqlite\n - Mirror__Enabled=false\n - Storage__Type=FileSystem\n - Storage__Path=/srv/baget/packages\n"})}),"\n",(0,i.jsx)(n.p,{children:"Aditional documentation for secrets:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://docs.docker.com/compose/use-secrets",children:"How to use secrets in Docker Compose"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://docs.docker.com/engine/swarm/secrets",children:"Docker Swarm secrets"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://kubernetes.io/docs/concepts/configuration/secret",children:"Kubernetes secrets"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://docs.microsoft.com/aspnet/core/fundamentals/configuration/#key-per-file-configuration-provider",children:"ASP.NET Core Documentation"})}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>o,a:()=>r});var i=s(7294);const t={},a=i.createContext(t);function r(e){const n=i.useContext(a);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),i.createElement(a.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/runtime~main.05b0267d.js b/assets/js/runtime~main.8a8dc0ff.js
similarity index 98%
rename from assets/js/runtime~main.05b0267d.js
rename to assets/js/runtime~main.8a8dc0ff.js
index f514f14..1877054 100644
--- a/assets/js/runtime~main.05b0267d.js
+++ b/assets/js/runtime~main.8a8dc0ff.js
@@ -1 +1 @@
-(()=>{"use strict";var e,a,t,r,f,d={},o={};function c(e){var a=o[e];if(void 0!==a)return a.exports;var t=o[e]={exports:{}};return d[e].call(t.exports,t,t.exports,c),t.exports}c.m=d,e=[],c.O=(a,t,r,f)=>{if(!t){var d=1/0;for(i=0;iMaximum
This can be useful if you are hosting a private feed and need to host large packages that include chocolatey installers, machine learning models, etc.
{
...
"MaxPackageSizeGiB": 8,
...
}
On the application's statistics page the currently used services are listed.
-You can hide or show this part by modifying the EnableStatisticsPage
configuration:
{
...
"Statistics": {
"EnableStatisticsPage": false,
"ListConfiguredServices": false
},
...
}
If you set ListConfiguredServices
to true
the currently used services for database and storage are shown on the stats page.
On the application's statistics page the currently used services and overall package and version counts are listed.
+You can hide or show this page by modifying the EnableStatisticsPage
configuration.
+If you set ListConfiguredServices
to false
the currently used services for database and storage (such as Sqlite
) are omitted on the stats page:
{
...
"Statistics": {
"EnableStatisticsPage": true,
"ListConfiguredServices": false
},
...
}
Mostly useful when running containerised (e.g. using Docker, Podman, Kubernetes, etc), the application will look for files named in the same pattern as environment variables under /run/secrets
.
/run/secrets/Database__ConnectionString