惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News | PayPal Newsroom
IT之家
IT之家
Jina AI
Jina AI
博客园 - 司徒正美
GbyAI
GbyAI
WordPress大学
WordPress大学
B
Blog
大猫的无限游戏
大猫的无限游戏
Y
Y Combinator Blog
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Recorded Future
Recorded Future
T
Threat Research - Cisco Blogs
AWS News Blog
AWS News Blog
Latest news
Latest news
宝玉的分享
宝玉的分享
小众软件
小众软件
NISL@THU
NISL@THU
C
CERT Recently Published Vulnerability Notes
The GitHub Blog
The GitHub Blog
P
Privacy & Cybersecurity Law Blog
P
Palo Alto Networks Blog
Spread Privacy
Spread Privacy
Last Week in AI
Last Week in AI
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
P
Proofpoint News Feed
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
量子位
博客园_首页
T
The Exploit Database - CXSecurity.com
The Cloudflare Blog
M
MIT News - Artificial intelligence
H
Help Net Security
Security Archives - TechRepublic
Security Archives - TechRepublic
V2EX - 技术
V2EX - 技术
I
InfoQ
D
Darknet – Hacking Tools, Hacker News & Cyber Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
O
OpenAI News
MongoDB | Blog
MongoDB | Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
P
Privacy International News Feed
Microsoft Security Blog
Microsoft Security Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Google DeepMind News
Google DeepMind News
H
Hacker News: Front Page
W
WeLiveSecurity
N
News and Events Feed by Topic

Hunsh's Blog

生成个人的 Github PR List 如何选择合适的加密手段 Nginx SNI Proxy 如何优雅导入 k8s.io/kubernetes 多架构镜像的体积优化 使用 buildkit 进行多架构构建并提取产物 如何修改镜像 layer(以 sourcemap-less grafana 为例) acme.sh 自动化 Google CA 申请证书 微信小程序嵌入任意公众号文章 k8s && bazel 项目从 go1.20 升级 go1.21 go serve http and https on same port typecho 迁移到 hexo 实现 hexo 文章和资源在同一目录下 golang mitm 遇到的问题 流式数据专用的 mine-type Golang 正向代理对于 Host 的处理 (RFC 7230) 分享 MacOS 的一些系统fix脚本(dns、sleep) prometheus rate/increase/delta/sum等函数不符合预期或出现小数的原理 [油猴脚本] USTB Everywhere 为校外访问添加访问任意网站的能力
Make Go mod and Git to use specify .netrc
2024-05-05 · via Hunsh's Blog

Background

I want to make a private goproxy, direct lookup with gitlab.

This service should be stateless, use user’s gitlab token. It works with

1
GOPROXY='https://username:accesstoken@private.goproxy.example.com' go mod get private.org/abc

How to do

Go document said that to use authenticate over HTTPS, we can use .netrc file.

But, by default, Git will only use $HOME/.netrc (supported by CURL).

Go vcs (cmd/go/internal/vcs) will follow NETRC env, but is not enough. We need make Git to use NETRC too.

Git contrib provider git-credential-netrc.

We can configure Git to use it.

1
2
3
wget -O /usr/local/bin/git-credential-netrc https://raw.githubusercontent.com/git/git/master/contrib/credential/netrc/git-credential-netrc.perl
chmod +x /usr/local/bin/git-credential-netrc
git config --global credential.helper 'netrc -f $NETRC'

Then, Go mod and Git and both works with NETRC env