Squid error invalid regular expression

Squid error invalid regular expression I’m using the squid 3 package now since a while in conjunction with squidguard without any problem. Due to a hardware-crash i had to reinstall all again (2.0 beta5, Jan 31 install-date, updated to Feb 03.) First what happened was the fact that squid doesn’t work any more in […]

Содержание

  1. Squid error invalid regular expression
  2. acl url_regex на squid3 не работает с использованием проверенного в сети регулярного выражения
  3. Squid error invalid regular expression

Squid error invalid regular expression

I’m using the squid 3 package now since a while in conjunction with squidguard without any problem.
Due to a hardware-crash i had to reinstall all again (2.0 beta5, Jan 31 install-date, updated to Feb 03.)

First what happened was the fact that squid doesn’t work any more in transparent mode. 🙁 If set to transparent, no more internet-surfing. Looking with pkg_info, i saw that the squid 2.7.9 was installed by squidguard. This packages reinstall before the squid-package, so maybe here is one problem.

I’m not shure if i should open another thread about the squidguard-auto-install-squid-thing…

Other thing are this log-entries:

The same expressions worked before without any glitch! Nasty

A manual deinstall of the «old» squid:

After that i removed squid3, installed it again and all works again like before.
So the big work i have after every update i have to do the same things again.

Who has to review his/her code now? The squidguard-maintainer? Or is that a package-manager-problem? Then this thread would be better in the 2.0 forum. Not shure…

Oh, a maybe silly question: Do i have to enable the loopback-device too, or only the interfaces which are used by my LAN? (LAN; WIFI; OPTx)

edit: I was too early: squid alone starts, squidguard not. If i try to start squidguard too, both services die. Last log-entry from squidguard was «servicing requests». No message about its death.

Источник

acl url_regex на squid3 не работает с использованием проверенного в сети регулярного выражения

Меня попросили заблокировать доступ к Facebook с 8:00 до 15:00 почти для всех пользователей, но они все равно используют альтернативные URL Facebook для доступа к социальной сети. Это потребляет большую часть нашей низкой пропускной способности, и мы даже не можем работать. Я решил создать регулярное выражение (регулярное выражение), чтобы проанализировать эти URL-адреса и заблокировать их. Я не хочу блокировать все URL-адреса facebook, но только альтернативы. Альтернативные адреса Facebook в основном содержат слова prod или iphone. Следующие являются альтернативными URL-адресами Facebook, зарегистрированными нашим прокси-сервером:

Разработанное регулярное выражение: /((?=.*biphoneb)|(?=.*bprodb)).*.facebook.com(:|d|)/

Я протестировал это регулярное выражение на https://regex101.com/ и https://www.regextester.com. Регулярное выражение для сопоставления:

И не подходит для:

Пока что это то, что я хотел, альтернативные URL-адреса заблокированы и разрешены обычные URL-адреса Facebook. Мое регулярное выражение выглядит хорошо для использования в Squid.

Следующим шагом является изменение файла /etc/squid3/squid.conf путем добавления нового acl, указывающего на файл, содержащий регулярное выражение:

Когда я запускаю squid3 -k parse для проверки файла конфигурации, я получаю ошибки:

Очевидно, парсер squid3 помечает мой acl как неправильный, но я уже тестировал онлайн, и это было хорошо для использования. Также там написано, что acl пуст. Что это значит? ACL был объявлен с именем Facebook. Я очень смущен этим.

Источник

Squid error invalid regular expression

Strangled by Lynx Редактировать | Профиль | Сообщение | ICQ | Цитировать | Сообщить модератору Я думаю удобнее сделать будет один топик по Squid и все вопросы касательно него постить сюда. 🙂
У меня вопрос такого характера: как настроить резку трафика squid и как настроить замену баннеров или просто их вырезку.

В первом посте собираем полезные ссылки, преимущественно на русском по Squid.

// текущий бэкап шапки.. Всего записей: 303 | Зарегистр. 07-12-2001 | Отправлено: 14:56 10-05-2002 | Исправлено: TheBarmaley TMP, 15:33 23-03-2016

Mavrikii

Platinum Member

Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Denirvan

Цитата:

Я изучаю эти моменты и настройки в целях самообразования

поднимайте виртуальную машину и изучайте, либо через https://docs.microsoft.com/ru-ru/windows/wsl/install-win10

Цитата:

а расширения для браузера как то не доверяю я им

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

со сквид вам придется разобраться с той частью работы с SSL, плюс браузеры будут ругаться, так как вы декодируете https для анализа и получения хоста запроса. читайте https://www.howtoforge.com/filtering-https-traffic-with-squid (можете с автопереводом в браузере — сейчас автоматический перевод приличный)
https://advsoft.info/articles/setting_up_HTTPS_inspection_in_squid.php (тут есть ссылка на виндовый сквид собранный с https поддержкой)

Цитата:

Ну и в целом, мой конфиг правильный?

часть по фильтрации домена (если не https) работает — проверил в вирт машине с Ubuntu. с настройкой для работы с ssl мне разбираться, если честно, не хочется. я бы поставил примочку в браузер, например https://chrome.google.com/webstore/detail/proxy-switchyomega/padekgcemlokbadohgkifijomclgjgif которая выбирает прокси по URL

Всего записей: 13683 | Зарегистр. 20-09-2014 | Отправлено: 02:10 26-12-2020 | Исправлено: Mavrikii, 02:14 26-12-2020
Denirvan

Junior Member

Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору И еще вопрос, например просто txt список можно прикрутить?
Всего записей: 62 | Зарегистр. 19-08-2018 | Отправлено: 02:14 26-12-2020
Mavrikii

