85 Commits

Author SHA1 Message Date
rofl0r
8b373f804e update html documentation, add quickstart section 2022-05-30 19:10:27 +00:00
rofl0r
235b1c10a7 implement filtertype keyword and fnmatch-based filtering
as suggested in #212, it seems the majority of people don't understand
that input was expected to be in regex format and people were using
filter lists containing plain hostnames, e.g. `www.google.com`.

apart from that, using fnmatch() for matching is actually a lot less
computationally expensive and allows to use big blacklists without
incurring a huge performance hit.

the config file now understands a new option `FilterType` which can
be one of `bre`, `ere` and `fnmatch`.
The `FilterExtended` option was deprecated in favor of it.
It still works, but will be removed in the release after the next.
2022-05-02 13:13:40 +00:00
rofl0r
d3d8943fe4 update website footer re: freenode 2021-09-22 12:14:58 +00:00
rofl0r
7af5b1a553 manpage: improve FilterDefaultDeny paragraph 2021-05-10 00:25:50 +01:00
rofl0r
cc47fbf1f7 manpage: URL-based filtering is no longer recommended 2021-05-09 17:53:52 +01:00
Anton Khirnov
3bb14e0440 Allow multiple Bind directives.
Try all the addresses specified with Bind in order. This is necessary
e.g. for maintaining IPv4+6 connectivity while still being restricted to
one interface.
2020-10-19 20:08:31 +01:00
Brett Randall
559faf7957 website stylesheet: added pre margin-bottom: 20px.
this improves rendering of literal code paragraphs.
2020-09-07 12:34:35 +01:00
rofl0r
7c37a61e00 manpages: update copyright years 2020-09-06 23:16:29 +01:00
rofl0r
65e79b84a4 update documentation about signals 2020-09-06 23:15:41 +01:00
rofl0r
51b8be3ee4 add tinyproxy website template to docs/web
this allows to automatically generate the website from the current
tinyproxy.conf.5 template.

    make
    cd docs/web
    make
2020-09-06 13:45:40 +01:00
Brett Randall
5e594e593a Added BasicAuth to tinyproxy.conf man page. 2020-09-06 12:25:46 +01:00
rofl0r
c4dc3ba007 filter: fix documentation about rules
the file docs/filter-howto.txt was removed, as it contained misleading
information since it was first checked in.

it suggests the syntax for filter rules is fnmatch()-like, when in
fact they need to be specified as posix regular expressions.

additionally it contained a lot of utterly unrelated and irrelevant/
outdated text.

a few examples with the correct syntax have now been added to
tinyproxy.conf.5 manpage.

closes #212
2020-09-05 17:33:53 +01:00
rofl0r
a547a298c7 generate manpages with pod2man instead of a2x/asciidoc(tor)
it turned out that the upstream section in tinyproxy.conf.5 wasn't rendered
properly, because in asciidoc items following a list item are always explicitly
appended to the last list item.
after several hours of finding a workaround, it was decided to change the
manpage generator to pod2man instead.

as pod2man ships together with any perl base install, it should be available
on almost every UNIX system, unlike asciidoc which requires installation
of a huge set of dependencies (more than 1.3 GB on Ubuntu 16.04), and the
replacement asciidoctor requires a ruby installation plus a "gem" (which is
by far better than asciidoc, but still more effort than using the already
available pod2man).

tinyproxy's hard requirement of a2x (asciidoctor) for building  from source
caused rivers of tears (and dozens of support emails/issues) in the past, but
finally we get rid of it. a tool such as a2x with its XML based bloat-
technology isn't really suited to go along with a supposedly lightweight
C program.

if it ever turns out that even pod2man is too heavy a dependency, we could
still write our own replacement in less than 50 lines of awk, as the pod
syntax is very low level and easy to parse.
2020-08-19 22:45:37 +01:00
rofl0r
3fa53f8660 tinyproxy.conf.5: fix typo 2020-08-19 20:37:03 +01:00
rofl0r
fc681e26b8 tinyproxy.conf.5: document upstream null-routing 2020-08-19 12:16:02 +01:00
rofl0r
c984122acd tinyproxy.conf.5: clarify that upstream none makes direct connection 2020-08-19 12:07:19 +01:00
rofl0r
5ba958829f add configure option to disable manpage generation
using --disable-manpage-support it's finally possibly to disable
the formerly obligatory use of a2x to generate the manpage
documentation.

