feat(docker): add repo_region (auto/official/cn) + point service at canonical path
Two changes:
1) Docker generator: introduce 'repo_region' select field with three modes:
auto — probe download.docker.com (5s timeout); fall back to Tuna
mirror if unreachable. Default.
official — force download.docker.com URLs (GPG + apt/yum repo).
cn — force mirrors.tuna.tsinghua.edu.cn/docker-ce URLs.
The apt/yum repo body now uses ${DOCKER_REPO_APT}/${DOCKER_REPO_YUM}
variables instead of hardcoded URLs. yum/dnf uses 'command -v
yum-config-manager' to pick the right tool (dnf-only distros like
Rocky/Alma now skip the failed yum-config-manager probe).
Tuna URLs verified reachable: curl -fsSI returned 200 for both
linux/ubuntu/gpg and linux/centos/gpg. registry_mirror default also
switched to docker.mirrors.ustc.edu.cn (was tencent cloud).
2) shell-gen.service: point WorkingDirectory and ExecStart at
/fs/1000/ftp/Project/shell-gen (the canonical git checkout) instead
of /root/shell-gen. The /root/ copy was a stale duplicate that
caused previous fixes to silently not reach the running web UI.
/root/shell-gen is preserved untouched (user has local artifacts
there: vnc_*.sh, k8s/, deliverables/, etc).
Verified:
- bash -n OK on all 3 region variants
- region=auto with reachable overseas: picks official
- region=auto with overseas-blocked (curl stubbed to fail):
DOCKER_REPO_APT/YUM correctly fall back to tuna.tsinghua,
warning emitted on stderr
- region=official: forces official URLs, no probe
- region=cn: forces Tuna URLs, no probe
- 7 other sampled generators unchanged (memcached, wireguard,
rabbitmq, chrony, mongodb, nginx, redis all bash -n OK,
$PKG_INSTALL count 0)
This commit is contained in:
+2
-2
@@ -5,8 +5,8 @@ After=network.target
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/root/shell-gen
|
||||
ExecStart=/usr/bin/python3 /root/shell-gen/app.py
|
||||
WorkingDirectory=/fs/1000/ftp/Project/shell-gen
|
||||
ExecStart=/usr/bin/python3 /fs/1000/ftp/Project/shell-gen/app.py
|
||||
Restart=on-failure
|
||||
RestartSec=3
|
||||
Environment=PORT=5099
|
||||
|
||||
Reference in New Issue
Block a user