Platinum Member

Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Denirvan

Цитата:

например просто txt список можно прикрутить?

acl tor_url url_regex
говорит об использовании url_regex, чтобы фильтровать можно было по URL целиком, а не просто домену. если нужен только домен, то
acl tor_url dstdomain

Всего записей: 13683 | Зарегистр. 20-09-2014 | Отправлено: 02:17 26-12-2020
Denirvan

Junior Member

Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Спасибо вас за помощь, попробую решить ошибку, если что напишу о результате, еще раз спс!
Всего записей: 62 | Зарегистр. 19-08-2018 | Отправлено: 02:23 26-12-2020
Denirvan

Junior Member

Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Здравствуйте, вот такой вот вопрос возник по поводу
acl NoSSLIntercept ssl :: server_name_regex «/etc/squid/url.nobump»
acl NoSSLIntercept ssl :: server_name_regex «/etc/squid/url.tor»

url.tor это файл со списком, который должен проходить через тор
url.nobump что это за файл, что в нем должно быть?

И еще, список ниже должен быть без #?
# ytimg. *
# googlevideo. *
# google. *
# googleapis. *
# googleusercontent. *

Всего записей: 62 | Зарегистр. 19-08-2018 | Отправлено: 13:54 26-12-2020
ipmanyak

Platinum Member

Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Denirvan
1 — двух acl с одним и тем же именем не должно быть!
и лучше добавлять параметр -i, независимость от регистра.
acl NoSSLIntercept ssl :: server_name_regex -i «/etc/squid/url.nobump»
иначе, если набрать урлу прописными буквами, то аксель не сработает.
2 — в файле для этого акселя пиши имена доменов с точкой в виде:
.vodka.ru
.pivo.ru
.prastitutki.ru
3. url.nobump — просто имя файла, можешь указать своё. В данном контексте означает, что сайты этих доменов не надо бампить, то есть не ковыряться в их трафике HTTPS. При подмене сертификата на сквидовский, некоторые сайты чухают , что сертификат клиента подменен, и сообщают об этом и не пускают. Например, сайты банкингов так делают.

———-
В сортире лучше быть юзером, чем админом.

Всего записей: 11275 | Зарегистр. 10-12-2003 | Отправлено: 14:26 26-12-2020 | Исправлено: ipmanyak, 14:29 26-12-2020
Denirvan