this is the final solution to the decade old problem that users need
to install the enormous asciidoc package to compile TINYproxy from
source, or otherwise get a build error, even though the vast majority
is only interested in the program itself.

solution was inspired by PR #179.

closes #179
closes #111

note that since 1.10.0 release the generated release tarball includes
the generated manpages too; in which case neither the use of a2x
nor --disable-manpage-support is required.
2020-08-12 00:15:45 +01:00
rofl0r
77853caa0a move manpages to maintainer-clean make target
according to https://www.gnu.org/prep/standards/html_node/Standard-Targets.html#Standard-Targets
`maintainer-clean` is the proper make target for files that are distributed
in a release tarball:

> The ‘maintainer-clean’ target is intended to be used by a maintainer of the
> package, not by ordinary users.
> You may need special tools to reconstruct some of the files that
> ‘make maintainer-clean’ deletes.

this prevents users without a2x or asciidoctor from losing their ability to
recompile tinyproxy after `make clean`, but it also means that users wanting
to regenerate the documentation need to run `make maintainer-clean`.
2020-08-11 18:00:34 +01:00
rofl0r
c2d4114427 add support for asciidoctor to generate manpages
asciidoctor is a modern replacement for asciidoc and much more lightweight,
issuing "apt-get install asciidoc" on ubuntu 16.04 results in an attempt to
install more than 1.3 GB of dependencies.
2020-08-11 15:25:02 +01:00
LucasVerneyDGE
25e2cc330c add a comment example in the filter file example 2020-07-06 12:20:58 +01:00
rofl0r
f6d4da5d81 do hostname resolution only when it is absolutely necessary for ACL check
tinyproxy used to do a full hostname resolution whenever a new client
connection happened, which could cause very long delays (as reported in #198).

there's only a single place/scenario that actually requires a hostname, and
that is when an Allow/Deny rule exists for a hostname or domain, rather than
a raw IP address. since it is very likely this feature is not very widely used,
it makes absolute sense to only do the costly resolution when it is unavoidable.
2019-12-21 00:43:45 +00:00
rofl0r
b935dc85c3 simplify codebase by using one thread/conn, instead of preforked procs
the existing codebase used an elaborate and complex approach for
its parallelism:

5 different config file options, namely

- MaxClients
- MinSpareServers
- MaxSpareServers
- StartServers
- MaxRequestsPerChild

were used to steer how (and how many) parallel processes tinyproxy
would spin up at start, how many processes at each point needed to
be idle, etc.
it seems all preforked processes would listen on the server port
and compete with each other about who would get assigned the new
incoming connections.
since some data needs to be shared across those processes, a half-
baked "shared memory" implementation was provided for this purpose.
that implementation used to use files in the filesystem, and since
it had a big FIXME comment, the author was well aware of how hackish
that approach was.

this entire complexity is now removed. the main thread enters
a loop which polls on the listening fds, then spins up a new
thread per connection, until the maximum number of connections
(MaxClients) is hit. this is the only of the 5 config options
left after this cleanup. since threads share the same address space,
the code necessary for shared memory access has been removed.
this means that the other 4 mentioned config option will now
produce a parse error, when encountered.

currently each thread uses a hardcoded default of 256KB per thread
for the thread stack size, which is quite lavish and should be
sufficient for even the worst C libraries, but people may want
to tweak this value to the bare minimum, thus we may provide a new
config option for this purpose in the future.
i suspect that on heavily optimized C libraries such a musl, a
stack size of 8-16 KB per thread could be sufficient.

since the existing list implementation in vector.c did not provide
a way to remove a single item from an existing list, i added my
own list implementation from my libulz library which offers this
functionality, rather than trying to add an ad-hoc, and perhaps
buggy implementation to the vector_t list code. the sblist
code is contained in an 80 line C file and as simple as it can get,
while offering good performance and is proven bugfree due to years
of use in other projects.
2019-12-21 00:43:45 +00:00
rofl0r
04f68e21e7 tinyproxy.8: remove l flag from short options 2018-09-05 00:57:23 +02:00
Michael Adam
8333a4bb1a docs: update the copyright notice in the manpages
Signed-off-by: Michael Adam <obnox@samba.org>
2018-09-01 04:06:59 +02:00
Michael Adam
56f30a4386 main: remove the "-l" switch to display the license and authors
Signed-off-by: Michael Adam <obnox@samba.org>
2018-09-01 04:06:59 +02:00
rofl0r
e78b461607 update upstream syntax in manpage template 2018-02-25 23:52:23 +00:00
Michael Adam
1e93411810 Merge pull request #59 from gmp216/pull
Fix OS X build
2017-01-04 16:21:27 +01:00
Greg
802a6aa93f Added conditional for xmllint by testing "a2x" without the -L flag. 2017-01-04 09:18:20 -05:00
rofl0r
909528e29c ship manpages as part of the dist tarball
`make dist` now creates the manpages and puts them into the tarball, so
the user does not need to have `a2x` installed to build them.

closes #2
2016-12-20 21:06:20 +00:00
rofl0r
ee83293285 update URL 2016-01-03 21:16:21 +00:00
Mukund Sivaraman
ec86c15d5a Minor whitespace fix 2011-08-16 17:44:17 +05:30
Mukund Sivaraman
50e3a0f6d9 Fix typo in manpage 2010-05-30 10:01:36 +05:30
Mukund Sivaraman
7c39cdfe1d Use complete sentences in the manpages 2010-04-22 21:14:27 +05:30
Mukund Sivaraman
1e0ad98f7f Just fix the support URLs 2010-03-28 10:33:38 +05:30
Mukund Sivaraman
34088e2175 Revert "Update Tinyproxy website URLs"
This reverts commit b108162dfb408b4818a6ea8b2a148ddaf1506bbe.
2010-03-28 10:27:40 +05:30
Mukund Sivaraman
b108162dfb Update Tinyproxy website URLs 2010-03-27 08:22:51 +05:30
Michael Adam
e87c856487 change the default pid file location to "@LOCALSTATEDIR@/run/tinyproxy/tinyproxy.pid"
I.e., add a tinyproxy subdirectory.
This is meant to ease running tinyproxy as non-root user.
The subdirectory can be used to give the tinyproxy user
write permission.

Michael
2010-03-02 23:39:30 +01:00
Michael Adam
cfa5792880 change the default log file location to "@LOCALSTATEDIR@/log/tinyproxy/tinyproxy.log"
i.e. add a tinyproxy subdirectory.
This is meant to ease running tinyproxy as non-root user
the subdirectory can be used to give the tinyproxy user
write permission.

Michael
2010-03-02 23:39:21 +01:00
Mukund Sivaraman
41d80861e3 Fix typo in manpage 2010-01-25 19:35:30 +05:30
Mukund Sivaraman
d3df735f89 Add author sections to the manpages 2010-01-16 16:42:02 +05:30
Mukund Sivaraman
74334a7700 Add see-also sections to the manpages 2010-01-16 16:40:48 +05:30
Michael Adam
b106091343 Happy new year 2010! 2010-01-10 13:53:03 +01:00
Michael Adam
594df6bf43 Happy new year 2010! 2010-01-10 13:52:17 +01:00
Mukund Sivaraman
9c0c3d5ced [BB#17] Add custom HTTP request headers to outgoing HTTP requests 2010-01-08 22:05:17 +05:30
Mukund Sivaraman
e5abe844d1 Use named lists to match rest of the document 2010-01-03 20:50:07 +05:30
Mukund Sivaraman
9e79e9975f Modify description of LogLevel in manpage 2010-01-03 20:46:37 +05:30
Mukund Sivaraman
70e8197344 Use proper asciidoc formatting in manpage 2010-01-03 20:14:43 +05:30
Mukund Sivaraman
34f9e5f95e Fix caps in manpage 2010-01-03 20:14:29 +05:30
Mukund Sivaraman
c42fbaaf80 Make asciidoc a requirement for building Tinyproxy
asciidoc is necessary as the version number is added during
configure into the asciidoc manpage sources. So simply bundling
a pre-generated manpage won't do.
2009-11-14 16:34:06 +05:30
Mukund Sivaraman
2061a18313 Revert "Don't cleanup generated and dist'ed manpages"
This reverts commit 276ca8369dbe82ddba5e72684becc5e774169157.
2009-11-14 16:16:49 +05:30