tarampampam / nod32-update-mirror

:large_orange_diamond: [WIP] ESET Nod32 Updates Mirror
MIT License
108 stars 50 forks source link

антивирусник требует логин и пароль #52

Closed DaRoni closed 8 years ago

DaRoni commented 8 years ago

Шаги для воспроизведения проблемы (steps to reproduce)

  1. скрипт отрабатывает нормально, база скачивается в каталог. до этого работал с версией 0.4.4 зависимости установлены.
  2. антивирусники не могут обновится, возможно не правильно настроен nginx, наружу смотрит,страница для доступа /home/pi/www/ обновления скидываются в /home/pi/www/nod32 в папке www и в подкаталоге www/nod32 тоже лежит файл .htpasswd пробовал удалить проблема не решилась. сейчас этих файлов нет.
# Virtual server configuration
server {
  listen 80;   ------- тут пробовал оставить default_server не помогло
  listen [::]:80;
  server_name test.ddns.net;
  root /home/pi/www;
  index       index.html;
  autoindex   on;
  access_log  on;

  # Setting directory names
  set $webface     "webface";
  set $errorspages "errorspages";

  # Setting custom error pages
  error_page 401 /error401.html;
  error_page 403 /error403.html;
  error_page 404 /error404.html;
  error_page 500 /error500.html;
  error_page 502 /error502.html;
  error_page 503 /error503.html;
  location ~ "^/error([\d]{3}\.html)$" {
    try_files /$webface/$errorspages/$1 $uri =404;
  }

  # Deny access for spiders/robots/tools/etc
  if ($http_user_agent ~* ^(wget|aria2|nod32view|perl|php|curl|google|yandex|yahoo|-|mirror|spider|bot|parser|grab)) {
    return 403;
  }

  # Deny direct access for hidden files/directories
  location ~ /\. {
    return 444;
  }

  # Redirect request to correct update.ver file, based on nod32 user-agent version
  location ~* "^(?<file_url>/update\.ver)$" {
    if ($http_user_agent ~* "BPC (?<version>[\d]{1,2})\.") {
      set $new_location "v$version$file_url";
    }
    if (-f $document_root/$new_location) {
      return 301 $scheme://$server_name/$new_location;
    }
  }

  # Enable checking username/password for updates files access
  location ~* ^.+\.nup$ {
    allow all;
    auth_basic "Enter login:password for getting access";
    auth_basic_user_file $document_root/.htpasswd;
  }

  # Redirect empty requests to webface index file
  location = / {
    try_files /$webface/index.html =404;
  }

  try_files $uri /$webface$uri /$webface/$errorspages$uri =404;
}

Какое действие ожидалось (expected behaviour)

ESS8 должен был обновится без запроса логина пароля (tell us what should happen)

Что произошло на самом деле (actual behaviour)

нажимаю в ESS8 обновить требует логин пароль,проверил на виртуалке предварительно установив ESS8. так же требует логин пароль при этом пишет неверные имя пользователя и пароль

Данные системы (system information)

установлена debian jessie Операционная система (operating system):

$ cat /proc/version
Linux version 4.1.19-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #858 SMP Tue Mar 15 15:56:00 GMT 2016

Bash:

$ bash --version
GNU bash, version 4.3.30(1)-release (arm-unknown-linux-gnueabihf)

wget / curl:

$ wget -V
GNU Wget 1.16 для linux-gnueabihf.

$ curl -V
curl 7.38.0 (arm-unknown-linux-gnueabihf) libcurl/7.38.0 OpenSSL/1.0.1k zlib/1.2.8 libidn/1.29 libssh2/1.4.3 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API SPNEGO NTLM NTLM_WB SSL libz TLS-SRP

Настройки (settings):

Настройки скрипта (script settings):