Junior Member

Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Не могли бы вы глянуть мой конфиг? Не могу понять, мне нужно что бы только сайты из моего списка проходили через тор, а у меня весь трафик идет (

Цитата:

2020/12/25 ***| FATAL: Invalid ACL type ‘at_step’
FATAL: Bungled /etc/squid/squid.conf line 21: acl DiscoverSNIHost at_step SslBump1
Squid Cache (Version 3.5.27): Terminated abnormally.

Здравствуйте, ошибку вроде поборол, но весь трафик все равно идет через тор (

Всего записей: 62 | Зарегистр. 19-08-2018 | Отправлено: 14:40 26-12-2020
ipmanyak

Platinum Member

Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Denirvan А какого лешего ты юзаешь TOR? Причем тут сквид?
Когда ставишь TOR, как сейчас не знаю, но ранее он прописывал свой прокси на своем порту в системных настройках винды, проверь кстати. Само собйо всё будет переть через его луковые сети и мосты. Деиинсталлируй TOR и не парь нам тут мозг тором в ветке по сквиду. Или юзай TOR или SQUID одно из двух. При запуске тор прописывает свой прокси кажется на ip 127.0.0.1 или 127.0.0.2, могу ошибаться. Давно это было. Зачем тебе тор вообще? Хочешь иметь другой Ip при заходе на сайт, юзай яндекс браузер или опера, там включи VPN в их настройках и всё.

———-
В сортире лучше быть юзером, чем админом.

Всего записей: 11275 | Зарегистр. 10-12-2003 | Отправлено: 18:37 26-12-2020 | Исправлено: ipmanyak, 18:44 26-12-2020
Denirvan

Junior Member

Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору
Цитата:

А какого лешего ты юзаешь TOR? Причем тут сквид?

HTTPS прокси для обхода блокировок Роскомнадзора+тонкая настройка+фильтрация через привокси+обход именно нужных мне сайтов+будет отдельный сервер в общем я много плюсов увидел в этой сборке.

Добавлено:
+ не большая анонимность, знаю точно что связка работает, вот только нужно настроить )

Добавлено:
В принципе уже настроил, вот только трафик весь через тор идет, а мне частичный нужен, вот и прошу глянуть мой конфиг.

Всего записей: 62 | Зарегистр. 19-08-2018 | Отправлено: 18:53 26-12-2020
ipmanyak

Platinum Member

Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Denirvan Если сейчас у тебя включен прокси тора, то сквид не при делах вообще.

———-
В сортире лучше быть юзером, чем админом.

Всего записей: 11275 | Зарегистр. 10-12-2003 | Отправлено: 07:58 27-12-2020
Denirvan

Junior Member

Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору
Цитата:

Если сейчас у тебя включен прокси тора, то сквид не при делах вообще.

Ну например privoxy+tor работают же, в привоксе прописываешь:
forward-socks5t nnmclub.to/ 127.0.0.1:9050 .
forward-socks5t rutracker.net/ 127.0.0.1:9050 .
forward-socks5t vsetop.org/ 127.0.0.1:9050 .
и трафик через тор идет только на эти сайты, когда подрубаешь сквид, то весь трафик идет через тор.

# Domains to be handled by Tor
acl tor_url url_regex «/etc/squid/url.tor»

# SSL bump rules
acl DiscoverSNIHost at_step SslBump1
acl NoSSLIntercept ssl::server_name_regex -i «/etc/squid/url.tor»
ssl_bump splice NoSSLIntercept
ssl_bump peek DiscoverSNIHost
ssl_bump bump all

# Tor access rules
never_direct allow tor_url

# Local Tor is cache parent
cache_peer 127.0.0.1 parent 8118 0 no-query no-digest default

cache_peer_access privoxy allow tor_url
cache_peer_access privoxy deny all

Почему то список url.tor не работает, то ли я его не верно заполняю, то ли еще что не так в настройках.

Всего записей: 62 | Зарегистр. 19-08-2018 | Отправлено: 11:34 27-12-2020
ipmanyak

Platinum Member

Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Denirvan
Ты в курсе что такое SSL BUMP и зачем он нужен?
Чтобы перенаправлять трафик SSLBUMP тебе не нужен.
Я вообще не вижу никакой необходимости в сквиде.
1 — расскажи конкретнее, что ты хочешь вообще, для чего тебе TOR и PRIVOXY
2 — затем какими методами ты собрался решать свою задачу и почему.
3 — Нарисуй схему.

>мне нужно что бы только сайты из моего списка проходили через тор, а у меня весь трафик идет

Если судить по этой фразе, то тебе и PRIVOXY не нужен.
Ходишь в ИНет обычным образом, когда тебе нужен анонимайзер или обход РКН , ТО запускаешь TOR и ходишь его браузером, и ВСЁ!
И даже TOR тебе не нужен, запускаешь браузер OPERA в нем включаешь VPN, твоя задача обхода запретов РКН будет решена. Есть и другие способы, плагины для браузеров и др.
Короче тебе не нужно ничего кроме браузеров опера и яндекс с функцией режима ТУРБО и VPN

———-
В сортире лучше быть юзером, чем админом.

Всего записей: 11275 | Зарегистр. 10-12-2003 | Отправлено: 19:14 27-12-2020 | Исправлено: ipmanyak, 19:17 27-12-2020
Denirvan

Junior Member

Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Странный вы, в общем закрываю вопрос, сам буду разбираться. Я задаю вопрос о том как я хотел бы сделать, так же про мой конфиг, а вы мне зачем, тебе это не нужно и т.д., вопрос был не в этом, если я спрашиваю значит мне это нужно и именно так, как я это вижу. Без обид, всем всех благ и с наступающим!

Добавлено:
Если в двух слова: хочу организовать не большой сервер для себя и пользователей, будет много различных правил для пользователей, отслеживание и ограничения трафика, привокси для фильтрации и просмотра что да как, тор для анонимизации посещения некоторых сайтов, так же для доступа к заблокированным сайтам, правила для тора по списку нужны что бы весь трафик не гнать через него.

Всего записей: 62 | Зарегистр. 19-08-2018 | Отправлено: 20:40 27-12-2020
Mavrikii

Platinum Member

Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Denirvan

Цитата:

# SSL bump rules
acl DiscoverSNIHost at_step SslBump1
acl NoSSLIntercept ssl::server_name_regex -i «/etc/squid/url.tor»
ssl_bump splice NoSSLIntercept
ssl_bump peek DiscoverSNIHost
ssl_bump bump all

закомментируйте, зайдите, к примеру, сюда http://2ip.kz/
потом добавьте его в список и снова проверьте какой будет IP.
сайт такой, потому что сейчас мало кто работает без https ) если найдете другой, который покажет ваш IP, проверьте на нем.

если все работает — значит нужно только разобраться с раскодированием https запросов.

Всего записей: 13683 | Зарегистр. 20-09-2014 | Отправлено: 03:43 28-12-2020 | Исправлено: Mavrikii, 03:44 28-12-2020
ForAdun

Junior Member

Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Есть ubuntu18 в облаке, понадобилось через него прокси орагнизовать.

Установил squid 3.5.27, прописал парольную авторизацию
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd
auth_param basic children 5
auth_param basic credentialsttl 3 hours
auth_param basic casesensitive off

тестирую дома с браузера ввожу пароль, снова просит ввести и тд
сомтрю в /var/log/squid/access.log там запись TCP_DENIED/407

в cache.log появляются такие записи:
2021/02/01 16:22:08 kid1| WARNING: basicauthenticator #Hlpr92404 exited
2021/02/01 16:22:08 kid1| Too few basicauthenticator processes are running (need 1/5)
2021/02/01 16:22:08 kid1| Starting new helpers
2021/02/01 16:22:08 kid1| helperOpenServers: Starting 1/5 ‘basic_ncsa_auth’ processes
FATAL: cannot stat /etc/squid/passwd

вайл /etc/squid/passwd существует, доступ 644 (пробовал менять на 777 — не помогает)

если в консоле проверить логин пароль, то пишет ОК
/usr/lib/squid/basic_ncsa_auth /etc/squid/passwd

Провобовал passwd пересоздавать, пробовал squid переустанавлить — не помогает.

Есть похожая тестовая машина дома на ней повторяю тот же путь — все ок

Подскажите как вылечить?

Всего записей: 65 | Зарегистр. 14-07-2006 | Отправлено: 16:59 01-02-2021 | Исправлено: ForAdun, 17:07 01-02-2021
Mavrikii

Platinum Member

Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору ForAdun

Цитата:

вайл /etc/squid/passwd существует, доступ 644 (пробовал менять на 777 — не помогает)

Stat — получение инфы о файле, без его чтения. Папка с файлом (и выше) хочет +x доступ для юзверя, под которым бегает аутентификатор.

Цитата:

