Skip to content

Commit

Permalink
Revert splitting mirror doc into separate page
Browse files Browse the repository at this point in the history
  • Loading branch information
Splamy committed Mar 30, 2024
1 parent bf80138 commit 9c523d6
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 107 deletions.
106 changes: 102 additions & 4 deletions docs/docs/configuration/index.md → docs/docs/configuration.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Configuration

You can modify BaGetter's configurations by editing the `appsettings.json` file.
Expand All @@ -20,11 +23,106 @@ Users will now have to provide the API key to push packages:
dotnet nuget push -s http://localhost:5000/v3/index.json -k NUGET-SERVER-API-KEY package.1.0.0.nupkg
```

## Enable Mirror (read-through caching)

To configure mirroring an external feed through BaGetter see here:
## Enable read-through caching

Read-through caching lets you index packages from an upstream source. You can use read-through
caching to:

1. Speed up your builds if restores from [nuget.org](https://nuget.org) are slow
2. Enable package restores in offline scenarios

The following `Mirror` setting configures BaGetter to index packages from [nuget.org](https://nuget.org):

<Tabs>
<TabItem value="None" label="No Authentication" default>
```json
{
...

"Mirror": {
"Enabled": true,
"PackageSource": "https://api.nuget.org/v3/index.json"
},

...
}
```
</TabItem>

<TabItem value="Basic" label="Basic Authentication">
For basic authentication, set `Type` to `Basic` and provide a `Username` and `Password`:

```json
{
...

"Mirror": {
"Enabled": true,
"PackageSource": "https://api.nuget.org/v3/index.json",
"Authentication": {
"Type": "Basic",
"Username": "username",
"Password": "password"
}
},

...
}
```
</TabItem>

<TabItem value="Bearer" label="Bearer Token">
For bearer authentication, set `Type` to `Bearer` and provide a `Token`:

```json
{
...

"Mirror": {
"Enabled": true,
"PackageSource": "https://api.nuget.org/v3/index.json",
"Authentication": {
"Type": "Bearer",
"Token": "your-token"
}
},

...
}
```
</TabItem>

<TabItem value="Custom" label="Custom Authentication">
With the custom authentication type, you can provide any key-value pairs which will be set as headers in the request:

```json
{
...

"Mirror": {
"Enabled": true,
"PackageSource": "https://api.nuget.org/v3/index.json",
"Authentication": {
"Type": "Custom",
"CustomHeaders": {
"My-Auth": "your-value",
"Other-Header": "value"
}
}
},

...
}
```
</TabItem>
</Tabs>


:::info

`PackageSource` is the value of the [NuGet service index](https://docs.microsoft.com/nuget/api/service-index).

[Mirror Configuration](configuration/mirror)
:::

## Enable package hard deletions

Expand Down
103 changes: 0 additions & 103 deletions docs/docs/configuration/mirror.md

This file was deleted.

0 comments on commit 9c523d6

Please sign in to comment.