Commits


gotwebd: allow to change the user ok stsp@


got{,web}d: unify log.c gotd and gotwebd are using almost the same log.c file, so unify. This only slightly changes gotwebd logs to include the process name, like gotd. ok stsp@


gotwebd: remove unix_socket_name Now that `listen' is a top-level, `unix_socket_name' is useless. The default socket remains /var/www/run/gotweb.sock, to listen on an alternate socket now `listen on socket "/some/other/sock" can be used. part of a larger diff that's ok stsp@


gotwebd: make `listen' a top-level statement gotwebd only uses the server name (i.e. the Host HTTP header) to match the server blocks. Since gotwebd by design sits behind an http server which is expected to filter virtual hosts, there's little point in having `listen' per-server. part of a larger diff that's ok stsp@


gotwebd: simplify handling of unix sockets - don't assume an implicit "listen on socket" when another listen was specified in a server block - allow servers to share the sockets they're listening on - fix unix_socket_name; now it's actually used - remove `listen on socket off' and `unix_socket off' options that are now no longer useful - unify the internal handling of the sockets, i.e. don't consider unix socket special. ok tracey@


gotwebd: plug leak in get_addrs() error path h is free'd by add_addr in case of error, but we still leak the getaddrinfo result. while here make the check strictier: addr_addr() fails with -1.


gotwebd: retire max_repos setting Unlike max_repos_display which limits the number of items per page, max_repos is an hard-limit on the number of repos gotwebd would process. "kill it with fire" tracey@ about the idea ok stsp


gotwebd: add knob for the number of tags and commits in the summary page ok jamsek


gotwebd: get rid of proc.[ch] proc.c really shines when there's a network of different types of processes, potentially with a various number of instances each, that needs to exchange messages. Gotwebd instead has a much simpler design, and using proc.c causes more overhead (/headaches) than it solves. So, this attempts to provide the same functionalities but with a much simpler implementation that fits gotwebd better. ok stsp@


gotwebd: clean up sockets_create_socket a bit Instead of hardcoding the flags, keep ai_{family,socktype,protocol} from the getaddrinfo() call and apply them here. ok stsp@


gotadmin: get rid of got_sockaddr.[ch] usage It was added due to gotwebd weird structure sockaddr_storage handling. Instead, save the size reported by getaddrinfo() and not reach into the struct sockaddr_storage at all (except for extracting the port number for diagnostics purposes.) sockets_conf_new_socket_fcgi() gets an hardcoded ipproto to zero (which is the only value it can get in practice, and keeps for the moment the hardcoded SOCK_STREAM. It'll be cleaned in a follow-up. ok stsp@


gotwebd: improve error message in get_addrs(); noticed by stsp@


gotwebd: make get_addrs() take the service name directly This changes how we handle the port number: bubbles up the local portstr added in previous commit and lets getaddrinfo() deals with port numbers and services name. getservice() can be gc. While here add the missing free() in parse.y. ok stsp@


fix typo in previous


gotwebd: merge host() and get_addrs(); use * instead of "" for any addr ok plus tweaks stsp@


gotwebd: disable listening on interfaces ok stsp@


gotwebd: remove dead ipproto handling in host() and host_if() ipproto is always -1, so delete the dead code. ok stsp@


gotwebd.conf: unbreak max_repos_display 0 in 1a0c81fb61 I've added a range check too strict for max_repos_display, as zero is allowed and means "show all the repositories".


gotwebd: set chroot path in config_init() saves a bit fiddling around with ternary operators. sockets_run() will reset the chroot to the default since it calls again config_init(), but at that stage it's not important anymore. ok stsp@


gotwebd.conf: error if chroot is the empty string


gotwebd.conf: range-check numeric values and raise errors


gotwebd.conf: disallow yes/no for booleans Supporting both "no" and "on" as valid syntax with an opposite meaning could easily result in accidental misconfiguration. Suggested by stsp, tracey agrees. Patch by Josiah Frentsos, thanks!


gotwebd: disallow 1 for max_commits_display and report range errors ok stsp


PF_UNSPEC -> AF_UNSPEC While they're the same value, it's more correct to use AF_UNSPEC in this case. While here, change SOCK_DGRAM to SOCK_STREAM since it's what we'll be using. ok stsp@


remove host, host_v4 and host_v6; rename host_dns -> host host_dns() (now just host()) uses getaddrinfo() which knows already how to handle IPv4/IPv6 addresses. Saves a good amount of duplication. ok stsp@