diff --git a/gemini/.gemini/policies/readonly-commands.toml b/gemini/.gemini/policies/readonly-commands.toml index a8eddba..0392218 100644 --- a/gemini/.gemini/policies/readonly-commands.toml +++ b/gemini/.gemini/policies/readonly-commands.toml @@ -126,12 +126,30 @@ commandPrefix = "tail " decision = "allow" priority = 100 +[[rule]] +toolName = "run_shell_command" +commandPrefix = "ls " +decision = "allow" +priority = 100 + [[rule]] toolName = "run_shell_command" commandPrefix = "cat " decision = "allow" priority = 100 +[[rule]] +toolName = "run_shell_command" +commandPrefix = "echo " +decision = "allow" +priority = 100 + +[[rule]] +toolName = "run_shell_command" +commandPrefix = "[ " +decision = "allow" +priority = 100 + [[rule]] toolName = "run_shell_command" commandPrefix = "sed -n " diff --git a/vscode/.vscode-server/server-env-setup b/vscode/.vscode-server/server-env-setup index 465ed81..770ce2a 100755 --- a/vscode/.vscode-server/server-env-setup +++ b/vscode/.vscode-server/server-env-setup @@ -1,7 +1,7 @@ #!/usr/bin/env bash -# VS Code WSL server startup hook. -# Loads private environment variables from ~/.env.secrets if available. +# Хук запуска сервера VS Code в WSL. +# Загружает приватные переменные окружения и настраивает прокси, если доступен hproxy.local. secrets_file="$HOME/.env.secrets" @@ -9,14 +9,29 @@ warn() { printf 'server-env-setup: %s\n' "$1" >&2 } -if [ ! -f "$secrets_file" ]; then - warn "warning: $secrets_file not found; starting without extra secrets." - return 0 2>/dev/null || exit 0 +# 1. Загрузка приватных секретов (API ключи и т.д.) +if [ -f "$secrets_file" ]; then + # shellcheck disable=SC1090 + if ! source "$secrets_file"; then + warn "warning: не удалось загрузить $secrets_file" + fi fi -# shellcheck disable=SC1090 -if ! source "$secrets_file"; then - warn "warning: failed to source $secrets_file; starting without extra secrets." +# 2. Автоматическая настройка прокси, если hproxy.local резолвится +# Используем getent, так как имя может быть в /etc/hosts или в DNS (режим mirror) +if getent hosts hproxy.local >/dev/null 2>&1; then + proxy_url="http://hproxy.local:12334" + + export HTTP_PROXY="$proxy_url" + export HTTPS_PROXY="$proxy_url" + export ALL_PROXY="socks5://hproxy.local:12334" + export NO_PROXY="hproxy.local,localhost,127.0.0.1" + + # Дублируем в нижнем регистре для лучшей совместимости с инструментами + export http_proxy="$HTTP_PROXY" + export https_proxy="$HTTPS_PROXY" + export all_proxy="$ALL_PROXY" + export no_proxy="$NO_PROXY" fi return 0 2>/dev/null || exit 0