Re: [squid-users] Is it possible to modify cached object?

2017-02-07 Thread boruc
I managed to patch this adapter (I don't know many things in Linux, but I
don't give up), properly configured Squid (with regex and quotes) and
successfully replaced closing *body* tag with image tag and of course
closing body tag.



--
View this message in context: 
http://squid-web-proxy-cache.1019090.n4.nabble.com/Is-it-possible-to-modify-cached-object-tp4681073p4681490.html
Sent from the Squid - Users mailing list archive at Nabble.com.
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-02-06 Thread Alex Rousskov
On 02/06/2017 03:27 PM, boruc wrote:

> So I've installed squid 3.5.12, libecap 1.0.1 and sample adapter 1.0.0. I
> was able to test a simple "the -> a" replacement shown in  documentation
>   . Next I tried some HTML injection,
> also from documentation. However, it didn't work and I got error like below:

> 2017/02/06 17:56:30 kid1| FATAL: dying from an unhandled exception:
> Modifying Adapter: configuration error: unsupported configuration parameter:
> replacement-src

As you have figured out already, the following bug report adds
replacement-src support to sample adapter v1.0:
https://bugs.launchpad.net/ecap/+bug/1634621


> What is more, when I try regular text replacement and I use space in
> replacement text I get no error message in cache.log, but browser says that
> "proxy server is refusing connections" and executing command "squid -k
> check" gives me this:

Squid is picky about spaces because they often separate various
configuration tokens. You can try to quote your replacement string,
possibly after turning configuration_includes_quoted_values on.

On the other hand, virtually all production adapters that inject content
into HTML pages need a far more sophisticated injection algorithm then
the primitive sample adapter you are using, so it probably does not make
sense to spend time on making spaces work in this configuration context.


> 2017/02/06 19:11:11| /etc/squid/squid.conf:84: Duplicate option "uri" in
> adaptation service definition
> FATAL: /etc/squid/squid.conf:84: malformed adaptation service configuration
> Squid Cache (Version 3.5.12): Terminated abnormally.
> 
> I managed to find a  bugfix   
> to *replacement-src* problem, but how should I
> appy this? Just add lines with "+" at the beginning and recompile sources
> one more time?

You should use a "patch" program to apply the patch to the adapter
sample sources and then rebuild the adapter from scratch.


> Will it work with spaces in replacement text? 

Yes, spaces are supported in the replacement text loaded from a file.


> My main goal is to add a
> paragraph to requested page, with link or image, but tags for those require
> spaces in string.

If you have not already, please read the following FAQ page for various
problems you will need to solve. The sample adapter does _not_ solve
most of them: https://answers.launchpad.net/ecap/+faq/1793


> Or maybe I have to write my own adapter to this?

YMMV, but I speculate that most folks that do not know how to patch
source files would have to learn a lot of complex topics before they
would be able to write a quality injection adapter from scratch. That
speculation, together with the complications mentioned at the above FAQ
page, prompt me to discourage you from attempting to write your own
adapter in C++.

I have not tried it myself yet, but you might be interested in the
following Tcl wrapper for eCAP API:
https://github.com/petasis/ecap-tcl

The other standard options include, if your project allows for that,
finding a capable C++ developer to write an adapter for you and buying a
ready-to-use adapter.


HTH,

Alex.

___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-02-06 Thread boruc
Hi again,

So I've installed squid 3.5.12, libecap 1.0.1 and sample adapter 1.0.0. I
was able to test a simple "the -> a" replacement shown in  documentation
  . Next I tried some HTML injection,
also from documentation. However, it didn't work and I got error like below:

2017/02/06 17:56:30 kid1| Loading Squid module from
'/usr/local/lib/ecap_adapter_modifying.so'
2017/02/06 17:56:30 kid1| Squid plugin modules loaded: 1
2017/02/06 17:56:30 kid1| Adaptation support is on
2017/02/06 17:56:30 kid1| ERROR: failed to start essential eCAP service:
ecap://e-cap.org/ecap/services/sample/modifying:
Modifying Adapter: configuration error: unsupported configuration parameter:
replacement-src
2017/02/06 17:56:30 kid1| FATAL: dying from an unhandled exception:
Modifying Adapter: configuration error: unsupported configuration parameter:
replacement-src

What is more, when I try regular text replacement and I use space in
replacement text I get no error message in cache.log, but browser says that
"proxy server is refusing connections" and executing command "squid -k
check" gives me this:

2017/02/06 19:11:11| /etc/squid/squid.conf:84: Duplicate option "uri" in
adaptation service definition
FATAL: /etc/squid/squid.conf:84: malformed adaptation service configuration
Squid Cache (Version 3.5.12): Terminated abnormally.

I managed to find a  bugfix   
to *replacement-src* problem in  this thread
  , but how should I
appy this? Just add lines with "+" at the beginning and recompile sources
one more time?

Will it work with spaces in replacement text? My main goal is to add a
paragraph to requested page, with link or image, but tags for those require
spaces in string. Or maybe I have to write my own adapter to this?

Thank you for your time.



--
View this message in context: 
http://squid-web-proxy-cache.1019090.n4.nabble.com/Is-it-possible-to-modify-cached-object-tp4681073p4681483.html
Sent from the Squid - Users mailing list archive at Nabble.com.
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-31 Thread Amos Jeffries
On 1/02/2017 7:34 a.m., boruc wrote:
> Thank you for your answers Antony.
> 
> On packages.ubuntu.com I searched for "squid3" and here's what I've found:
> 12.04LTS - 3.1.19
> 14.04LTS - 3.3.8
> 16.04LTS - 3.5.12
> 
> For now the best option would be to upgrade Ubuntu to 16.04, but I cannot do
> it now. Also Amos has written earlier: "All the newer versions should come
> pre-packaged with eCAP support with no action needed on your part." I'd like
> to know if in squid 3.5.12 eCAP is already enabled, but I cannot find it by
> myself.
> 
> I tried it on Ubuntu 14.04, by "sudo apt-get install squid3", squid 3.3.8
> was installed (and also package libecap2 (0.2.0-1ubuntu4)), the output for
> "squid3 -v" was:
> 
...
>
> So actually this squid release is already configured with "--enable-ecap"
> and all I need to do is to set "ecap_enable" in configuration file to "on"
> (and other stuff mentioned in  documentation
>   ) and it'll work fine?

Correct, thats what I meant by what I wrote earlier.

Note that its the 0.2 version of eCAP though, so some things from the
1.0 version will not be exactly as documented. It should work reasonably
well for most needs.

Amos

___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-31 Thread Yuri Voinov
Exactly, localhost system administrators can do what they want ;-)


