devzone 7.1.1 → 7.3.0
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/.devcontainer/Dockerfile +14 -14
- package/.devcontainer/ai/host-check.message +12 -12
- package/.devcontainer/ai/host-check.sh +1 -1
- package/.devcontainer/catalog/catalog-watcher.sh +9 -12
- package/.devcontainer/catalog.sh +5 -28
- package/.devcontainer/cluster.sh +1 -4
- package/.devcontainer/devzone +27 -25
- package/.devcontainer/devzone-ai.sh +1 -1
- package/.devcontainer/devzone-cluster.sh +1 -2
- package/.devcontainer/devzone-modules.sh +9 -20
- package/.devcontainer/devzone-repair.sh +3 -3
- package/.devcontainer/devzone-services.sh +2 -2
- package/.devcontainer/devzone-status.sh +1 -1
- package/.devcontainer/gitlab/demo/.gitlab-ci.yml +1 -1
- package/.devcontainer/help.sh +0 -1
- package/.devcontainer/packages.sh +1 -1
- package/.devcontainer/password.sh +5 -6
- package/.devcontainer/ports.sh +3 -6
- package/.devcontainer/services-admin.sh +5 -8
- package/.devcontainer/workspace-init.sh +0 -7
- package/Makefile +3 -3
- package/README.md +1 -13
- package/bin/SHA256SUMS +6 -6
- package/bin/devzone-darwin-amd64 +0 -0
- package/bin/devzone-darwin-arm64 +0 -0
- package/bin/devzone-linux-amd64 +0 -0
- package/bin/devzone-linux-arm64 +0 -0
- package/bin/devzone-windows-amd64.exe +0 -0
- package/bin/devzone-windows-arm64.exe +0 -0
- package/manage/devzone +6 -17
- package/manage/scripts/ci/check-names.sh +5 -6
- package/manage/scripts/ci/ticket-protocol.txt +7 -0
- package/manage/scripts/ci/versions-tools-plan.sh +1 -1
- package/manage/scripts/devzone-create.sh +4 -4
- package/manage/scripts/devzone-update.sh +18 -22
- package/manage/scripts/workspace/argocd-services.sh +1 -1
- package/manage/scripts/workspace/argocd-workspace.sh +2 -2
- package/manage/scripts/workspace/ports-workspace.sh +5 -5
- package/manage/scripts/workspace/services-workspace.sh +3 -3
- package/manage/scripts/workspace/workspace-update.sh +0 -3
- package/manage/workspace.sh +0 -14
- package/package.json +1 -1
- package/.devcontainer/command-aliases.sh +0 -234
- package/.devcontainer/rename-legacy-files.sh +0 -172
- package/.devcontainer/rename-legacy-ports.sh +0 -119
- package/.devcontainer/state-gitops.sh +0 -23
- package/.devcontainer/state-json.sh +0 -282
- package/.devcontainer/state-lock.sh +0 -53
- package/.devcontainer/state.sh +0 -219
- package/manage/scripts/ci/check-english.sh +0 -57
package/.devcontainer/Dockerfile
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
# Java, Node, Python,
|
|
1
|
+
# devzone base image: tools without an official feature, pinned versions.
|
|
2
|
+
# Java, Node, Python, kubectl, helm and gh are added by the features
|
|
3
3
|
# de devcontainer.json, par-dessus cette image.
|
|
4
4
|
|
|
5
5
|
# uv : binaire de l'image officielle (pas de script curl | sh)
|
|
@@ -8,7 +8,7 @@ FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv
|
|
|
8
8
|
|
|
9
9
|
FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04
|
|
10
10
|
|
|
11
|
-
# Versions
|
|
11
|
+
# Versions: to update, change the version AND the sha256 checksum,
|
|
12
12
|
# puis Rebuild Container
|
|
13
13
|
ARG K9S_VERSION=0.51.0
|
|
14
14
|
ARG ACTIONLINT_VERSION=1.7.12
|
|
@@ -17,7 +17,7 @@ ARG KIND_VERSION=0.33.0
|
|
|
17
17
|
ARG KUBECTX_VERSION=0.11.0
|
|
18
18
|
ARG RUFF_VERSION=0.17.0
|
|
19
19
|
ARG VULTURE_VERSION=2.16
|
|
20
|
-
# pytest
|
|
20
|
+
# pytest: same version as the repowarden CI (ci/requirements/e2e-python.in)
|
|
21
21
|
ARG PYTEST_VERSION=9.1.1
|
|
22
22
|
# BuildKit client (buildctl) for the Kubernetes workspace pod (#514). Pinned to
|
|
23
23
|
# the buildkitd sidecar version; checksums from the moby/buildkit v0.34.2 release
|
|
@@ -34,16 +34,16 @@ ARG GO_SHA256_ARM64=3392582988a273a87ab5043ee1b2c9c17a2c3c00580bf9326c47a2e0aaae
|
|
|
34
34
|
|
|
35
35
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
36
36
|
|
|
37
|
-
#
|
|
38
|
-
# (repowarden guard, module
|
|
39
|
-
# Python 3.12
|
|
37
|
+
# Shell checks of repowarden; jq: read by its guard for AI agents
|
|
38
|
+
# (repowarden guard, ai module), which checks nothing without it
|
|
39
|
+
# Python 3.12 of Ubuntu 24.04, packages signed by apt, no key server (#464)
|
|
40
40
|
RUN apt-get -o Acquire::Retries=5 update \
|
|
41
41
|
&& apt-get -o Acquire::Retries=5 install -y --no-install-recommends shellcheck bats jq python3 python3-venv python3-pip python-is-python3 \
|
|
42
42
|
&& rm -rf /var/lib/apt/lists/*
|
|
43
43
|
|
|
44
|
-
# k9s, actionlint (
|
|
45
|
-
#
|
|
46
|
-
# (kind
|
|
44
|
+
# k9s, actionlint (same versions as the repowarden CI), gitleaks, kind:
|
|
45
|
+
# install <name> <url> <sha256>: checksum verified before installing anything into /usr/local/bin
|
|
46
|
+
# (kind is a single binary, without an archive: installed separately, same check)
|
|
47
47
|
RUN set -eu; \
|
|
48
48
|
arch="$(dpkg --print-architecture)"; \
|
|
49
49
|
case "$arch" in \
|
|
@@ -75,7 +75,7 @@ RUN set -eu; \
|
|
|
75
75
|
install -m 0755 /tmp/kind /usr/local/bin/kind-reel; \
|
|
76
76
|
rm -f /tmp/kind
|
|
77
77
|
|
|
78
|
-
# kubectx
|
|
78
|
+
# kubectx and kubens: official ahmetb/kubectx binaries, versions pinned with
|
|
79
79
|
# empreinte sha256 par architecture (comme k9s)
|
|
80
80
|
RUN set -eu; \
|
|
81
81
|
arch="$(dpkg --print-architecture)"; \
|
|
@@ -142,9 +142,9 @@ ENV PATH="/usr/local/go/bin:${PATH}" \
|
|
|
142
142
|
|
|
143
143
|
COPY --from=uv /uv /uvx /usr/local/bin/
|
|
144
144
|
|
|
145
|
-
# ruff, vulture (
|
|
146
|
-
#
|
|
147
|
-
# (
|
|
145
|
+
# ruff, vulture (both needed by repowarden dead-code checks) and pytest, installed
|
|
146
|
+
# for every user, with a Python managed by uv outside the home
|
|
147
|
+
# (build-only variables: uv tool install stays in ~/.local for vscode)
|
|
148
148
|
RUN export UV_TOOL_DIR=/opt/uv/tools UV_TOOL_BIN_DIR=/usr/local/bin \
|
|
149
149
|
UV_PYTHON_INSTALL_DIR=/opt/uv/python \
|
|
150
150
|
&& uv tool install "ruff==${RUFF_VERSION}" \
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
MSG_TITRE="
|
|
2
|
-
MSG_AUCUN="devzone
|
|
3
|
-
MSG_TAILLE="
|
|
4
|
-
MSG_A_JOUR="
|
|
5
|
-
MSG_MAJ="
|
|
6
|
-
MSG_NON="
|
|
7
|
-
MSG_PULL="
|
|
8
|
-
MSG_MESURE="
|
|
9
|
-
MSG_RETENU="
|
|
10
|
-
MSG_RAISON_VAR="
|
|
11
|
-
MSG_RAISON_MESURE="
|
|
12
|
-
MSG_RAISON_REGLE="
|
|
1
|
+
MSG_TITRE="host (Ollama) models detected:"
|
|
2
|
+
MSG_AUCUN="devzone: no Ollama model detected on {url} (answer on /api/tags)"
|
|
3
|
+
MSG_TAILLE="size"
|
|
4
|
+
MSG_A_JOUR="up to date"
|
|
5
|
+
MSG_MAJ="update available"
|
|
6
|
+
MSG_NON="not verifiable"
|
|
7
|
+
MSG_PULL="on the host: ollama pull {modele}"
|
|
8
|
+
MSG_MESURE="measurement reussite {reussite}, tok_s {tok_s}"
|
|
9
|
+
MSG_RETENU="chosen model: {modele} ({raison})"
|
|
10
|
+
MSG_RAISON_VAR="DEVZONE_HOST_MODEL"
|
|
11
|
+
MSG_RAISON_MESURE="measurement"
|
|
12
|
+
MSG_RAISON_REGLE="rule"
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
# printed for the host). The registry is DEVZONE_OLLAMA_REGISTRY, else
|
|
10
10
|
# https://registry.ollama.ai.
|
|
11
11
|
# bash 3.2 (macOS). Code and comments in English; the user messages are French
|
|
12
|
-
# and live in host-check.message
|
|
12
|
+
# and live in host-check.message, a data file outside the code check.
|
|
13
13
|
set -euo pipefail
|
|
14
14
|
|
|
15
15
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# Catalog hot detection (#414): when .devzone.modules changes, catalog.sh apply
|
|
3
3
|
# runs. A single instance (lock, as #394).
|
|
4
|
-
# catalog-watcher.sh
|
|
4
|
+
# catalog-watcher.sh loop | start | stop | tick
|
|
5
5
|
set -euo pipefail
|
|
6
6
|
|
|
7
7
|
ICI="$(cd "$(dirname "$0")" && pwd)"
|
|
8
8
|
RACINE="${DEVZONE_ROOT:-$(cd "$ICI/../.." && pwd)}"
|
|
9
9
|
ETAT="${DEVZONE_STATE:-$RACINE/.devzone.modules}"
|
|
10
|
-
# shellcheck source=SCRIPTDIR/state.sh
|
|
11
|
-
# shellcheck disable=SC1091
|
|
12
|
-
. "$(dirname "$ICI")/state.sh"
|
|
13
10
|
BASE="${DEVZONE_CATALOG_WATCHER_DIR:-$RACINE/.devzone.catalog-watcher}"
|
|
14
11
|
LOCK_DIR="$BASE/lock"
|
|
15
12
|
LAST_FILE="$BASE/dernier"
|
|
@@ -54,8 +51,8 @@ tick() {
|
|
|
54
51
|
[ -f "$ETAT" ] || return 0
|
|
55
52
|
# Restored or rebuilt state: the watcher does not follow a doubtful state,
|
|
56
53
|
# and never uninstalls until devzone apply has confirmed it
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
DEVZONE_STATE="$ETAT" bash "${ICI:-$(dirname "$ICI")}/devzone" state recovery-wait && return 0
|
|
55
|
+
DEVZONE_STATE="$ETAT" bash "${ICI:-$(dirname "$ICI")}/devzone" state recovery-pending && return 0
|
|
59
56
|
mkdir -p "$BASE"
|
|
60
57
|
now="$(stat -c %Y "$ETAT" 2>/dev/null || stat -f %m "$ETAT" 2>/dev/null || true)"
|
|
61
58
|
[ -n "$now" ] || return 0
|
|
@@ -86,7 +83,7 @@ start_detached() {
|
|
|
86
83
|
mkdir -p "$BASE"
|
|
87
84
|
# Same detachment as relay_start: setsid when present, else nohup.
|
|
88
85
|
command -v setsid >/dev/null 2>&1 && detache=(setsid)
|
|
89
|
-
${detache[@]+"${detache[@]}"} nohup env DEVZONE_CATALOG_REAL=yes bash "$0"
|
|
86
|
+
${detache[@]+"${detache[@]}"} nohup env DEVZONE_CATALOG_REAL=yes bash "$0" loop >"$BASE/veilleur.log" 2>&1 &
|
|
90
87
|
i=0
|
|
91
88
|
while [ "$i" -lt 20 ]; do
|
|
92
89
|
pid="$(cat "$LOCK_DIR/pid" 2>/dev/null || true)"
|
|
@@ -112,8 +109,8 @@ stop_watcher() {
|
|
|
112
109
|
}
|
|
113
110
|
|
|
114
111
|
case "${1:-}" in
|
|
115
|
-
|
|
116
|
-
|
|
112
|
+
loop) if ! guard_watcher; then exit 2; fi; loop ;;
|
|
113
|
+
start)
|
|
117
114
|
if ! guard_watcher; then exit 2; fi
|
|
118
115
|
if [ -f "$LOCK_DIR/pid" ] && kill -0 "$(cat "$LOCK_DIR/pid")" 2>/dev/null; then
|
|
119
116
|
echo "already running"
|
|
@@ -121,10 +118,10 @@ case "${1:-}" in
|
|
|
121
118
|
start_detached || exit 1
|
|
122
119
|
fi
|
|
123
120
|
;;
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
stop) stop_watcher ; echo "stopped" ;;
|
|
122
|
+
tick) tick ;;
|
|
126
123
|
*)
|
|
127
|
-
echo "devzone : catalog-watcher :
|
|
124
|
+
echo "devzone : catalog-watcher : loop | start | stop | tick" >&2
|
|
128
125
|
exit 2
|
|
129
126
|
;;
|
|
130
127
|
esac
|
package/.devcontainer/catalog.sh
CHANGED
|
@@ -12,9 +12,6 @@ ETAT="${DEVZONE_STATE:-$RACINE/.devzone.modules}"
|
|
|
12
12
|
# shellcheck source=SCRIPTDIR/cluster.sh
|
|
13
13
|
# shellcheck disable=SC1091
|
|
14
14
|
. "$ICI/cluster.sh"
|
|
15
|
-
# shellcheck source=SCRIPTDIR/state.sh
|
|
16
|
-
# shellcheck disable=SC1091
|
|
17
|
-
. "$ICI/state.sh"
|
|
18
15
|
# shellcheck source=SCRIPTDIR/password.sh
|
|
19
16
|
# shellcheck disable=SC1091
|
|
20
17
|
. "$ICI/password.sh"
|
|
@@ -92,30 +89,10 @@ app_ready() {
|
|
|
92
89
|
}
|
|
93
90
|
|
|
94
91
|
# Adds to the state the <app>=off lines of the absent applications (once each,
|
|
95
|
-
# an existing line is never changed),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
[ -f "$ETAT" ] || return 0
|
|
100
|
-
header="# Catalog applications: set to on to install (devzone catalog)"
|
|
101
|
-
state_lock_take || return 1
|
|
102
|
-
# The lock is released on exit, including on an error under set -e
|
|
103
|
-
trap 'state_lock_release' EXIT
|
|
104
|
-
while IFS= read -r app; do
|
|
105
|
-
[ -n "$app" ] || continue
|
|
106
|
-
grep -qE "^${app}=" "$ETAT" 2>/dev/null && continue
|
|
107
|
-
missing="${missing}${missing:+$'\n'}${app}=off"
|
|
108
|
-
done <<<"$(catalog_apps)"
|
|
109
|
-
[ -n "$missing" ] || return 0
|
|
110
|
-
tmp="$(mktemp)"
|
|
111
|
-
{
|
|
112
|
-
cat "$ETAT"
|
|
113
|
-
grep -qF -e "$header" "$ETAT" || echo "$header"
|
|
114
|
-
echo "$missing"
|
|
115
|
-
} >"$tmp"
|
|
116
|
-
state_replace "$tmp"
|
|
117
|
-
rm -f "$tmp"
|
|
118
|
-
)
|
|
92
|
+
# an existing line is never changed), under the Go state lock (#879).
|
|
93
|
+
catalog_sync() {
|
|
94
|
+
DEVZONE_STATE="$ETAT" bash "$ICI/devzone" state catalog-sync
|
|
95
|
+
}
|
|
119
96
|
|
|
120
97
|
# Real state of an application: available, expected, installed, failed. These
|
|
121
98
|
# values are the etat field of devzone status --json: keep them
|
|
@@ -223,7 +200,7 @@ case "${1:-}" in
|
|
|
223
200
|
json) catalog_json ;;
|
|
224
201
|
# Removal of an application: StatefulSet and service, volume kept (#441)
|
|
225
202
|
remove) app_remove "$2" ;;
|
|
226
|
-
-h | --help
|
|
203
|
+
-h | --help) sed -n '2,6p' "$0" | sed 's/^# \{0,1\}//' ;;
|
|
227
204
|
*)
|
|
228
205
|
echo "devzone : catalog : sync | apply | list | resume | json | remove <app>" >&2
|
|
229
206
|
exit 1
|
package/.devcontainer/cluster.sh
CHANGED
|
@@ -29,9 +29,6 @@ export KUBECONFIG
|
|
|
29
29
|
|
|
30
30
|
# Safe state write (#417): lock, temporary file in the state folder, backup copy
|
|
31
31
|
# .prev — shared by devzone, ports
|
|
32
|
-
# shellcheck source=SCRIPTDIR/state.sh
|
|
33
|
-
# shellcheck disable=SC1091
|
|
34
|
-
. "$(dirname "${BASH_SOURCE[0]}")/state.sh"
|
|
35
32
|
|
|
36
33
|
# Instance name: empty or « devzone » = default instance (no suffix)
|
|
37
34
|
: "${DEVZONE_INSTANCE:=}"
|
|
@@ -57,7 +54,7 @@ cluster_saved() {
|
|
|
57
54
|
}
|
|
58
55
|
|
|
59
56
|
cluster_save() {
|
|
60
|
-
|
|
57
|
+
DEVZONE_STATE="$ETAT" bash "${ICI:-$(dirname "${BASH_SOURCE[0]}")}/devzone" state write cluster "$1"
|
|
61
58
|
}
|
|
62
59
|
|
|
63
60
|
cluster_is_dedicated() {
|
package/.devcontainer/devzone
CHANGED
|
@@ -32,7 +32,7 @@ if [ -z "${DEVZONE_NO_GO:-}" ] && [ -z "$FROM_GO" ]; then
|
|
|
32
32
|
aarch64 | arm64) POD_GO_ARCH=arm64 ;;
|
|
33
33
|
*) POD_GO_ARCH="" ;;
|
|
34
34
|
esac
|
|
35
|
-
POD_GO="$ICI/bin/devzone-pod-
|
|
35
|
+
POD_GO="$ICI/bin/devzone-pod-$(uname -s | tr '[:upper:]' '[:lower:]')-$POD_GO_ARCH"
|
|
36
36
|
if [ -n "$POD_GO_ARCH" ] && [ -x "$POD_GO" ] && "$POD_GO" handles "${1:-}" >/dev/null 2>&1; then
|
|
37
37
|
DEVZONE_POD_SCRIPT="$ICI/devzone" exec "$POD_GO" "$@"
|
|
38
38
|
fi
|
|
@@ -49,12 +49,6 @@ MODULES=(ai kubernetes gitlab postgres argocd mysql)
|
|
|
49
49
|
# shellcheck source=SCRIPTDIR/cluster.sh
|
|
50
50
|
# shellcheck disable=SC1091
|
|
51
51
|
. "$ICI/cluster.sh"
|
|
52
|
-
# English command names are accepted (#502); a copied devzone may miss the file
|
|
53
|
-
# shellcheck source=SCRIPTDIR/command-aliases.sh
|
|
54
|
-
# shellcheck disable=SC1091
|
|
55
|
-
if [ -f "$ICI/command-aliases.sh" ]; then
|
|
56
|
-
. "$ICI/command-aliases.sh"
|
|
57
|
-
fi
|
|
58
52
|
# .argocd.conf of the instance: the GitOps repository designation (#539)
|
|
59
53
|
# shellcheck source=SCRIPTDIR/argocd/conf.sh
|
|
60
54
|
# shellcheck disable=SC1091
|
|
@@ -64,9 +58,6 @@ if [ -f "$ICI/argocd/conf.sh" ]; then
|
|
|
64
58
|
. "$ICI/argocd/conf.sh"
|
|
65
59
|
fi
|
|
66
60
|
# GitOps repository line in the Kubernetes workspace pod (#639)
|
|
67
|
-
# shellcheck source=SCRIPTDIR/state-gitops.sh
|
|
68
|
-
# shellcheck disable=SC1091
|
|
69
|
-
. "$ICI/state-gitops.sh"
|
|
70
61
|
# Detection of the host (Ollama) models and the devzone-host opencode provider (#665).
|
|
71
62
|
# shellcheck source=SCRIPTDIR/ai/host-models.sh
|
|
72
63
|
# shellcheck disable=SC1091
|
|
@@ -131,27 +122,38 @@ GITLAB_URL_MODULE=http://gitlab.localhost:8929
|
|
|
131
122
|
# shellcheck disable=SC1091
|
|
132
123
|
. "$ICI/devzone-status.sh"
|
|
133
124
|
|
|
134
|
-
# shellcheck source=state-json.sh
|
|
135
|
-
# shellcheck disable=SC1091
|
|
136
|
-
if [ -f "$ICI/state-json.sh" ]; then
|
|
137
|
-
. "$ICI/state-json.sh"
|
|
138
|
-
fi
|
|
139
|
-
|
|
140
|
-
# Renamed names (#695): an old French name is refused with its new name, before
|
|
141
|
-
# anything runs (exit 1). Without the aliases file (copied devzone): no check.
|
|
142
|
-
if command -v reject_renamed >/dev/null 2>&1; then
|
|
143
|
-
reject_renamed "$@" || exit 1
|
|
144
|
-
fi
|
|
145
125
|
|
|
146
126
|
case "${1:-}" in
|
|
147
|
-
"" | status | modules) if [ "${2:-}" = "--json" ]; then
|
|
127
|
+
"" | status | modules) if [ "${2:-}" = "--json" ]; then DEVZONE_STATE="$ETAT" bash "$ICI/devzone" state json; else show_state; fi ;;
|
|
128
|
+
state)
|
|
129
|
+
export DEVZONE_STATE="$ETAT"
|
|
130
|
+
case "${2:-}" in
|
|
131
|
+
write|remove|replace|init|recovery-mark|recovery-wait|recovery-pending|recovery-confirm|catalog-sync|gitops-line|json)
|
|
132
|
+
# shellcheck disable=SC2034 # DEVZONE_STATE used by state helpers
|
|
133
|
+
ETAT="$DEVZONE_STATE"
|
|
134
|
+
;;
|
|
135
|
+
*) echo "devzone state: write|remove|replace|init|recovery-mark|recovery-wait|recovery-pending|recovery-confirm|catalog-sync|gitops-line|json" >&2; exit 1 ;;
|
|
136
|
+
esac
|
|
137
|
+
ici_state="$ICI"
|
|
138
|
+
pod_state=""
|
|
139
|
+
case "$(uname -m)" in
|
|
140
|
+
x86_64) pod_state="$ici_state/bin/devzone-pod-linux-amd64" ;;
|
|
141
|
+
aarch64 | arm64) pod_state="$ici_state/bin/devzone-pod-linux-arm64" ;;
|
|
142
|
+
esac
|
|
143
|
+
if [ -n "$pod_state" ] && [ -x "$pod_state" ]; then
|
|
144
|
+
"$pod_state" "$@"
|
|
145
|
+
else
|
|
146
|
+
echo "devzone : state: Go pod binary unavailable" >&2
|
|
147
|
+
exit 127
|
|
148
|
+
fi
|
|
149
|
+
;;
|
|
148
150
|
enable) change_module on "${2:-}" "${@:3}" ;;
|
|
149
151
|
disable) change_module off "${2:-}" "${@:3}" ;;
|
|
150
152
|
apply)
|
|
151
153
|
migrate_llm
|
|
152
154
|
# The user confirms the current state (#417, step 4): the watchers
|
|
153
155
|
# may uninstall again
|
|
154
|
-
|
|
156
|
+
DEVZONE_STATE="$ETAT" bash "$ICI/devzone" state recovery-confirm
|
|
155
157
|
apply_repowarden
|
|
156
158
|
[ "$(value_of ai)" = off ] || apply_ai on
|
|
157
159
|
# gitlab, postgres, argocd: installed from the workstation in the
|
|
@@ -218,9 +220,9 @@ case "${1:-}" in
|
|
|
218
220
|
port) DEVZONE_STATE="$ETAT" bash "$ICI/ports.sh" "${@:2}" ;;
|
|
219
221
|
packages) bash "$ICI/packages.sh" "${@:2}" ;;
|
|
220
222
|
passwords)
|
|
221
|
-
bash "$ICI/password.sh"
|
|
223
|
+
bash "$ICI/password.sh" regenerate ||
|
|
222
224
|
echo "devzone : grouped credentials not updated" >&2
|
|
223
|
-
bash "$ICI/password.sh"
|
|
225
|
+
bash "$ICI/password.sh" path
|
|
224
226
|
;;
|
|
225
227
|
-h | --help | help) devzone_aide ;;
|
|
226
228
|
test-bash32) bash "$RACINE/manage/test/bash32.sh" ;;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Marker of the default configuration: first line of opencode.jsonc. The former
|
|
8
8
|
# wording (French, before #722) is still recognised. Byte escapes keep the accent
|
|
9
|
-
# out of the source (check
|
|
9
|
+
# out of the source (English code check).
|
|
10
10
|
OPENCODE_MARKER='// devzone : default opencode configuration'
|
|
11
11
|
|
|
12
12
|
# True if the file carries the default-configuration marker
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# All the databases disappear: confirmation in the terminal (without a terminal,
|
|
8
8
|
# the command is explicit); a yes or --yes sets DELETE_DATA, read by
|
|
9
|
-
# apply_mysql to run delete-data (#441)
|
|
10
|
-
# --oui is refused before reaching here, only --yes passes (#695).
|
|
9
|
+
# apply_mysql to run delete-data (#441); only --yes reaches this function.
|
|
11
10
|
confirm_removal() {
|
|
12
11
|
local app="$1" answer arg
|
|
13
12
|
DELETE_DATA=""
|
|
@@ -21,11 +21,11 @@ is_known() {
|
|
|
21
21
|
return 1
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
# First start (no state): the state is created by state
|
|
24
|
+
# First start (no state): the state is created by Go state command (#879): old global
|
|
25
25
|
# state taken over, backup copy restored, state rebuilt from the services
|
|
26
26
|
# cluster, otherwise first installation
|
|
27
27
|
init_state() {
|
|
28
|
-
|
|
28
|
+
DEVZONE_STATE="$ETAT" bash "${ICI:-$(dirname "${BASH_SOURCE[0]}")}/devzone" state init "${MODULES[@]}"
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
value_of() {
|
|
@@ -35,28 +35,17 @@ value_of() {
|
|
|
35
35
|
[ "$v" = on ] && echo on || echo off
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
# State-file
|
|
39
|
-
# recreated empty between the two
|
|
38
|
+
# State-file write delegated to Go (#879): lock, backup and atomic replace.
|
|
40
39
|
write_value() {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
state_lock_release
|
|
44
|
-
return 1
|
|
45
|
-
fi
|
|
46
|
-
state_lock_release
|
|
47
|
-
return 0
|
|
40
|
+
init_state || return 1
|
|
41
|
+
DEVZONE_STATE="$ETAT" bash "${ICI:-$(dirname "${BASH_SOURCE[0]}")}/devzone" state write "$1" "$2"
|
|
48
42
|
}
|
|
49
43
|
|
|
50
44
|
# Removes a key from the state file: the configuration of a service only exists
|
|
51
45
|
# while it is chosen (#242)
|
|
52
46
|
remove_key() {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
state_lock_release
|
|
56
|
-
return 1
|
|
57
|
-
fi
|
|
58
|
-
state_lock_release
|
|
59
|
-
return 0
|
|
47
|
+
init_state || return 1
|
|
48
|
+
DEVZONE_STATE="$ETAT" bash "${ICI:-$(dirname "${BASH_SOURCE[0]}")}/devzone" state remove "$1"
|
|
60
49
|
}
|
|
61
50
|
|
|
62
51
|
# True if the file only holds the $schema key (created by opencode by default)
|
|
@@ -75,7 +64,7 @@ llm_removed_msg() {
|
|
|
75
64
|
migrate_llm() {
|
|
76
65
|
[ -f "$ETAT" ] || return 0
|
|
77
66
|
grep -qE '^llm=' "$ETAT" 2>/dev/null || return 0
|
|
78
|
-
|
|
67
|
+
DEVZONE_STATE="$ETAT" bash "${ICI:-$(dirname "${BASH_SOURCE[0]}")}/devzone" state remove llm
|
|
79
68
|
llm_removed_msg
|
|
80
69
|
}
|
|
81
70
|
|
|
@@ -89,7 +78,7 @@ change_module() {
|
|
|
89
78
|
if [ "$m" = llm ]; then
|
|
90
79
|
init_state 2>/dev/null || true
|
|
91
80
|
if [ -f "$ETAT" ] && grep -qE '^llm=' "$ETAT" 2>/dev/null; then
|
|
92
|
-
|
|
81
|
+
DEVZONE_STATE="$ETAT" bash "${ICI:-$(dirname "${BASH_SOURCE[0]}")}/devzone" state remove llm
|
|
93
82
|
fi
|
|
94
83
|
llm_removed_msg
|
|
95
84
|
return 1
|
|
@@ -66,7 +66,7 @@ repair_item() {
|
|
|
66
66
|
repair_workstation() {
|
|
67
67
|
repair_failed=0
|
|
68
68
|
if [ "$(value_of gitlab)" = on ]; then
|
|
69
|
-
repair_item "gitlab name" devzone gitlab
|
|
69
|
+
repair_item "gitlab name" devzone gitlab host-set
|
|
70
70
|
repair_item "gitlab relay" devzone gitlab relay-start
|
|
71
71
|
fi
|
|
72
72
|
if [ "$(value_of postgres)" = on ]; then
|
|
@@ -78,8 +78,8 @@ repair_workstation() {
|
|
|
78
78
|
if [ "$(value_of mysql)" = on ]; then
|
|
79
79
|
repair_item "mysql relay" devzone mysql relay-start
|
|
80
80
|
fi
|
|
81
|
-
repair_item "catalog watcher" env DEVZONE_CATALOG_REAL=yes bash "$ICI/catalog/catalog-watcher.sh"
|
|
82
|
-
repair_item "credentials" bash "$ICI/password.sh"
|
|
81
|
+
repair_item "catalog watcher" env DEVZONE_CATALOG_REAL=yes bash "$ICI/catalog/catalog-watcher.sh" start
|
|
82
|
+
repair_item "credentials" bash "$ICI/password.sh" regenerate
|
|
83
83
|
devzone cluster clean || true
|
|
84
84
|
return "$repair_failed"
|
|
85
85
|
}
|
|
@@ -101,7 +101,7 @@ apply_gitlab() {
|
|
|
101
101
|
if [[ "$current_state" == *"ready"* && "$current_state" == *"runner online"* ]]; then
|
|
102
102
|
echo "devzone : gitlab already active, nothing to do."
|
|
103
103
|
# /etc/hosts regenerated by Docker: gitlab.localhost is set again here too
|
|
104
|
-
devzone gitlab
|
|
104
|
+
devzone gitlab host-set
|
|
105
105
|
# Failure of an old run cleared: gitlab is ready (#366)
|
|
106
106
|
rm -f "$(failure_marker_file gitlab)"
|
|
107
107
|
else
|
|
@@ -114,7 +114,7 @@ apply_gitlab() {
|
|
|
114
114
|
fi
|
|
115
115
|
else
|
|
116
116
|
# Disable gitlab only if its namespace still exists
|
|
117
|
-
if devzone gitlab
|
|
117
|
+
if devzone gitlab installed; then
|
|
118
118
|
echo "devzone : deactivating gitlab…"
|
|
119
119
|
if [ -n "${DELETE_DATA:-}" ]; then
|
|
120
120
|
devzone gitlab uninstall --yes
|
|
@@ -81,7 +81,7 @@ show_state() {
|
|
|
81
81
|
if [ -n "$argocd_repo" ] && [ "$argocd_repo" != none ]; then
|
|
82
82
|
printf ' ○ argocd GitOps repository: %s\n' "$argocd_repo"
|
|
83
83
|
elif in_pod; then
|
|
84
|
-
|
|
84
|
+
DEVZONE_STATE="$ETAT" bash "$ICI/devzone" state gitops-line
|
|
85
85
|
else
|
|
86
86
|
printf ' ○ argocd no GitOps repository: devzone argocd init\n'
|
|
87
87
|
fi
|
package/.devcontainer/help.sh
CHANGED
|
@@ -38,6 +38,5 @@ devzone_aide() {
|
|
|
38
38
|
devzone port [--close <n>] list or remove a relay of the workstation
|
|
39
39
|
devzone passwords regenerate .password and print its path
|
|
40
40
|
devzone packages [add|remove|apply] … system packages kept after a rebuild
|
|
41
|
-
Old French names are refused and print the new name (see the reference).
|
|
42
41
|
AIDE
|
|
43
42
|
}
|
|
@@ -223,6 +223,6 @@ case "${1:-}" in
|
|
|
223
223
|
add) add_packages "${@:2}" ;;
|
|
224
224
|
remove) remove_packages "${@:2}" ;;
|
|
225
225
|
apply) apply_packages ;;
|
|
226
|
-
-h | --help
|
|
226
|
+
-h | --help) awk 'NR==1{next} /^#$/{exit} /^#/{sub(/^# ?/,""); print; next} {exit}' "${BASH_SOURCE[0]}" ;;
|
|
227
227
|
*) refuse "unknown command: ${1:-(none)} (devzone packages --help)" ;;
|
|
228
228
|
esac
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# Grouped credentials of the accounts created by devzone (#332).
|
|
3
|
-
# password.sh
|
|
4
|
-
# password.sh
|
|
3
|
+
# password.sh regenerate reads the module files, writes $ROOT/.password
|
|
4
|
+
# password.sh path prints the path of $ROOT/.password
|
|
5
5
|
# The module files stay the source: .password is a regenerated view.
|
|
6
6
|
# Plain-text secrets: never printed, never committed (.gitignore), mode 600.
|
|
7
|
-
# (regenerer and chemin are public subcommand names, kept as they are.)
|
|
8
7
|
set -euo pipefail
|
|
9
8
|
|
|
10
9
|
PASSWORD_HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
@@ -139,10 +138,10 @@ password_regenerate() (
|
|
|
139
138
|
|
|
140
139
|
if [ "${BASH_SOURCE[0]}" = "$0" ]; then
|
|
141
140
|
case "${1:-}" in
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
regenerate) password_regenerate ;;
|
|
142
|
+
path) printf '%s\n' "$PASSWORD_TARGET" ;;
|
|
144
143
|
*)
|
|
145
|
-
echo "devzone : password.sh :
|
|
144
|
+
echo "devzone : password.sh : regenerate | path" >&2
|
|
146
145
|
exit 1
|
|
147
146
|
;;
|
|
148
147
|
esac
|
package/.devcontainer/ports.sh
CHANGED
|
@@ -14,9 +14,6 @@ ETAT="${DEVZONE_STATE:-$ROOT/.devzone.modules}"
|
|
|
14
14
|
INSTANCE="${DEVZONE_INSTANCE:-devzone}"
|
|
15
15
|
|
|
16
16
|
# Safe state write (#417): lock, temporary file in the state folder, backup copy
|
|
17
|
-
# shellcheck source=SCRIPTDIR/state.sh
|
|
18
|
-
# shellcheck disable=SC1091
|
|
19
|
-
. "$HERE/state.sh"
|
|
20
17
|
|
|
21
18
|
refuse() { echo "devzone : port : $*" >&2; exit 1; }
|
|
22
19
|
|
|
@@ -41,9 +38,9 @@ sort_ports() {
|
|
|
41
38
|
printf '%s\n' "${1:-}" | tr ',' '\n' | awk 'NF && $0 ~ /^[0-9]+$/ { print }' | sort -n -u | paste -sd, -
|
|
42
39
|
}
|
|
43
40
|
|
|
44
|
-
# Writes the ports= line of the state (#417: never mv outside state
|
|
41
|
+
# Writes the ports= line of the state (#417: never mv outside Go state command)
|
|
45
42
|
write_ports() {
|
|
46
|
-
|
|
43
|
+
DEVZONE_STATE="$ETAT" bash "$HERE/devzone" state write ports "${1:-}" || { echo "devzone : port : state not saved : $ETAT" >&2; exit 1; }
|
|
47
44
|
}
|
|
48
45
|
|
|
49
46
|
add_port() {
|
|
@@ -130,6 +127,6 @@ case "${1:-}" in
|
|
|
130
127
|
;;
|
|
131
128
|
close | --close) close_port "${2:-}" ;;
|
|
132
129
|
resume) summary ;;
|
|
133
|
-
-h | --help
|
|
130
|
+
-h | --help) sed -n '2,8p' "$0" | sed 's/^# \{0,1\}//' ;;
|
|
134
131
|
esac
|
|
135
132
|
fi
|
|
@@ -34,15 +34,12 @@ refuse() {
|
|
|
34
34
|
exit 2
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
# shellcheck source=SCRIPTDIR/state.sh
|
|
38
|
-
# shellcheck disable=SC1091
|
|
39
|
-
. "$HERE/state.sh"
|
|
40
37
|
|
|
41
38
|
action="${1:-}"
|
|
42
39
|
service="${2:-}"
|
|
43
40
|
case "$action" in
|
|
44
|
-
enable
|
|
45
|
-
disable
|
|
41
|
+
enable) action=enable ;;
|
|
42
|
+
disable) action=disable ;;
|
|
46
43
|
seed) ;;
|
|
47
44
|
*) refuse "usage: services-admin.sh enable|disable|seed gitlab|postgres|argocd [options]" ;;
|
|
48
45
|
esac
|
|
@@ -73,9 +70,9 @@ cleanup() {
|
|
|
73
70
|
rm -f "$kubeconfig"
|
|
74
71
|
"$DEVZONE_CMD" "$service" relay-stop >/dev/null 2>&1 || true
|
|
75
72
|
if [ -n "$cluster_before" ]; then
|
|
76
|
-
|
|
73
|
+
DEVZONE_STATE="$ETAT" bash "$HERE/devzone" state write cluster "$cluster_before" || true
|
|
77
74
|
else
|
|
78
|
-
|
|
75
|
+
DEVZONE_STATE="$ETAT" bash "$HERE/devzone" state remove cluster || true
|
|
79
76
|
fi
|
|
80
77
|
}
|
|
81
78
|
trap cleanup EXIT
|
|
@@ -109,7 +106,7 @@ unset token ca_data
|
|
|
109
106
|
export KUBECONFIG="$kubeconfig"
|
|
110
107
|
export DEVZONE_KUBE_CONFIG="$kubeconfig"
|
|
111
108
|
export DEVZONE_SERVICES_ADMIN=1
|
|
112
|
-
|
|
109
|
+
DEVZONE_STATE="$ETAT" bash "$HERE/devzone" state write cluster "$ADMIN_CONTEXT" || refuse "cannot write the state: $ETAT"
|
|
113
110
|
echo "devzone services: $action $service in the cluster of the pod (temporary administrator)"
|
|
114
111
|
case "$action" in
|
|
115
112
|
# The seed is a module command: devzone gitlab seed (#538)
|
|
@@ -57,12 +57,6 @@ init_modules() {
|
|
|
57
57
|
fi
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
# Former French names renamed to English (#733). Idempotent: the script logs one
|
|
61
|
-
# line per rename, and a pair already renamed is left alone
|
|
62
|
-
init_legacy_names() {
|
|
63
|
-
bash "$HERE/rename-legacy-files.sh" || log "legacy names: not renamed"
|
|
64
|
-
}
|
|
65
|
-
|
|
66
60
|
init_prompt() {
|
|
67
61
|
local bashrc="$HOME/.bashrc"
|
|
68
62
|
if ! touch "$bashrc" 2>/dev/null; then
|
|
@@ -92,7 +86,6 @@ PROMPT
|
|
|
92
86
|
|
|
93
87
|
init_safe_directory
|
|
94
88
|
init_repowarden
|
|
95
|
-
init_legacy_names
|
|
96
89
|
init_modules
|
|
97
90
|
init_prompt
|
|
98
91
|
log "done"
|
package/Makefile
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
# to the first, without fixing anything. In the container: /.dockerenv, or folder /workspaces/devzone
|
|
9
9
|
hors-conteneur:
|
|
10
10
|
@if [ -f /.dockerenv ] || [ "$(CURDIR)" = /workspaces/devzone ]; then \
|
|
11
|
-
echo "✖ make $(MAKECMDGOALS)
|
|
12
|
-
echo "
|
|
11
|
+
echo "✖ make $(MAKECMDGOALS): run it on your machine (Mac or PC terminal), not in the devzone pod." >&2; \
|
|
12
|
+
echo " Here in the pod: devzone (state, modules), and the tools directly." >&2; \
|
|
13
13
|
exit 1; fi
|
|
14
14
|
|
|
15
15
|
help: ## Lists the commands
|
|
@@ -27,5 +27,5 @@ test-cli: hors-conteneur ## CLI tests in a real terminal: isolated devzone, then
|
|
|
27
27
|
desinstaller: hors-conteneur ## Removes Kubernetes objects of this devzone instance, after confirmation
|
|
28
28
|
@bash manage/devzone uninstall
|
|
29
29
|
|
|
30
|
-
uninstall: hors-conteneur ## Removes Kubernetes objects of this devzone instance, after confirmation (alias of
|
|
30
|
+
uninstall: hors-conteneur ## Removes Kubernetes objects of this devzone instance, after confirmation (alias of the remove target)
|
|
31
31
|
@bash manage/devzone uninstall
|