$ cat ./settings.conf ./conf.d/*.conf | grep -v -e '^#' -e '^$'

cat: ./conf.d/*.conf: Нет такого файла или каталога
export NOD32MIRROR_DEBUG_MODE=0;
export NOD32MIRROR_COLOR_OUTPUT=1;
export NOD32MIRROR_USE_FREE_KEY=1;
export NOD32MIRROR_MIRROR_DIR="/home/pi/www/nod32";
export NOD32MIRROR_TEMP_DIR="$HOME/tmp";
export NOD32MIRROR_URI_PATH='nod32/';       ----------------тут я пробывал и с пустым
export NOD32MIRROR_SERVER_0='http://update.eset.com:80/eset_upd/ username password';
export NOD32MIRROR_SERVER_1='http://nod32.someserver.com/';
export NOD32MIRROR_SERVER_2='http://someserver2.com/nod32/';
export NOD32MIRROR_PLATFORMS='__ALL__';
export NOD32MIRROR_TYPES='__ALL__';
export NOD32MIRROR_LANGUAGES='1033 1049';
export NOD32MIRROR_VERSIONS='pcu 8';
export NOD32MIRROR_LOG_PATH="$HOME/nod32mirror.log";
export NOD32MIRROR_CURL_BIN='false';
export NOD32MIRROR_TEST_URI='http://update.eset.com:80/v8-rel-sta/mod_010_smon_1036/em010_32_l0.nup';
export NOD32MIRROR_DOWNLOAD_DELAY=1;
export NOD32MIRROR_TIMESTAMP_FILE_NAME='lastevent.txt';
export NOD32MIRROR_VERSION_FILE_NAME='version.txt';
``` shell pi@raspberrypi:~/www/nod32 $ ls -a . eav_nt64_enu.nup em002_32_l1.nup em006_32_l1.nup em009_32_l1.nup em011_32_l2.nup em014_32_l1.nup em017_64_l1.nup em019_32_l1.nup em022_32_l2.nup em029_32_l1.nup essbe_nt64_rus.nup tmp .. eav_nt64_rus.nup em002_32_l2.nup em006_32_l2.nup em009_64_l0.nup em013_32_l0.nup em014_32_l2.nup em018_32_l0.nup em019_32_l2.nup em023_32_l0.nup em029_32_l2.nup ess_nt32_enu.nup update.ver eavbe_nt32_enu.nup em000_32_l0.nup em003_32_l0.nup em006_64_l0.nup em009_64_l1.nup em013_32_l1.nup em015_32_l0.nup em018_32_l1.nup em020_32_l0.nup em023_32_l1.nup em041_32_l0.nup ess_nt32_rus.nup v8 eavbe_nt32_rus.nup em000_64_l0.nup em004_32_l0.nup em006_64_l1.nup em010_32_l0.nup em013_32_l2.nup em015_64_l0.nup em018_32_l2.nup em021_32_l0.nup em023_32_l2.nup em041_32_l1.nup ess_nt64_enu.nup version.txt eavbe_nt64_enu.nup em001_32_l0.nup em005_32_l0.nup em008_32_l0.nup em010_32_l1.nup em013_64_l0.nup em017_32_l0.nup em018_64_l0.nup em021_32_l1.nup em024_32_l0.nup em041_32_l2.nup ess_nt64_rus.nup eavbe_nt64_rus.nup em001_32_l1.nup em005_32_l1.nup em008_32_l1.nup em010_32_l2.nup em013_64_l1.nup em017_32_l1.nup em018_64_l1.nup em021_32_l2.nup em024_32_l1.nup essbe_nt32_enu.nup .htpasswd eav_nt32_enu.nup em001_32_l2.nup em005_32_l2.nup em008_64_l0.nup em011_32_l0.nup em013_64_l2.nup em017_32_l2.nup em018_64_l2.nup em022_32_l0.nup em028_64_l0.nup essbe_nt32_rus.nup lastevent.txt eav_nt32_rus.nup em002_32_l0.nup em006_32_l0.nup em009_32_l0.nup em011_32_l1.nup em014_32_l0.nup em017_64_l0.nup em019_32_l0.nup em022_32_l1.nup em029_32_l0.nup essbe_nt64_enu.nup pcu pi@raspberrypi:~/www/nod32 $ rm .htpasswd pi@raspberrypi:~/www/nod32 $ ls -a . eav_nt64_enu.nup em002_32_l1.nup em006_32_l1.nup em009_32_l1.nup em011_32_l2.nup em014_32_l1.nup em017_64_l1.nup em019_32_l1.nup em022_32_l2.nup em029_32_l1.nup essbe_nt64_rus.nup update.ver .. eav_nt64_rus.nup em002_32_l2.nup em006_32_l2.nup em009_64_l0.nup em013_32_l0.nup em014_32_l2.nup em018_32_l0.nup em019_32_l2.nup em023_32_l0.nup em029_32_l2.nup ess_nt32_enu.nup v8 eavbe_nt32_enu.nup em000_32_l0.nup em003_32_l0.nup em006_64_l0.nup em009_64_l1.nup em013_32_l1.nup em015_32_l0.nup em018_32_l1.nup em020_32_l0.nup em023_32_l1.nup em041_32_l0.nup ess_nt32_rus.nup version.txt eavbe_nt32_rus.nup em000_64_l0.nup em004_32_l0.nup em006_64_l1.nup em010_32_l0.nup em013_32_l2.nup em015_64_l0.nup em018_32_l2.nup em021_32_l0.nup em023_32_l2.nup em041_32_l1.nup ess_nt64_enu.nup eavbe_nt64_enu.nup em001_32_l0.nup em005_32_l0.nup em008_32_l0.nup em010_32_l1.nup em013_64_l0.nup em017_32_l0.nup em018_64_l0.nup em021_32_l1.nup em024_32_l0.nup em041_32_l2.nup ess_nt64_rus.nup eavbe_nt64_rus.nup em001_32_l1.nup em005_32_l1.nup em008_32_l1.nup em010_32_l2.nup em013_64_l1.nup em017_32_l1.nup em018_64_l1.nup em021_32_l2.nup em024_32_l1.nup essbe_nt32_enu.nup lastevent.txt eav_nt32_enu.nup em001_32_l2.nup em005_32_l2.nup em008_64_l0.nup em011_32_l0.nup em013_64_l2.nup em017_32_l2.nup em018_64_l2.nup em022_32_l0.nup em028_64_l0.nup essbe_nt32_rus.nup pcu eav_nt32_rus.nup em002_32_l0.nup em006_32_l0.nup em009_32_l0.nup em011_32_l1.nup em014_32_l0.nup em017_64_l0.nup em019_32_l0.nup em022_32_l1.nup em029_32_l0.nup essbe_nt64_enu.nup tmp pi@raspberrypi:~/www/nod32 $ cd .. pi@raspberrypi:~/www $ ls-a -bash: ls-a: команда не найдена pi@raspberrypi:~/www $ ls -a . .. download .gitignore .htpasswd nod32 README.md webface pi@raspberrypi:~/www $ rm .htpasswd pi@raspberrypi:~/www $ ls -a . .. download .gitignore nod32 README.md webface pi@raspberrypi:~/www $ cd pi@raspberrypi:~ $ ls -a . .. .bash_history .bash_logout .bashrc conf.d .gitignore include .nod32keys nod32mirror.log nod32-mirror.sh ._noip-2.1.9-1 .profile .selected_editor settings.conf www pi@raspberrypi:~ $ ```
tarampampam commented 8 years ago
  # Enable checking username/password for updates files access
  location ~* ^.+\.nup$ {
    allow all;
    auth_basic "Enter login:password for getting access";
    auth_basic_user_file $document_root/.htpasswd;
  }
DaRoni commented 8 years ago

Попробую в auth_basic поставить off. upd: Проблема решена.