01.02.2017 1:05, boruc пишет:
> Well, basically I'm working on virtual machine with nothing special installed
> on it so I don't have to worry about all of this. I wanted to give squid a
> try, look how it works, learn something new. Being here, reading all your
> answers and suggestions is a great experience for me :)
>
>
>
> --
> View this message in context: 
> http://squid-web-proxy-cache.1019090.n4.nabble.com/Is-it-possible-to-modify-cached-object-tp4681073p4681398.html
> Sent from the Squid - Users mailing list archive at Nabble.com.
> ___
> squid-users mailing list
> squid-users@lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-users

-- 
Bugs to the Future


0x613DEC46.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-31 Thread boruc
Well, basically I'm working on virtual machine with nothing special installed
on it so I don't have to worry about all of this. I wanted to give squid a
try, look how it works, learn something new. Being here, reading all your
answers and suggestions is a great experience for me :)



--
View this message in context: 
http://squid-web-proxy-cache.1019090.n4.nabble.com/Is-it-possible-to-modify-cached-object-tp4681073p4681398.html
Sent from the Squid - Users mailing list archive at Nabble.com.
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-31 Thread Yuri Voinov


01.02.2017 0:34, boruc пишет:
> Thank you for your answers Antony.
>
> On packages.ubuntu.com I searched for "squid3" and here's what I've found:
> 12.04LTS - 3.1.19
> 14.04LTS - 3.3.8
> 16.04LTS - 3.5.12
>
> For now the best option would be to upgrade Ubuntu to 16.04, but I cannot do
> it now. Also Amos has written earlier: "All the newer versions should come
> pre-packaged with eCAP support with no action needed on your part." I'd like
> to know if in squid 3.5.12 eCAP is already enabled, but I cannot find it by
> myself.
What an idea, dude! To upgrade one package - upgrade OS at whole! Wow!
You have unlimited free time and not responsible to the all datacenter,
right? :)
> I tried it on Ubuntu 14.04, by "sudo apt-get install squid3", squid 3.3.8
> was installed (and also package libecap2 (0.2.0-1ubuntu4)), the output for
> "squid3 -v" was:
>
> configure options:  '--build=x86_64-linux-gnu' '--prefix=/usr'
> '--includedir=${prefix}/include' '--mandir=${prefix}/share/man'
> '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var'
> '--libexecdir=${prefix}/lib/squid3' '--srcdir=.' '--disable-maintainer-mode'
> '--disable-dependency-tracking' '--disable-silent-rules'
> '--datadir=/usr/share/squid3' '--sysconfdir=/etc/squid3'
> '--mandir=/usr/share/man' '--enable-inline' '--enable-async-io=8'
> '--enable-storeio=ufs,aufs,diskd,rock' '--enable-removal-policies=lru,heap'
> '--enable-delay-pools' '--enable-cache-digests' '--enable-underscores'
> '--enable-icap-client' '--enable-follow-x-forwarded-for'
> '--enable-auth-basic=DB,fake,getpwnam,LDAP,MSNT,MSNT-multi-domain,NCSA,NIS,PAM,POP3,RADIUS,SASL,SMB'
> '--enable-auth-digest=file,LDAP' '--enable-auth-negotiate=kerberos,wrapper'
> '--enable-auth-ntlm=fake,smb_lm'
> '--enable-external-acl-helpers=file_userip,kerberos_ldap_group,LDAP_group,session,SQL_session,unix_group,wbinfo_group'
> '--enable-url-rewrite-helpers=fake' '--enable-eui' '--enable-esi'
> '--enable-icmp' '--enable-zph-qos' *'--enable-ecap'* '--disable-translation'
> '--with-swapdir=/var/spool/squid3' '--with-logdir=/var/log/squid3'
> '--with-pidfile=/var/run/squid3.pid' '--with-filedescriptors=65536'
> '--with-large-files' '--with-default-user=proxy' '--enable-linux-netfilter'
> 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fPIE -fstack-protector
> --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall'
> 'LDFLAGS=-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now'
> 'CPPFLAGS=-D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fPIE -fstack-protector
> --param=ssp-buffer-size=4 -Wformat -Werror=format-security'
>
> So actually this squid release is already configured with "--enable-ecap"
> and all I need to do is to set "ecap_enable" in configuration file to "on"
> (and other stuff mentioned in  documentation
>   ) and it'll work fine?
>
>
>
> --
> View this message in context: 
> http://squid-web-proxy-cache.1019090.n4.nabble.com/Is-it-possible-to-modify-cached-object-tp4681073p4681396.html
> Sent from the Squid - Users mailing list archive at Nabble.com.
> ___
> squid-users mailing list
> squid-users@lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-users

