Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Biçim [Keep a Changelog](https://keepachangelog.com/) esas alınmıştır.

## [Unreleased]

### Düzeltildi
- **Sunucu eklerken CIDR editörü:** `ModuleGenerator.sh` `SSHModule.sh`'yi yüklemediği için sunucu bilgileri (IP/port/kullanıcı/anahtar) okunamıyor ve "_ssh_env_get: command not found" yazıyordu; ayrıca değişken türü sorgusu Python'a BrokenPipe izi bastırabiliyordu. İkisi de giderildi (test eklendi).

### Eklendi
- **Eylem düzeyi `requires_vars` (isteğe bağlı manifest alanı):** bir eylem, listedeki değişken değerler dosyasında boş/yoksa ssh'a gitmeden "⛔ çalıştırılmadı: değeri boş değişken: …" ile reddedilir; menüde eylem kartında ⛔ ve "Boş: …" ipucu görünür. Yalnızca o eylemleri kapatır (`audit`, `rollback_*` etkilenmez); alan yoksa davranış değişmez. Amaç: erişim kısıtını (örn. `hardening_ssh_allow_from`) boş bırakıp kendini dışarıda bırakmayı önlemek.
- **Manifest: `platform_choices` / `onboarding_vars` okunur ve doğrulanır** (sunucu eklerken platform seçimi için hazırlık; seçim ekranı ve `apply_vars` uygulaması sonraki PR'larda). Alan yoksa davranış değişmez; bozuksa paket kilide yazılmaz. Tasarım: `docs/sunucu-ekleme-platform-secimi.md`.
Expand Down
5 changes: 3 additions & 2 deletions sistem/Helpers/ComponentsOnboard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ comp_onboard_ids() {

# _comp_onboard_var_type <manifest> <değişken> → tür (örn. list[cidr])
_comp_onboard_var_type() {
comp_vars_describe "$1" | awk -F'\t' -v n="$2" '$1 == n { print $2; exit }'
# awk'ı erken bitirmek (exit) python'a BrokenPipe izi bastırırdı: çıktı tamamen okunur
comp_vars_describe "$1" | awk -F'\t' -v n="$2" '$1 == n && !d { print $2; d=1 }'
}

# _comp_onboard_ask_platform <bilgi> → seçilen platform kimliği (stdout); "" = şimdi değil (hiçbir şey yazılmaz). Menü stderr'e yazılır.
Expand Down Expand Up @@ -106,7 +107,7 @@ _comp_onboard_vars() {
COMP_MENU_DIR="$dir"
comp_menu_edit_cidr "$n" "$server" || true
else
echo "$n — $(comp_vars_describe "$mf" | awk -F'\t' -v n="$n" '$1 == n { print $NF; exit }')"
echo "$n — $(comp_vars_describe "$mf" | awk -F'\t' -v n="$n" '$1 == n && !d { print $NF; d=1 }')"
IFS= read -r -p "Değer (boş = atla): " v || return 1
if [ -n "$v" ]; then
if out=$(comp_vars_check "$mf" "$n" "$v" 2>&1); then comp_vars_set "$vf" "$n" "$v" && echo "✅ Kaydedildi: $n = $v"
Expand Down
2 changes: 2 additions & 0 deletions sistem/ModuleGenerator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ source "$SCRIPT_DIR/Helpers/ModuleFiles.sh"
source "$SCRIPT_DIR/Helpers/Servers.sh"
# shellcheck source=Helpers/SSHHelper.sh
source "$SCRIPT_DIR/Helpers/SSHHelper.sh"
# shellcheck source=Helpers/SSHModule.sh
source "$SCRIPT_DIR/Helpers/SSHModule.sh"
# Paket platformu / zorunlu ayar soruları (manifestinde platform_choices olan paket yoksa hiçbir şey sorulmaz)
for _f in Components ComponentsInstall ComponentsManifest ComponentsRun ComponentsVars ComponentsMenu ComponentsOnboard; do
# shellcheck source=/dev/null
Expand Down
1 change: 1 addition & 0 deletions test/components_onboard.bats
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ CHOICES=',"platform_choices":[{"id":"generic","label":"Debian / Ubuntu"},{"id":"
bash "$ROOT/sistem/ModuleGenerator.sh" <<< $'web9\n192.0.2.9\ndeploy\n\nn\n2\n\ne\n10.1.10.0/24\nk\n\n\n'
[ "$status" -eq 0 ]
[[ "$output" == *"sunucu türü ve zorunlu ayarlar"* && "$output" == *"Sunucu oluşturuldu"* ]] || { echo "$output"; false; }
[[ "$output" != *"command not found"* && "$output" != *Traceback* ]] || { echo "$output"; false; }
[ "$(comp_vars_get "$T/srv2/web9/demo.vars" demo_platform)" = proxmox-host ]
[ "$(comp_vars_get "$T/srv2/web9/demo.vars" allow_from)" = 10.1.10.0/24 ]
# paket kurulu değil: soru çıkmaz, sunucu yine oluşur
Expand Down
Loading