大量更新

This commit is contained in:
zeaslity
2026-05-19 14:28:56 +08:00
parent 9fc3372fa3
commit 37a6c6510f
223 changed files with 140833 additions and 2424 deletions

View File

@@ -0,0 +1,24 @@
# master节点
sudo apt update
sudo apt install -y apt-cacher-ng
systemctl status apt-cacher-ng
# worker节点
sudo tee /etc/apt/apt.conf.d/01proxy <<EOF
Acquire::http::Proxy "http://10.22.57.8:3142";
Acquire::https::Proxy "http://10.22.57.8:3142";
EOF
ssh root@${server} "printf '%s\n' \
'Acquire::http::Proxy \"http://10.22.57.8:3142\";' \
'Acquire::https::Proxy \"http://10.22.57.8:3142\";' \
| tee /etc/apt/apt.conf.d/01proxy >/dev/null"

View File

@@ -0,0 +1,47 @@
# master节点
# 安装 squid
yum install -y squid
# 备份默认配置
cp /etc/squid/squid.conf /etc/squid/squid.conf.bak
# 编辑 /etc/squid/squid.conf
# 定义内网网段 关键!
acl localnet src 192.168.5.0/24
# 允许内网访问
http_access allow localnet
http_access allow localhost
# 监听端口
http_port 3128
# 其余保持默认,拒绝所有其他
http_access deny all
systemctl enable squid --now
# worker节点
## 编辑 /etc/yum.conf
[main]
# ... 其他配置 ...
proxy=http://192.168.5.41:3128
# 在客户端节点执行
yum makecache
yum install -y wget
# 直接执行
sed -n '/^proxy=/ {p;q}; $ {a proxy=http://192.168.5.41:3128' -e 'p}' /etc/yum.conf
# 批量执行
ssh root@${server} "grep -q '^proxy=' /etc/yum.conf && grep '^proxy=' /etc/yum.conf || echo 'proxy=http://192.168.5.41:3128' >> /etc/yum.conf"