安装文档: https://github.com/loic-sharma/BaGet?tab=readme-ov-file#getting-started
通过nginx反向代理配置授权访问
server {
location / {
auth_basic "authorization";
auth_basic_user_file /etc/nginx/secrets/baget.htpasswd;
proxy_pass http://localhost:9000/;
}
}
修改nuget配置,设置访问用户名和密码
windows: %appdata%\NuGet\NuGet.Config
mac: $HOME/.nuget/NuGet/NuGet.Config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="Baget" value="your_baget_url" />
</packageSources>
<packageSourceCredentials>
<Baget>
<add key="Username" value="your-user-name" />
<add key="ClearTextPassword" value="your-clear-text-password" />
<add key="ValidAuthenticationTypes" value="basic" />
</Baget>
</packageSourceCredentials>
</configuration>