These functions return information about a file, in the buffer pointed to by statbuf. No permissions are required on the file itself, but—in the case of stat(), fstatat(), and lstat()—execute (search) permission is required on all of the directories in pathname that lead to the file.

Всего записей: 13683 | Зарегистр. 20-09-2014 | Отправлено: 17:24 01-02-2021 | Исправлено: Mavrikii, 17:37 01-02-2021
ForAdun

Junior Member

Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору спасибо
Всего записей: 65 | Зарегистр. 14-07-2006 | Отправлено: 18:22 01-02-2021
mithridat1

Silver Member

Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Релизы Squid 5.1 и 5.2
Всего записей: 4664 | Зарегистр. 05-01-2006 | Отправлено: 17:07 06-10-2021
Yura12

Member

Редактировать | Профиль | Сообщение | ICQ | Цитировать | Сообщить модератору Просьба проконсультировать по настройке кэширующего прокси-сервера Squid.

Вот основные настройки Squid

cache_mem 768 MB
maximum_object_size_in_memory 9512 KB
maximum_object_size 544 MB
cache_dir ufs /var/spool/squid 12000 16 256

Версия системы: Linux linux4 5.4.0-107-generic #121-Ubuntu SMP
Версия Squid Cache: Version 4.10

Так вот, кэширование на локальный диск работает практически для всех сайтов которые ещё работают по http протоколу, в /var/spool/squid уже достаточно большой локальный дисковый кэш.

Но вот именно .UPO файлы оперативных обновлений систем Кодекс / Техэксперт почему-то не хотят записываться в локальный дисковый кэш, и при обновлении разных установок Кодекс / Техэксперт каждый раз скачиваться напрямую с интернета.

С чем это может быть связано? Ведь протокол у раздатчика http

Источник

Adblock
detector

Меня попросили заблокировать доступ к Facebook с 8:00 до 15:00 почти для всех пользователей, но они все равно используют альтернативные URL Facebook для доступа к социальной сети. Это потребляет большую часть нашей низкой пропускной способности, и мы даже не можем работать. Я решил создать регулярное выражение (регулярное выражение), чтобы проанализировать эти URL-адреса и заблокировать их. Я не хочу блокировать все URL-адреса facebook, но только альтернативы. Альтернативные адреса Facebook в основном содержат слова prod или iphone. Следующие являются альтернативными URL-адресами Facebook, зарегистрированными нашим прокси-сервером:

m.iphone.touch.prod.facebook.com
m.iphone.haid.prod.facebook.com:443
m.ct.prod.facebook.com
m.vi-vn.prod.facebook.com

Разработанное регулярное выражение: /((?=.*biphoneb)|(?=.*bprodb)).*.facebook.com(:|d|)/

Я протестировал это регулярное выражение на https://regex101.com/ и https://www.regextester.com. Регулярное выражение для сопоставления:

m.iphone.touch.prod.facebook.com
m.iphone.haid.prod.facebook.com:443
m.ct.prod.facebook.com
m.vi-vn.prod.facebook.com

И не подходит для:

www.facebook.com
m.facebook.com
mqtt.facebook.com (for purple-facebook)
graph.facebook.com
connect.facebook.com
3-edge-chat.facebook.com

Пока что это то, что я хотел, альтернативные URL-адреса заблокированы и разрешены обычные URL-адреса Facebook. Мое регулярное выражение выглядит хорошо для использования в Squid.

Следующим шагом является изменение файла /etc/squid3/squid.conf путем добавления нового acl, указывающего на файл, содержащий регулярное выражение:

acl facebook dstdom_regex "/etc/squid3/acl/facebook" //The file contains the regex
http_access deny pass facebook

Когда я запускаю squid3 -k parse для проверки файла конфигурации, я получаю ошибки:

2017/09/22 11:12:26| Processing: acl facebook dstdom_regex "/etc/squid3/acl/facebook"
2017/09/22 11:12:26| squid.conf line 78: acl facebook dstdom_regex "/etc/squid3/acl/facebook"
2017/09/22 11:12:26| aclParseRegexList: Invalid regular expression '((?=.*biphoneb)|(?=.*bprodb)).*.facebook.com(:|d|)': Invalid preceding regular expression
2017/09/22 12:39:33| Warning: empty ACL: acl facebook dstdom_regex "/etc/squid3/acl/facebook"

Очевидно, парсер squid3 помечает мой acl как неправильный, но я уже тестировал онлайн, и это было хорошо для использования. Также там написано, что acl пуст. Что это значит? ACL был объявлен с именем Facebook. Я очень смущен этим.

