@jigw/install 0.1.0-review.0 → 0.1.0-review.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/install.sh +27 -4
- package/package.json +2 -1
package/install.sh
CHANGED
|
@@ -3,7 +3,15 @@ set -euo pipefail
|
|
|
3
3
|
umask 077
|
|
4
4
|
fail() { printf '%s\n' "$1" >&2; exit 1; }
|
|
5
5
|
root="$HOME/.jigw-hermes"
|
|
6
|
-
[[ $OSTYPE == linux*
|
|
6
|
+
[[ $OSTYPE == linux* ]] || fail "이 설치기는 Linux에서 실행해야 합니다. 에이전트를 운영할 Linux 서버에서 다시 실행하세요."
|
|
7
|
+
if (( EUID == 0 )); then
|
|
8
|
+
printf '%s\n' 'JIGW host installer stopped before setup: current Linux user is root (UID 0).' >&2
|
|
9
|
+
printf '%s\n' 'Use the account that will own the agent files and run its own rootless Docker engine.' >&2
|
|
10
|
+
if [[ -n ${SUDO_USER:-} && $SUDO_USER != root ]]; then
|
|
11
|
+
printf '%s\n' 'If you opened this shell with sudo -i, type exit to leave it.' >&2
|
|
12
|
+
fi
|
|
13
|
+
fail 'In that account, run id -un to confirm the username, then run npx @jigw/install without sudo.'
|
|
14
|
+
fi
|
|
7
15
|
for tool in curl tar sha256sum mktemp install mv base64 flock timeout loginctl grep; do
|
|
8
16
|
command -v "$tool" >/dev/null || fail "Install the missing tool: $tool. Then run this command again."
|
|
9
17
|
done
|
|
@@ -22,10 +30,25 @@ check_worker_host() {
|
|
|
22
30
|
[[ $endpoint == "unix://$runtime/"* && $endpoint != *'/../'* && $endpoint != *'/..' ]] ||
|
|
23
31
|
fail "설치 계정의 런타임 경로 아래에 있는 rootless Docker Unix 소켓을 DOCKER_HOST에 지정한 뒤 다시 실행하세요."
|
|
24
32
|
command -v docker >/dev/null || fail "Docker CLI가 없습니다. 이 계정에 rootless Docker를 준비하세요."
|
|
25
|
-
|
|
26
|
-
|
|
33
|
+
local socket=${endpoint#unix://} source='default for this user' rc
|
|
34
|
+
[[ -z ${DOCKER_HOST:-} ]] || source=DOCKER_HOST
|
|
35
|
+
if [[ ! -S $socket ]]; then
|
|
36
|
+
printf 'JIGW Docker check stopped: no Unix socket found at %q (%s, UID %s).\n' "$socket" "$source" "$EUID" >&2
|
|
37
|
+
fail "Check the socket path and whether this user can access its parent directory. Check that this user's rootless Docker service has started and is listening at that path. Then retry."
|
|
38
|
+
fi
|
|
39
|
+
timeout 15 docker --host "$endpoint" version --format '{{.Server.Version}}' >/dev/null || {
|
|
40
|
+
rc=$?
|
|
41
|
+
printf 'JIGW Docker check stopped: Unix socket found at %q (%s, UID %s).\n' "$socket" "$source" "$EUID" >&2
|
|
42
|
+
if (( rc == 124 )); then
|
|
43
|
+
printf '%s\n' 'Docker did not return its server version within 15 seconds.' >&2
|
|
44
|
+
else
|
|
45
|
+
printf 'Docker could not read the server version (exit %s). See the Docker error above.\n' "$rc" >&2
|
|
46
|
+
fi
|
|
47
|
+
printf 'From the same account, run: docker --host %q version\n' "$endpoint" >&2
|
|
48
|
+
fail "Check the rootless Docker service status and logs for this socket. Retry when the command shows a Server version."
|
|
49
|
+
}
|
|
27
50
|
options=$(timeout 15 docker --host "$endpoint" info --format '{{range .SecurityOptions}}{{println .}}{{end}}') ||
|
|
28
|
-
fail "
|
|
51
|
+
fail "JIGW Docker check stopped: the engine returned its version, but docker info failed. Check the Docker error above and run docker info against the same socket."
|
|
29
52
|
grep -Fxq 'name=rootless' <<<"$options" ||
|
|
30
53
|
fail "이 소켓의 Docker는 rootless가 아닙니다. 설치 계정의 rootless Docker 소켓을 확인하세요."
|
|
31
54
|
printf '%s\n' 'services:' ' probe:' ' image: busybox:latest' |
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jigw/install",
|
|
3
|
-
"version": "0.1.0-review.
|
|
3
|
+
"version": "0.1.0-review.2",
|
|
4
|
+
"repository": "https://github.com/hannpasssoft-dev/jigw-host-installer.git",
|
|
4
5
|
"description": "JIGW agent server installer",
|
|
5
6
|
"os": ["linux"],
|
|
6
7
|
"bin": { "jigw-install": "install.sh" },
|