BETA-457 - ajustes na instalacao
This commit is contained in:
@@ -102,26 +102,43 @@ check_docker_installed() {
|
||||
INSTALL_DIR="attendancesystem"
|
||||
|
||||
# ══════════════════════════════════════════════════════════════
|
||||
# Garantir .env.observability
|
||||
# Carregar / inicializar .env.observability
|
||||
# ══════════════════════════════════════════════════════════════
|
||||
|
||||
ensure_observability_env() {
|
||||
local env_file="${INSTALL_DIR}/.env.observability"
|
||||
|
||||
if [ -f "$env_file" ]; then
|
||||
print_ok ".env.observability já existe"
|
||||
return 0
|
||||
fi
|
||||
|
||||
_observability_defaults() {
|
||||
local env_file="$1"
|
||||
cat > "$env_file" <<'EOF'
|
||||
SeventhLogs__CustomLevel__Warning__0=Microsoft.AspNetCore
|
||||
SeventhLogs__CustomLevel__Warning__1=Microsoft.AspNetCore.Hosting.Diagnostics
|
||||
SeventhLogs__CustomLevel__Warning__2=System.Net.Http.HttpClient.OtlpTraceExporter.ClientHandler
|
||||
SeventhLogs__CustomLevel__Warning__3=System.Net.Http.HttpClient.OtlpTraceExporter.LogicalHandler
|
||||
EOF
|
||||
print_ok ".env.observability criado"
|
||||
}
|
||||
|
||||
load_observability_env() {
|
||||
local env_file="${INSTALL_DIR}/.env.observability"
|
||||
|
||||
if [ ! -f "$env_file" ]; then
|
||||
_observability_defaults "$env_file"
|
||||
print_ok ".env.observability criado com configurações padrão"
|
||||
return
|
||||
fi
|
||||
|
||||
print_warn "Configuração de observabilidade encontrada em ${env_file}"
|
||||
|
||||
if confirm "Deseja manter as configurações atuais?"; then
|
||||
print_ok ".env.observability mantido sem alterações"
|
||||
return
|
||||
fi
|
||||
|
||||
if confirm "Não manter as configurações atuais do arquivo .env.observability vai redefinir para as configurações padrões, você realmente deseja fazer isso?"; then
|
||||
print_ok ".env.observability mantido sem alterações"
|
||||
return
|
||||
fi
|
||||
|
||||
_observability_defaults "$env_file"
|
||||
print_ok ".env.observability redefinido para as configurações padrão"
|
||||
}
|
||||
# ══════════════════════════════════════════════════════════════
|
||||
# Flags de controle
|
||||
# ══════════════════════════════════════════════════════════════
|
||||
@@ -337,7 +354,7 @@ main() {
|
||||
configure_docker_service
|
||||
configure_docker_log_limit
|
||||
verify_result
|
||||
ensure_observability_env
|
||||
load_observability_env
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
Reference in New Issue
Block a user