This topic has been deleted. Only users with topic management privileges can see it.

  • I’m using the squid 3 package now since a while in conjunction with squidguard without any problem.
    Due to a hardware-crash i had to reinstall all again (2.0 beta5, Jan 31 install-date, updated to Feb 03.)

    First what happened was the fact that squid doesn’t work any more in transparent mode. :( If set to transparent, no more internet-surfing. Looking with pkg_info, i saw that the squid 2.7.9 was installed by squidguard. This packages reinstall before the squid-package, so maybe here is one problem.

    I’m not shure if i should open another thread about the squidguard-auto-install-squid-thing…

    Other thing are this log-entries:

    Feb 3 10:44:03	squid[11575]: Squid Parent: child process 12030 started
    Feb 3 10:44:03	php: : Starting Squid
    Feb 3 10:43:48	php: : The command '/usr/local/sbin/squid -k kill' returned exit code '1', the output was '2011/02/03 10:43:48| aclParseAclLine: WARNING: empty ACL: acl throttle_exts urlpath_regex -i "/var/squid/acl/throttle_exts.acl" 2011/02/03 10:43:48| squid.conf line 77: refresh_pattern ([^.]+.|)(download|(windows|)update|).(microsoft.|)com/.*.(cab|exe|msi|msp) 4320 100% 43200 reload-into-ims 2011/02/03 10:43:48| parse_refreshpattern: Invalid regular expression '([^.]+.|)(download|(windows|)update|).(microsoft.|)com/.*.(cab|exe|msi|msp)': empty (sub)expression 2011/02/03 10:43:48| squid.conf line 78: refresh_pattern ([^.]+.|)(download|adcdownload).(apple.|)com/.*.(pkg|dmg) 4320 100% 43200 reload-into-ims 2011/02/03 10:43:48| parse_refreshpattern: Invalid regular expression '([^.]+.|)(download|adcdownload).(apple.|)com/.*.(pkg|dmg)': empty (sub)expression squid: ERROR: No running copy'
    Feb 3 10:43:43	php: : The command '/usr/local/sbin/squid -k shutdown' returned exit code '1', the output was '2011/02/03 10:43:43| aclParseAclLine: WARNING: empty ACL: acl throttle_exts urlpath_regex -i "/var/squid/acl/throttle_exts.acl" 2011/02/03 10:43:43| squid.conf line 77: refresh_pattern ([^.]+.|)(download|(windows|)update|).(microsoft.|)com/.*.(cab|exe|msi|msp) 4320 100% 43200 reload-into-ims 2011/02/03 10:43:43| parse_refreshpattern: Invalid regular expression '([^.]+.|)(download|(windows|)update|).(microsoft.|)com/.*.(cab|exe|msi|msp)': empty (sub)expression 2011/02/03 10:43:43| squid.conf line 78: refresh_pattern ([^.]+.|)(download|adcdownload).(apple.|)com/.*.(pkg|dmg) 4320 100% 43200 reload-into-ims 2011/02/03 10:43:43| parse_refreshpattern: Invalid regular expression '([^.]+.|)(download|adcdownload).(apple.|)com/.*.(pkg|dmg)': empty (sub)expression squid: ERROR: No running copy'
    Feb 3 10:43:43	php: : Creating squid cache subdirs in /var/squid/cache
    

    The same expressions worked before without any glitch! Nasty

    A manual deinstall of the «old» squid:

    equired by these other packages
    and may not be deinstalled:
    squidGuard-1.4_2
    #: pkg_delete  -f squid-2.7.9
    pkg_delete: package 'squid-2.7.9' is required by these other packages
    and may not be deinstalled (but I'll delete it anyway):
    squidGuard-1.4_2
    pkg_delete: unable to completely remove directory '/usr/local/libexec/squid'
    pkg_delete: unable to completely remove directory '/usr/local/etc/squid/errors'
    pkg_delete: unable to completely remove directory '/usr/local/etc/squid'
    pkg_delete: file '/usr/local/etc/rc.d/squid' doesn't exist
    pkg_delete: couldn't entirely delete package (perhaps the packing list is
    incorrectly specified?)
    ===> post-deinstallation information for squid-2.7.9:
    
         Note:
         Squid related user accounts and groups were not removed.
    
         To remove the 'squid' user and the 'squid' group which were
         created by a default installation of this package, run
    
         pw userdel -n squid -u 100
    
         In order to ease updates the cache and log directories
         and all configuration files modified by you were preserved.
    
         Please remove them manually if you do not want to use
         Squid any longer.
    
    

    After that i removed squid3, installed it again and all works again like before.
    So the big work i have after every update i have to do the same things again.

    Who has to review his/her code now? The squidguard-maintainer? Or is that a package-manager-problem? Then this thread would be better in the 2.0 forum. Not shure…

    Oh, a maybe silly question: Do i have to enable the loopback-device too, or only the interfaces which are used by my LAN? (LAN; WIFI; OPTx)

    edit: I was too early: squid alone starts, squidguard not. If i try to start squidguard too, both services die. Last log-entry from squidguard was «servicing requests». No message about its death.

    squid logs this message now:

    Feb 3 14:05:42	php: : SQUID is installed but not started. Not installing "filter" rules.
    Feb 3 14:05:41	php: : SQUID is installed but not started. Not installing "nat" rules.
    Feb 3 14:05:40	php: /pkg_edit.php: The command '/usr/local/sbin/squid -D' returned exit code '1', the output was '2011/02/03 14:05:40| WARNING: -D command-line option is obsolete. 2011/02/03 14:05:40| WARNING: Netmasks are deprecated. Please use CIDR masks instead. 2011/02/03 14:05:40| WARNING: IPv4 netmasks are particularly nasty when used to compare IPv6 to IPv4 ranges. 2011/02/03 14:05:40| WARNING: For now we will assume you meant to write /27 2011/02/03 14:05:40| ERROR: '0.0.0.0/0.0.0.0' needs to be replaced by the term 'all'. 2011/02/03 14:05:40| SECURITY NOTICE: Overriding config setting. Using 'all' instead. 2011/02/03 14:05:40| WARNING: (B) '::/0' is a subnetwork of (A) '::/0' 2011/02/03 14:05:40| WARNING: because of this '::/0' is ignored to keep splay tree searching predictable 2011/02/03 14:05:40| WARNING: You should probably remove '::/0' from the ACL named 'all' 2011/02/03 14:05:40| WARNING: Netmasks are deprecated. Please use CIDR masks instead. 2011/02/03 14:05:40| WARNING: IPv4 netmasks a
    Feb 3 14:05:40	squid: Bungled squid.conf line 62: reply_body_max_size 0 allow all
    Feb 3 14:05:40	php: /pkg_edit.php: Starting Squid
    
  • You use HDD full installed version of the pfsense?

  • Its a full install. It doesn’t work even after deinstalling/reinstalling.

  • Deinstall (1)squidGuard/(2)squid from GUI, and type pkg_info from console. Result pkg_info pls post here.

  • What happens on deinstallation of squidguard:

    Backing up libraries... 
    Removing package...
    Starting package deletion for squidGuard-1.4_2...done.
    Starting package deletion for cyrus-sasl-2.1...done.
    Starting package deletion for openldap-client-2.4...done.
    Starting package deletion for openssl-1.0...done.
    Starting package deletion for squid-2.7...done.
    Starting package deletion for db3-3.3...done.
    Starting package deletion for db41-4.1.25_4...done.
    Starting package deletion for db3-3.3.11_3,1...done.
    Starting package deletion for cyrus-sasl-2.1.23...done.
    Removing squidGuard components...
    Tabs items... done.
    Menu items... done.
    Services... done.
    Loading package instructions...
    

    The squid 2.7 here… i had installed squid3!

    output of pkg_info after deinstallation:

    aspell-0.60.6_3    Spelling checker with better suggestion logic than ispell
    bsdinstaller-2.0.2011.0131 BSD Installer mega-package
    expat-2.0.1_1      XML 1.0 parser written in C
    gettext-0.18.1.1    GNU gettext package
    grub-0.97_4        GRand Unified Bootloader
    joe-3.7,1          Joe’s Own Editor
    jpeg-8_3            IJG’s jpeg compression utilities
    libevent-1.4.14b_1  Provides an API to execute callback functions on certain ev
    libiconv-1.13.1_1  A character set conversion library
    lightsquid-1.8_2    A light and fast web based squid proxy traffic analyser
    p7zip-9.13          File archiver with high compression ratio
    perl-5.10.1_2      Practical Extraction and Report Language
    perl-5.10.1_3      Practical Extraction and Report Language
    unbound-1.4.8      A validating, recursive, and caching DNS resolver
    zip-3.0            Create/update ZIP files compatible with pkzip

  • The squid 2.7 here... i had installed squid3!
    

    Yes — it’s a SG depences. Need fix.
    You can try install SG before and squid 3 then.

  • @dvserg:

    The squid 2.7 here... i had installed squid3!
    

    Yes — it’s a SG depences. Need fix.
    You can try install SG before and squid 3 then.

    There is a missing units in the line that creates the .conf file for Squid3. in the squid.inc file

    The line

            $conf .= 'reply_body_max_size ' . ($down_limit * 1024) . " deny alln";
    
    

    Should read

            $conf .= 'reply_body_max_size ' . ($down_limit * 1024) . " alln";
    
    

    removing the «deny».  In Squid version 3 the use of allow or deny are no longer valid for this directive.

    the squid.inc file can be found in the /usr/local/pkg directory

    Strangely though I was also having problems when the limit was set to 0, which according to the Squid documentation should be valid, however I would always receive a «request to large» error.  I added a qualifier ( != 0) so that the line is only added if required.

    if ($down_limit != 0) $conf .= 'reply_body_max_size ' . ($down_limit * 1024) . " all n";
    
  • kewl!

    That change should go into the package. Thats that nasty error which made me scratch my head in a way my balls never like…
    I took out the whole line in my config to get rid of the error at last. What i can tell is that i didn’t see any failures in the function of squid3 without that line.

    Thanks a lot for your finding!!!!

  • Here ya go:
    https://github.com/bsdperimeter/pfsense-packages/commit/54c49bf2b5358b35602cae3cf6a9fead0ba886e5

  • @jimp:

    Here ya go:
    https://github.com/bsdperimeter/pfsense-packages/commit/54c49bf2b5358b35602cae3cf6a9fead0ba886e5

    thank you very much, just installed a new router, install the Squid3 package and viola, the Change was made.  :)

    Woot, I don’t have to make the change manually any more.

    If I find any other bugs, I will post them here.

  • Newb question here..
    I’ve been searching and can’t seem to find an answer on version 3 vs 2.  I can see posts from over a year ago on squid-cache about the comparison. v3 was in development, and 2 was stable.
      Since then, I see v3 has stable versions (3.1).
    So does this not mean instead of having both 2.x and 3.0.8 in pfsense, the path forward should actually be to remove the 2.x package and move into a stable 3.x release?
      Not pushing and developers (although I’d contribute to a bounty), just trying to make sense of all the versions.
      Am I understanding this right?

  • You are somewhat confusing the stability of squid with the stability of the pfSense package.

    We still have a squid 2.7.x package for pfSense because it works, and it works well, and there isn’t a large compelling reason to rush into 3.

    The squid 3 pfSense package is largely untested and most likely still needs work. Until the squid 3 package for pfSense is proven to be stable, and work well with squidGuard/HAVP/whatever, then it will likely still remain in limbo.

    There are FreeBSD ports still for Squid 2.x, 3.0.x, and 3.1.x, and 2.x is still the default as far as I can see there.

  • Thanks for the clarification.  I’m running 2.X right now and it’s running with no issues.  I’ve always been confused as to the point of the 3.x packages.

  • New issue

    Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

    By clicking “Sign up for GitHub”, you agree to our terms of service and
    privacy statement. We’ll occasionally send you account related emails.

    Already on GitHub?
    Sign in
    to your account


    Closed

    muuvmuuv opened this issue

    Feb 3, 2020

    · 36 comments

    Comments

    @muuvmuuv

    @TrySound

    @muuvmuuv

    @kornysietsma

    Note that this also impacts Gatsby projects in «develop» mode on firefox 74 (current) — negative lookbehinds work for building a site, but when developing it also rebuilds pages in the browser.

    eysi09

    added a commit
    to garden-io/garden
    that referenced
    this issue

    Apr 3, 2020

    @eysi09

    This was referenced

    Apr 3, 2020

    eysi09

    added a commit
    to garden-io/garden
    that referenced
    this issue

    Apr 3, 2020

    @eysi09

    eysi09

    added a commit
    to garden-io/garden
    that referenced
    this issue

    Apr 3, 2020

    @eysi09

    eysi09

    added a commit
    to garden-io/garden
    that referenced
    this issue

    Apr 3, 2020

    @eysi09

    @exentrich

    It’s critical issue! Page that uses normalize-url version 5 can’t be opened in iOS nor macOS!

    @TrySound

    @muuvmuuv

    It is getting some support from browsers now. Maybe some more month and v5 will be working in all major browsers as well. I’m using it in a Ionic app. Need to try if v5 works for it.

    @muuvmuuv

    @Aarbel

    I confirm that installing v4 package solves the problem on WkWebview (iOS)

    npm i normalize-url@4

    @whalemare

    Not worked version 6 and version 4 on iOS react-native.

    Crashed with error: TypeError: Attempted to assign to readonly property.

    import normalizeUrl from 'normalize-url'
    const normalized = normalizeUrl('fb.com')
    

    @fcisio

    Hey, I’m coming from Gatsby, thanks a lot for this issue.
    As mentioned above, it’s a critical issue.

    And this has been open for a while. Any Idea why there hasn’t been any progress on something that seems like a simple syntax error?

    Thanks

    @gregdingle

    I also got burned by this issue. I don’t see how it’s good to release new versions that are known to be broken in Safari. There must be another regex that doesn’t use negative lookbehinds. @gcox ?

    @gcox

    @gregdingle Not sure if you meant to reference me, but I don’t see how to avoid the negative lookbehinds. I’m certainly no regex expert so I can’t say it’s impossible. I don’t use this in a browser either, so I’m not motivated to try to work around an annoying browser limitation.

    @edenhermelin

    any updates on that? or it is not planned to implement a workaround for the regex?

    @muuvmuuv

    Still no native support for Safari… @edenhermelin I mentioned a workaround in an earlier comment but it seems it wont be implemented.

    loynoir

    added a commit
    to loynoir/normalize-url
    that referenced
    this issue

    Aug 7, 2021

    @loynoir

    loynoir

    added a commit
    to loynoir/normalize-url
    that referenced
    this issue

    Aug 7, 2021

    @loynoir

    @loynoir

    Hi, @muuvmuuv
    Can you please help me test #146

    I don’t have available environment.

    @muuvmuuv

    @loynoir I have not touched my portfolio a long time, I will try to. No promise.

    @loynoir

    @muuvmuuv
    Sorry to bother you. The real browser test in blocking by another issue.

    I tried to port test.js to use mocha+chai, to let you easy test with index.html.

    But unfortunatly seems at least two bugs, make browser-normalize-url stuck in v4 and cant up to v7.

    1. this one, (should be fixed?)
    2. and Error result when url using custom protocol in browser #147

    @loynoir

    Did any one test v4 in real browser? So I don’t have to test again myself.

    loynoir

    added a commit
    to loynoir/normalize-url
    that referenced
    this issue

    Aug 9, 2021

    @loynoir

    @loynoir

    I think, this error raise from normalize-url@v7.0.0 should be fixed in pull/146.

    If anyone see this, with browser not support js-regexp-lookbehind,
    you can use your real browser to test browser-test/index.html within
    https://github.com/loynoir/normalize-url

    You can also build that bundle using npm run build

    @loynoir

    @tuarrep

    Just tested on my iPhone under iOS 15 beta. Two tests are failing see below.

    If I remember well I’ve encountered this issue on my MacBook with Safari, I’ll test on it too later this day

    AEC883C9-D2C3-43A9-9306-5CABBF46A574

    @JKrol

    @loynoir here is the result from iPad, Safari:

    image

    @muuvmuuv

    Got the same as above from Windows 10 Microsoft Edge latest release

    @loynoir

    • Invalid URL

    This is because of the test regexp is hard-coded, I push a commit allow less strict checking.

    But seems rawgit cache haven’t refresh.

    https://ghcdn.rawgit.org/loynoir/normalize-url/f9f36c8f22b9649f0eac7219c31a9da2beef7896/browser-test/index.html

    • duplicate slashes
      I pick logic from v4.5.0 as fallback, it’s unexpected.
      Did any one know which minor version of v4 works best?

    • special-protocol-schemes
      Kind of weird that 3/3 of you failed on same 2 errors, but I failed in a totally different 4 caused by custom protocol ‘sindre://www.sorhus.com’ 😂
      Under «Mozilla Firefox 90» & «Google Chrome 92»

    @JKrol

    @loynoir

    Folded as outdated

    duplicate slashes

    • duplicate slashes
      I pick logic from v4.5.0 as fallback, it’s unexpected.
      Did any one know which minor version of v4 works best?

    I can reproduce that after I run into that fallback v4 logic.
    If anyone interest,

    • v4.js pass v4 test.js
    • v7 test.js add many tests
    • v4 fallback logic still pass the old v4 test.js
    • v4 fallback logic not pass v7 test.js ADDED test
    • default logic pass both v4 test.js and v7 test.js

    I just so trust the v4 code, I didn’t comment out the default logic to reproduce. Sorry for waste your time.
    @tuarrep @JKrol @muuvmuuv

    For sake of testing, I think preferJsRegexpLookbehind: false or something, has to be added.

    But, as v4 fallback logic not pass v7 test.js ADDED test, I write new logic using reverse + look ahead + reverse as new fallback.

    • 2 logic: look-behind and look-ahead
    • 2 period test: v4 & v7
    • 2 browser: latest chrome and latest firefox
      8 situations remove duplicate slashes pass test on my side.

    https://ghcdn.rawgit.org/loynoir/normalize-url/8bace639547eae21df941c57a9cec1ed0ce994a6/browser-test/index.html

    @loynoir

    @JKrol
    Sorry, I can’t reproduce on firefox90 and chrome92.
    Maybe you can try to find what happen.
    And, that test is expected to throw an error, but seems somehow it’s not try-catched.
    Is it fail in invalid url loose test or invalid url strict test?
    If it failed in invalid url strict, that is somehow expected, because it use a regexp to detect whether the error is url error constructing.

    @loynoir

    @gcox

    @loynoir FYI, 1 test fails in Safari 14.1.2 (16611.3.10.1.3) on macOS 11.5

    Screen Shot 2021-08-10 at 11 51 06 AM

    @sindresorhus

    @loynoir

    Hi, @gcox
    Can you run this in safari,

    // sindresorhus/normalize-url v7.0.1
    normalizeUrl('http://');

    Does its error.message match /^Invalid URL/?

    As, TypeError seems too wide to match.

    @loynoir

    @gcox

    Can you run this in safari,

    // sindresorhus/normalize-url v7.0.1
    normalizeUrl('http://');

    Does its error.message match /^Invalid URL/?

    Tried it at a break point when loading the new test page and yes, that’s the error it produces.

    Screen Shot 2021-08-11 at 3 20 57 PM

    @loynoir

    @gcox

    @loynoir

    • Печать

    Страницы: [1]   Вниз

    Тема: Настройка regex в squid  (Прочитано 16212 раз)

    0 Пользователей и 1 Гость просматривают эту тему.

    Оффлайн
    DenS

    Добрый день!

    Хочу в squid добавить «черный список» сайтов, к которым закрыт доступ. Добавляю в squid.conf строчки

    acl bad url_regex «/etc/squid/bad»
    http_access deny bad

    На файл bad установил права rw- r— r—, все под root

    При рестарте, перестает работать squid. Достаточно добавить первую строчку, чтобы покси-сервер перестал работать. Куда копать, не могу найти ошибку в конфе?

    « Последнее редактирование: 25 Октября 2010, 08:53:49 от DenS »


    Оффлайн
    fisher74

    Посмотреть бы ошибку в логе squid и содержимое /etc/squid/bad глянуть не помешало бы


    Оффлайн
    Unreg


    Оффлайн
    fisher74

    urlpath_regex — это если ищешь в url-е регулярное выражение, а url_regex — сравнивается весь url.
    Но ни в том ни в другом случае squid не должен падать


    Оффлайн
    Unreg

    $ /usr/sbin/squid -v|grep Version

    Squid Cache: Version 2.7.STABLE3

    $ sudo grep  url_regex  squid.conf

    #       acl aclname url_regex [-i] ^http:// …     # regex matching on whole URL
    # acl buggy_server url_regex ^http://….

    это я про «-i»


    Оффлайн
    fisher74

    опция -i говорит, что на регистр букв не обращать внимания


    Оффлайн
    Unreg

    действительно, не досмотрел


    Оффлайн
    DenS

    Посмотреть бы ошибку в логе squid и содержимое /etc/squid/bad глянуть не помешало бы

    Вот, содержимое обоих файлов

    Файл /etc/squid/bad

    squid.conf


    Оффлайн
    fisher74

    Ещё хотим видеть

    tail /var/log/squid/access.log
    Кстати, если Вы хотите фильтровать урлы в том виде, что внесли в файл /etc/squid/bad, то нужно воспользоваться советом Unreg и использовать опцию urlpath_regex


    Оффлайн
    DenS

    Ещё хотим видеть
    tail /var/log/squid/access.log

    Добавлял в файл конфигурации строку

    acl bad urlpath_regex -i  «/etc/squid/bad»

    результат такой-же, не работает squid

    Вот /var/log/squid/access.log


    Оффлайн
    Unreg

    acl special_client src 192.168.1.0/255.255.255.0
    acl special_url url_regex ^http://www.vk.com  ^http://vk.com  ^http://www.vkontakte.ru  ^http://vkontakte.ru
    http_access deny special_client special_url


    Оффлайн
    fisher74

    Ай… пепел на мою седую голову, вечно забываю, что н свои ошибки в другой лог пишет

    tail /var/log/squid/cache.logЕстественно, это нужно после падения squid-а


    Оффлайн
    DenS

    tail /var/log/squid/cache.log

    При перезагрузке сервера появляется


    Оффлайн
    Unreg

    auth_param basic program /usr/lib/squid/ncsa_auth /usr/etc/passwd
    acl localnet proxy_auth REQUIRED

    попробуйте заменить на

    auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd
    auth_param basic children 5
    auth_param basic realm Squid proxy-caching web server
    auth_param basic credentialsttl 2 hours
    auth_param basic casesensitive off

    acl ncsa_users proxy_auth REQUIRED
    http_access allow ncsa_users


    • Печать

    Страницы: [1]   Вверх

    Понравилась статья? Поделить с друзьями:
  • Squid custom error page
  • Squashfs error при установке ubuntu
  • Squashfs error xattrs in filesystem these will be ignored
  • Squashfs error unable to read xattr id index table
  • Squashfs error unable to read page после установки