diff options
author | Andrej Zverev <az@FreeBSD.org> | 2015-02-17 21:03:05 +0000 |
---|---|---|
committer | Andrej Zverev <az@FreeBSD.org> | 2015-02-17 21:03:05 +0000 |
commit | 1f10808cedaacc749f62b0898b167f1550a3fc65 (patch) | |
tree | e04f7a74ee6c73e4acd1cdc15ea8b558b649b3be | |
parent | 31773f73ac4492474c7e004d4560f817c8a3baa3 (diff) | |
download | ports-1f10808cedaacc749f62b0898b167f1550a3fc65.tar.gz ports-1f10808cedaacc749f62b0898b167f1550a3fc65.zip |
- add new port: www/h2o
H2O is a very fast HTTP server written in C. It can also be used as a library.
It supports:
- HTTP/1.0, HTTP/1.1
- [HTTP/2](http://http2.github.io/)
- draft 16 (and draft 14 to support older clients)
- persistent connections
- chunked encoding
- negotiation methods: NPN, ALPN, Upgrade, direct
- dependency and weight-based prioritization
- server push
- TLS
- uses [OpenSSL](https://www.openssl.org/)
- forward secrecy
- AEAD ciphers
- OCSP stapling (automatically enabled)
- session resumption (internal memory)
- conditional GET using last-modified / etag
- mime-type configuration
- reverse proxy
- persistent upstream connection
PR: 197519
Submitted by: Dave Cottlehuber <dch@skunkwerks.at>
Notes
Notes:
svn path=/head/; revision=379190
-rw-r--r-- | www/Makefile | 1 | ||||
-rw-r--r-- | www/h2o/Makefile | 57 | ||||
-rw-r--r-- | www/h2o/distinfo | 2 | ||||
-rw-r--r-- | www/h2o/files/h2o.conf.sample | 27 | ||||
-rw-r--r-- | www/h2o/files/h2o.in | 46 | ||||
-rw-r--r-- | www/h2o/pkg-descr | 23 | ||||
-rw-r--r-- | www/h2o/pkg-plist | 5 |
7 files changed, 161 insertions, 0 deletions
diff --git a/www/Makefile b/www/Makefile index c01dae2e5eb5..cf9387bd7308 100644 --- a/www/Makefile +++ b/www/Makefile @@ -235,6 +235,7 @@ SUBDIR += gtkhtml4 SUBDIR += guile-www SUBDIR += gurlchecker + SUBDIR += h2o SUBDIR += habari SUBDIR += hastymail SUBDIR += hastymail2 diff --git a/www/h2o/Makefile b/www/h2o/Makefile new file mode 100644 index 000000000000..a8807482a3f8 --- /dev/null +++ b/www/h2o/Makefile @@ -0,0 +1,57 @@ +# Created by: Dave Cottlehuber <dch@skunkwerks.at> +# $FreeBSD$ + +PORTNAME= h2o +PORTVERSION= 0.9.2 +CATEGORIES= www + +MAINTAINER= dch@skunkwerks.at +COMMENT= Optimized HTTP2 server with support for HTTP/1.x + +LICENSE= MIT + +LIB_DEPENDS= libyaml.so:${PORTSDIR}/textproc/libyaml + +USE_GITHUB= yes +GH_ACCOUNT= h2o +GH_TAGNAME= v0.9.2 +GH_COMMIT= 5e20cff + +MAKE_JOBS_UNSAFE= yes +USES= cmake:outsource + +USE_OPENSSL= yes + +PORTDOCS= README.md + +SUB_FILES= ${PORTNAME} +SUB_LIST+= H2O_USER=${H2O_USER} \ + H2O_GROUP=${H2O_GROUP} \ + H2O_PIDDIR=${H2O_PIDDIR} \ + H2O_LOGDIR=${H2O_LOGDIR} + +PLIST_SUB= H2O_USER=${H2O_USER} \ + H2O_GROUP=${H2O_GROUP} \ + H2O_PIDDIR=${H2O_PIDDIR} \ + H2O_LOGDIR=${H2O_LOGDIR} + +H2O_USER?= www +H2O_GROUP?= www + +H2O_LOGDIR= /var/log/${PORTNAME}/ +H2O_PIDDIR= /var/run/${PORTNAME}/ + +USE_RC_SUBR= ${PORTNAME} + +do-install: + ${MKDIR} ${STAGEDIR}${DOCSDIR} \ + ${STAGEDIR}${ETCDIR} \ + ${STAGEDIR}${H2O_PIDDIR} \ + ${STAGEDIR}${H2O_LOGDIR} + ${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} \ + ${FILESDIR}/${PORTNAME}.conf.sample \ + ${STAGEDIR}${ETCDIR}/${PORTNAME}.conf.sample + ${INSTALL_PROGRAM} ${WRKDIR}/.build/h2o ${STAGEDIR}${PREFIX}/bin/h2o + +.include <bsd.port.mk> diff --git a/www/h2o/distinfo b/www/h2o/distinfo new file mode 100644 index 000000000000..e4a7a0867d7c --- /dev/null +++ b/www/h2o/distinfo @@ -0,0 +1,2 @@ +SHA256 (h2o-0.9.2.tar.gz) = c7d50856231b10bb7662356842283a99b5505f983765ea3c6c347daff6302a9f +SIZE (h2o-0.9.2.tar.gz) = 775547 diff --git a/www/h2o/files/h2o.conf.sample b/www/h2o/files/h2o.conf.sample new file mode 100644 index 000000000000..387b0885bdfc --- /dev/null +++ b/www/h2o/files/h2o.conf.sample @@ -0,0 +1,27 @@ +# vi: ft=yaml +# to find out the configuration commands, run: h2o --help +listen: 80 +listen: + port: 443 + ssl: + minimum-version: TLSv1.2 + # generate your own certificates + certificate-file: /usr/local/etc/h2o/server.crt + key-file: /usr/local/etc/h2o/server.key +access-log: /var/log/h2o/h2o.log +file.dirlisting: on +# per-host configuration +hosts: + my.example.org: + paths: + "/": + file.dir: "/usr/local/www/data/my.example.org" + pkg.example.org: + # virtual directory layout + paths: + "/poudriere": + file.dir: "/usr/local/poudriere/data/logs/bulk" + "/FreeBSD:10:amd64": + file.dir: "/usr/local/poudriere/data/packages/10_1_amd64-default/" + "/FreeBSD:11:amd64": + file.dir: "/usr/local/poudriere/data/packages/current_amd64-default/" diff --git a/www/h2o/files/h2o.in b/www/h2o/files/h2o.in new file mode 100644 index 000000000000..455d9df1a752 --- /dev/null +++ b/www/h2o/files/h2o.in @@ -0,0 +1,46 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: h2o +# REQUIRE: LOGIN DAEMON NETWORKING +# KEYWORD: shutdown + +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# h2o_enable (bool): Set to NO by default. +# Set it to YES to enable h2o. +# +# h2o_config (string): Optional full path for h2o config file +# h2o_user (user): Set to h2o by default. +# h2o_group (group): Set to h2o by default. + +. /etc/rc.subr + +name=h2o +rcvar=h2o_enable + +# defaults +: ${h2o_enable:="NO"} +: ${h2o_user:="%%H2O_USER%%"} +: ${h2o_group:="%%H2O_GROUP%%"} +: ${h2o_config:="%%PREFIX%%/etc/${name}/${name}.conf"} +: ${h2o_options:=" --conf ${h2o_config}"} + +# daemon +h2o_pidfile="%%H2O_PIDDIR%%${name}.pid" +procname="%%PREFIX%%/bin/${name}" +command=/usr/sbin/daemon +command_args=" -f -c -r -p ${h2o_pidfile} ${procname} ${h2o_options}" +start_precmd="h2o_precmd" + +h2o_precmd() +{ + # create empty pidfile with correct permissions + install -o ${h2o_user} /dev/null ${h2o_pidfile} +} + +load_rc_config $name +run_rc_command "$1" diff --git a/www/h2o/pkg-descr b/www/h2o/pkg-descr new file mode 100644 index 000000000000..9aafe7a6ac91 --- /dev/null +++ b/www/h2o/pkg-descr @@ -0,0 +1,23 @@ +H2O is a very fast HTTP server written in C. It can also be used as a library. +It supports: + +- HTTP/1.0, HTTP/1.1 +- [HTTP/2](http://http2.github.io/) +- draft 16 (and draft 14 to support older clients) +- persistent connections +- chunked encoding +- negotiation methods: NPN, ALPN, Upgrade, direct +- dependency and weight-based prioritization +- server push +- TLS +- uses [OpenSSL](https://www.openssl.org/) +- forward secrecy +- AEAD ciphers +- OCSP stapling (automatically enabled) +- session resumption (internal memory) +- conditional GET using last-modified / etag +- mime-type configuration +- reverse proxy +- persistent upstream connection + +WWW: http://github.com/h2o/h2o diff --git a/www/h2o/pkg-plist b/www/h2o/pkg-plist new file mode 100644 index 000000000000..2d658128191f --- /dev/null +++ b/www/h2o/pkg-plist @@ -0,0 +1,5 @@ +bin/h2o +@dir(%%H2O_USER%%,%%H2O_GROUP%%,0750) %%H2O_LOGDIR%% +@dir(%%H2O_USER%%,%%H2O_GROUP%%,0750) %%H2O_PIDDIR%% +@dir(%%H2O_USER%%,%%H2O_GROUP%%,0750) %%ETCDIR%% +@sample %%ETCDIR%%/h2o.conf.sample |