-- 
Bugs to the Future


0x613DEC46.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-31 Thread boruc
Thank you for your answers Antony.

On packages.ubuntu.com I searched for "squid3" and here's what I've found:
12.04LTS - 3.1.19
14.04LTS - 3.3.8
16.04LTS - 3.5.12

For now the best option would be to upgrade Ubuntu to 16.04, but I cannot do
it now. Also Amos has written earlier: "All the newer versions should come
pre-packaged with eCAP support with no action needed on your part." I'd like
to know if in squid 3.5.12 eCAP is already enabled, but I cannot find it by
myself.

I tried it on Ubuntu 14.04, by "sudo apt-get install squid3", squid 3.3.8
was installed (and also package libecap2 (0.2.0-1ubuntu4)), the output for
"squid3 -v" was:

configure options:  '--build=x86_64-linux-gnu' '--prefix=/usr'
'--includedir=${prefix}/include' '--mandir=${prefix}/share/man'
'--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var'
'--libexecdir=${prefix}/lib/squid3' '--srcdir=.' '--disable-maintainer-mode'
'--disable-dependency-tracking' '--disable-silent-rules'
'--datadir=/usr/share/squid3' '--sysconfdir=/etc/squid3'
'--mandir=/usr/share/man' '--enable-inline' '--enable-async-io=8'
'--enable-storeio=ufs,aufs,diskd,rock' '--enable-removal-policies=lru,heap'
'--enable-delay-pools' '--enable-cache-digests' '--enable-underscores'
'--enable-icap-client' '--enable-follow-x-forwarded-for'
'--enable-auth-basic=DB,fake,getpwnam,LDAP,MSNT,MSNT-multi-domain,NCSA,NIS,PAM,POP3,RADIUS,SASL,SMB'
'--enable-auth-digest=file,LDAP' '--enable-auth-negotiate=kerberos,wrapper'
'--enable-auth-ntlm=fake,smb_lm'
'--enable-external-acl-helpers=file_userip,kerberos_ldap_group,LDAP_group,session,SQL_session,unix_group,wbinfo_group'
'--enable-url-rewrite-helpers=fake' '--enable-eui' '--enable-esi'
'--enable-icmp' '--enable-zph-qos' *'--enable-ecap'* '--disable-translation'
'--with-swapdir=/var/spool/squid3' '--with-logdir=/var/log/squid3'
'--with-pidfile=/var/run/squid3.pid' '--with-filedescriptors=65536'
'--with-large-files' '--with-default-user=proxy' '--enable-linux-netfilter'
'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fPIE -fstack-protector
--param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall'
'LDFLAGS=-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now'
'CPPFLAGS=-D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fPIE -fstack-protector
--param=ssp-buffer-size=4 -Wformat -Werror=format-security'

So actually this squid release is already configured with "--enable-ecap"
and all I need to do is to set "ecap_enable" in configuration file to "on"
(and other stuff mentioned in  documentation
  ) and it'll work fine?



