BETA-457 - ajustes na instalacao
This commit is contained in:
Submodule attendancesystem deleted from 27f03cf6f3
@@ -102,26 +102,43 @@ check_docker_installed() {
|
|||||||
INSTALL_DIR="attendancesystem"
|
INSTALL_DIR="attendancesystem"
|
||||||
|
|
||||||
# ══════════════════════════════════════════════════════════════
|
# ══════════════════════════════════════════════════════════════
|
||||||
# Garantir .env.observability
|
# Carregar / inicializar .env.observability
|
||||||
# ══════════════════════════════════════════════════════════════
|
# ══════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
ensure_observability_env() {
|
_observability_defaults() {
|
||||||
local env_file="${INSTALL_DIR}/.env.observability"
|
local env_file="$1"
|
||||||
|
|
||||||
if [ -f "$env_file" ]; then
|
|
||||||
print_ok ".env.observability já existe"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat > "$env_file" <<'EOF'
|
cat > "$env_file" <<'EOF'
|
||||||
SeventhLogs__CustomLevel__Warning__0=Microsoft.AspNetCore
|
SeventhLogs__CustomLevel__Warning__0=Microsoft.AspNetCore
|
||||||
SeventhLogs__CustomLevel__Warning__1=Microsoft.AspNetCore.Hosting.Diagnostics
|
SeventhLogs__CustomLevel__Warning__1=Microsoft.AspNetCore.Hosting.Diagnostics
|
||||||
SeventhLogs__CustomLevel__Warning__2=System.Net.Http.HttpClient.OtlpTraceExporter.ClientHandler
|
SeventhLogs__CustomLevel__Warning__2=System.Net.Http.HttpClient.OtlpTraceExporter.ClientHandler
|
||||||
SeventhLogs__CustomLevel__Warning__3=System.Net.Http.HttpClient.OtlpTraceExporter.LogicalHandler
|
SeventhLogs__CustomLevel__Warning__3=System.Net.Http.HttpClient.OtlpTraceExporter.LogicalHandler
|
||||||
EOF
|
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
|
# Flags de controle
|
||||||
# ══════════════════════════════════════════════════════════════
|
# ══════════════════════════════════════════════════════════════
|
||||||
@@ -337,7 +354,7 @@ main() {
|
|||||||
configure_docker_service
|
configure_docker_service
|
||||||
configure_docker_log_limit
|
configure_docker_log_limit
|
||||||
verify_result
|
verify_result
|
||||||
ensure_observability_env
|
load_observability_env
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|||||||
42
install.sh
42
install.sh
@@ -472,24 +472,42 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
# ══════════════════════════════════════════════════════════════
|
# ══════════════════════════════════════════════════════════════
|
||||||
# Garantir .env.observability
|
# Carregar / inicializar .env.observability
|
||||||
# ══════════════════════════════════════════════════════════════
|
# ══════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
ensure_observability_env() {
|
_observability_defaults() {
|
||||||
local env_file="${INSTALL_DIR}/.env.observability"
|
local env_file="$1"
|
||||||
|
|
||||||
if [ -f "$env_file" ]; then
|
|
||||||
print_ok ".env.observability já existe"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat > "$env_file" <<'EOF'
|
cat > "$env_file" <<'EOF'
|
||||||
SeventhLogs__CustomLevel__Warning__0=Microsoft.AspNetCore
|
SeventhLogs__CustomLevel__Warning__0=Microsoft.AspNetCore
|
||||||
SeventhLogs__CustomLevel__Warning__1=Microsoft.AspNetCore.Hosting.Diagnostics
|
SeventhLogs__CustomLevel__Warning__1=Microsoft.AspNetCore.Hosting.Diagnostics
|
||||||
SeventhLogs__CustomLevel__Warning__2=System.Net.Http.HttpClient.OtlpTraceExporter.ClientHandler
|
SeventhLogs__CustomLevel__Warning__2=System.Net.Http.HttpClient.OtlpTraceExporter.ClientHandler
|
||||||
SeventhLogs__CustomLevel__Warning__3=System.Net.Http.HttpClient.OtlpTraceExporter.LogicalHandler
|
SeventhLogs__CustomLevel__Warning__3=System.Net.Http.HttpClient.OtlpTraceExporter.LogicalHandler
|
||||||
EOF
|
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"
|
||||||
}
|
}
|
||||||
|
|
||||||
# ══════════════════════════════════════════════════════════════
|
# ══════════════════════════════════════════════════════════════
|
||||||
@@ -529,11 +547,11 @@ main() {
|
|||||||
configure_docker_log_limit
|
configure_docker_log_limit
|
||||||
clone_repo
|
clone_repo
|
||||||
load_existing_env # detecta .env.prod existente
|
load_existing_env # detecta .env.prod existente
|
||||||
|
load_observability_env
|
||||||
collect_config # wizard com navegação
|
collect_config # wizard com navegação
|
||||||
show_summary # resumo com menu de edição
|
show_summary # resumo com menu de edição
|
||||||
|
|
||||||
generate_envs
|
generate_envs
|
||||||
ensure_observability_env
|
|
||||||
|
|
||||||
if confirm "Deseja subir o ambiente agora?"; then
|
if confirm "Deseja subir o ambiente agora?"; then
|
||||||
start_environment
|
start_environment
|
||||||
|
|||||||
Reference in New Issue
Block a user