avatar
童琦杰
Jun 14, 2024Technology

Baget

安装文档: https://github.com/loic-sharma/BaGet?tab=readme-ov-file#getting-started

通过nginx反向代理配置授权访问

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

$HOME/.nuget/NuGet/NuGet.Config
xml
<?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>
© 2015-2022 tongqijie.com 版权所有沪ICP备17000682号