--
View this message in context: 
http://squid-web-proxy-cache.1019090.n4.nabble.com/Is-it-possible-to-modify-cached-object-tp4681073p4681396.html
Sent from the Squid - Users mailing list archive at Nabble.com.
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-31 Thread Antony Stone
On Tuesday 31 January 2017 at 18:19:14, boruc wrote:

> Antony Stone wrote
> 
> > What do you get from the following:
> > /etc/init.d/squid status
> > /etc/init.d/squid restart
> 
> literally nothing. I just noticed that there isn't anything with "squid" in
> name in /etc/init.d.

Ah, right - that means the original tarball build doesn't put any init scripts 
into place, then - I haven't built Squid like that myself for some time, so I 
had forgotten this.

I suggest you wait until one of the developers responds to this thread and 
reminds us how to get the appropriate init scripts into place for an Ubuntu 12 
system - I can't help with that, sorry :(

However, you're definitely very close to your desired objective.


Antony.

-- 
.evah I serutangis sseltniop tsom eht fo eno eb tsum sihT

   Please reply to the list;
 please *don't* CC me.
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-31 Thread boruc
Antony Stone wrote
> What do you get from the following:
> 
>   /etc/init.d/squid status
>   /etc/init.d/squid restart

literally nothing. I just noticed that there isn't anything with "squid" in
name in /etc/init.d. 

Here are some locations and files with "squid" in name:
/usr/share/vim/vim73/syntax/squid.vim
/usr/share/man/man1/squidclient.1
/usr/share/man/man8/squid.8
/usr/share/squid3
/usr/sbin/squid
/usr/bin/squidclient
/etc/squid3/
/lib/squid3
/var/log/squid3
/var/spool/squid3
/var/cache/squid

Running "squid -k restart" gives me this: "squid: ERROR: No running copy"
Running "sudo service squid restart" gives me: "squid: unrecognized service"



--
View this message in context: 
http://squid-web-proxy-cache.1019090.n4.nabble.com/Is-it-possible-to-modify-cached-object-tp4681073p4681394.html
Sent from the Squid - Users mailing list archive at Nabble.com.
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-31 Thread Antony Stone
On Tuesday 31 January 2017 at 17:28:15, boruc wrote:

> 1. Ubuntu 12.04.5 LTS
> 2. Squid downloaded from
> http://www.squid-cache.org/Versions/v3/3.5/squid-3.5.24.tar.gz

Okay, so that's an official source tarball, good.

> 3. About "sudo auto-apt run ./configure && sudo make && sudo checkinstall",
> I just wanted to give it a shot, original command was "sudo ./configure &&
> make && sudo make install"

That latter command would have been *far* more sensible (provided you remember 
the extra sudo in the middle) - it would configure, build and install the 
version you just downloaded from the Squid website.

> 4. Command to list packages: dpkg --get-selections | grep -v deinstall

Okay, that'll tell you what Ubuntu thinks has been installed via the package 
manager.

> 5. Like Amon has written: "Please upgrade. 3.1 is over 5 years outdated and
> the OS it was written for wont even have LTS support for very much longer.
> All the newer versions should come pre-packaged with eCAP support with no
> action needed on your part."

Yes, I completely agree you should upgrade from Squid 3.1

You might also consider upgrading from Ubuntu 12.04... :)

> So I wanted the newest stable release and that is 3.5.24

> 6. I've deleted every squid-related package with dpkg (what about this one,
> should I delete it too?: /usr/share/vim/vim73/syntax/squid.vim)

No, that's just an editor syntax rules file, for "intelligent" highlighting 
when you edit the Squid config file.

Leave it or delete it; it's nothing to do with installing or running Squid.

> 7. Inside unpacked squid folder I used ./configure that is at the end of
> this post && sudo make && sudo make install

Now *that* sounds good.

> 8. Command from 4. doesn't show that squid is installed

No, it won't, because you didn't install it through the package manager.

> however, "squid -v" shows
> Squid Cache: Version 3.5.24
> Service Name: squid

Excellent.

> 9. When I go to /etc/init.d and type "squid" I get no error (I got earlier
> because there was no cache.log file in /var/log/squid3)

Do you really mean "squid" or do you mean "./squid"?

If it's the first, I don't understand the relevance of being in /etc/init.d

> 10. I can run squid -z to create directories

Good.

> 11. there is no squid service on the list using "service --status-all"

What do you get from the following:

/etc/init.d/squid status
/etc/init.d/squid restart


Basically I think you are doing very well now.


Antony.

