doug [Wed, 6 Aug 2014 02:31:47 +0000 (02:31 +0000)]
Explain the options in httpd.8
ok deraadt@
jsing [Wed, 6 Aug 2014 02:04:42 +0000 (02:04 +0000)]
Load the SSL public/private keys in the parent process, then provide them
to the privsep process via imsg. This allows the keys to be moved out of
the chroot (now /etc/ssl/server.crt, /etc/ssl/private/server.key).
ok reyk@
jsing [Wed, 6 Aug 2014 01:54:01 +0000 (01:54 +0000)]
Add support for loading the public/private key from memory, rather than
directly from file.
mpi [Tue, 5 Aug 2014 20:26:15 +0000 (20:26 +0000)]
Only check if the abort transfer is the interrupt one if the pipe is
opened with a callback.
If a driver opens an interrupt pipe without callback function, like
umct(4) does with one of its bulk in endpoints being reported as an
interrupt endpoint, then we can end up aborting a transfer which is
different from the interrupt one.
Issue reported by Roberto E. Vargas Caballero, ok deraadt@
reyk [Tue, 5 Aug 2014 18:01:10 +0000 (18:01 +0000)]
Add configuration options for the most-important connection limits:
max requests (per connection) and timeout. We don't want to add too
many button, and there are good defaults, but these ones are kind of
mandatory.
reyk [Tue, 5 Aug 2014 17:13:16 +0000 (17:13 +0000)]
Tweak the httpd.conf manpage with "sub-lists".
reyk [Tue, 5 Aug 2014 17:03:21 +0000 (17:03 +0000)]
Bring back the tcp/ip configuration options. This code was already
there and is from relayd. We can decide later which options should
be added or removed, but it shouldn't do any harm.
reyk [Tue, 5 Aug 2014 16:46:35 +0000 (16:46 +0000)]
Add srv_conf helper variable to make the code more readable.
No functional change.
reyk [Tue, 5 Aug 2014 16:35:37 +0000 (16:35 +0000)]
Fix an example: hostapd table entries have to be comma-separated.
From "Vigdis" via misc@
can go in deraadt@
reyk [Tue, 5 Aug 2014 16:34:03 +0000 (16:34 +0000)]
Fix an example, nat-to requires to specify the "out" direction in pf rules.
From "Vigdis" via misc@
can go in deraadt@
reyk [Tue, 5 Aug 2014 16:30:35 +0000 (16:30 +0000)]
Limit the number of (Keep-Alive) requests per connection to 100.
(Same default as in nginx and Apache).
reyk [Tue, 5 Aug 2014 15:36:59 +0000 (15:36 +0000)]
Improve logging to allow per- server/location log files. The log
files can also be owned by root now: they're opened by the parent and
send to the logger process with fd passing. This also works with reload.
ok deraadt@
deraadt [Tue, 5 Aug 2014 14:36:10 +0000 (14:36 +0000)]
retire blink because this is serious software now; ok beck
deraadt [Tue, 5 Aug 2014 14:35:47 +0000 (14:35 +0000)]
spaces
deraadt [Tue, 5 Aug 2014 13:15:51 +0000 (13:15 +0000)]
handle wsconsctl.conf and sysctl.conf just being examples.
from ratchov
jsing [Tue, 5 Aug 2014 12:46:16 +0000 (12:46 +0000)]
Add $OpenBSD$ tags.
jsg [Tue, 5 Aug 2014 09:24:21 +0000 (09:24 +0000)]
add a config option to specify the chroot directory
ok reyk@
naddy [Mon, 4 Aug 2014 20:17:09 +0000 (20:17 +0000)]
enable httpd; ok deraadt@
reyk [Mon, 4 Aug 2014 18:12:15 +0000 (18:12 +0000)]
Temporarily move the default location of the SSL/TLS server key and
certificate from /var/www/ to /var/www/conf/. Don't get scared - this
will be changed soon! They're currently located in the chroot
directory but will be moved outside as soon as we adopted some of the
key privsep from relayd in ressl/httpd.
reyk [Mon, 4 Aug 2014 18:00:06 +0000 (18:00 +0000)]
Add HTTPS = on CGI variable.
reyk [Mon, 4 Aug 2014 17:50:48 +0000 (17:50 +0000)]
Add HTTPS server example.
reyk [Mon, 4 Aug 2014 17:43:20 +0000 (17:43 +0000)]
Redirect to https:// if SSL/TLS is enabled.
reyk [Mon, 4 Aug 2014 17:38:12 +0000 (17:38 +0000)]
Proxy commit for jsing@:
"Add TLS/SSL support to httpd, based on the recent ressl commits."
From jsing@
ok reyk@
reyk [Mon, 4 Aug 2014 17:12:44 +0000 (17:12 +0000)]
manpage tweaks about logging
jsing [Mon, 4 Aug 2014 16:34:11 +0000 (16:34 +0000)]
Implement ressl_accept_socket, which allocates a new server connection
context (if necessary) and handles the TLS/SSL handshake over the given
socket.
jsing [Mon, 4 Aug 2014 16:19:50 +0000 (16:19 +0000)]
Return -1 on error (not 1).
jsing [Mon, 4 Aug 2014 16:18:42 +0000 (16:18 +0000)]
A ressl server needs different configuration from a ressl client - provide
a specific server configuration function and call this from
ressl_configure.
reyk [Mon, 4 Aug 2014 16:07:59 +0000 (16:07 +0000)]
Change grammar from "log [style]" to "log style [style]".
jsing [Mon, 4 Aug 2014 16:07:25 +0000 (16:07 +0000)]
Provide a function that returns a server connection context.
jsing [Mon, 4 Aug 2014 15:58:29 +0000 (15:58 +0000)]
Provide a utility function for loading a private/public keypair.
reyk [Mon, 4 Aug 2014 15:57:25 +0000 (15:57 +0000)]
Print error message if the log files cannot be opened.
jsing [Mon, 4 Aug 2014 15:55:26 +0000 (15:55 +0000)]
Improve ressl_{read,write} handling of non-blocking reads/writes.
reyk [Mon, 4 Aug 2014 15:49:28 +0000 (15:49 +0000)]
Add initial support for log files in /var/www/logs/. Logging with
syslog is still supported but disabled by default.
ok deraadt@
jsing [Mon, 4 Aug 2014 15:48:01 +0000 (15:48 +0000)]
Free the SSL context first and let the reference counting do its thing.
reyk [Mon, 4 Aug 2014 14:49:24 +0000 (14:49 +0000)]
Implement PATH_INFO and add DOCUMENT_ROOT.
PATH_INFO was requested by naddy@ who successfully tested it with "cvsweb".
ok naddy@
jasper [Mon, 4 Aug 2014 13:24:42 +0000 (13:24 +0000)]
fix small layout inconsistency
ok'd by many
reyk [Mon, 4 Aug 2014 11:09:25 +0000 (11:09 +0000)]
httpd doesn't support SSL/TLS yet, remove the remaining bits.
The secrect plan is to add it later using the ressl wrapper library.
deraadt [Mon, 4 Aug 2014 06:35:31 +0000 (06:35 +0000)]
no need for param.h
deraadt [Mon, 4 Aug 2014 06:35:10 +0000 (06:35 +0000)]
whitespace
miod [Mon, 4 Aug 2014 04:16:11 +0000 (04:16 +0000)]
In chacha_init(), allow for a NULL iv. Reported by znz on github.
ok guenther@ jsing@
reyk [Sun, 3 Aug 2014 22:47:25 +0000 (22:47 +0000)]
Only allow GET and HEAD for static files or return 405.
ok florian@
reyk [Sun, 3 Aug 2014 22:38:12 +0000 (22:38 +0000)]
Also write log messages, like 404 Not Found, on error. This is a bit
tricky because we couldn't guarantee a sane state after
server_response_http() so fail hard afterwards and close the connection.
ok doug@
florian [Sun, 3 Aug 2014 22:06:51 +0000 (22:06 +0000)]
c-type functions / makros need a cast to unsigned char, not int
"feel free to commit" reyk@
reyk [Sun, 3 Aug 2014 21:33:27 +0000 (21:33 +0000)]
Allocate http_host instead of carrying a buffer in the descriptor.
reyk [Sun, 3 Aug 2014 20:43:03 +0000 (20:43 +0000)]
spacing
reyk [Sun, 3 Aug 2014 20:39:40 +0000 (20:39 +0000)]
Dynamically pass HTTP request headers as protocol-specific HTTP_* CGI
meta-variables.
ok florian@
stsp [Sun, 3 Aug 2014 17:52:46 +0000 (17:52 +0000)]
Add ral(4) at pci and cardbus to RAMDISK on macppc; ok deraadt
stsp [Sun, 3 Aug 2014 17:52:10 +0000 (17:52 +0000)]
Add ral(4) at cardbus to GENERIC on macppc; ok deraadt
rpe [Sun, 3 Aug 2014 16:00:15 +0000 (16:00 +0000)]
smtpd got privsep'ed and the _smtpq user is now used to manage these
directories. Ensure proper ownership in case smtpd has been started
before this change.
brought up by matthieu@
OK deraadt@
jsg [Sun, 3 Aug 2014 14:35:30 +0000 (14:35 +0000)]
X509_NAME_get_text_by_NID() returns -1 on error so the type
the return value is stored in must be signed. Fixes a test for error.
ok jsing@ guenther@
jsg [Sun, 3 Aug 2014 14:30:28 +0000 (14:30 +0000)]
don't return unitialised memory on error in ehci_alloc_sqtd()
It seems mpi introduced a problem into ehci.c rev 1.162
two weeks ago. An error check that used to return NULL
now jumps to the end of the function, but sqtd isn't
initialised at that point.
ok miod@ deraadt@
jsg [Sun, 3 Aug 2014 14:23:59 +0000 (14:23 +0000)]
When stsp changed bwi_encap() for 30 bit addresses in rev 1.106 code
that used to always initialise the error variable is no longer run.
And at the end of bwi_encap() there is:
if (error)
m_freem(m);
return (error);
Fixing this prevents packet loss stsp was seeing.
ok stsp@ miod@ deraadt@
reyk [Sun, 3 Aug 2014 12:26:19 +0000 (12:26 +0000)]
Add function to iterate all headers. No functional change.
reyk [Sun, 3 Aug 2014 11:51:40 +0000 (11:51 +0000)]
The first server example should be the "minimal default" to illustrate
that you don't have to push all kinds of buttons to run httpd.
reyk [Sun, 3 Aug 2014 11:28:58 +0000 (11:28 +0000)]
More examples, include FastCGI for php and cgi-bin and logging.
reyk [Sun, 3 Aug 2014 11:16:10 +0000 (11:16 +0000)]
Split fastcgi socket path and document root option and add the
SCRIPT_FILENAME CGI param with a prepended root. This fixes php-fpm
that expects SCRIPT_FILENAME and also works with slowcgi if you
configure the root correctly. For example, if SCRIPT_NAME and
REQUEST_URI are /php/index.php, root is /htdocs, SCRIPT_FILENAME will
be /htdocs/php/index.php. As tested and discussed with florian@
reyk [Sun, 3 Aug 2014 10:38:42 +0000 (10:38 +0000)]
Add missing log call for FastCGI requests.
reyk [Sun, 3 Aug 2014 10:26:43 +0000 (10:26 +0000)]
Add another log mode "connection" for a relayd(8)-style log entry after
each connection, not every request. The code was already there and enabled
on debug, I just turned it into an alternative log format.
reyk [Sun, 3 Aug 2014 10:22:30 +0000 (10:22 +0000)]
Prefer getnameinfo() with NI_NUMERICHOST over inet_ntop because it is also
aware of the IPv6 scope Id. We already have a function print_host() that
uses getnameinfo, so no need for the inet_ntop cases. Confirmed by florian@
doug [Sat, 2 Aug 2014 21:21:47 +0000 (21:21 +0000)]
Locations now inherit access log settings from the server.
Add log to the server flags.
input/"Looks ok" reyk@
florian [Sat, 2 Aug 2014 17:42:24 +0000 (17:42 +0000)]
don't leak fcgi fd
florian [Sat, 2 Aug 2014 17:05:18 +0000 (17:05 +0000)]
Padding of fcgi records is optional, but if we receive padding data we
should read it.
florian [Sat, 2 Aug 2014 11:59:04 +0000 (11:59 +0000)]
We need to read from the fcgi bufferevent until it's empty because the
event handler will not be called again if no new data arrives.
Debugged with and OK reyk@
reyk [Sat, 2 Aug 2014 11:52:00 +0000 (11:52 +0000)]
Allow to specify a FastCGI TCP socket on localhost (eg. :9000). Used
for debugging, you should prefer local UNIX sockets, but it helped to
find an issue that will be fixed with the next commit.
OK florian@
reyk [Sat, 2 Aug 2014 10:24:36 +0000 (10:24 +0000)]
'fastcgi socket "path"' is the correct syntax; update the manpage.
Found by jsg@
reyk [Sat, 2 Aug 2014 09:54:13 +0000 (09:54 +0000)]
spacing
reyk [Sat, 2 Aug 2014 09:46:51 +0000 (09:46 +0000)]
scandir(3)-based directory auto index didn't work on NFS because the
file system is not filling in d_type properly. Using st_mode from the
stat call fixes the problem, eg. S_ISDIR(st.st_mode) instead of
dp->d_type == DT_DIR. Pointed out by pelikan@
jmc [Sat, 2 Aug 2014 08:07:07 +0000 (08:07 +0000)]
remove nasty unclosed Xo in previous; ok reyk
reyk [Fri, 1 Aug 2014 22:24:05 +0000 (22:24 +0000)]
Use the log buffer to defer the logging until the connection is closed
or the request completed. Turn the old log message into a debug message.
ok doug@
reyk [Fri, 1 Aug 2014 21:59:56 +0000 (21:59 +0000)]
remove the global "log updates/all" option that came from relayd.
doug [Fri, 1 Aug 2014 21:51:02 +0000 (21:51 +0000)]
Add common and combined access logging to httpd.
ok reyk@
florian [Fri, 1 Aug 2014 18:26:32 +0000 (18:26 +0000)]
Rewrite fcgi_add_param and hand over a lot more http headers etc. to
the cgi script.
OK reyk@
"blanket OK" for changes in httpd for the time beeing from deraadt@
florian [Fri, 1 Aug 2014 08:34:46 +0000 (08:34 +0000)]
Correctly parse fcgi records if we don't get the whole record in one
bufferevent_read().
Input/OK reyk@
rpe [Fri, 1 Aug 2014 04:57:01 +0000 (04:57 +0000)]
Don't return, just skip over non existing rc.conf or rc.conf.local file.
OK ajacoutot@ halex@
jsing [Fri, 1 Aug 2014 01:32:09 +0000 (01:32 +0000)]
When attempting to rebuild a softraid volume, use the actual data offset
from the volume metadata rather than the currently defined data offset.
This allows rebuilds to work correctly when the volume metadata has a
different data offset to that currently in use (for example, volumes
created prior to softraid gaining boot support).
Found the hard way by henning@
ok deraadt@
pelikan [Thu, 31 Jul 2014 19:49:25 +0000 (19:49 +0000)]
unbreak the build - e2fs_isave now needs the superblock.
pelikan [Thu, 31 Jul 2014 19:11:38 +0000 (19:11 +0000)]
always use the little-endian copy of a superblock.
Damn those memcpy-wrapping macros!
"do it" deraadt
jasper [Thu, 31 Jul 2014 18:14:46 +0000 (18:14 +0000)]
unbreak aac(4) by re-adding uvm_extern.h for ptoa()
ok deraadt@ sthen@
reyk [Thu, 31 Jul 2014 18:07:11 +0000 (18:07 +0000)]
Only write the HTTP header for the first fastcgi chunk.
reyk [Thu, 31 Jul 2014 17:55:09 +0000 (17:55 +0000)]
some fastcgi improvements:
- DPRINTF instead of log_info for internal debugging.
- submit QUERY_STRING, if it exists
- use a proper function to create an HTTP header.
- use server_file_error() to detect EOF and fastcgi stream errors.
- disable keep-alive/persist for now until we have a reliable way to
get the content length from the cgi response or support chunked
encoding.
"Cool, jep" florian@
pelikan [Thu, 31 Jul 2014 17:37:52 +0000 (17:37 +0000)]
use proper on-disk inode size: no more, no less.
Reported by Roman Yakovlev, thanks!
"do it now" deraadt
ajacoutot [Thu, 31 Jul 2014 14:57:41 +0000 (14:57 +0000)]
In debug mode, properly sort and drop duplicates so that we don't end
up with a confusing output like:
multicast_host >NO<
<...>
multicast_host >YES<
Also properly evaluate values _after_ running _rc_quirks() because these
can modify flags.
ok robert@ halex@
reyk [Thu, 31 Jul 2014 14:25:14 +0000 (14:25 +0000)]
One bufferevent can be shared by file and fcgi.
reyk [Thu, 31 Jul 2014 14:18:38 +0000 (14:18 +0000)]
Allow to specify a non-default fastcgi socket.
reyk [Thu, 31 Jul 2014 13:28:15 +0000 (13:28 +0000)]
Rename the "docroot" variable to "path" because it will be used for
either files or the fastcgi socket (and there's no need to use a union yet).
reyk [Thu, 31 Jul 2014 09:34:57 +0000 (09:34 +0000)]
Add a configuration variable "fastcgi" to enable it per server or location.
florian [Thu, 31 Jul 2014 09:23:53 +0000 (09:23 +0000)]
Put in first stab at fastcgi. Very early work in progress. Putting it
in now so that we can quickly work on it in tree. Requested by reyk@.
deraadt@ is OK with this according to reyk@.
deraadt [Wed, 30 Jul 2014 17:45:13 +0000 (17:45 +0000)]
sync
jsg [Wed, 30 Jul 2014 17:21:50 +0000 (17:21 +0000)]
unhook auxcpp
ajacoutot [Wed, 30 Jul 2014 16:54:09 +0000 (16:54 +0000)]
Properly warn when an example changes and the corresponding file is found
under /etc.
issue reported by Nathanael Rensen
"fine" deraadt@
jsg [Wed, 30 Jul 2014 16:46:17 +0000 (16:46 +0000)]
switch to tradcpp
jsg [Wed, 30 Jul 2014 16:34:24 +0000 (16:34 +0000)]
descend into tradcpp
jsg [Wed, 30 Jul 2014 16:33:11 +0000 (16:33 +0000)]
Add tradcpp 0.4, a standalone traditional whitespace preserving cpp
by David A. Holland of NetBSD.
reyk [Wed, 30 Jul 2014 13:49:48 +0000 (13:49 +0000)]
Make "location" work with name-based virtual servers.
ajacoutot [Wed, 30 Jul 2014 13:18:59 +0000 (13:18 +0000)]
Fix evil typo (multicast_hosts -> multicast_host).
espie [Wed, 30 Jul 2014 12:44:26 +0000 (12:44 +0000)]
prepare for post 5.6 packages, recognize special case where timestamp exist.
(specifically, this is a nop for 5.6, but it will allow changes to packages
without needing anything in pkg_add)
reyk [Wed, 30 Jul 2014 10:05:14 +0000 (10:05 +0000)]
Add "location" keyword to specify path-specific configuration in
servers, for example auto index for a sub-directory only. Internally,
a "location" is just a special type of a "virtual" server.
reyk [Wed, 30 Jul 2014 09:51:40 +0000 (09:51 +0000)]
Small fix and clarification
reyk [Wed, 30 Jul 2014 07:09:38 +0000 (07:09 +0000)]
Reserve an extra file descriptor per connection instead of per
request. This fixes fd accounting with persistent connections and
reduces the complexity of the implementation.
ok benno@
reyk [Tue, 29 Jul 2014 16:38:34 +0000 (16:38 +0000)]
The inflight decremented message should only be printed with DEBUG.