Fix error handling in server_content_type()
[privoxy.git] / TODO
1 $Id: TODO,v 1.124 2014/10/16 11:54:58 fabiankeil Exp $
2
3 Some Privoxy-related tasks, sorted by the time they
4 have been added, not by priority.
5
6 The latest version should be available at:
7 http://ijbswa.cvs.sourceforge.net/viewvc/ijbswa/current/TODO
8
9 There's work in progress to fund development on these items using
10 donations. If you want to donate, please have a look at:
11 http://www.spi-inc.org/donations/
12
13 If you have any questions regarding donations please either mail to
14 the public user mailing list (ijbswa-users@lists.sourceforge.net) or
15 to Privoxy's SPI liason Fabian (fk@fabiankeil.de).
16
17 1)  Add more regression tests. Filters should be tested automatically
18     (variables too). Could probably reuse large parts of Privoxy-Filter-Test.
19     Note that there is currently work in progress to leverage curl's
20     test suite, patches have been submitted upstream:
21     http://curl.haxx.se/mail/lib-2014-06/0070.html
22
23 3)  Fix some more XXX: comments.
24
25 6)  Remove actions that aren't needed anymore:
26
27     content-type-overwrite should probably stay as it's also
28     used by some of the CGI pages (XXX: name them).
29
30     crunch-client-header and crunch-server-header should probably
31     go, their only advantage is that their search strings can be
32     controlled through the CGI pages, other than that they only
33     have disadvantages.
34
35     crunch-if-none-match can be replaced with a header filter.
36
37     prevent-compression has a misleading name and could
38     be replaced with a header filter.
39
40 7)  force-text-mode has a stupid name and should probably
41     be renamed to force-filter-mode.
42
43 8)  handle-as-empty-document and handle-as-image should
44     be merged to something like handle-as{something} to
45     prevent them from being activated at the same time.
46
47 10) There's a bug in the CGI editor that turns the
48     first section's "Insert new section below" into
49     a "Insert new section above" button.
50
51 11) CGI templates should use semantically-correct HTML
52     and scale properly.
53
54 12) Support pipelining for outgoing connections.
55
56 14) Allow to filter POST parameters.
57
58 15) If trusted CGI pages are requested without trusted referrer,
59     set the status code to 403 instead of 200.
60
61 16) Filter SSL encrypted content as well.
62
63     At the beginning we could use a unencrypted connection between
64     client and Privoxy, and use an encrypted connection between
65     Privoxy and the server.
66
67     This should be good enough for most of the content the
68     user would want to filter.
69
70 19) enable-forward-fallback. Syntax? Suggested by K.R.
71
72 21) User Manual delivery doesn't accept multiple slashes. Should it?
73
74 22) Verify action files properly (Including arguments) and
75     act accordingly (should probably intercept all requests
76     with a "Invalid option foo detected" CGI page).
77
78 23) Do the same in case of syntax errors in the configuration file,
79     instead of just exiting or ignoring the problem.
80
81 25) Handle multiple filters with the same name better. Reject them?
82
83 26) Let show-url-info detect clearly invalid URLs.
84
85 27) Make errno logging less thread-unsafe.
86     Verify that it's really an improvement.
87
88 28) Don't take default ports in case of invalid forwarding ports.
89
90 31) If a string action foo is disabled csp->action->string[ACTION_STRING_FOO]
91     doesn't necessarily contain NULL, but may contain the string of an
92     enabled foo action in an overruled section. Is it a bug? Does it matter?
93
94 32) In case of forwarding failures with socks port == 9050,
95     show extra info about Tor (the whole FAQ entry?).
96
97 36) Unload unused action files directly, even if they are
98     disabled without replacement.
99
100 38) In the final results, explicitly list disabled multi actions
101     with their parameters. Not as trivial as it sounds.
102
103 40) When running in daemon mode, Privoxy's working directory is '/'
104     which means it may not have permissions to dump core when necessary.
105     Figure out a way to solve this. Introduce a cwd config option?
106
107 41) Change documentation framework to one that works cross-platform.
108     Evaluate WML.
109
110 42) Add a DTrace USDT provider. Now that FreeBSD has userland DTrace
111     support there's no longer any reason not to.
112
113 43) Write a tool to check URL patterns against URLs in the log file.
114     This could be included in Privoxy-Regression-Test.
115
116 44) Privoxy-Log-Parser: Consider highlighting "Connection" in:
117     23:13:03.506 283b6100 Header: Replaced: 'Connection: Keep-Alive' with 'Connection: close'
118
119 50) Investigate possible PCRS template speedup when searching
120     macros with strstr() before compiling pcrs commands.
121     Investigated, needs some restructuring but is probably worth it.
122
123 51) Make user-manual directive more generic to allow serving
124     the FAQ and other stuff, too. Consider changing the port
125     for "same origin policy" issues.
126
127 53) Find a more reliable hoster. Involves finding out what our
128     requirements are and which SF alternatives fulfil them.
129     It would probably also make sense to look into what other
130     projects did when migrating away from SF.
131
132     2014-05-13: Work in progress. Hosting wish list at the end
133     of this file.
134
135     Interested donors: 1.
136
137 54) Move away from CVS to a more modern revision control system.
138     Find out if there are any objection against going with Git.
139     Using Git would also have the advantage that SF now pretends
140     to support it, so we could do it independently from 53).
141
142 58) Move more template strings from the code into the actual templates.
143
144 59) Import the German template translation.
145
146 60) Ask the Russian translators for input on how to make their
147     life easier.
148
149 61) Consider (optionally?) skipping the hostname comparison when
150     checking if a connections that goes to a HTTP proxy can be reused.
151     Do all HTTP proxy support that? Is it worth it?
152
153 63) Reject clearly too large requests earlier?
154
155 64) Use proper copyright attribution. "Privoxy Developers"
156     is no legal entity.
157
158 65) Polish Website. Probably involves ditching the Docbook
159     mess in favour of wml. There are already several threads
160     in the mailinglist archives about this. See also #41.
161
162 66) Stop hard-coding the number of action and filter files.
163
164 67) Clean up source code directory layout. Depends on 54 so
165     we don't lose the revision history.
166
167 68) Use standard make syntax so we don't depend on GNU make.
168
169 69) Update autoconf setup (or move away from it).
170
171 70) If the server connection is reset but the headers are
172     received, consider passing the mess to the client instead
173     of showing the connect-failed template. Relates to #2698674.
174
175 74) Let Privoxy-Regression-Test optionally check that action
176     sections which disable actions actually are preceded by
177     sections that enable said actions.
178
179 75) Create a tool that creates Privoxy action (and filter?) files
180     out of adblock files. Could be implemented as option for
181     url-pattern-translator.pl.
182
183 76) Cache DNS responses. Note that this has been requested
184     several times by users, but is not a developer priority.
185     If you care about this, feel free to submit patches.
186
187 77) Allow to configure the IP address used in outgoing connections.
188
189 78) Allow to optionally use pcre's DFA algorithm.
190
191 79) Evaluate pcre alternatives.
192
193 80) Change FEATURE_EXTENDED_HOST_PATTERNS to support both
194     extended and vanilla host patterns at the same time.
195
196     Note that the requirement is to allow the user to decide
197     if the domain pattern should be interpreted as regex or
198     traditional host pattern and if it's not obvious that the
199     user made any decision, default to the latter.
200
201     Possible solutions would be:
202
203     1. An always-use-regex-domain-patterns config option
204     2. An enable-regex-domain-patterns-for-this-action-file option
205     3. An enable-regex-domain-patterns-for-this-action-file-until-the-user-says-otherwise option
206     4. A treat-the-domain-pattern-in-this-line-as-regex(-or-not) option
207     5. Combinations of the options above
208
209     With 2+4, 3+4 or 2+3+4 being the preferences until
210     further discussion.
211
212 82) Detect if the system time goes back in time let the user
213     know if it caused any connections to get closed.
214
215 84) Flesh out the user-manual delivery to serve pages from
216     other directories, too.
217
218 85) Once #84 is done, write a script that populates a directory with
219     various common third-party icons (stumbleupon.png, facebook.png ...)
220     and redirect requests for them to Privoxy.
221
222 86) Add a server-body-tagger action. This is trivial as as all the
223     functionality required to do it already exists.
224
225 87) Add a client-body-tagger action. This is less trivial as we currently
226     don't buffer client bodies. After 14) is implemented it would be
227     trivial, though.
228
229 88) Investigate if there's a Perl module that Privoxy-Regression-Test
230     could optionally use to keep connections alive, preferably while
231     requiring less forks at the same time.
232
233 89) When multiple block actions apply, consider showing all the block
234     reasons on the blocked page that haven't been overruled, not just
235     the last one.
236
237 91) Add an optional limit for internal redirects. It would probably
238     be reasonable to default to a limit of one and showing an error
239     message if the request for the redirect URL would be redirected
240     again.
241
242 92) The statistics currently aren't calculated correctly by Privoxy
243     as each thread is only counted as one request which is no longer
244     correct. This should be fixed, or the statistic code removed.
245     Privoxy-Log-Parser's provides more detailed statistics, anyway.
246
247 93) Add a config directive to let Privoxy explicitly request either
248     IPv4 (or IPv6) addresses, even if the system supports both.
249     Could be useful as a workaround for misconfigured setups where the
250     libc returns IPv6 addresses even if there's no IPv6 connectivity.
251
252 94) Add a config directive to let Privoxy prefer either IPv4 (or IPv6)
253     addresses, instead of trusting the libc to return them in an order
254     that makes sense. Like #93, this could be useful as a workaround
255     for misconfigured setups.
256
257 95) Support a non-standard client header in CONNECT requests that
258     contains the URL of the requested resource, which is then treated
259     like the request URL.
260
261     This way the client could opt-in for path-based blocking of https
262     requests. Given that the headers from the CONNECT request aren't
263     forwarded to the destination server, an unencrypted URL should be
264     acceptable if the client and Privoxy are running on the same system
265     or in a trusted environment.
266
267 96) Filters should be easier to look up. Currently get_filter() has to
268     go through all filters and skip the filter types the caller isn't
269     interested in.
270
271 98) When showing action section on the CGI pages, properly escape
272     line breaks so they can be copy&pasted into action files without
273     adjustments.
274
275 99) Figure out a mechanism through which a user can easily enable
276     site-specific action sections that are too aggressive to be
277     enabled by default. This could be similar to the presettings
278     in default.action, but could also be just another action file
279     that isn't used by default.
280
281 100) Create a cross-platform Privoxy control program and retire
282      the win32 GUI. Integrate support for Privoxy-Regression-Test,
283      Privoxy-Log-Parser, Privoxy-Filter-Test, uagen and similar tools.
284
285 102) Add an include directive to split the config file into several parts.
286
287 103) Potential performance improvement for large action files:
288      when figuring out which actions apply, check the action bit mask
289      before pattern matching and skip section that wouldn't modify the
290      actions already set. To increase the impact the sections would have
291      to be applied in reverse.
292
293 104) The code to modify global_toggle_state should be factored out into
294      a separate function. Currently we mess with it in three different
295      files, but only in w32log.c the tray icon is explicitly set.
296      The logging is inconsistent as well. For details see #3525694.
297
298 105) Add support for socks authentication.
299
300 106) actionlist.h should be embedded in a way that causes less text
301      segment bloat.
302
303 107) Support more pcrs variables, for example $destination-ip-address
304      and $source-ip-address.
305
306 108) Allow to use a somewhat random string instead of PRIVOXY-FORCE.
307
308 109) Let log_error() support the format specifier %S which should
309      work like %s but escape new lines like %N. This would be useful
310      to log the result of header filters which may inject new lines.
311
312 110) Add a global-buffer-limit directive that roughly limits how
313      much malloc'ed memory Privoxy will use and can potentially
314      be smaller than (buffer-limit * max-client-connections).
315
316 111) Reject requests if hosts and ports in request line and Host
317      header don't match (before filters have been applied).
318
319 112) If a header filter is used to inject another header by inserting
320      a \r\n (undocumented feature), detect it and split the headers so
321      following header actions do not treat them as a single string.
322      Alternatively add another header injection mechanism.
323
324 113) Log statistics upon receiving a certain signal (SIGINFO or SIGUSR1).
325
326 114) Properly deal with status code 100. The current "Continue hack"
327      can cause problems for gpg when uploading keys through Privoxy.
328
329 115) Add ICAP (RFC 3507) support. FR #3615158.
330
331 116) Due to the use of sscanf(), Privoxy currently will fail to properly
332      parse chunks whose size can't be represented with 32 bit. This is
333      unlikely to cause problems in the real world, but should eventually
334      be fixed anyway. See also:
335      https://bugzilla.mozilla.org/show_bug.cgi?id=959100
336
337 118) There should be "escaped" dynamic variables that are guaranteed
338      not to break filters.
339
340 119) Evaluate using pcre's jit mode.
341
342 120) Add an option to limit pcre's recursion limit below the default.
343      On some platforms the recursion limit doesn't prevent pcre from
344      running out of stack space, causing the kernel to kill Privoxy
345      ungracefully.
346
347 121) Add HTTP/2 support. As a first step, incomming HTTP/1.x requests
348      should be translated to outgoing HTTP/2 requests where possible
349      (and if desired by the user).
350
351 122) Allow customized log messages.
352
353 123) Evaluate if the voluntarily-disclose-session-keys option in Firefox
354      (and other browsers) can be leveraged. Probably depends on #16.
355
356 124) Add support for the "lightweight OS capability and sandbox framework"
357      Capsicum. http://www.cl.cam.ac.uk/research/security/capsicum/
358      Interested donors: 1.
359
360 125) Allow clients to HTTPS-encrypt the proxy connection.
361      Interested donors: 1.
362
363 126) Run the Co-Advisor HTTP compliance tests, evaluate the results,
364      fix the compliance issues that aren't by design and document
365      the rest.
366      Note that Privoxy developers qualified for free account upgrades:
367      http://coad.measurement-factory.com/details.html#pricing
368
369 127) Add "real" CGI support (serve program output instead of forwarding
370      the request). The work is mostly done due to +external-filter{}.
371
372 128) Add a config directive to control the stack limit.
373
374 129) Completely implement RFC 7230 4.1 (Chunked Transfer Coding).
375      Currently Privoxy doesn't properly deal with trailers which
376      are rarely used in the real world but should be supported anyway.
377
378 130) Move header_tagger() out of the parser structs and let it execute
379      taggers one-by-one against all headers so the header order has less
380      influence on the tagging result. As a bonus, dynamic taggers would
381      have to be compiled less often.
382
383 131) The handle-as-empty-doc-returns-ok directive should be replaced with
384      an action so the behaviour can be enabled on a per-request basis.
385      Interested donors: 1.
386
387 132) Provide a Tor hidden service to reach the Privoxy website.
388      Interested donors: 1.
389
390 133) Consider allowing bitcoin donations.
391      Interested donors: 1.
392
393 134) Track the total number of bytes written to and received from a socket.
394
395 135) Add OpenBSM audit support.
396
397 136) Make builds reproducible.
398
399 137) Add a (preferably vector-based) logo.
400
401 138) Analyse Coverity scan results:
402      https://scan.coverity.com/projects/3212
403
404 ##########################################################################
405
406 Hosting wish list (relevant for #53)
407
408 What we need:
409
410 - Bug tracker
411 - Mailinglists (Mailman with public archives preferred)
412 - Webspace (on a Unix-like OS that works with the webserver targets
413   in GNUMakefile)
414 - Source code repositories (currently CVS, but migrating away
415   from it is TODO #54 anyway and shouldn't be too much trouble)
416 - Commit mails (preferably with unified diffs)
417
418 (Unsorted) details to look at when evaluating hosters:
419
420 1. Preferably no third-party ads and trackers.
421    External images, CSS and JavaScript may count as trackers
422    but texts like "supported by company XYZ" may be acceptable.
423
424 2. JavaScript should be optional or not used at all.
425
426 3. Services we don't need shouldn't be enabled anyway.
427    (We currently don't use Web forums, wikis, surveys etc.)
428
429 4. It would be preferable if the hoster didn't have a bad track
430    record as far as user experience, security and privacy are
431    concerned and if the terms of service are "reasonable" and
432    haven't changed too often in the past. Updates in the past
433    should have been improvements and not regressions.
434
435 5. It would be preferable if most of the server administration
436    is done by a trusted third-party (or at least not a lot of work
437    for us).
438
439 6. The server(s) should be located in a country with laws we can
440    understand and follow (or at least not unintentionally violate).
441
442 7. A server location in a country with some kind of due process
443    and strong data protection laws (at least on paper) would be
444    preferable.
445
446 8. Given that Privoxy is a free software project it would be
447    preferable if the hoster would use free software where possible.
448
449 9. Migrating away from the hoster in the future without losing
450    any important data should be possible without writing web
451    scrapers first.