-- 
The next sentence is true.
The previous sentence is untrue.

   Please reply to the list;
 please *don't* CC me.
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-31 Thread boruc
1. Ubuntu 12.04.5 LTS
2. Squid downloaded from
http://www.squid-cache.org/Versions/v3/3.5/squid-3.5.24.tar.gz
3. About "sudo auto-apt run ./configure && sudo make && sudo checkinstall",
I just wanted to give it a shot, original command was "sudo ./configure &&
make && sudo make install"
4. Command to list packages: dpkg --get-selections | grep -v deinstall
5. Like Amon has written: "Please upgrade. 3.1 is over 5 years outdated and
the OS it was written 
for wont even have LTS support for very much longer. All the newer versions
should come pre-packaged with eCAP support with no action needed on your
part."
So I wanted the newest stable release and that is 3.5.24
6. I've deleted every squid-related package with dpkg (what about this one,
should I delete it too?: /usr/share/vim/vim73/syntax/squid.vim)
7. Inside unpacked squid folder I used ./configure that is at the end of
this post && sudo make && sudo make install 
8. Command from 4. doesn't show that squid is installed, however, "squid -v"
shows
Squid Cache: Version 3.5.24
Service Name: squid
9. When I go to /etc/init.d and type "squid" I get no error (I got earlier
because there was no cache.log file in /var/log/squid3)
10. I can run squid -z to create directories
11. there is no squid service on the list using "service --status-all"


./configure --build=x86_64-linux-gnu --prefix=/usr
--includedir=${prefix}/include --mandir=${prefix}/share/man
--infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var
--libexecdir=${prefix}/lib/squid3 --srcdir=. --disable-maintainer-mode
--disable-dependency-tracking --disable-silent-rules
--datadir=/usr/share/squid3 --sysconfdir=/etc/squid3 --mandir=/usr/share/man
--with-cppunit-basedir=/usr --enable-inline --enable-async-io=8
--enable-ecap --enable-storeio=ufs,aufs,diskd
--enable-removal-policies=lru,heap --enable-delay-pools
--enable-cache-digests --enable-underscores --enable-icap-client
--enable-follow-x-forwarded-for
--enable-basic-auth-helpers=LDAP,MSNT,NCSA,PAM,SASL,SMB,YP,DB,POP3,getpwnam,squid_radius_auth,multi-domain-NTLM
--enable-ntlm-auth-helpers=smb_lm,
--enable-digest-auth-helpers=ldap,password
--enable-negotiate-auth-helpers=squid_kerb_auth  --enable-arp-acl
--enable-esi --enable-zph-qos --enable-wccpv2 --disable-translation
--with-logdir=/var/log/squid3 --with-pidfile=/var/run/squid3.pid
--with-filedescriptors=65536 --with-large-files --with-default-user=proxy
--enable-linux-netfilter



--
View this message in context: 
http://squid-web-proxy-cache.1019090.n4.nabble.com/Is-it-possible-to-modify-cached-object-tp4681073p4681392.html
Sent from the Squid - Users mailing list archive at Nabble.com.
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-31 Thread Antony Stone
On Tuesday 31 January 2017 at 10:35:30, boruc wrote:

> I ran command "sudo apt-get remove --purge squid3"

Okay, that will remove the distribution (Debian or Debian-based) package.

> then I downloaded squid-3.5.24 in browser

What exactly did you download from where?

> unpacked it

So, presumably this was some source code tarball?

> then "sudo auto-apt run ./configure && sudo make && sudo checkinstall".

That looks like a rather bizarre combination of a Distribution command (auto-
apt run) and a distribution-independent configure & build (but not an 
installation of the resulting binary), followed by a checkinstall (which is 
designed to create an installable object, but dow not install it).

My biggest question here is "where did you find the instructions telling you to 
run that combination of commands?"

> deb package is created, message says that it was also installed.

Show us the message.

> So i ran command

What command?

> to see installed packages and that's what I get:
> 
> squid-common
> squid-langpack
> squid3
> squid3-common
> 
> When I run any command with "squid3" it says that squid3 is not installed,
> but "squid -v" gives me "Squid Cache: Version 3.1.19". Also there is no
> "squid" or "squid3" service.
> 
> What am I doing wrong?

You are getting horribly confused between installing a distribution-packaged 
version, and compiling your own binary from source.

> What should I do to get this 3.5.24 version to work and also have squid
> service?

1. Tell us which Linux distribution and version you are running.

2. Use you distribution's package manager to remove the packages you currently 
have installed:

squid-common
squid-langpack
squid3
squid3-common

3. Make sure they really have been removed, by running:

find / -name "squid*"

Remove anything that command finds on your system.

4. If you really want version 3.5.24, check whether that is available for your 
distribution and if it is, install it through your package manager.

If that version is not available, and you're not happy to install whatever the 
latest version for your distribution is, follow the instructions at 
http://wiki.squid-cache.org/SquidFaq/CompilingSquid

