devzone 1.1.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.
- package/.devcontainer/Dockerfile +4 -4
- package/.devcontainer/{agent-erreurs.sh → agent-errors.sh} +6 -6
- package/.devcontainer/agent-local.sh +2 -2
- package/.devcontainer/{agent-modele.messages → agent-model.messages} +1 -1
- package/.devcontainer/{agent-modele.sh → agent-model.sh} +5 -5
- package/.devcontainer/agent-pod-manifest.sh +4 -4
- package/.devcontainer/{agent-droits.sh → agent-rights.sh} +2 -2
- package/.devcontainer/agent-session.sh +3 -3
- package/.devcontainer/{agent-etat-json.sh → agent-state-json.sh} +6 -6
- package/.devcontainer/agent-workspace.sh +1 -1
- package/.devcontainer/agent.sh +14 -14
- package/.devcontainer/{ia/docker-garde.sh → ai/docker-guard.sh} +1 -1
- package/.devcontainer/{ia → ai}/host-models.sh +2 -2
- package/.devcontainer/{ia/plugins/devzone-garde-v2.js → ai/plugins/devzone-guard-v2.js} +7 -7
- package/.devcontainer/{ia/plugins/devzone-garde.js → ai/plugins/devzone-guard.js} +6 -6
- package/.devcontainer/argocd/argocd.sh +94 -93
- package/.devcontainer/argocd/{catalogue-argocd.sh → catalog-argocd.sh} +3 -3
- package/.devcontainer/argocd/services-hook.sh +8 -8
- package/.devcontainer/argocd/services.sh +1 -1
- package/.devcontainer/catalog/app.sh +209 -0
- package/.devcontainer/catalog/catalog-watcher.sh +130 -0
- package/.devcontainer/{catalogue → catalog}/mysql/app.conf +1 -1
- package/.devcontainer/catalog/mysql/install.sh +87 -0
- package/.devcontainer/catalog/mysql/mysql.sh +262 -0
- package/.devcontainer/catalog/mysql/volume.sh +71 -0
- package/.devcontainer/catalog.sh +231 -0
- package/.devcontainer/chart-direct.sh +1 -1
- package/.devcontainer/cluster.sh +222 -224
- package/.devcontainer/clusters.sh +41 -41
- package/.devcontainer/devcontainer.json +1 -1
- package/.devcontainer/devzone +103 -1506
- package/.devcontainer/devzone-ai-guard.sh +76 -0
- package/.devcontainer/devzone-ai.sh +201 -0
- package/.devcontainer/devzone-cluster.sh +210 -0
- package/.devcontainer/devzone-modules.sh +126 -0
- package/.devcontainer/devzone-platform.sh +189 -0
- package/.devcontainer/devzone-repair.sh +94 -0
- package/.devcontainer/devzone-services.sh +241 -0
- package/.devcontainer/devzone-skill.sh +97 -0
- package/.devcontainer/devzone-status.sh +140 -0
- package/.devcontainer/devzone-version.sh +78 -0
- package/.devcontainer/git-identity.sh +28 -0
- package/.devcontainer/gitlab/argocd.sh +2 -2
- package/.devcontainer/gitlab/chart.sh +2 -2
- package/.devcontainer/gitlab/gitlab.sh +83 -84
- package/.devcontainer/gitlab/installation.sh +111 -111
- package/.devcontainer/gitlab/secrets.sh +47 -47
- package/.devcontainer/gitlab/seed.sh +77 -77
- package/.devcontainer/gitlab/test-gitlab.sh +242 -243
- package/.devcontainer/help.sh +1 -1
- package/.devcontainer/isolation.sh +65 -0
- package/.devcontainer/kind-wrapper.sh +45 -0
- package/.devcontainer/kube-account.sh +199 -0
- package/.devcontainer/kube-config.sh +45 -46
- package/.devcontainer/{invite-kube.sh → kube-prompt.sh} +6 -6
- package/.devcontainer/kube-reachable.sh +64 -0
- package/.devcontainer/{memoire.sh → memory.sh} +1 -1
- package/.devcontainer/metrics-server.sh +2 -2
- package/.devcontainer/opencode.jsonc +2 -2
- package/.devcontainer/packages.sh +228 -0
- package/.devcontainer/password.sh +1 -1
- package/.devcontainer/ports-auto.sh +152 -153
- package/.devcontainer/ports-json.sh +16 -15
- package/.devcontainer/ports.sh +127 -123
- package/.devcontainer/post-create.sh +52 -52
- package/.devcontainer/postgres/postgres.sh +176 -176
- package/.devcontainer/rename-legacy-files.sh +103 -0
- package/.devcontainer/services-admin.sh +5 -5
- package/.devcontainer/skills/devzone/SKILL.md +40 -41
- package/.devcontainer/startup.sh +65 -0
- package/.devcontainer/{etat-gitops.sh → state-gitops.sh} +1 -1
- package/.devcontainer/{etat-json.sh → state-json.sh} +39 -65
- package/.devcontainer/{etat-verrou.sh → state-lock.sh} +1 -1
- package/.devcontainer/{etat.sh → state.sh} +4 -4
- package/.devcontainer/workspace-init.sh +17 -3
- package/Makefile +8 -8
- package/README.md +195 -194
- package/charts/devzone-workspace/templates/statefulset.yaml +1 -1
- package/manage/devzone +8 -10
- package/manage/scripts/argocd-workspace.sh +1 -1
- package/manage/scripts/check-go-layout.sh +40 -0
- package/manage/scripts/check-names.sh +61 -0
- package/manage/scripts/create-cluster.sh +1 -1
- package/manage/scripts/create-mode.sh +2 -2
- package/manage/scripts/devzone-create.sh +5 -5
- package/manage/scripts/devzone-manifest.sh +3 -3
- package/manage/scripts/devzone-update.sh +12 -8
- package/manage/scripts/docker-workstation.sh +2 -2
- package/manage/scripts/docker.sh +2 -2
- package/manage/scripts/{lancer.sh → launch.sh} +10 -51
- package/manage/scripts/{migrer-retour.sh → migrate-revert.sh} +4 -4
- package/manage/scripts/{migrer.sh → migrate.sh} +8 -14
- package/manage/scripts/ports-apps.sh +1 -1
- package/manage/scripts/ports-workspace.sh +7 -7
- package/manage/scripts/{desinstaller.sh → uninstall.sh} +8 -8
- package/manage/scripts/workspace-egress.sh +2 -2
- package/manage/scripts/workspace-update.sh +5 -2
- package/manage/scripts/workspace-wait.sh +2 -2
- package/manage/workspace.sh +4 -4
- package/package.json +1 -1
- package/.devcontainer/catalogue/app.sh +0 -211
- package/.devcontainer/catalogue/catalogue-veilleur.sh +0 -130
- package/.devcontainer/catalogue/mysql/installer.sh +0 -87
- package/.devcontainer/catalogue/mysql/mysql.sh +0 -262
- package/.devcontainer/catalogue/mysql/volume.sh +0 -71
- package/.devcontainer/catalogue.sh +0 -231
- package/.devcontainer/demarrage.sh +0 -66
- package/.devcontainer/docker-relais.sh +0 -149
- package/.devcontainer/docker-sans-hote.sh +0 -12
- package/.devcontainer/git-identite.sh +0 -28
- package/.devcontainer/isolement.sh +0 -65
- package/.devcontainer/kind-enveloppe.sh +0 -45
- package/.devcontainer/kube-compte.sh +0 -200
- package/.devcontainer/kube-joignable.sh +0 -64
- package/.devcontainer/paquets.sh +0 -227
- /package/.devcontainer/{ia/docker-garde.message → ai/docker-guard.message} +0 -0
- /package/.devcontainer/{ia → ai}/host-check.message +0 -0
- /package/.devcontainer/{ia → ai}/host-check.sh +0 -0
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# MySQL du catalogue (#414) : create, list, delete, status, relay-start, relay-stop, install, delete-data.
|
|
3
|
-
set -euo pipefail
|
|
4
|
-
ICI="$(cd "$(dirname "$0")" && pwd)"
|
|
5
|
-
RACINE="${DEVZONE_RACINE:-$(dirname "$(dirname "$(dirname "$ICI")")")}"
|
|
6
|
-
ETAT="${DEVZONE_ETAT:-$RACINE/.devzone.modules}"
|
|
7
|
-
# shellcheck source=SCRIPTDIR/../../cluster.sh
|
|
8
|
-
# shellcheck disable=SC1091
|
|
9
|
-
. "$ICI/../../cluster.sh"
|
|
10
|
-
# shellcheck source=SCRIPTDIR/../../password.sh
|
|
11
|
-
# shellcheck disable=SC1091
|
|
12
|
-
. "$ICI/../../password.sh"
|
|
13
|
-
# shellcheck source=SCRIPTDIR/../../isolement.sh
|
|
14
|
-
# shellcheck disable=SC1091
|
|
15
|
-
. "$ICI/../../isolement.sh"
|
|
16
|
-
# shellcheck source=SCRIPTDIR/volume.sh
|
|
17
|
-
# shellcheck disable=SC1091
|
|
18
|
-
. "$ICI/volume.sh"
|
|
19
|
-
# shellcheck source=SCRIPTDIR/installer.sh
|
|
20
|
-
# shellcheck disable=SC1091
|
|
21
|
-
. "$ICI/installer.sh"
|
|
22
|
-
# Le module argocd actif : MySQL installé par une Application (#538)
|
|
23
|
-
# shellcheck source=SCRIPTDIR/../../argocd/catalogue-argocd.sh
|
|
24
|
-
# shellcheck disable=SC1091
|
|
25
|
-
. "$ICI/../../argocd/catalogue-argocd.sh"
|
|
26
|
-
NS=devzone-mysql
|
|
27
|
-
SECRETS="$RACINE/workspace/.mysql"
|
|
28
|
-
MYSQL_PORT="${MYSQL_PORT:-3306}"
|
|
29
|
-
MYSQL_IMAGE="${MYSQL_IMAGE:-mysql:8.4}"
|
|
30
|
-
MYSQL_MEMOIRE="${MYSQL_MEMOIRE:-1Gi}"
|
|
31
|
-
MYSQL_TAILLE="${MYSQL_TAILLE:-5Gi}"
|
|
32
|
-
MYSQL_ATTENTE="${MYSQL_ATTENTE:-300}"
|
|
33
|
-
# Refus standard avec message et code 2
|
|
34
|
-
refuse() { echo "devzone : catalogue mysql : $*" >&2; exit 2; }
|
|
35
|
-
# Secret mysql-admin du hook services.sh : le même que l'installation directe
|
|
36
|
-
services_secret_mysql() { mysql_secret; }
|
|
37
|
-
# Régénère la vue .password (échec non bloquant)
|
|
38
|
-
regenerer_identifiants() {
|
|
39
|
-
password_regenerate ||
|
|
40
|
-
echo "devzone : catalogue mysql : identifiants regroupés non mis à jour (devzone passwords)" >&2
|
|
41
|
-
}
|
|
42
|
-
# Raccourci kubectl dans le namespace devzone-mysql
|
|
43
|
-
k() { kubectl --context devzone -n "$NS" "$@"; }
|
|
44
|
-
# Le namespace devzone-mysql existe-t-il ? Lecture des namespaces réservée à
|
|
45
|
-
# l'administrateur (#430)
|
|
46
|
-
installe() { compte_admin "$(compte_ctx)" get namespace "$NS" >/dev/null 2>&1; }
|
|
47
|
-
# Contexte du module : celui du cluster de devzone
|
|
48
|
-
contexte() {
|
|
49
|
-
local c
|
|
50
|
-
c="$(cluster_lu)"
|
|
51
|
-
[ -n "$c" ] || refuse "aucun cluster choisi : devzone enable mysql"
|
|
52
|
-
echo "$c"
|
|
53
|
-
}
|
|
54
|
-
# Marque d'échec du module (même schéma que fichier_echec de devzone)
|
|
55
|
-
fichier_echec() { echo "$ETAT-echec-mysql"; }
|
|
56
|
-
# Nom de projet : identifiant SQL simple, jamais à échapper, pas un nom réservé
|
|
57
|
-
valider_projet() {
|
|
58
|
-
local p="${1:-}"
|
|
59
|
-
[ -n "$p" ] || refuse "nom de projet manquant"
|
|
60
|
-
[[ "$p" =~ ^[a-z][a-z0-9_]{0,62}$ ]] || refuse "nom de projet invalide : $p (minuscules, chiffres, _ ; commence par une lettre)"
|
|
61
|
-
case "$p" in
|
|
62
|
-
mysql | information_schema | performance_schema | sys) refuse "nom réservé : $p" ;;
|
|
63
|
-
esac
|
|
64
|
-
}
|
|
65
|
-
# Mot de passe aléatoire pour un nouveau projet
|
|
66
|
-
mot_de_passe() { openssl rand -hex 24; }
|
|
67
|
-
# Mot de passe root : root.env d'une installation existante, sinon admin-password
|
|
68
|
-
root_password() {
|
|
69
|
-
local mdp
|
|
70
|
-
mdp="$(sed -n 's/^MYSQL_PASSWORD=//p' "$SECRETS/root.env" 2>/dev/null | tail -1 || true)"
|
|
71
|
-
[ -z "$mdp" ] && [ -f "$SECRETS/admin-password" ] && mdp="$(cat "$SECRETS/admin-password" 2>/dev/null || true)"
|
|
72
|
-
[ -n "$mdp" ] || refuse "mot de passe root MySQL introuvable (workspace/.mysql/root.env)"
|
|
73
|
-
echo "$mdp"
|
|
74
|
-
}
|
|
75
|
-
# mysql en superutilisateur dans le pod ; le mot de passe n'est jamais affiché
|
|
76
|
-
mysql_admin() { k exec -i mysql-0 -c mysql -- mysql -uroot -p"$(root_password)" "$@"; }
|
|
77
|
-
# Nombre de bases hors bases système
|
|
78
|
-
nombre_bases() {
|
|
79
|
-
local n
|
|
80
|
-
n="$(mysql_admin -N -B -e "SHOW DATABASES" 2>/dev/null | grep -vE '^(information_schema|mysql|performance_schema|sys)$' | grep -c . || true)"
|
|
81
|
-
echo "${n:-0}"
|
|
82
|
-
}
|
|
83
|
-
installer() {
|
|
84
|
-
local CTX claim
|
|
85
|
-
CTX="$(contexte)"
|
|
86
|
-
if ! contexte_devzone_poser "$CTX"; then
|
|
87
|
-
echo "devzone : catalogue mysql : impossible de poser le contexte devzone sur $CTX" >&2
|
|
88
|
-
return 1
|
|
89
|
-
fi
|
|
90
|
-
echo "▶ MySQL sur le cluster $CTX (namespace $NS)…"
|
|
91
|
-
if catalogue_argocd_active mysql; then
|
|
92
|
-
mysql_installer_argocd "$CTX"
|
|
93
|
-
return
|
|
94
|
-
fi
|
|
95
|
-
compte_namespace "$CTX" "$NS"
|
|
96
|
-
namespace_isoler "$NS" >/dev/null
|
|
97
|
-
if k get statefulset mysql >/dev/null 2>&1; then
|
|
98
|
-
echo "devzone : catalogue mysql : installation existante dans $NS, adoptée (volume et root.env gardés)"
|
|
99
|
-
else
|
|
100
|
-
mysql_secret
|
|
101
|
-
claim="$(mysql_claim_choisir "$NS")" || return 2
|
|
102
|
-
mysql_appliquer_chart "$NS" "$claim" || return 1
|
|
103
|
-
if ! k rollout status statefulset/mysql --timeout="${MYSQL_ATTENTE}s" >/dev/null; then
|
|
104
|
-
echo "devzone : catalogue mysql : pas prêt après ${MYSQL_ATTENTE}s : kubectl --context $CTX -n $NS describe pod mysql-0" >&2
|
|
105
|
-
return 1
|
|
106
|
-
fi
|
|
107
|
-
fi
|
|
108
|
-
mysql_secret
|
|
109
|
-
relais_lancer mysql "$CTX" "$NS" svc/mysql 3306:3306
|
|
110
|
-
echo "✔ MySQL prêt : 127.0.0.1:$MYSQL_PORT dans le conteneur"
|
|
111
|
-
regenerer_identifiants
|
|
112
|
-
}
|
|
113
|
-
# Supprime le namespace (donc les PVC), garde workspace/.mysql (#441) :
|
|
114
|
-
# confirmation en terminal [o/N], --yes obligatoire sinon (refus, code 2)
|
|
115
|
-
supprimer_donnees() {
|
|
116
|
-
local CTX oui="" arg reponse
|
|
117
|
-
for arg in "$@"; do
|
|
118
|
-
case "$arg" in
|
|
119
|
-
--yes) oui=1 ;;
|
|
120
|
-
*) refuse "argument inconnu : $arg" ;;
|
|
121
|
-
esac
|
|
122
|
-
done
|
|
123
|
-
if [ -z "$oui" ]; then
|
|
124
|
-
cluster_interactif || refuse "confirmation impossible sans terminal : devzone mysql delete-data --yes"
|
|
125
|
-
printf 'Supprimer le namespace %s et tous ses volumes ? [o/N] ' "$NS" >&2
|
|
126
|
-
read -r reponse || reponse=""
|
|
127
|
-
case "$reponse" in
|
|
128
|
-
o | O | oui) ;;
|
|
129
|
-
*) echo "Abandon : rien n'a été supprimé."; return 0 ;;
|
|
130
|
-
esac
|
|
131
|
-
fi
|
|
132
|
-
CTX="$(cluster_lu)"
|
|
133
|
-
[ -n "$CTX" ] || refuse "aucun cluster choisi : devzone enable mysql"
|
|
134
|
-
installe || refuse "module inactif : devzone enable mysql"
|
|
135
|
-
echo "▶ Suppression de MySQL et de ses volumes sur ${CTX}…"
|
|
136
|
-
# L'Application part d'abord (#538) : sinon Argo CD recrée le namespace
|
|
137
|
-
catalogue_argocd_delete mysql >/dev/null 2>&1 || true
|
|
138
|
-
# RoleBinding retiré puis namespace supprimé par l'administrateur (#430)
|
|
139
|
-
compte_retirer "$CTX" "$NS" >/dev/null 2>&1 || true
|
|
140
|
-
compte_admin "$CTX" delete namespace "$NS" --wait=true >/dev/null
|
|
141
|
-
relais_arreter mysql
|
|
142
|
-
rm -f "$(fichier_echec)"
|
|
143
|
-
echo "✔ namespace $NS et volume supprimés ; workspace/.mysql/root.env gardé"
|
|
144
|
-
regenerer_identifiants
|
|
145
|
-
}
|
|
146
|
-
# État : désactivé, en échec, prêt, relais arrêté
|
|
147
|
-
etat() {
|
|
148
|
-
local CTX
|
|
149
|
-
CTX="$(cluster_lu)"
|
|
150
|
-
if [ -z "$CTX" ] || ! installe; then
|
|
151
|
-
echo "désactivé"
|
|
152
|
-
return 0
|
|
153
|
-
fi
|
|
154
|
-
if [ "$(k get statefulset mysql -o jsonpath='{.status.readyReplicas}' 2>/dev/null || true)" != 1 ]; then
|
|
155
|
-
echo "en échec sur $CTX : devzone apply"
|
|
156
|
-
return 0
|
|
157
|
-
fi
|
|
158
|
-
if ! relais_actif mysql; then
|
|
159
|
-
echo "prêt sur $CTX, relais arrêté : devzone apply"
|
|
160
|
-
return 0
|
|
161
|
-
fi
|
|
162
|
-
echo "prêt sur $CTX : 127.0.0.1:$MYSQL_PORT, $(nombre_bases) base(s)"
|
|
163
|
-
}
|
|
164
|
-
# Crée l'utilisateur et la base d'un projet ; .env en 600, mot de passe gardé
|
|
165
|
-
creer() {
|
|
166
|
-
local projet="${1:-}" nouveau="" fichier mdp arg
|
|
167
|
-
valider_projet "$projet"
|
|
168
|
-
for arg in "${@:2}"; do
|
|
169
|
-
case "$arg" in
|
|
170
|
-
--new-password) nouveau=1 ;;
|
|
171
|
-
*) refuse "argument inconnu : $arg" ;;
|
|
172
|
-
esac
|
|
173
|
-
done
|
|
174
|
-
CTX="$(contexte)"
|
|
175
|
-
installe || refuse "module inactif : devzone enable mysql"
|
|
176
|
-
fichier="$SECRETS/$projet.env"
|
|
177
|
-
if [ -z "$nouveau" ] && [ -s "$fichier" ]; then
|
|
178
|
-
mdp="$(sed -n 's/^MYSQL_PASSWORD=//p' "$fichier" 2>/dev/null | tail -1)"
|
|
179
|
-
else
|
|
180
|
-
mdp="$(mot_de_passe)"
|
|
181
|
-
fi
|
|
182
|
-
mysql_admin <<SQL
|
|
183
|
-
CREATE USER IF NOT EXISTS '$projet'@'%' IDENTIFIED BY '$mdp';
|
|
184
|
-
ALTER USER '$projet'@'%' IDENTIFIED BY '$mdp';
|
|
185
|
-
CREATE DATABASE IF NOT EXISTS $projet;
|
|
186
|
-
GRANT ALL ON $projet.* TO '$projet'@'%';
|
|
187
|
-
SQL
|
|
188
|
-
mkdir -p "$SECRETS"
|
|
189
|
-
chmod 700 "$SECRETS"
|
|
190
|
-
(
|
|
191
|
-
umask 077
|
|
192
|
-
cat >"$fichier" <<ENV
|
|
193
|
-
MYSQL_HOST=127.0.0.1
|
|
194
|
-
MYSQL_PORT=$MYSQL_PORT
|
|
195
|
-
MYSQL_USER=$projet
|
|
196
|
-
MYSQL_PASSWORD=$mdp
|
|
197
|
-
MYSQL_URL=jdbc:mysql://127.0.0.1:$MYSQL_PORT/$projet
|
|
198
|
-
ENV
|
|
199
|
-
)
|
|
200
|
-
echo "✔ base $projet prête ; identifiants : $fichier"
|
|
201
|
-
regenerer_identifiants
|
|
202
|
-
}
|
|
203
|
-
# Liste les bases du serveur
|
|
204
|
-
liste() {
|
|
205
|
-
local CTX
|
|
206
|
-
CTX="$(contexte)"
|
|
207
|
-
installe || refuse "module inactif : devzone enable mysql"
|
|
208
|
-
# grep -v sort 1 sans base utilisateur : sous pipefail, liste reste à 0
|
|
209
|
-
mysql_admin -N -B -e "SHOW DATABASES" 2>/dev/null |
|
|
210
|
-
{ grep -vE '^(information_schema|mysql|performance_schema|sys)$' || true; } |
|
|
211
|
-
awk 'BEGIN { n = 0 } { printf " %-30s\n", $1; n++ } END { if (n == 0) print " (aucune base : devzone mysql create <projet>)" }'
|
|
212
|
-
}
|
|
213
|
-
# Supprime la base et l'utilisateur d'un projet (confirmation sans --yes)
|
|
214
|
-
supprimer() {
|
|
215
|
-
local projet="${1:-}" oui="" arg reponse
|
|
216
|
-
valider_projet "$projet"
|
|
217
|
-
for arg in "${@:2}"; do
|
|
218
|
-
case "$arg" in
|
|
219
|
-
--yes) oui=1 ;;
|
|
220
|
-
*) refuse "argument inconnu : $arg" ;;
|
|
221
|
-
esac
|
|
222
|
-
done
|
|
223
|
-
CTX="$(contexte)"
|
|
224
|
-
installe || refuse "module inactif : devzone enable mysql"
|
|
225
|
-
if [ -z "$oui" ]; then
|
|
226
|
-
cluster_interactif || refuse "confirmation impossible sans terminal : devzone mysql delete $projet --yes"
|
|
227
|
-
printf 'Supprimer la base %s et son utilisateur ? [o/N] ' "$projet" >&2
|
|
228
|
-
read -r reponse || reponse=""
|
|
229
|
-
case "$reponse" in
|
|
230
|
-
o | O | oui) ;;
|
|
231
|
-
*) echo "Abandon : rien n'a été supprimé."; return 0 ;;
|
|
232
|
-
esac
|
|
233
|
-
fi
|
|
234
|
-
mysql_admin <<SQL
|
|
235
|
-
DROP DATABASE IF EXISTS $projet;
|
|
236
|
-
DROP USER IF EXISTS '$projet'@'%';
|
|
237
|
-
SQL
|
|
238
|
-
rm -f "$SECRETS/$projet.env"
|
|
239
|
-
echo "✔ base $projet supprimée"
|
|
240
|
-
regenerer_identifiants
|
|
241
|
-
}
|
|
242
|
-
# Relance le relais 127.0.0.1:3306 si le namespace existe
|
|
243
|
-
relais() {
|
|
244
|
-
local CTX
|
|
245
|
-
CTX="$(cluster_lu)"
|
|
246
|
-
[ -n "$CTX" ] && installe && relais_lancer mysql "$CTX" "$NS" svc/mysql 3306:3306
|
|
247
|
-
}
|
|
248
|
-
case "${1:-}" in
|
|
249
|
-
install) installer ;;
|
|
250
|
-
delete-data) supprimer_donnees "${@:2}" ;;
|
|
251
|
-
status) etat ;;
|
|
252
|
-
create) creer "${@:2}" ;;
|
|
253
|
-
list) liste ;;
|
|
254
|
-
delete) supprimer "${@:2}" ;;
|
|
255
|
-
volume) mysql_volume "$NS" "${@:2}" ;;
|
|
256
|
-
relay-start) relais ;;
|
|
257
|
-
relay-stop) relais_arreter mysql ;;
|
|
258
|
-
*)
|
|
259
|
-
echo "devzone : catalogue mysql : create <projet> [--new-password] | list | delete <projet> [--yes] | volume [<nom>] [--delete <nom>] [--yes] | delete-data [--yes]" >&2
|
|
260
|
-
exit 1
|
|
261
|
-
;;
|
|
262
|
-
esac
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Volumes MySQL (#440) : choix, liste et suppression des PVC -mysql-0.
|
|
3
|
-
|
|
4
|
-
# Liste les PVC du namespace mysql dont le nom finit par -mysql-0
|
|
5
|
-
mysql_volumes() {
|
|
6
|
-
local ns="$1"
|
|
7
|
-
kubectl --context devzone -n "$ns" get pvc -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' 2>/dev/null |
|
|
8
|
-
grep -E '\-mysql-0$' || true
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
# Préfixe de claim : 1 PVC → son préfixe, 0 → donnees, >1 → refus (code 2)
|
|
12
|
-
mysql_claim_choisir() {
|
|
13
|
-
local ns="$1" liste nb
|
|
14
|
-
liste="$(mysql_volumes "$ns")"
|
|
15
|
-
if [ -z "$liste" ]; then echo donnees; return 0; fi
|
|
16
|
-
nb="$(printf '%s\n' "$liste" | grep -c .)"
|
|
17
|
-
if [ "$nb" -eq 1 ]; then echo "${liste%-mysql-0}"; return 0; fi
|
|
18
|
-
echo "devzone : catalogue mysql : plusieurs volumes trouvés :" >&2
|
|
19
|
-
printf '%s\n' "$liste" | sed 's/^/ /' >&2
|
|
20
|
-
echo "devzone : catalogue mysql : choisir avec devzone mysql volume <nom>" >&2
|
|
21
|
-
return 2
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
# Claim porté par le StatefulSet (vide si absent)
|
|
25
|
-
mysql_claim_monte() {
|
|
26
|
-
local ns="$1"
|
|
27
|
-
kubectl --context devzone -n "$ns" get statefulset mysql \
|
|
28
|
-
-o jsonpath='{.spec.volumeClaimTemplates[0].metadata.name}' 2>/dev/null || true
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
# Sous-commande volume : liste ou sélectionne/supprime un PVC
|
|
32
|
-
mysql_volume() {
|
|
33
|
-
local ns="$1" nom="" oui="" supprimer="" arg reponse pvc monte claim
|
|
34
|
-
shift
|
|
35
|
-
for arg in "$@"; do
|
|
36
|
-
case "$arg" in
|
|
37
|
-
--delete) supprimer=1 ;;
|
|
38
|
-
--yes) oui=1 ;;
|
|
39
|
-
*) nom="$arg" ;;
|
|
40
|
-
esac
|
|
41
|
-
done
|
|
42
|
-
if [ -n "$supprimer" ]; then
|
|
43
|
-
[ -n "$nom" ] || refuse "volume --delete : nom manquant"
|
|
44
|
-
pvc="$nom"
|
|
45
|
-
[[ "$pvc" == *-mysql-0 ]] || pvc="$pvc-mysql-0"
|
|
46
|
-
monte="$(mysql_claim_monte "$ns")"
|
|
47
|
-
[ "${pvc%-mysql-0}" != "$monte" ] || refuse "volume monté, suppression refusée : $nom"
|
|
48
|
-
if [ -z "$oui" ]; then
|
|
49
|
-
cluster_interactif || refuse "confirmation impossible sans terminal : devzone mysql volume --delete $nom --yes"
|
|
50
|
-
printf 'Supprimer le volume %s ? [o/N] ' "$pvc" >&2
|
|
51
|
-
read -r reponse || reponse=""
|
|
52
|
-
case "$reponse" in
|
|
53
|
-
o | O | oui) ;;
|
|
54
|
-
*) echo "Abandon : rien n'a été supprimé."; return 0 ;;
|
|
55
|
-
esac
|
|
56
|
-
fi
|
|
57
|
-
kubectl --context devzone -n "$ns" delete pvc "$pvc" >/dev/null
|
|
58
|
-
echo "✔ volume $pvc supprimé"
|
|
59
|
-
return 0
|
|
60
|
-
fi
|
|
61
|
-
if [ -z "$nom" ]; then
|
|
62
|
-
monte="$(mysql_claim_monte "$ns")"
|
|
63
|
-
mysql_volumes "$ns" | awk -v m="$monte-mysql-0" 'NF { mark = ($0 == m) ? " (monté)" : ""; printf " %s%s\n", $0, mark; n++ } END { if (!n) print " (aucun volume)" }'
|
|
64
|
-
return 0
|
|
65
|
-
fi
|
|
66
|
-
contexte >/dev/null
|
|
67
|
-
installe || refuse "module inactif : devzone enable mysql"
|
|
68
|
-
claim="$nom"
|
|
69
|
-
[[ "$claim" == *-mysql-0 ]] && claim="${claim%-mysql-0}"
|
|
70
|
-
mysql_installer_claim "$ns" "$claim"
|
|
71
|
-
}
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Catalogue d'applications (#414) : une application préconfigurée par dossier
|
|
3
|
-
# .devcontainer/catalogue/<app>/ (app.conf ; le chart charts/devzone-<app>, #559), installée dans le
|
|
4
|
-
# cluster des services de devzone sous son namespace de app.conf ; l'état
|
|
5
|
-
# voulu est la ligne <app>=on|off de .devzone.modules.
|
|
6
|
-
# catalogue.sh sync | apply | list | resume | json | remove <app>
|
|
7
|
-
set -euo pipefail
|
|
8
|
-
|
|
9
|
-
ICI="$(cd "$(dirname "$0")" && pwd)"
|
|
10
|
-
RACINE="${DEVZONE_RACINE:-$(dirname "$ICI")}"
|
|
11
|
-
ETAT="${DEVZONE_ETAT:-$RACINE/.devzone.modules}"
|
|
12
|
-
# shellcheck source=SCRIPTDIR/cluster.sh
|
|
13
|
-
# shellcheck disable=SC1091
|
|
14
|
-
. "$ICI/cluster.sh"
|
|
15
|
-
# shellcheck source=SCRIPTDIR/etat.sh
|
|
16
|
-
# shellcheck disable=SC1091
|
|
17
|
-
. "$ICI/etat.sh"
|
|
18
|
-
# shellcheck source=SCRIPTDIR/password.sh
|
|
19
|
-
# shellcheck disable=SC1091
|
|
20
|
-
. "$ICI/password.sh"
|
|
21
|
-
# shellcheck source=SCRIPTDIR/isolement.sh
|
|
22
|
-
# shellcheck disable=SC1091
|
|
23
|
-
. "$ICI/isolement.sh"
|
|
24
|
-
# shellcheck source=SCRIPTDIR/catalogue/app.sh
|
|
25
|
-
# shellcheck disable=SC1091
|
|
26
|
-
. "$ICI/catalogue/app.sh"
|
|
27
|
-
|
|
28
|
-
refuse() { echo "devzone : catalogue : $*" >&2; exit 2; }
|
|
29
|
-
|
|
30
|
-
# Dossier du catalogue (surchargeable par les tests)
|
|
31
|
-
dossier_catalogue() { echo "${DEVZONE_CATALOGUE:-$ICI/catalogue}"; }
|
|
32
|
-
|
|
33
|
-
# Applications du catalogue : dossiers pourvus d'un app.conf, triés
|
|
34
|
-
catalogue_apps() {
|
|
35
|
-
local d
|
|
36
|
-
for d in "$(dossier_catalogue)"/*; do
|
|
37
|
-
[ -f "$d/app.conf" ] || continue
|
|
38
|
-
echo "${d##*/}"
|
|
39
|
-
done | LC_ALL=C sort
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
# Clé de app.conf (nom, description, image, port, mémoire, taille, namespace)
|
|
43
|
-
app_lire() {
|
|
44
|
-
grep -E "^$2=" "$(dossier_catalogue)/$1/app.conf" 2>/dev/null | tail -1 | cut -d= -f2- || true
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
# Namespace de l'application : celui de app.conf (requis)
|
|
48
|
-
app_ns() {
|
|
49
|
-
local ns
|
|
50
|
-
ns="$(app_lire "$1" namespace)"
|
|
51
|
-
[ -n "$ns" ] || refuse "namespace manquant dans app.conf de $1"
|
|
52
|
-
echo "$ns"
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
# Marque d'échec d'une application : même schéma que fichier_echec des modules
|
|
56
|
-
fichier_echec() { echo "$ETAT-echec-$1"; }
|
|
57
|
-
|
|
58
|
-
# État voulu : on si la ligne <app>=on existe, off par défaut
|
|
59
|
-
voulu() {
|
|
60
|
-
local v
|
|
61
|
-
v="$(grep -E "^$1=" "$ETAT" 2>/dev/null | tail -1 | cut -d= -f2- || true)"
|
|
62
|
-
[ "$v" = on ] && echo on || echo off
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
# Application present in the cluster. In the Kubernetes workspace pod: its
|
|
66
|
-
# service resolves in the cluster DNS (no RBAC needed, #515). Elsewhere: labelled
|
|
67
|
-
# namespace and StatefulSet of the app name; reading the namespaces is reserved
|
|
68
|
-
# to the administrator (#430). Nothing without a chosen cluster or when absent.
|
|
69
|
-
presente() {
|
|
70
|
-
local ctx ns
|
|
71
|
-
ns="$(app_ns "$1")"
|
|
72
|
-
if [ "${DEVZONE_WORKSPACE:-}" = kubernetes ]; then
|
|
73
|
-
# In the pod there is no kubeconfig and the limited service account
|
|
74
|
-
# cannot list StatefulSets (#430): presence is the cluster DNS
|
|
75
|
-
# resolving the service, no RBAC needed, the pod service account
|
|
76
|
-
# stays limited
|
|
77
|
-
getent hosts "$(app_lire "$1" nom).${ns}.svc" >/dev/null 2>&1
|
|
78
|
-
return
|
|
79
|
-
fi
|
|
80
|
-
ctx="$(cluster_lu)"
|
|
81
|
-
[ -n "$ctx" ] || return 1
|
|
82
|
-
compte_admin "$ctx" get namespace "$ns" >/dev/null 2>&1 &&
|
|
83
|
-
kubectl --context devzone -n "$ns" get statefulset "$1" >/dev/null 2>&1
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
# Application prête : le StatefulSet compte une réplique prête
|
|
87
|
-
app_prete() {
|
|
88
|
-
local ns
|
|
89
|
-
ns="$(app_ns "$1")"
|
|
90
|
-
[ "$(kubectl --context devzone -n "$ns" get statefulset "$1" \
|
|
91
|
-
-o jsonpath='{.status.readyReplicas}' 2>/dev/null || true)" = 1 ]
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
# Ajoute à l'état les lignes <app>=off des applications absentes (une fois
|
|
95
|
-
# chacune, jamais une ligne existante modifiée), précédées une fois du
|
|
96
|
-
# commentaire ; la lecture et l'écriture tiennent le même verrou (#417) :
|
|
97
|
-
# une écriture concurrente ne peut pas être perdue entre les deux
|
|
98
|
-
catalogue_synchroniser() (
|
|
99
|
-
local app entete manque="" tmp
|
|
100
|
-
[ -f "$ETAT" ] || return 0
|
|
101
|
-
entete="# Applications du catalogue : passer à on pour installer (devzone catalog)"
|
|
102
|
-
state_lock_take || return 1
|
|
103
|
-
# Le verrou est rendu à la sortie, y compris sur une erreur sous set -e
|
|
104
|
-
trap 'state_lock_release' EXIT
|
|
105
|
-
while IFS= read -r app; do
|
|
106
|
-
[ -n "$app" ] || continue
|
|
107
|
-
grep -qE "^${app}=" "$ETAT" 2>/dev/null && continue
|
|
108
|
-
manque="${manque}${manque:+$'\n'}${app}=off"
|
|
109
|
-
done <<<"$(catalogue_apps)"
|
|
110
|
-
[ -n "$manque" ] || return 0
|
|
111
|
-
tmp="$(mktemp)"
|
|
112
|
-
{
|
|
113
|
-
cat "$ETAT"
|
|
114
|
-
grep -qF "$entete" "$ETAT" || echo "$entete"
|
|
115
|
-
echo "$manque"
|
|
116
|
-
} >"$tmp"
|
|
117
|
-
state_replace "$tmp"
|
|
118
|
-
rm -f "$tmp"
|
|
119
|
-
)
|
|
120
|
-
|
|
121
|
-
# État réel d'une application : disponible, attendue, installée, echec
|
|
122
|
-
app_etat() {
|
|
123
|
-
local app="$1"
|
|
124
|
-
if [ "$(voulu "$app")" != on ]; then
|
|
125
|
-
echo disponible
|
|
126
|
-
elif [ -f "$(fichier_echec "$app")" ]; then
|
|
127
|
-
echo echec
|
|
128
|
-
elif presente "$app"; then
|
|
129
|
-
echo installée
|
|
130
|
-
else
|
|
131
|
-
echo attendue
|
|
132
|
-
fi
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
# devzone catalog : nom, état (off, on installée, on en échec), description
|
|
136
|
-
catalogue_lister() {
|
|
137
|
-
local app etat etiquette
|
|
138
|
-
while IFS= read -r app; do
|
|
139
|
-
[ -n "$app" ] || continue
|
|
140
|
-
etat="$(app_etat "$app")"
|
|
141
|
-
case "$etat" in
|
|
142
|
-
disponible) etiquette='off disponible' ;;
|
|
143
|
-
installée) etiquette="on installée" ;;
|
|
144
|
-
echec) etiquette="on en échec" ;;
|
|
145
|
-
*) etiquette="on attendue" ;;
|
|
146
|
-
esac
|
|
147
|
-
printf ' %-12s %-14s %s\n' "$app" "$etiquette" "$(app_lire "$app" description)"
|
|
148
|
-
done <<<"$(catalogue_apps)"
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
# Relais de l application installee : etat de son script, sinon pid du relais
|
|
152
|
-
app_relais_arrete() {
|
|
153
|
-
local app="$1" script etat
|
|
154
|
-
if [ "${DEVZONE_WORKSPACE:-}" = kubernetes ]; then
|
|
155
|
-
# In the pod, no relay: the access goes through the workspace ports
|
|
156
|
-
return 1
|
|
157
|
-
fi
|
|
158
|
-
script="$ICI/catalogue/$app/$app.sh"
|
|
159
|
-
if [ -f "$script" ]; then
|
|
160
|
-
etat="$(bash "$script" status 2>/dev/null || true)"
|
|
161
|
-
case "$etat" in *"relais arrêté"*) return 0 ;; esac
|
|
162
|
-
fi
|
|
163
|
-
! relais_actif "$app"
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
# Lignes Applications du récapitulatif de devzone : ○ disponible, ✔ installée
|
|
167
|
-
# (adresse du relais), ✖ en échec, ⚠ attendue
|
|
168
|
-
catalogue_resume() {
|
|
169
|
-
local app
|
|
170
|
-
while IFS= read -r app; do
|
|
171
|
-
[ -n "$app" ] || continue
|
|
172
|
-
case "$(app_etat "$app")" in
|
|
173
|
-
disponible) printf ' ○ application %-12s disponible, %s : devzone enable %s\n' \
|
|
174
|
-
"$app" "$(app_lire "$app" description)" "$app" ;;
|
|
175
|
-
installée)
|
|
176
|
-
if app_relais_arrete "$app"; then
|
|
177
|
-
printf ' ⚠ application %-12s installée, relais arrêté : devzone repair\n' "$app"
|
|
178
|
-
else
|
|
179
|
-
if [ "${DEVZONE_WORKSPACE:-}" = kubernetes ]; then
|
|
180
|
-
printf ' ✔ application %-12s installée : local access: devzone workspace ports\n' "$app"
|
|
181
|
-
else
|
|
182
|
-
printf ' ✔ application %-12s installée : 127.0.0.1:%s\n' \
|
|
183
|
-
"$app" "$(app_lire "$app" port)"
|
|
184
|
-
fi
|
|
185
|
-
fi ;;
|
|
186
|
-
attendue) printf ' ⚠ application %-12s attendue : devzone apply\n' "$app" ;;
|
|
187
|
-
*) printf ' ✖ application %s en échec : %s : devzone apply\n' \
|
|
188
|
-
"$app" "$(head -1 "$(fichier_echec "$app")")" ;;
|
|
189
|
-
esac
|
|
190
|
-
done <<<"$(catalogue_apps)"
|
|
191
|
-
app_mysql_volumes_inutilises 2>/dev/null || true
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
# Rubrique applications de devzone status --json : mêmes champs que modules
|
|
195
|
-
catalogue_json() {
|
|
196
|
-
local app actif etat echec cmd json='[]'
|
|
197
|
-
while IFS= read -r app; do
|
|
198
|
-
[ -n "$app" ] || continue
|
|
199
|
-
actif=false
|
|
200
|
-
[ "$(voulu "$app")" = on ] && actif=true
|
|
201
|
-
etat="$(app_etat "$app")"
|
|
202
|
-
echec=""
|
|
203
|
-
cmd="devzone apply"
|
|
204
|
-
case "$etat" in
|
|
205
|
-
disponible) cmd="devzone enable $app" ;;
|
|
206
|
-
installée) cmd="devzone disable $app" ;;
|
|
207
|
-
echec) echec="$(head -1 "$(fichier_echec "$app")")" ;;
|
|
208
|
-
esac
|
|
209
|
-
json="$(jq -cn --argjson avant "$json" --arg nom "$app" --argjson actif "$actif" \
|
|
210
|
-
--arg description "$(app_lire "$app" description)" \
|
|
211
|
-
--arg etat "$etat" --arg port "$(app_lire "$app" port)" \
|
|
212
|
-
--arg echec "$echec" --arg commande "$cmd" \
|
|
213
|
-
'$avant + [{nom:$nom,actif:$actif,description:$description,port:$port,etat:$etat,echec:(if $echec=="" then null else $echec end),commande:(if $commande=="" then null else $commande end)}]')"
|
|
214
|
-
done <<<"$(catalogue_apps)"
|
|
215
|
-
printf '%s\n' "$json"
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
case "${1:-}" in
|
|
219
|
-
sync) catalogue_synchroniser ;;
|
|
220
|
-
apply) catalogue_appliquer ;;
|
|
221
|
-
list) catalogue_lister ;;
|
|
222
|
-
resume) catalogue_resume ;;
|
|
223
|
-
json) catalogue_json ;;
|
|
224
|
-
# Retrait d'une application : StatefulSet et service, volume gardé (#441)
|
|
225
|
-
remove) app_desinstaller "$2" ;;
|
|
226
|
-
-h | --help | aide) sed -n '2,6p' "$0" | sed 's/^# \{0,1\}//' ;;
|
|
227
|
-
*)
|
|
228
|
-
echo "devzone : catalogue : sync | apply | list | resume | json | remove <app>" >&2
|
|
229
|
-
exit 1
|
|
230
|
-
;;
|
|
231
|
-
esac
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# À chaque démarrage, dans l'ordre : relais du socket Docker (#293), identité git
|
|
3
|
-
# (déduite du compte gh), clusters Kubernetes, nom gitlab.localhost et relais
|
|
4
|
-
# 8929/2224 du module gitlab s'il est actif, relais des modules postgres et
|
|
5
|
-
# argocd s'ils sont actifs, relais de ports vers le poste, identifiants
|
|
6
|
-
# regroupés (.password), puis
|
|
7
|
-
# récapitulatif de ce qui reste à faire (devzone).
|
|
8
|
-
# Séquentiel : le récapitulatif voit l'identité tout juste posée ; l'échec
|
|
9
|
-
# d'une étape n'empêche pas les suivantes.
|
|
10
|
-
# Jamais de question (gh, kubectl et ses plugins d'authentification) : sortie
|
|
11
|
-
# invisible derrière make, une attente bloquerait (voir post-create.sh)
|
|
12
|
-
exec </dev/null
|
|
13
|
-
ICI="$(dirname "$0")"
|
|
14
|
-
# Relais du socket Docker d'abord (#293) : sans lui, les docker exec longs
|
|
15
|
-
# (kind, modules) sont coupés au bout de 0,5 s sous Docker Desktop
|
|
16
|
-
DEVZONE_RELAIS_REEL=oui bash "$ICI/docker-relais.sh" || echo "démarrage : relais Docker non corrigé (devzone repair)"
|
|
17
|
-
bash "$ICI/git-identite.sh" || echo "démarrage : identité git non traitée (devzone start)"
|
|
18
|
-
bash "$ICI/kube-config.sh" || echo "démarrage : clusters non traités (devzone start)"
|
|
19
|
-
# Jeton du compte Kubernetes limité (#430) : 24 h, renouvelé à chaque
|
|
20
|
-
# démarrage ; compte posé au passage s'il manque. Sans cluster des services
|
|
21
|
-
# choisi, rien à faire
|
|
22
|
-
bash "$ICI/kube-compte.sh" jeton || echo "démarrage : jeton du compte kubernetes non renouvelé (devzone repair)"
|
|
23
|
-
# Module gitlab actif : /etc/hosts est un montage Docker régénéré à chaque
|
|
24
|
-
# démarrage, gitlab.localhost doit être re-pose (ssh, glab et getent passent
|
|
25
|
-
# par le résolveur système) ; hote-poser n'échoue jamais (avertissement seul)
|
|
26
|
-
if bash "$ICI/devzone" is-enabled gitlab; then
|
|
27
|
-
bash "$ICI/gitlab/gitlab.sh" hote-poser || echo "démarrage : nom gitlab.localhost non posé (devzone repair)"
|
|
28
|
-
# Relais TCP 8929/2224 : curl et git en HTTP passent par la boucle locale
|
|
29
|
-
# pour *.localhost, le relais doit être relancé après chaque démarrage
|
|
30
|
-
bash "$ICI/gitlab/gitlab.sh" relay-start || echo "démarrage : relais gitlab non lancé (devzone repair)"
|
|
31
|
-
fi
|
|
32
|
-
# Module postgres actif : le relais (port-forward vers 127.0.0.1:5432) ne
|
|
33
|
-
# survit pas à l'arrêt du conteneur, relancé ici après les clusters
|
|
34
|
-
if bash "$ICI/devzone" is-enabled postgres; then
|
|
35
|
-
bash "$ICI/postgres/postgres.sh" relay-start || echo "démarrage : relais postgres non lancé (devzone repair)"
|
|
36
|
-
fi
|
|
37
|
-
# Module argocd actif : relais (port-forward vers 127.0.0.1:8443), relancé
|
|
38
|
-
# après les clusters comme celui de postgres
|
|
39
|
-
if bash "$ICI/devzone" is-enabled argocd; then
|
|
40
|
-
bash "$ICI/argocd/argocd.sh" relay-start || echo "démarrage : relais argocd non lancé (devzone repair)"
|
|
41
|
-
fi
|
|
42
|
-
# Module mysql actif : le relais 127.0.0.1:3306, relancé comme celui de
|
|
43
|
-
# postgres après chaque démarrage
|
|
44
|
-
if bash "$ICI/devzone" is-enabled mysql; then
|
|
45
|
-
bash "$ICI/catalogue/mysql/mysql.sh" relay-start || echo "démarrage : relais mysql non lancé (devzone repair)"
|
|
46
|
-
fi
|
|
47
|
-
# Relais de ports vers le poste (#290) : l'IP du conteneur change à chaque
|
|
48
|
-
# démarrage, chaque relais de l'état est recréé ; un échec n'empêche rien
|
|
49
|
-
bash "$ICI/ports.sh" restart || echo "démarrage : relais de ports non relancés (devzone repair)"
|
|
50
|
-
# Veilleur de ports automatiques vers le poste (#394, garde #293) : une seule
|
|
51
|
-
# instance en arrière-plan, contexte réel posé pour cet appel seulement.
|
|
52
|
-
# Kubernetes workspace (#517): no watcher, ports go through devzone workspace ports
|
|
53
|
-
if [ "${DEVZONE_WORKSPACE:-}" != kubernetes ]; then
|
|
54
|
-
DEVZONE_PORTS_AUTO_REEL=oui bash "$ICI/ports-auto.sh" demarrer >/dev/null 2>&1 || echo "démarrage : veilleur de ports auto non lancé (devzone repair)"
|
|
55
|
-
fi
|
|
56
|
-
# Catalogue d'applications : une ligne <app>=off par application absente,
|
|
57
|
-
# écrite une fois, jamais une ligne existante modifiée (#414)
|
|
58
|
-
bash "$ICI/catalogue.sh" sync || echo "démarrage : catalogue non synchronisé (devzone repair)"
|
|
59
|
-
# Veilleur du catalogue : réapplique à chaud dès que .devzone.modules change
|
|
60
|
-
DEVZONE_CATALOGUE_REEL=oui bash "$ICI/catalogue/catalogue-veilleur.sh" demarrer >/dev/null 2>&1 || echo "démarrage : veilleur catalogue non lancé (devzone repair)"
|
|
61
|
-
|
|
62
|
-
# Vue regroupée des identifiants (#332), regénérée à chaque démarrage ; un
|
|
63
|
-
# échec n'empêche rien et le contenu n'est jamais affiché
|
|
64
|
-
bash "$ICI/password.sh" regenerer || echo "démarrage : identifiants regroupés non mis à jour (devzone repair)"
|
|
65
|
-
echo
|
|
66
|
-
bash "$ICI/devzone"
|