devzone 2.0.0 → 3.0.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.
Files changed (90) hide show
  1. package/.devcontainer/agent-errors.sh +6 -6
  2. package/.devcontainer/agent-pod-manifest.sh +4 -4
  3. package/.devcontainer/agent-session.sh +2 -2
  4. package/.devcontainer/agent-state-json.sh +2 -2
  5. package/.devcontainer/agent-workspace.sh +1 -1
  6. package/.devcontainer/agent.sh +7 -7
  7. package/.devcontainer/ai/host-models.sh +2 -2
  8. package/.devcontainer/ai/plugins/devzone-guard-v2.js +3 -3
  9. package/.devcontainer/ai/plugins/devzone-guard.js +3 -3
  10. package/.devcontainer/argocd/argocd.sh +90 -89
  11. package/.devcontainer/argocd/catalog-argocd.sh +2 -2
  12. package/.devcontainer/argocd/services-hook.sh +3 -3
  13. package/.devcontainer/argocd/services.sh +1 -1
  14. package/.devcontainer/catalog/app.sh +114 -116
  15. package/.devcontainer/catalog/catalog-watcher.sh +62 -62
  16. package/.devcontainer/catalog/mysql/app.conf +1 -1
  17. package/.devcontainer/catalog/mysql/install.sh +40 -40
  18. package/.devcontainer/catalog/mysql/mysql.sh +141 -141
  19. package/.devcontainer/catalog/mysql/volume.sh +39 -39
  20. package/.devcontainer/catalog.sh +112 -112
  21. package/.devcontainer/chart-direct.sh +1 -1
  22. package/.devcontainer/cluster.sh +216 -218
  23. package/.devcontainer/clusters.sh +41 -41
  24. package/.devcontainer/devzone +92 -1495
  25. package/.devcontainer/devzone-ai-guard.sh +76 -0
  26. package/.devcontainer/devzone-ai.sh +201 -0
  27. package/.devcontainer/devzone-cluster.sh +210 -0
  28. package/.devcontainer/devzone-modules.sh +126 -0
  29. package/.devcontainer/devzone-platform.sh +189 -0
  30. package/.devcontainer/devzone-repair.sh +94 -0
  31. package/.devcontainer/devzone-services.sh +241 -0
  32. package/.devcontainer/devzone-skill.sh +97 -0
  33. package/.devcontainer/devzone-status.sh +140 -0
  34. package/.devcontainer/devzone-version.sh +78 -0
  35. package/.devcontainer/git-identity.sh +28 -0
  36. package/.devcontainer/gitlab/chart.sh +2 -2
  37. package/.devcontainer/gitlab/gitlab.sh +81 -82
  38. package/.devcontainer/gitlab/installation.sh +109 -109
  39. package/.devcontainer/gitlab/secrets.sh +47 -47
  40. package/.devcontainer/gitlab/seed.sh +77 -77
  41. package/.devcontainer/gitlab/test-gitlab.sh +242 -243
  42. package/.devcontainer/help.sh +1 -1
  43. package/.devcontainer/isolation.sh +30 -30
  44. package/.devcontainer/kind-wrapper.sh +17 -17
  45. package/.devcontainer/kube-account.sh +112 -113
  46. package/.devcontainer/kube-config.sh +45 -46
  47. package/.devcontainer/{invite-kube.sh → kube-prompt.sh} +6 -6
  48. package/.devcontainer/kube-reachable.sh +40 -40
  49. package/.devcontainer/memory.sh +1 -1
  50. package/.devcontainer/metrics-server.sh +2 -2
  51. package/.devcontainer/opencode.jsonc +2 -2
  52. package/.devcontainer/packages.sh +136 -135
  53. package/.devcontainer/password.sh +1 -1
  54. package/.devcontainer/ports-auto.sh +152 -153
  55. package/.devcontainer/ports-json.sh +16 -15
  56. package/.devcontainer/ports.sh +126 -122
  57. package/.devcontainer/post-create.sh +52 -52
  58. package/.devcontainer/postgres/postgres.sh +174 -174
  59. package/.devcontainer/rename-legacy-files.sh +103 -0
  60. package/.devcontainer/services-admin.sh +3 -3
  61. package/.devcontainer/skills/devzone/SKILL.md +40 -41
  62. package/.devcontainer/startup.sh +48 -49
  63. package/.devcontainer/state-gitops.sh +1 -1
  64. package/.devcontainer/state-json.sh +36 -62
  65. package/.devcontainer/state.sh +2 -2
  66. package/.devcontainer/workspace-init.sh +16 -2
  67. package/Makefile +1 -1
  68. package/README.md +195 -194
  69. package/charts/devzone-workspace/templates/statefulset.yaml +1 -1
  70. package/manage/devzone +5 -7
  71. package/manage/scripts/argocd-workspace.sh +1 -1
  72. package/manage/scripts/check-names.sh +6 -5
  73. package/manage/scripts/create-cluster.sh +1 -1
  74. package/manage/scripts/create-mode.sh +2 -2
  75. package/manage/scripts/devzone-create.sh +3 -3
  76. package/manage/scripts/devzone-manifest.sh +1 -1
  77. package/manage/scripts/devzone-update.sh +12 -8
  78. package/manage/scripts/launch.sh +7 -48
  79. package/manage/scripts/migrate-revert.sh +3 -3
  80. package/manage/scripts/migrate.sh +7 -13
  81. package/manage/scripts/ports-apps.sh +1 -1
  82. package/manage/scripts/ports-workspace.sh +7 -7
  83. package/manage/scripts/uninstall.sh +8 -8
  84. package/manage/scripts/workspace-egress.sh +2 -2
  85. package/manage/scripts/workspace-update.sh +5 -2
  86. package/manage/scripts/workspace-wait.sh +2 -2
  87. package/package.json +1 -1
  88. package/.devcontainer/docker-relay.sh +0 -149
  89. package/.devcontainer/docker-without-host.sh +0 -12
  90. package/.devcontainer/git-identite.sh +0 -28