5. Return here with copy/pasted commands and output if you need further help.


Regards,


Antony.

-- 
There's no such thing as bad weather - only the wrong clothes.

 - Billy Connolly

   Please reply to the list;
 please *don't* CC me.
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-31 Thread boruc
I ran command "sudo apt-get remove --purge squid3", then I downloaded
squid-3.5.24 in browser, unpacked it, then "sudo auto-apt run ./configure &&
sudo make && sudo checkinstall". deb package is created, message says that
it was also installed. So i ran command to see installed packages and that's
what I get:

squid-common
squid-langpack
squid3
squid3-common

When I run any command with "squid3" it says that squid3 is not installed,
but "squid -v" gives me "Squid Cache: Version 3.1.19". Also there is no
"squid" or "squid3" service.

What am I doing wrong? What should I do to get this 3.5.24 version to work
and also have squid service?

Thanks in advance.



--
View this message in context: 
http://squid-web-proxy-cache.1019090.n4.nabble.com/Is-it-possible-to-modify-cached-object-tp4681073p4681390.html
Sent from the Squid - Users mailing list archive at Nabble.com.
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-29 Thread Amos Jeffries
On 30/01/2017 7:52 a.m., boruc wrote:
> What would be the safest way to rebuild squid and enable eCAP?
> 
> I wanted to install libecap and some examples from  e-cap.org/Documentation
>    for my squid. My version is 3.1.19,  wiki

Please upgrade. 3.1 is over 5 years outdated and the OS it was written
for wont even have LTS support for very much longer.

All the newer versions should come pre-packaged with eCAP support with
no action needed on your part.

Amos

___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-29 Thread boruc
What would be the safest way to rebuild squid and enable eCAP?

I wanted to install libecap and some examples from  e-cap.org/Documentation
   for my squid. My version is 3.1.19,  wiki
   says that suitable version of
both /libecap/ and /adapter/ should be 0.0.3. First I wanted to do this on
VirtualBox so installing new stuff and rebuilding won't break my work.
1. sudo apt-get install squid3 (I did to recreate everything like it's on my
PC)
2. sudo apt-get remove --purge squid3
3. install libecap from downloaded source (./configure && make && sudo make
install)
4. install adapter (just like above)
5. run "squid3 -v" on PC to get configuration used to install with /apt-get/
6. configure squid3 with that config and add "--enable-ecap"
7. sudo make && sudo make install

After quite long installation I am unable to do commands like "squid3 -v",
"squid3 -z", I get message:

bash: /usr/sbin/squid3: No such file or directory

when I try "sudo service squid restart then I get "squid3: unrecognized
service". However, I am able to run "squid -v" (without 3 in name), but
there's no "squid" service.

Has anyone faced similar problem? What can I do to have squid service?

Thank you.



--
View this message in context: 
http://squid-web-proxy-cache.1019090.n4.nabble.com/Is-it-possible-to-modify-cached-object-tp4681073p4681379.html
Sent from the Squid - Users mailing list archive at Nabble.com.
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-22 Thread Amos Jeffries
On 23/01/2017 4:34 a.m., boruc wrote:
> So basically eCAP will allow me to modify any pages that is in response? What
> about pages that are gzipped? Would I have to decode, modify it as I want
> and encode?

Yes you would. Squid just passes the data it gets.

> If you could write a "lifecycle" of object that is going to be
> cached, what would it look like?
> 
> HTTP Request -> HTTP Response -> ContentAdaptation -> Cache ->
> Refresh/Delete/OtherStuff

Not even close.

A request goes through REQMOD-precache adaptation and other stages
before the cache lookup happens.

 request -> stuff -> REQMOD adaptation -> stuff -> cache [ -> upstream
server ]


There is a 1:1 relationship between request and response on the client
connection. But multiple transactions may be occuring with server(s) to
produce that response.
RESPMOD-precache adaptation happens for each server response, before the
adapted content is delivered to the cache or the client.

 server response -> RESPMOD adaptation -> cache [ -> client response ]


In both chains the last entry is in [] since it may not exist.


Amos

___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-22 Thread boruc
So basically eCAP will allow me to modify any pages that is in response? What
about pages that are gzipped? Would I have to decode, modify it as I want
and encode? If you could write a "lifecycle" of object that is going to be
cached, what would it look like?

HTTP Request -> HTTP Response -> ContentAdaptation -> Cache ->
Refresh/Delete/OtherStuff



--
View this message in context: 
http://squid-web-proxy-cache.1019090.n4.nabble.com/Is-it-possible-to-modify-cached-object-tp4681073p4681243.html
Sent from the Squid - Users mailing list archive at Nabble.com.
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-08 Thread Amos Jeffries
On 9/01/2017 8:41 a.m., Rafael Akchurin wrote:
> Hello Boruc,
> 
> Please use https://en.wikipedia.org/wiki/Data_URI_scheme
> 

