Commit Graph

64 Commits

Author SHA1 Message Date
rofl0r
cea0ebe657 tinyproxy.conf.5: explain what a site_spec looks like 2025-01-06 19:25:57 +00:00
Robert Grumann
73da8a35a3
conf: add BasicAuthRealm feature (#547)
makes BasicAuth realm string editable in config file.

closes #235
2024-07-14 13:38:25 +02:00
rofl0r
d7c20e663f tinyproxy.conf.5: document syntax for upstream IPv6 addresses
follow-up to 2bec15ee40
2023-05-25 19:42:02 +00:00
ivanwick
1e615e66a9
tinyproxy.conf.5: document config strings that require double quotes (#493)
* tinyproxy.conf.5: document config strings that require double quotes

String config values matched by the STR regex must be enclosed in double
quotes

Edit descriptions for brevity

conf.c: move boolean arguments comment before BOOL group

addresses #491

* Revert conf.c: move boolean arguments comment before BOOL group
2023-05-24 15:06:15 +01:00
rofl0r
31339cb161 tinyproxy.conf.5: update text for bind directive
the existing text was sort of misleading as it was written in a
pre-HTTPS era.

addressing #475
2023-02-01 15:46:58 +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
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
rofl0r
7c37a61e00 manpages: update copyright years 2020-09-06 23:16:29 +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
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
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
rofl0r
e78b461607 update upstream syntax in manpage template 2018-02-25 23:52:23 +00:00
rofl0r
ee83293285 update URL 2016-01-03 21:16:21 +00:00
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 b108162dfb.
2010-03-28 10:27:40 +05:30
Mukund Sivaraman
b108162dfb Update Tinyproxy website URLs 2010-03-27 08:22:51 +05:30
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
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
Michael Adam
cbb179ef0b docs: document StatHost in tinyproxy.conf(5)
Michael
2009-11-10 13:58:07 +01:00
Michael Adam
db7f340b3a Document DisableViaHeader in the tinyproxy.conf(5) manpage. 2009-10-11 02:00:44 +02:00
Michael Adam
03b8e8bc19 Fix another typo in the tinyproxy.conf(5) manpage. 2009-10-10 22:24:02 +02:00
Michael Adam
add2685a55 Fix a typo in the tinyproxy.conf(5) manpage. 2009-10-10 22:23:28 +02:00
Mukund Sivaraman
92378a9085 docs: Fix typos in tinyproxy.conf manpage 2009-09-28 18:51:42 +05:30
Mukund Sivaraman
afcd38536b docs: Fix case 2009-09-28 16:26:19 +05:30
Michael Adam
5a77c9744a docs: document the reverse proxying options in tinyproxy.conf(5) 2009-09-28 12:18:52 +02:00
Michael Adam
f0cbc35ca9 docs: document ConnectPort in tinyproxy.conf(5) 2009-09-28 11:37:54 +02:00
Michael Adam
9ff9bd18fe docs: document Anonymous in tinproxy.conf(5) 2009-09-28 11:35:20 +02:00
Michael Adam
f1e5360ef1 docs: document the filtering options in tinyproxy.conf(5) 2009-09-28 11:24:34 +02:00
Michael Adam
33872928d5 docs: document ViaProxyName in tinyproxy.conf(5) 2009-09-28 11:24:34 +02:00
Michael Adam
8c31287805 docs: document Allow and Deny in tinyproxy.conf(5) 2009-09-28 11:24:34 +02:00
Michael Adam
42b072b863 docs: document MaxRequestsPerChild in tinyproy.conf(5) 2009-09-28 11:24:34 +02:00
Michael Adam
553b95b3ed docs: document StartServers in tinyproxy.conf(5) 2009-09-28 11:24:34 +02:00
Michael Adam
9574bf0855 docs: document MinSpareServers and MaxSpareServers in tinyproxy.conf(5)
Michael
2009-09-28 11:24:33 +02:00