@@ -1,149 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Relais du socket Docker (#293), lancé en premier par startup.sh.
3
- #
4
- # Pourquoi : la feature docker-outside-of-docker relaie le socket de l'hôte
5
- # par « socat UNIX-LISTEN:/var/run/docker.sock,… UNIX-CONNECT:… » sans
6
- # option -t (seulement sous Docker Desktop, socket au gid 0 ; sous Linux elle
7
- # passe par un groupe, sans socat). Dès que le client ferme son côté (un
8
- # « docker exec » sans entrée standard), socat coupe la connexion 0,5 s plus
9
- # tard : la sortie est tronquée et docker exec renvoie quand même 0. kind lance
10
- # kubeadm init ainsi, et le croit réussi au bout de 0,5 s (cluster kind et
11
- # module gitlab impossibles depuis devzone). Le même socat avec -t 86400 laisse
12
- # passer la réponse du démon jusqu'à ce qu'il ferme lui-même.
13
- #
14
- # Ce que fait le script : relais de la feature sans -t → remplacé par le même
15
- # avec -t 86400 (fichier PID de la feature mis à jour, docker-init.sh ne le
16
- # relance donc pas) ; puis contrôle qu'un docker exec long va au bout. Sans
17
- # relais socat (Linux), seul le contrôle est fait. Idempotent.
18
- #
19
- # Sûr par construction : chemins et commandes réglables (tests : tout sous un
20
- # dossier temporaire), et refus de toucher au vrai socket sans
21
- # DEVZONE_RELAIS_REEL=oui, que seuls startup.sh et devzone repair posent.
22
- # Code : 0 contrôle réussi, 1 contrôle en échec (marque écrite pour le
23
- # récapitulatif devzone), 2 refus de la garde. Compatible bash 3.2.
24
- set -euo pipefail
25
-
26
- SOCKET="${DEVZONE_RELAIS_SOCKET:-/var/run/docker.sock}"
27
- SOURCE="${DEVZONE_RELAIS_SOURCE:-/var/run/docker-host.sock}"
28
- # Fichiers de la feature (/usr/local/share/docker-init.sh : SOCAT_PID, SOCAT_LOG)
29
- PID_FICHIER="${DEVZONE_RELAIS_PID:-/tmp/vscr-docker-from-docker.pid}"
30
- JOURNAL="${DEVZONE_RELAIS_LOG:-/tmp/vscr-docker-from-docker.log}"
31
- UTILISATEUR="${DEVZONE_RELAIS_UTILISATEUR:-vscode}"
32
- DOCKER="${DEVZONE_RELAIS_DOCKER:-docker}"
33
- # Marque d'échec lue par le récapitulatif (.devcontainer/devzone) : propre au
34
- # conteneur, effacée à chaque redémarrage avec /tmp
35
- MARQUE="${DEVZONE_RELAIS_MARQUE:-/tmp/devzone-relais-docker.echec}"
36
- ATTENTE="${DEVZONE_RELAIS_ATTENTE:-10}"
37
- # Le relais de la feature tourne en root : sudo sauf si on est déjà root
38
- if [ -n "${DEVZONE_RELAIS_SUDO+x}" ]; then
39
- SUDO="$DEVZONE_RELAIS_SUDO"
40
- elif [ "$(id -u)" = 0 ]; then
41
- SUDO=""
42
- else
43
- SUDO=sudo
44
- fi
45
-
46
- if [ -n "${BATS_TEST_TMPDIR:-}" ] && [ "$SOCKET" = /var/run/docker.sock ]; then
47
- echo "docker-relais : refus sous bats (tests)" >&2
48
- exit 2
49
- fi
50
-
51
- if [ "$SOCKET" = /var/run/docker.sock ] && [ "${DEVZONE_RELAIS_REEL:-}" != oui ]; then
52
- echo "docker-relais : refus de toucher au vrai socket ($SOCKET) : lancer plutôt devzone repair" >&2
53
- exit 2
54
- fi
55
-
56
- # Sans socket (option docker-hote=off, #432) : rien à relayer ni à contrôler.
57
- # Sortie 0 pour ne pas gêner le démarrage ; docker renvoie au workspace.
58
- if [ ! -e "$SOCKET" ]; then
59
- rm -f "$MARQUE" 2>/dev/null || true
60
- echo "docker-relais : pas de socket Docker de l'hôte (option docker-hote=off)"
61
- exit 0
62
- fi
63
-
64
- # $SUDO vide : commande lancée par env, jamais en commande intégrée (kill est
65
- # un builtin de bash : env passe par le PATH, comme sudo ; les tests y mettent
66
- # leurs faux outils)
67
- en_root() {
68
- if [ -n "$SUDO" ]; then
69
- "$SUDO" "$@"
70
- else
71
- env "$@"
72
- fi
73
- }
74
-
75
- echec() {
76
- echo "docker-relais : $1" >&2
77
- printf '%s\n' "$1" >"$MARQUE" 2>/dev/null || true
78
- exit 1
79
- }
80
-
81
- # « <pid> <a_t> » du socat qui écoute sur $SOCKET (a_t : 1 s'il a -t), rien
82
- # sinon. Seul le processus socat lui-même compte (pas un « sudo socat » parent),
83
- # et seulement s'il écoute sur ce socket-là.
84
- relais_trouve() {
85
- local pid args
86
- while read -r pid args; do
87
- case "$args" in
88
- "socat "*) ;;
89
- *) continue ;;
90
- esac
91
- case "$args" in
92
- *"UNIX-LISTEN:$SOCKET,"* | *"UNIX-LISTEN:$SOCKET "* | *"UNIX-LISTEN:$SOCKET") ;;
93
- *) continue ;;
94
- esac
95
- case " $args " in
96
- *" -t "*) echo "$pid 1" ;;
97
- *) echo "$pid 0" ;;
98
- esac
99
- return 0
100
- done < <(ps -eo pid=,args=)
101
- }
102
-
103
- remplacer() {
104
- local ancien="$1" nouveau i
105
- en_root kill "$ancien" 2>/dev/null || true
106
- i=0
107
- while [ "$i" -lt 20 ] && en_root kill -0 "$ancien" 2>/dev/null; do
108
- sleep 0.1
109
- i=$((i + 1))
110
- done
111
- en_root rm -f "$SOCKET"
112
- # setsid -f : socat détaché, il survit à la fin du démarrage ; -lf : son
113
- # journal (fichier de root) est ouvert par socat lui-même
114
- en_root setsid -f socat -t 86400 -lf "$JOURNAL" \
115
- "UNIX-LISTEN:$SOCKET,fork,mode=660,user=$UTILISATEUR,backlog=128" \
116
- "UNIX-CONNECT:$SOURCE" </dev/null >/dev/null 2>&1 ||
117
- echec "relais non relancé (socat -t 86400)"
118
- # PID du nouveau socat dans le fichier de la feature : docker-init.sh le
119
- # voit vivant et ne relance pas l'ancien relais
120
- i=0
121
- nouveau=""
122
- while [ "$i" -lt 20 ]; do
123
- nouveau="$(relais_trouve || true)"
124
- [ -n "$nouveau" ] && break
125
- sleep 0.1
126
- i=$((i + 1))
127
- done
128
- [ -n "$nouveau" ] || echec "relais relancé introuvable (ps)"
129
- printf '%s\n' "${nouveau%% *}" | en_root tee "$PID_FICHIER" >/dev/null
130
- echo "✔ relais Docker : socat -t 86400 (docker exec longs non coupés)"
131
- }
132
-
133
- trouve="$(relais_trouve || true)"
134
- if [ -n "$trouve" ] && [ "${trouve##* }" = 0 ]; then
135
- remplacer "${trouve%% *}"
136
- fi
137
-
138
- i=0
139
- until "$DOCKER" version >/dev/null 2>&1; do
140
- i=$((i + 1))
141
- [ "$i" -lt "$ATTENTE" ] || echec "le socket $SOCKET ne répond pas"
142
- sleep 1
143
- done
144
-
145
- # Contrôle : 1 s dépasse les 0,5 s de socat sans -t ; « ok » prouve que la
146
- # sortie d'un docker exec sans entrée standard arrive en entier
147
- sortie="$("$DOCKER" exec "$(hostname)" sh -c 'sleep 1; echo ok' </dev/null 2>&1 || true)"
148
- [ "$sortie" = ok ] || echec "docker exec long coupé (sortie : ${sortie:-vide})"
149
- rm -f "$MARQUE" 2>/dev/null || true
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Docker du poste non partagé (option docker-hote=off, #432). post-create.sh
3
- # installe ce script comme commande docker quand la feature
4
- # docker-outside-of-docker est absente : au lieu d'un « command not found »,
5
- # un message clair renvoie au workspace Kubernetes.
6
- cat >&2 <<'MESSAGE'
7
- ✖ Docker du poste non partagé (option docker-hote=off) : docker n'est pas disponible ici.
8
- Pour lancer des conteneurs, utilise le workspace Kubernetes : devzone workspace
9
- (docker et Testcontainers y parlent à kubedock, les images sont construites par BuildKit).
10
- Pour partager le socket Docker de l'hôte : devzone enable docker-hote, puis make rebuild sur le poste.
11
- MESSAGE
12
- exit 1
@@ -1,28 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Identité git, à chaque démarrage tant qu'elle manque : déduite du compte gh
3
- # (propre à chaque utilisateur, connexion gardée dans son volume) et écrite dans
4
- # ~/.config/git/config (volume devzone-git, survit aux rebuilds).
5
- # Une identité déjà définie (à la main, ou recopiée par VS Code dans
6
- # ~/.gitconfig) n'est jamais remplacée. Email noreply de GitHub : les commits
7
- # sont rattachés au compte sans exposer l'email personnel.
8
- set -euo pipefail
9
-
10
- CONFIG="$HOME/.config/git/config"
11
- nom_git="$(git config --get user.name || true)"
12
- email_git="$(git config --get user.email || true)"
13
-
14
- [ -n "$nom_git" ] && [ -n "$email_git" ] && exit 0
15
-
16
- # Sans gh : rien à déduire ; le récapitulatif de devzone le signale
17
- gh auth status >/dev/null 2>&1 || exit 0
18
-
19
- id="" login="" nom=""
20
- IFS=$'\t' read -r id login nom < <(gh api user --jq '[.id, .login, (.name // "")] | @tsv' 2>/dev/null || true)
21
- if [ -z "$id" ] || [ -z "$login" ]; then
22
- echo "git-identite : compte GitHub illisible (réseau ?) ; relancer : bash .devcontainer/git-identite.sh"
23
- exit 0
24
- fi
25
-
26
- [ -n "$nom_git" ] || git config --file "$CONFIG" user.name "${nom:-$login}"
27
- [ -n "$email_git" ] || git config --file "$CONFIG" user.email "${id}+${login}@users.noreply.github.com"
28
- echo "git-identite : $(git config --get user.name) <$(git config --get user.email)>"