boruc:

Also you should not be manually (or even with a Script) editing cache
objects on disk as a routine operation. As Alex already mentioned use
ICAP or eCAP adaptation for that instead - thats one reason why those
adaptation APIs exist.

As I noted in the other email you have to fully stop Squid and restart
with a VERY SLOW full-disk scan of the cache after editing disk objects
to prevent the metadata being mismatched and your edit thrown away. So
dont do it unless its a one-off situation. Even then simply deleting the
bad object and letting Squid find a new copy on next request is better
than editing.

Amos

___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-08 Thread Amos Jeffries
On 9/01/2017 3:49 a.m., boruc wrote:
> Thank you for your answer.
> 
> Actually I managed to do what I want by simply editing that file and
> changing content length if necessary. I don't know why sometimes I need to
> restart Squid or reopen browser to see changed version of page. Sometimes
> it works fine on regular browser window, sometimes I need to open it in
> private mode, but that's the thing that I want to figure out now.

That is because what is on disk is only about half of the object. There
may be a whole copy of it in memory, or just the metadata about it.

Squid needs to be stopped, the swap.state file erased, then Squid
started again to scan the disk files (all of them) to load the changed
objects information.

> 
> Would it be possible to NOT cache specific files, like images by using
> refresh_pattern? Or in other words - I'd like to cache only HTML/CSS files.

Not with refresh_pattern, that is only for tuning revalidation
operations. Use 'cache deny ...' and/or 'store_miss deny ...' for
preventing things caching.

It is better though to fix the data on the server generating it = before
it goes anywhere neara a proxy or cache. Whatever you do on your own
proxy wil not fix the same problems occuring in ay of the other caches
handling it (guaranteed to be at least 1 other and probably 2-3).

Amos

___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-08 Thread Rafael Akchurin
Hello Boruc,

Please use https://en.wikipedia.org/wiki/Data_URI_scheme

Best regards,
Rafael Akchurin
Diladele B.V.



-Original Message-
From: squid-users [mailto:squid-users-boun...@lists.squid-cache.org] On Behalf 
Of boruc
Sent: Sunday, January 8, 2017 6:18 PM
To: squid-users@lists.squid-cache.org
Subject: Re: [squid-users] Is it possible to modify cached object?

Sorry for multiple posts. I used tag in incorrect way so you can't see the 
code. Here's correct message:

I can change content of the HTML in cached object, but not in every way. I have 
a trouble inserting an image to that site from my PC. If I simply put:
img src="/home/username/Images/image.png" there's only a displayed icon which 
is refering to given location but on the page server. I also tried like this: 
img src="file:///home/username/Images/image.png",  but also with no effect. I 
cannot find any solution to my problem, you guys are my only hope :)



--
View this message in context: 
http://squid-web-proxy-cache.1019090.n4.nabble.com/Is-it-possible-to-modify-cached-object-tp4681073p4681094.html
Sent from the Squid - Users mailing list archive at Nabble.com.
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-08 Thread boruc
Sorry for multiple posts. I used tag in incorrect way so you can't see the
code. Here's correct message:

I can change content of the HTML in cached object, but not in every way. I
have a trouble inserting an image to that site from my PC. If I simply put:
img src="/home/username/Images/image.png" there's only a displayed icon
which is refering to given location but on the page server. I also tried
like this: img src="file:///home/username/Images/image.png",  but also with
no effect. I cannot find any solution to my problem, you guys are my only
hope :)



--
View this message in context: 
http://squid-web-proxy-cache.1019090.n4.nabble.com/Is-it-possible-to-modify-cached-object-tp4681073p4681094.html
Sent from the Squid - Users mailing list archive at Nabble.com.
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-08 Thread boruc
I can change content of the HTML in cached object, but not in every way. I
have a trouble inserting an image to that site from my PC. If I simply put: 
  there's only a displayed icon which is
refering to given location but on the page server. I also tried like this: 
  but also with no effect. I cannot
find any solution to my problem, you guys are my only hope :) 



--
View this message in context: 
http://squid-web-proxy-cache.1019090.n4.nabble.com/Is-it-possible-to-modify-cached-object-tp4681073p4681093.html
Sent from the Squid - Users mailing list archive at Nabble.com.
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-08 Thread Yuri Voinov


08.01.2017 20:49, boruc пишет:
> Thank you for your answer.
>
> Actually I managed to do what I want by simply editing that file and
> changing content length if necessary. I don't know why sometimes I need to
> restart Squid or reopen browser to see changed version of page. Sometimes
> it works fine on regular browser window, sometimes I need to open it in
> private mode, but that's the thing that I want to figure out now.
>
> Would it be possible to NOT cache specific files, like images by using
> refresh_pattern? Or in other words - I'd like to cache only HTML/CSS files.
Sure. You can do it either using refresh_pattern, or, more selectively,
using

# No cache directives
cache deny dont_cache_url
cache allow all

> 2017-01-06 21:33 GMT+01:00 reinerotto [via Squid Web Proxy Cache] <
> ml-node+s1019090n4681075...@n4.nabble.com>:
>
>> Content adaption can also be done without squid. Mod of message body
>> "on-the-fly" can be achieved using commercial product(s).
>>
>> --
>> If you reply to this email, your message will be added to the discussion
>> below:
>> http://squid-web-proxy-cache.1019090.n4.nabble.com/Is-it-
>> possible-to-modify-cached-object-tp4681073p4681075.html
>> To unsubscribe from Is it possible to modify cached object?, click here
>> 
>> .
>> NAML
>> 
>>
>
>
>
> --
> View this message in context: 
> http://squid-web-proxy-cache.1019090.n4.nabble.com/Is-it-possible-to-modify-cached-object-tp4681073p4681091.html
> Sent from the Squid - Users mailing list archive at Nabble.com.
> ___
> squid-users mailing list
> squid-users@lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-users

-- 
What is the fundamental difference between the programmer and by a fag?
Fag never become five times to free the memory of one object. Fag will
not use two almost identical string libraries in the same project. Fag
will never write to a mixture of C and C ++. Fag will never pass objects
by pointer. Now you know why these two categories so often mentioned
together, and one of them is worse :)


0x613DEC46.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-08 Thread boruc
Thank you for your answer.

Actually I managed to do what I want by simply editing that file and
changing content length if necessary. I don't know why sometimes I need to
restart Squid or reopen browser to see changed version of page. Sometimes
it works fine on regular browser window, sometimes I need to open it in
private mode, but that's the thing that I want to figure out now.

Would it be possible to NOT cache specific files, like images by using
refresh_pattern? Or in other words - I'd like to cache only HTML/CSS files.

2017-01-06 21:33 GMT+01:00 reinerotto [via Squid Web Proxy Cache] <
ml-node+s1019090n4681075...@n4.nabble.com>:

> Content adaption can also be done without squid. Mod of message body
> "on-the-fly" can be achieved using commercial product(s).
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
> http://squid-web-proxy-cache.1019090.n4.nabble.com/Is-it-
> possible-to-modify-cached-object-tp4681073p4681075.html
> To unsubscribe from Is it possible to modify cached object?, click here
> 
> .
> NAML
> 
>




--
View this message in context: 
http://squid-web-proxy-cache.1019090.n4.nabble.com/Is-it-possible-to-modify-cached-object-tp4681073p4681091.html
Sent from the Squid - Users mailing list archive at Nabble.com.
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-06 Thread reinerotto
Content adaption can also be done without squid. Mod of message body
"on-the-fly" can be achieved using commercial product(s).



--
View this message in context: 
http://squid-web-proxy-cache.1019090.n4.nabble.com/Is-it-possible-to-modify-cached-object-tp4681073p4681075.html
Sent from the Squid - Users mailing list archive at Nabble.com.
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


Re: [squid-users] Is it possible to modify cached object?

2017-01-06 Thread Alex Rousskov
On 01/06/2017 11:35 AM, boruc wrote:

> I am facing a really big problem (for me). I've set up a home network (few
> PCs, some mobiles) with squid proxying all requests. Is it possible to
> change cached objects manually? Let's say I have an object that contains
> /www.example.com/ page HTML source and what I want to do is e.g. change some
> words so users will see modified pages. I won't do this with HTTPS of
> course, just HTTP.
> 
> I tried to do that (I've changed one letter, so content length won't
> change), but after refreshing a page that cached file disappeared. Here's my
> refresh_pattern config section:
> 
> 
> 
> Or maybe there's another way to achieve my goal with squid?

If you just want to change one or two cached files once and do not care
that they will be replaced by fresher copies eventually (possibly
immediately; see P.S.), then you can very carefully hand-edit the cached
content on disk and restart Squid (to get rid of in-memory cached
copies, if any). You have to preserve the old content length of the
edited response and all [binary] metadata. Most editors will not do that
for you. A response may even contain a Content-MD5 checksum. This hack
is technically possible in some cases but it is unsupported.

Otherwise, what you want to do is called Content Adaptation. There are
several ways to do it as summarized at
http://wiki.squid-cache.org/SquidFaq/ContentAdaptation

HTH,

Alex.
P.S. Squid may get a fresh copy from the origin server if you tell the
browser to refresh the page or if Squid decides to refresh it for other
reasons. Your refresh patterns may combat some of these problems. Please
note that the patterns you used did not reach this mailing list.
___
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users