diff options
Diffstat (limited to 'nixpkgs/pkgs/servers/http')
60 files changed, 2400 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/http/4store/4store-1.1.6-glibc-2.26.patch b/nixpkgs/pkgs/servers/http/4store/4store-1.1.6-glibc-2.26.patch new file mode 100644 index 000000000000..dda21c54f693 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/4store/4store-1.1.6-glibc-2.26.patch @@ -0,0 +1,12 @@ +diff --git a/src/frontend/filter-datatypes.c b/src/frontend/filter-datatypes.c +index 8aae1dd..49ed358 100644 +--- a/src/frontend/filter-datatypes.c ++++ b/src/frontend/filter-datatypes.c +@@ -23,6 +23,7 @@ + #include <string.h> + #include <math.h> + #define __USE_MISC ++#define __USE_XOPEN_EXTENDED + #include <time.h> + + #include "filter.h" diff --git a/nixpkgs/pkgs/servers/http/4store/default.nix b/nixpkgs/pkgs/servers/http/4store/default.nix new file mode 100644 index 000000000000..664953ca34dc --- /dev/null +++ b/nixpkgs/pkgs/servers/http/4store/default.nix @@ -0,0 +1,50 @@ +{ stdenv, fetchFromGitHub, librdf_raptor +, librdf_rasqal, glib, libxml2, pcre +, avahi, readline, ncurses, expat, autoreconfHook +, zlib, pkgconfig, which, perl, libuuid +, gmp, mpfr +, db_dir ? "/var/lib/4store" }: + + +stdenv.mkDerivation rec { + name = "4store-${version}"; + version = "1.1.6"; + + src = fetchFromGitHub { + owner = "4store"; + repo = "4store"; + rev = "v${version}"; + sha256 = "1kzdfmwpzy64cgqlkcz5v4klwx99w0jk7afckyf7yqbqb4rydmpk"; + }; + + patches = [ ./4store-1.1.6-glibc-2.26.patch ]; + + nativeBuildInputs = [ autoreconfHook perl pkgconfig which ]; + + buildInputs = [ librdf_raptor librdf_rasqal glib libxml2 pcre + avahi readline ncurses expat zlib libuuid gmp mpfr ]; + + # needed for ./autogen.sh + prePatch = '' + echo "${version}" > .version + ''; + + preConfigure = '' + sed -e 's@#! */bin/bash@#! ${stdenv.shell}@' -i configure + find . -name Makefile -exec sed -e "s@/usr/local@$out@g" -i '{}' ';' + + rm src/utilities/4s-backend + sed -e 's@/var/lib/4store@${db_dir}@g' -i configure.ac src/utilities/* + sed -e '/FS_STORE_ROOT/d' -i src/utilities/Makefile* + ''; + + enableParallelBuilding = true; + + meta = with stdenv.lib; { + description = "SparQL query server (RDF storage)"; + homepage = https://4store.danielknoell.de/; + maintainers = with maintainers; [ raskin ]; + platforms = platforms.linux; + broken = true; # since 2018-04-11 + }; +} diff --git a/nixpkgs/pkgs/servers/http/4store/src-for-default.nix b/nixpkgs/pkgs/servers/http/4store/src-for-default.nix new file mode 100644 index 000000000000..7076b921911e --- /dev/null +++ b/nixpkgs/pkgs/servers/http/4store/src-for-default.nix @@ -0,0 +1,9 @@ +rec { + version="v1.1.5"; + name="4store-v1.1.5"; + hash="0nwckvf8xqwvc2h3v6s1rvmxvcx2xrjy6yapghc052180jw6zp9b"; + url="http://4store.org/download/4store-${version}.tar.gz"; + advertisedUrl="http://4store.org/download/4store-v1.1.5.tar.gz"; + + +} diff --git a/nixpkgs/pkgs/servers/http/4store/src-info-for-default.nix b/nixpkgs/pkgs/servers/http/4store/src-info-for-default.nix new file mode 100644 index 000000000000..91a9bad92def --- /dev/null +++ b/nixpkgs/pkgs/servers/http/4store/src-info-for-default.nix @@ -0,0 +1,6 @@ +{ + downloadPage = "http://4store.org/download/"; + baseName = "4store"; + choiceCommand = "tail -n 1"; + versionExtractorSedScript = "s@.*-(v[0-9.]+)[.].*@\\1@"; +} diff --git a/nixpkgs/pkgs/servers/http/apache-httpd/2.4.nix b/nixpkgs/pkgs/servers/http/apache-httpd/2.4.nix new file mode 100644 index 000000000000..bf82e916590b --- /dev/null +++ b/nixpkgs/pkgs/servers/http/apache-httpd/2.4.nix @@ -0,0 +1,100 @@ +{ stdenv, fetchurl, perl, zlib, apr, aprutil, pcre, libiconv, lynx +, proxySupport ? true +, sslSupport ? true, openssl +, http2Support ? true, nghttp2 +, ldapSupport ? true, openldap +, libxml2Support ? true, libxml2 +, brotliSupport ? true, brotli +, luaSupport ? false, lua5 +}: + +let inherit (stdenv.lib) optional optionalString; +in + +assert sslSupport -> aprutil.sslSupport && openssl != null; +assert ldapSupport -> aprutil.ldapSupport && openldap != null; +assert http2Support -> nghttp2 != null; + +stdenv.mkDerivation rec { + version = "2.4.37"; + name = "apache-httpd-${version}"; + + src = fetchurl { + url = "mirror://apache/httpd/httpd-${version}.tar.bz2"; + sha256 = "09npb7vlz5sizgj0nvl0bqxj9zig29ipkp07fgmw5ykjcxfdr61l"; + }; + + # FIXME: -dev depends on -doc + outputs = [ "out" "dev" "man" "doc" ]; + setOutputFlags = false; # it would move $out/modules, etc. + + buildInputs = [perl] ++ + optional brotliSupport brotli ++ + optional sslSupport openssl ++ + optional ldapSupport openldap ++ # there is no --with-ldap flag + optional libxml2Support libxml2 ++ + optional http2Support nghttp2 ++ + optional stdenv.isDarwin libiconv; + + prePatch = '' + sed -i config.layout -e "s|installbuilddir:.*|installbuilddir: $dev/share/build|" + sed -i support/apachectl.in -e 's|@LYNX_PATH@|${lynx}/bin/lynx|' + ''; + + # Required for ‘pthread_cancel’. + NIX_LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s"; + + preConfigure = '' + configureFlags="$configureFlags --includedir=$dev/include" + ''; + + configureFlags = [ + "--with-apr=${apr.dev}" + "--with-apr-util=${aprutil.dev}" + "--with-z=${zlib.dev}" + "--with-pcre=${pcre.dev}" + "--disable-maintainer-mode" + "--disable-debugger-mode" + "--enable-mods-shared=all" + "--enable-mpms-shared=all" + "--enable-cern-meta" + "--enable-imagemap" + "--enable-cgi" + (stdenv.lib.enableFeature proxySupport "proxy") + (stdenv.lib.enableFeature sslSupport "ssl") + (stdenv.lib.withFeatureAs libxml2Support "libxml2" "${libxml2.dev}/include/libxml2") + "--docdir=$(doc)/share/doc" + + (stdenv.lib.enableFeature brotliSupport "brotli") + (stdenv.lib.withFeatureAs brotliSupport "brotli" brotli) + + (stdenv.lib.enableFeature http2Support "http2") + (stdenv.lib.withFeature http2Support "nghttp2") + + (stdenv.lib.enableFeature luaSupport "lua") + (stdenv.lib.withFeatureAs luaSupport "lua" lua5) + ]; + + enableParallelBuilding = true; + + stripDebugList = "lib modules bin"; + + postInstall = '' + mkdir -p $doc/share/doc/httpd + mv $out/manual $doc/share/doc/httpd + mkdir -p $dev/bin + mv $out/bin/apxs $dev/bin/apxs + ''; + + passthru = { + inherit apr aprutil sslSupport proxySupport ldapSupport; + }; + + meta = with stdenv.lib; { + description = "Apache HTTPD, the world's most popular web server"; + homepage = http://httpd.apache.org/; + license = licenses.asl20; + platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; + maintainers = with maintainers; [ lovek323 peti ]; + }; +} diff --git a/nixpkgs/pkgs/servers/http/apache-modules/mod_auth_mellon/default.nix b/nixpkgs/pkgs/servers/http/apache-modules/mod_auth_mellon/default.nix new file mode 100644 index 000000000000..8a773631ee6c --- /dev/null +++ b/nixpkgs/pkgs/servers/http/apache-modules/mod_auth_mellon/default.nix @@ -0,0 +1,39 @@ +{ stdenv, apacheHttpd, autoconf, automake, autoreconfHook, curl, fetchFromGitHub, glib, lasso, libtool, libxml2, libxslt, openssl, pkgconfig, xmlsec }: + +stdenv.mkDerivation rec { + + name = "mod_auth_mellon-${version}"; + version = "0.13.1"; + + src = fetchFromGitHub { + owner = "UNINETT"; + repo = "mod_auth_mellon"; + rev = "v${version}"; + sha256 = "16b43y5a5p8g1287x04rv923230cy8dfs2j18cx6208n4bv4dvnk"; + }; + + patches = [ + ./fixdeps.patch + ]; + + nativeBuildInputs = [ autoreconfHook pkgconfig ]; + buildInputs = [ apacheHttpd autoconf automake curl glib lasso libtool libxml2 libxslt openssl xmlsec ]; + + configureFlags = ["--with-apxs2=${apacheHttpd.dev}/bin/apxs" "--exec-prefix=$out"]; + + installPhase = '' + mkdir -p $out/bin + cp ./mellon_create_metadata.sh $out/bin + mkdir -p $out/modules + cp ./.libs/mod_auth_mellon.so $out/modules + ''; + + meta = with stdenv.lib; { + homepage = https://github.com/UNINETT/mod_auth_mellon; + description = "An Apache module with a simple SAML 2.0 service provider"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ womfoo ]; + }; + +} diff --git a/nixpkgs/pkgs/servers/http/apache-modules/mod_auth_mellon/fixdeps.patch b/nixpkgs/pkgs/servers/http/apache-modules/mod_auth_mellon/fixdeps.patch new file mode 100644 index 000000000000..63b69fb142f6 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/apache-modules/mod_auth_mellon/fixdeps.patch @@ -0,0 +1,30 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -74,6 +74,16 @@ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.12]) + AC_SUBST(GLIB_CFLAGS) + AC_SUBST(GLIB_LIBS) + ++#include <libxml/uri.h> ++PKG_CHECK_MODULES(LIBXML2, libxml-2.0) ++AC_SUBST(LIBXML2_CFLAGS) ++AC_SUBST(LIBXML2_LIBS) ++ ++#include <xmlsec/xmlenc.h> ++PKG_CHECK_MODULES(XMLSEC, xmlsec1-openssl) ++AC_SUBST(XMLSEC_CFLAGS) ++AC_SUBST(XMLSEC_LIBS) ++ + # Test to see if we can include lasso/utils.h + # AC_CHECK_HEADER won't work correctly unless we specifiy the include directories + # found in the LASSO_CFLAGS. Save and restore CFLAGS and CPPFLAGS. +--- a/Makefile.in ++++ b/Makefile.in +@@ -25,7 +25,7 @@ + all: mod_auth_mellon.la + + mod_auth_mellon.la: $(SRC) auth_mellon.h auth_mellon_compat.h +- @APXS2@ -Wc,"-std=c99 @OPENSSL_CFLAGS@ @LASSO_CFLAGS@ @CURL_CFLAGS@ @GLIB_CFLAGS@ @CFLAGS@" -Wl,"@OPENSSL_LIBS@ @LASSO_LIBS@ @CURL_LIBS@ @GLIB_LIBS@" -Wc,-Wall -Wc,-g -c $(SRC) ++ @APXS2@ -Wc,"-std=c99 @OPENSSL_CFLAGS@ @LASSO_CFLAGS@ @CURL_CFLAGS@ @GLIB_CFLAGS@ @CFLAGS@ @LIBXML2_CFLAGS@ @XMLSEC_CFLAGS@ @CFLAGS@" -Wl,"@OPENSSL_LIBS@ @LASSO_LIBS@ @CURL_LIBS@ @GLIB_LIBS@ @LIBXML2_LIBS@ @XMLSEC_LIBS@" -Wc,-Wall -Wc,-g -c $(SRC) + + + # Building configure (for distribution) diff --git a/nixpkgs/pkgs/servers/http/apache-modules/mod_dnssd/default.nix b/nixpkgs/pkgs/servers/http/apache-modules/mod_dnssd/default.nix new file mode 100644 index 000000000000..d681146eee5d --- /dev/null +++ b/nixpkgs/pkgs/servers/http/apache-modules/mod_dnssd/default.nix @@ -0,0 +1,33 @@ +{ stdenv, fetchurl, fetchpatch, pkgconfig, apacheHttpd, apr, avahi }: + +stdenv.mkDerivation rec { + name = "mod_dnssd-0.6"; + + src = fetchurl { + url = "http://0pointer.de/lennart/projects/mod_dnssd/${name}.tar.gz"; + sha256 = "2cd171d76eba398f03c1d5bcc468a1756f4801cd8ed5bd065086e4374997c5aa"; + }; + + configureFlags = [ "--disable-lynx" ]; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ apacheHttpd avahi apr ]; + + patches = [ (fetchpatch { + url = "http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/vivid/mod-dnssd/vivid/download/package-import%40ubuntu.com-20130530193334-kqebiy78q534or5k/portforapache2.4.pat-20130530222510-7tlw5btqchd04edb-3/port-for-apache2.4.patch"; + sha256 = "1hgcxwy1q8fsxfqyg95w8m45zbvxzskf1jxd87ljj57l7x1wwp4r"; + }) ]; + + installPhase = '' + mkdir -p $out/modules + cp src/.libs/mod_dnssd.so $out/modules + ''; + + meta = with stdenv.lib; { + homepage = http://0pointer.de/lennart/projects/mod_dnssd; + description = "Provide Zeroconf support via DNS-SD using Avahi"; + license = licenses.asl20; + platforms = platforms.linux; + maintainers = with maintainers; [ lethalman ]; + }; +} diff --git a/nixpkgs/pkgs/servers/http/apache-modules/mod_evasive/default.nix b/nixpkgs/pkgs/servers/http/apache-modules/mod_evasive/default.nix new file mode 100644 index 000000000000..2b8693f7379d --- /dev/null +++ b/nixpkgs/pkgs/servers/http/apache-modules/mod_evasive/default.nix @@ -0,0 +1,35 @@ +{ lib, stdenv, fetchurl, apacheHttpd }: + +if lib.versionAtLeast (lib.getVersion apacheHttpd) "2.4" then + + throw "mod_evasive is not supported on Apache httpd 2.4" + +else + +stdenv.mkDerivation { + name = "mod_evasive-1.10.1"; + + src = fetchurl { + url = http://www.zdziarski.com/blog/wp-content/uploads/2010/02/mod_evasive_1.10.1.tar.gz; + sha256 = "0rsnx50rjv6xygbp9r0gyss7xqdkcb0hy3wh9949jf1im8wm3i07"; + }; + + buildInputs = [ apacheHttpd ]; + + buildPhase = '' + export APACHE_LIBEXECDIR=$out/modules + export makeFlagsArray=(APACHE_LIBEXECDIR=$out/modules) + apxs -ca mod_evasive20.c + ''; + + installPhase = '' + mkdir -p $out/modules + cp .libs/mod_evasive20.so $out/modules + ''; + + meta = { + homepage = http://www.zdziarski.com/blog/?page_id=442; + description = "Evasive maneuvers module for Apache to provide evasive action in the event of an HTTP DoS or DDoS attack or brute force attack"; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/servers/http/apache-modules/mod_fastcgi/default.nix b/nixpkgs/pkgs/servers/http/apache-modules/mod_fastcgi/default.nix new file mode 100644 index 000000000000..647589621029 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/apache-modules/mod_fastcgi/default.nix @@ -0,0 +1,44 @@ +{ stdenv, fetchurl, apacheHttpd }: + +stdenv.mkDerivation rec { + name = "mod_fastcgi-2.4.6"; + + src = fetchurl { + url = "http://www.fastcgi.com/dist/${name}.tar.gz"; + sha256 = "12g6vcfl9jl8rqf8lzrkdxg2ngca310d3d6an563xqcgrkp8ga55"; + }; + + patches = + [ (fetchurl { + name = "compile-against-apache24.diff"; + url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/compile-against-apache24.diff?h=packages/mod_fastcgi&id=81c7cb99d15682df3bdb1edcaeea5259e9e43a42"; + sha256 = "000qvrf5jb979i37rimrdivcgjijcffgrpkx38c0rn62z9jz61g4"; + }) + ]; + + buildInputs = [ apacheHttpd ]; + + preBuild = '' + cp Makefile.AP2 Makefile + makeFlags="top_dir=${apacheHttpd.dev}/share prefix=$out" + ''; + + meta = { + homepage = http://www.fastcgi.com/; + description = "Provide support for the FastCGI protocol"; + + longDescription = '' + mod_fastcgi is a module for the Apache web server that enables + FastCGI - a standards based protocol for communicating with + applications that generate dynamic content for web pages. FastCGI + provides a superset of CGI functionality, but a subset of the + functionality of programming for a particular web server API. + Nonetheless, the feature set is rich enough for programming + virtually any type of web application, but the result is generally + more scalable. + ''; + + platforms = stdenv.lib.platforms.linux; + maintainers = [ stdenv.lib.maintainers.peti ]; + }; +} diff --git a/nixpkgs/pkgs/servers/http/apache-modules/mod_perl/default.nix b/nixpkgs/pkgs/servers/http/apache-modules/mod_perl/default.nix new file mode 100644 index 000000000000..04746d678c52 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/apache-modules/mod_perl/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchurl, apacheHttpd, perl }: + +stdenv.mkDerivation rec { + name = "mod_perl-2.0.10"; + + src = fetchurl { + url = "mirror://apache/perl/${name}.tar.gz"; + sha256 = "0r1bhzwl5gr0202r6448943hjxsickzn55kdmb7dzad39vnq7kyi"; + }; + + buildInputs = [ apacheHttpd perl ]; + buildPhase = '' + perl Makefile.PL \ + MP_APXS=${apacheHttpd.dev}/bin/apxs + make + ''; + installPhase = '' + mkdir -p $out + make install DESTDIR=$out + mv $out${apacheHttpd}/* $out + mv $out${apacheHttpd.dev}/* $out + mv $out${perl}/* $out + rm $out/nix -rf + ''; +} diff --git a/nixpkgs/pkgs/servers/http/apache-modules/mod_python/default.nix b/nixpkgs/pkgs/servers/http/apache-modules/mod_python/default.nix new file mode 100644 index 000000000000..f947bf535cc9 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/apache-modules/mod_python/default.nix @@ -0,0 +1,33 @@ +{ stdenv, fetchurl, apacheHttpd, python2 }: + +stdenv.mkDerivation rec { + name = "mod_python-3.5.0"; + + src = fetchurl { + url = "http://dist.modpython.org/dist/${name}.tgz"; + sha256 = "146apll3yfqk05s8fkf4acmxzqncl08bgn4rv0c1rd4qxmc91w0f"; + }; + + patches = [ ./install.patch ]; + + postPatch = '' + substituteInPlace dist/version.sh \ + --replace 'GIT=`git describe --always`' "" \ + --replace '-$GIT' "" + ''; + + preInstall = '' + installFlags="LIBEXECDIR=$out/modules $installFlags" + mkdir -p $out/modules $out/bin + ''; + + passthru = { inherit apacheHttpd; }; + + buildInputs = [ apacheHttpd python2 ]; + + meta = { + homepage = http://modpython.org/; + description = "An Apache module that embeds the Python interpreter within the server"; + platforms = stdenv.lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/servers/http/apache-modules/mod_python/install.patch b/nixpkgs/pkgs/servers/http/apache-modules/mod_python/install.patch new file mode 100644 index 000000000000..29667e11ed8e --- /dev/null +++ b/nixpkgs/pkgs/servers/http/apache-modules/mod_python/install.patch @@ -0,0 +1,12 @@ +diff -ru -x '*~' mod_python-3.5.0-orig/dist/Makefile.in mod_python-3.5.0/dist/Makefile.in +--- mod_python-3.5.0-orig/dist/Makefile.in 2013-11-12 04:21:34.000000000 +0100 ++++ mod_python-3.5.0/dist/Makefile.in 2014-11-07 11:28:24.466377733 +0100 +@@ -34,7 +34,7 @@ + install_py_lib: mod_python src + @cd src; $(MAKE) psp_parser.c + if test -z "$(DESTDIR)" ; then \ +- $(PYTHON_BIN) setup.py install --optimize 2 --force ; \ ++ $(PYTHON_BIN) setup.py install --optimize 2 --force --prefix $(out) ; \ + else \ + $(PYTHON_BIN) setup.py install --optimize 2 --force --root $(DESTDIR) ; \ + fi diff --git a/nixpkgs/pkgs/servers/http/apache-modules/mod_wsgi/default.nix b/nixpkgs/pkgs/servers/http/apache-modules/mod_wsgi/default.nix new file mode 100644 index 000000000000..19a9be8e86e8 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/apache-modules/mod_wsgi/default.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchurl, apacheHttpd, python2 }: + +stdenv.mkDerivation rec { + name = "mod_wsgi-${version}"; + version = "4.6.5"; + + src = fetchurl { + url = "https://github.com/GrahamDumpleton/mod_wsgi/archive/${version}.tar.gz"; + sha256 = "1q75ifadjd5frr5i2b9swbjiwfv4fr4ny8npsm09w6mjp7w0bgjw"; + }; + + buildInputs = [ apacheHttpd python2 ]; + + patchPhase = '' + sed -r -i -e "s|^LIBEXECDIR=.*$|LIBEXECDIR=$out/modules|" \ + ${if stdenv.isDarwin then "-e 's|/usr/bin/lipo|lipo|'" else ""} \ + configure + ''; + + meta = { + homepage = https://github.com/GrahamDumpleton/mod_wsgi; + description = "Host Python applications in Apache through the WSGI interface"; + license = stdenv.lib.licenses.asl20; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/servers/http/apache-modules/tomcat-connectors/default.nix b/nixpkgs/pkgs/servers/http/apache-modules/tomcat-connectors/default.nix new file mode 100644 index 000000000000..138864aec7d0 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/apache-modules/tomcat-connectors/default.nix @@ -0,0 +1,33 @@ +{ stdenv, fetchurl, apacheHttpd, jdk }: + +stdenv.mkDerivation rec { + name = "tomcat-connectors-1.2.46"; + + src = fetchurl { + url = "mirror://apache/tomcat/tomcat-connectors/jk/${name}-src.tar.gz"; + sha256 = "1sfbcsmshjkj4wc969ngjcxhjyp4mbkjprbs111d1b0x3l7547by"; + }; + + configureFlags = [ + "--with-apxs=${apacheHttpd.dev}/bin/apxs" + "--with-java-home=${jdk}" + ]; + + setSourceRoot = '' + sourceRoot=$(echo */native) + ''; + + installPhase = '' + mkdir -p $out/modules + cp apache-2.0/mod_jk.so $out/modules + ''; + + buildInputs = [ apacheHttpd jdk ]; + + meta = with stdenv.lib; { + description = "Provides web server plugins to connect web servers with Tomcat"; + homepage = https://tomcat.apache.org/download-connectors.cgi; + license = licenses.asl20; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/servers/http/apt-cacher-ng/default.nix b/nixpkgs/pkgs/servers/http/apt-cacher-ng/default.nix new file mode 100644 index 000000000000..aa826a9c528b --- /dev/null +++ b/nixpkgs/pkgs/servers/http/apt-cacher-ng/default.nix @@ -0,0 +1,34 @@ +{ stdenv +, bzip2 +, cmake +, doxygen +, fetchurl +, fuse +, lzma +, openssl +, pkgconfig +, systemd +, tcp_wrappers +, zlib +}: + +stdenv.mkDerivation rec { + name = "apt-cacher-ng-${version}"; + version = "3.2"; + + src = fetchurl { + url = "http://ftp.debian.org/debian/pool/main/a/apt-cacher-ng/apt-cacher-ng_${version}.orig.tar.xz"; + sha256 = "1kas5xq44rx33pczhrz05dsdhjaavxdmcs5h1ygfi76bpqvyhpa0"; + }; + + nativeBuildInputs = [ cmake doxygen pkgconfig ]; + buildInputs = [ bzip2 fuse lzma openssl systemd tcp_wrappers zlib ]; + + meta = with stdenv.lib; { + description = "A caching proxy specialized for linux distribution files"; + homepage = https://www.unix-ag.uni-kl.de/~bloch/acng/; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = [ maintainers.makefu ]; + }; +} diff --git a/nixpkgs/pkgs/servers/http/couchdb/2.0.0.nix b/nixpkgs/pkgs/servers/http/couchdb/2.0.0.nix new file mode 100644 index 000000000000..fa8cb23bf1f8 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/couchdb/2.0.0.nix @@ -0,0 +1,54 @@ +{ stdenv, fetchurl, erlang, icu, openssl, spidermonkey +, coreutils, bash, makeWrapper }: + +stdenv.mkDerivation rec { + name = "couchdb-${version}"; + version = "2.3.0"; + + src = fetchurl { + url = "mirror://apache/couchdb/source/${version}/apache-${name}.tar.gz"; + sha256 = "0lpk64n6fip85j1jz59kq20jdliwv6mh8j2h5zyxjn5i8b86hf0b"; + }; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ erlang icu openssl spidermonkey ]; + + patches = [ ./jsapi.patch ]; + postPatch = '' + substituteInPlace src/couch/rebar.config.script --replace '-DHAVE_CURL -I/usr/local/include' "-DHAVE_CURL -I/usr/local/include $NIX_CFLAGS_COMPILE" + + patch bin/rebar <<EOF + 1c1 + < #!/usr/bin/env escript + --- + > #!${coreutils}/bin/env escript + EOF + + ''; + + # Configure a username. The build system would use "couchdb" as + # default if none is provided. Note that it is unclear where this + # username is actually used in the build, as any choice seems to be + # working. + configurePhase = '' + ./configure -u nobody + ''; + + buildPhase = '' + make release + ''; + + installPhase = '' + mkdir -p $out + cp -r rel/couchdb/* $out + wrapProgram $out/bin/couchdb --suffix PATH : ${bash}/bin + ''; + + meta = with stdenv.lib; { + description = "A database that uses JSON for documents, JavaScript for MapReduce queries, and regular HTTP for an API"; + homepage = http://couchdb.apache.org; + license = licenses.asl20; + platforms = platforms.all; + maintainers = with maintainers; [ garbas ]; + }; +} diff --git a/nixpkgs/pkgs/servers/http/couchdb/default.nix b/nixpkgs/pkgs/servers/http/couchdb/default.nix new file mode 100644 index 000000000000..5239c027b8fa --- /dev/null +++ b/nixpkgs/pkgs/servers/http/couchdb/default.nix @@ -0,0 +1,39 @@ +{ stdenv, fetchurl, erlang, icu, openssl, spidermonkey, curl, help2man +, sphinx, which, file, pkgconfig, getopt }: + +stdenv.mkDerivation rec { + name = "couchdb-${version}"; + version = "1.7.1"; + + src = fetchurl { + url = "mirror://apache/couchdb/source/${version}/apache-${name}.tar.gz"; + sha256 = "1b9cbdrmh1i71mrwvhm17v4cf7lckpil1vvq7lpmxyn6zfk0l84i"; + }; + + nativeBuildInputs = [ help2man which file pkgconfig sphinx ]; + buildInputs = [ erlang icu openssl spidermonkey curl ]; + + postInstall = '' + substituteInPlace $out/bin/couchdb --replace getopt "${getopt}/bin/getopt" + ''; + + /* + Versions of SpiderMonkey after the js185-1.0.0 release remove the optional + enforcement of preventing anonymous functions in a statement context. This + will most likely break your existing JavaScript code as well as render all + example code invalid. + + If you wish to ignore this error pass --enable-js-trunk to ./configure. + */ + configureFlags = [ + "--enable-js-trunk" + ]; + + meta = with stdenv.lib; { + description = "A database that uses JSON for documents, JavaScript for MapReduce queries, and regular HTTP for an API"; + homepage = http://couchdb.apache.org; + license = licenses.asl20; + platforms = platforms.all; + maintainers = with maintainers; [ garbas ]; + }; +} diff --git a/nixpkgs/pkgs/servers/http/couchdb/jsapi.patch b/nixpkgs/pkgs/servers/http/couchdb/jsapi.patch new file mode 100644 index 000000000000..bb7d4ca610c7 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/couchdb/jsapi.patch @@ -0,0 +1,60 @@ +diff -ru couch_js/http.c couch_js-patched/http.c +--- apache-couchdb-2.0.0/src/couch/priv/couch_js/http.c 2016-09-12 11:28:51.000000000 +0200 ++++ apache-couchdb-2.0.0-patched/src/couch/priv/couch_js/http.c 2017-02-10 10:52:33.025854045 +0100 +@@ -15,7 +15,7 @@ + #include <string.h> + #include <sys/types.h> + #include <sys/stat.h> +-#include <jsapi.h> ++#include <js/jsapi.h> + #include "config.h" + #include "utf8.h" + #include "util.h" +diff -ru couch_js/main.c couch_js-patched/main.c +--- apache-couchdb-2.0.0/src/couch/priv/couch_js/main.c 2016-09-12 11:28:51.000000000 +0200 ++++ apache-couchdb-2.0.0-patched/src/couch/priv/couch_js/main.c 2017-02-10 10:52:33.001854154 +0100 +@@ -20,7 +20,7 @@ + #include <unistd.h> + #endif + +-#include <jsapi.h> ++#include <js/jsapi.h> + #include "config.h" + #include "http.h" + #include "utf8.h" +diff -ru couch_js/utf8.c couch_js-patched/utf8.c +--- apache-couchdb-2.0.0/src/couch/priv/couch_js/utf8.c 2016-09-12 11:28:51.000000000 +0200 ++++ apache-couchdb-2.0.0-patched/src/couch/priv/couch_js/utf8.c 2017-02-10 10:52:33.009854117 +0100 +@@ -10,7 +10,7 @@ + // License for the specific language governing permissions and limitations under + // the License. + +-#include <jsapi.h> ++#include <js/jsapi.h> + #include "config.h" + + static int +diff -ru couch_js/util.c couch_js-patched/util.c +--- apache-couchdb-2.0.0/src/couch/priv/couch_js/util.c 2016-09-12 11:28:51.000000000 +0200 ++++ apache-couchdb-2.0.0-patched/src/couch/priv/couch_js/util.c 2017-02-10 10:52:33.017854081 +0100 +@@ -13,7 +13,7 @@ + #include <stdlib.h> + #include <string.h> + +-#include <jsapi.h> ++#include <js/jsapi.h> + + #include "help.h" + #include "util.h" +diff -ru couch_js/util.h couch_js-patched/util.h +--- apache-couchdb-2.0.0/src/couch/priv/couch_js/util.h 2016-09-12 11:28:51.000000000 +0200 ++++ apache-couchdb-2.0.0-patched/src/couch/priv/couch_js/util.h 2017-02-10 10:52:32.988854212 +0100 +@@ -13,7 +13,7 @@ + #ifndef COUCHJS_UTIL_H + #define COUCHJS_UTIL_H + +-#include <jsapi.h> ++#include <js/jsapi.h> + + typedef struct { + int no_eval; diff --git a/nixpkgs/pkgs/servers/http/darkhttpd/default.nix b/nixpkgs/pkgs/servers/http/darkhttpd/default.nix new file mode 100644 index 000000000000..3efc97f6296b --- /dev/null +++ b/nixpkgs/pkgs/servers/http/darkhttpd/default.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation rec { + name = "darkhttpd-${version}"; + version = "1.12"; + + src = fetchurl { + url = "https://unix4lyfe.org/darkhttpd/${name}.tar.bz2"; + sha256 = "0185wlyx4iqiwfigp1zvql14zw7gxfacncii3d15yaxk4av1f155"; + }; + + enableParallelBuilding = true; + + installPhase = '' + # install darkhttpd + install -Dm755 "darkhttpd" "$out/bin/darkhttpd" + + # install license + install -d "$out/share/licenses/darkhttpd" + head -n 18 darkhttpd.c > "$out/share/licenses/darkhttpd/LICENSE" + ''; + + meta = with stdenv.lib; { + description = "Small and secure static webserver"; + homepage = https://unix4lyfe.org/darkhttpd/; + license = licenses.bsd3; + maintainers = with maintainers; [ bobvanderlinden ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/servers/http/gatling/default.nix b/nixpkgs/pkgs/servers/http/gatling/default.nix new file mode 100644 index 000000000000..19b2d01f5be8 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/gatling/default.nix @@ -0,0 +1,32 @@ +{ stdenv, fetchurl, libowfat, zlib, openssl }: + +let + version = "0.15"; +in +stdenv.mkDerivation rec { + name = "gatling-${version}"; + + src = fetchurl { + url = "https://www.fefe.de/gatling/${name}.tar.xz"; + sha256 = "194srqyja3pczpbl6l169zlvx179v7ln0m6yipmhvj6hrv82k8vg"; + }; + + buildInputs = [ libowfat zlib openssl.dev ]; + + configurePhase = '' + substituteInPlace Makefile --replace "/usr/local" "$out" + substituteInPlace GNUmakefile --replace "/opt/diet" "$out" + ''; + + buildPhase = '' + make gatling + ''; + + meta = with stdenv.lib; { + description = "A high performance web server"; + homepage = http://www.fefe.de/gatling/; + license = stdenv.lib.licenses.gpl2; + platforms = platforms.linux; + maintainers = [ maintainers.the-kenny ]; + }; +} diff --git a/nixpkgs/pkgs/servers/http/h2o/default.nix b/nixpkgs/pkgs/servers/http/h2o/default.nix new file mode 100644 index 000000000000..ceffd3e0260d --- /dev/null +++ b/nixpkgs/pkgs/servers/http/h2o/default.nix @@ -0,0 +1,39 @@ +{ stdenv, fetchFromGitHub +, pkgconfig, cmake +, libressl, libuv, zlib +}: + +with builtins; + +stdenv.mkDerivation rec { + name = "h2o-${version}"; + version = "2.2.5"; + + src = fetchFromGitHub { + owner = "h2o"; + repo = "h2o"; + rev = "refs/tags/v${version}"; + sha256 = "0jyvbp6cjiirj44nxqa2fi5y473gnc8awfn8zv82hb1y9rlxqfyv"; + }; + + # We have to fix up some function prototypes, because despite upstream h2o + # issue #1705 (https://github.com/h2o/h2o/issues/1706), libressl 2.7+ doesn't + # seem to work + patchPhase = '' + substituteInPlace ./deps/neverbleed/neverbleed.c \ + --replace 'static void RSA_' 'void RSA_' \ + --replace 'static int RSA_' 'int RSA_' + ''; + + nativeBuildInputs = [ pkgconfig cmake ]; + buildInputs = [ libressl libuv zlib ]; + enableParallelBuilding = true; + + meta = { + description = "Optimized HTTP/1 and HTTP/2 server"; + homepage = https://h2o.examp1e.net; + license = stdenv.lib.licenses.mit; + maintainers = [ stdenv.lib.maintainers.thoughtpolice ]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/servers/http/hiawatha/default.nix b/nixpkgs/pkgs/servers/http/hiawatha/default.nix new file mode 100644 index 000000000000..d99a04642deb --- /dev/null +++ b/nixpkgs/pkgs/servers/http/hiawatha/default.nix @@ -0,0 +1,56 @@ +{ stdenv +, fetchFromGitLab + +, cmake +, ninja +, mbedtls + +, enableCache ? true # Internal cache support. +, enableIpV6 ? true +, enableTls ? true +, enableMonitor ? false # Support for the Hiawatha Monitor. +, enableRproxy ? true # Reverse proxy support. +, enableTomahawk ? false # Tomahawk, the Hiawatha command shell. +, enableXslt ? true, libxml2 ? null, libxslt ? null +, enableToolkit ? true # The URL Toolkit. +}: + +stdenv.mkDerivation rec { + name = "hiawatha-${version}"; + version = "10.8.3"; + + src = fetchFromGitLab { + owner = "hsleisink"; + repo = "hiawatha"; + rev = "v${version}"; + sha256 = "057kglz5grrxg5m2brr7mcncwd3idxzczq5vg8yd1iri2rq63hdc"; + }; + + nativeBuildInputs = [ cmake ninja ]; + buildInputs = [ mbedtls ] ++ stdenv.lib.optionals enableXslt [ libxslt libxml2 ]; + + prePatch = '' + substituteInPlace CMakeLists.txt --replace SETUID "" + ''; + + cmakeFlags = [ + "-DUSE_SYSTEM_MBEDTLS=on" # Policy to use Nix deps, and Nix uses up to date deps + ( if enableCache then "-DENABLE_CACHE=on" else "-DENABLE_CACHE=off" ) + ( if enableIpV6 then "-DENABLE_IPV6=on" else "-DENABLE_IPV6=off" ) + ( if enableTls then "-DENABLE_TLS=on" else "-DENABLE_TLS=off" ) + ( if enableMonitor then "-DENABLE_MONITOR=on" else "-DENABLE_MONITOR=off" ) + ( if enableRproxy then "-DENABLE_RPROXY=on" else "-DENABLE_RPROXY=off" ) + ( if enableTomahawk then "-DENABLE_TOMAHAWK=on" else "-DENABLE_TOMAHAWK=off" ) + ( if enableXslt then "-DENABLE_XSLT=on" else "-DENABLE_XSLT=off" ) + ( if enableToolkit then "-DENABLE_TOOLKIT=on" else "-DENABLE_TOOLKIT=off" ) + ]; + + meta = with stdenv.lib; { + homepage = https://www.hiawatha-webserver.org; + description = "An advanced and secure webserver"; + license = licenses.gpl2; + platforms = platforms.unix; # "Hiawatha runs perfectly on Linux, BSD and MacOS X" + maintainers = [ maintainers.ndowens ]; + }; + +} diff --git a/nixpkgs/pkgs/servers/http/hyp/default.nix b/nixpkgs/pkgs/servers/http/hyp/default.nix new file mode 100644 index 000000000000..3a1eb50f05be --- /dev/null +++ b/nixpkgs/pkgs/servers/http/hyp/default.nix @@ -0,0 +1,19 @@ +{ stdenv, fetchurl, python3Packages }: + +python3Packages.buildPythonPackage rec { + name = "hyp-server-${version}"; + version = "1.2.0"; + + src = fetchurl { + url = "mirror://pypi/h/hyp-server/${name}.tar.gz"; + sha256 = "1lafjdcn9nnq6xc3hhyizfwh6l69lc7rixn6dx65aq71c913jc15"; + }; + + meta = with stdenv.lib; { + description = "Hyperminimal https server"; + homepage = https://github.com/rnhmjoj/hyp; + license = with licenses; [gpl3Plus mit]; + maintainers = with maintainers; [ rnhmjoj ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/servers/http/jboss/default.nix b/nixpkgs/pkgs/servers/http/jboss/default.nix new file mode 100644 index 000000000000..c5702132d280 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/jboss/default.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchurl, unzip, jdk }: + +stdenv.mkDerivation { + name = "jboss-as-7.1.1.Final"; + src = fetchurl { + url = https://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.tar.gz; + sha256 = "1bdjw0ib9qr498vpfbg8klqw6rl11vbz7vwn6gp1r5gpqkd3zzc8"; + }; + + buildInputs = [ unzip ]; + + phases = [ "unpackPhase" "installPhase" "fixupPhase" ]; + + installPhase = '' + mv $PWD $out + find $out/bin -name \*.sh -print0 | xargs -0 sed -i -e '/#!\/bin\/sh/aJAVA_HOME=${jdk}' + ''; + + meta = with stdenv.lib; { + homepage = http://www.jboss.org/; + description = "Open Source J2EE application server"; + license = licenses.lgpl21; + maintainers = [ maintainers.sander ]; + platforms = platforms.unix; + knownVulnerabilities = [ + "CVE-2015-7501: remote code execution in apache-commons-collections: InvokerTransformer during deserialisation" + ]; + }; +} diff --git a/nixpkgs/pkgs/servers/http/jboss/jdbc/mysql/builder.sh b/nixpkgs/pkgs/servers/http/jboss/jdbc/mysql/builder.sh new file mode 100644 index 000000000000..6af39a0cb633 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/jboss/jdbc/mysql/builder.sh @@ -0,0 +1,5 @@ +buildInputs="$mysql_jdbc" +source $stdenv/setup + +mkdir -p $out/server/default/lib +ln -s $mysql_jdbc/share/java/mysql-connector-java.jar $out/server/default/lib/mysql-connector-java.jar diff --git a/nixpkgs/pkgs/servers/http/jboss/jdbc/mysql/default.nix b/nixpkgs/pkgs/servers/http/jboss/jdbc/mysql/default.nix new file mode 100644 index 000000000000..fd2dec44c7f3 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/jboss/jdbc/mysql/default.nix @@ -0,0 +1,13 @@ +{ stdenv, mysql_jdbc }: + +stdenv.mkDerivation { + name = "jboss-mysql-jdbc"; + + builder = ./builder.sh; + + inherit mysql_jdbc; + + meta = { + platforms = stdenv.lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/servers/http/jetty/default.nix b/nixpkgs/pkgs/servers/http/jetty/default.nix new file mode 100644 index 000000000000..70c48fc95f4b --- /dev/null +++ b/nixpkgs/pkgs/servers/http/jetty/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation rec { + name = "jetty-${version}"; + version = "9.4.14.v20181114"; + src = fetchurl { + url = "https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/${version}/jetty-distribution-${version}.tar.gz"; + name = "jetty-distribution-${version}.tar.gz"; + sha256 = "1i83jfd17d9sl9pjc8r9i8mx3nr9x0m5s50fd4l5ppzn4drvssn6"; + }; + + phases = [ "unpackPhase" "installPhase" ]; + + installPhase = '' + mkdir -p $out + mv etc lib modules start.ini start.jar $out + ''; + + meta = { + description = "A Web server and javax.servlet container"; + homepage = http://www.eclipse.org/jetty/; + platforms = stdenv.lib.platforms.all; + license = [ stdenv.lib.licenses.asl20 stdenv.lib.licenses.epl10 ]; + }; +} diff --git a/nixpkgs/pkgs/servers/http/lighttpd/default.nix b/nixpkgs/pkgs/servers/http/lighttpd/default.nix new file mode 100644 index 000000000000..cdebbf739e6a --- /dev/null +++ b/nixpkgs/pkgs/servers/http/lighttpd/default.nix @@ -0,0 +1,65 @@ +{ stdenv, fetchurl, pkgconfig, pcre, libxml2, zlib, attr, bzip2, which, file +, openssl, enableMagnet ? false, lua5_1 ? null +, enableMysql ? false, mysql ? null +, enableLdap ? false, openldap ? null +, enableWebDAV ? true, sqlite ? null, libuuid ? null +, perl +}: + +assert enableMagnet -> lua5_1 != null; +assert enableMysql -> mysql != null; +assert enableLdap -> openldap != null; +assert enableWebDAV -> sqlite != null; +assert enableWebDAV -> libuuid != null; + +stdenv.mkDerivation rec { + name = "lighttpd-1.4.52"; + + src = fetchurl { + url = "https://download.lighttpd.net/lighttpd/releases-1.4.x/${name}.tar.xz"; + sha256 = "0r57zp7050qxlwg41xqnqnhw3lrl34cg5zvfbqrwddrhqn8hkg17"; + }; + + postPatch = '' + patchShebangs tests + ''; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ pcre libxml2 zlib attr bzip2 which file openssl ] + ++ stdenv.lib.optional enableMagnet lua5_1 + ++ stdenv.lib.optional enableMysql mysql.connector-c + ++ stdenv.lib.optional enableLdap openldap + ++ stdenv.lib.optional enableWebDAV sqlite + ++ stdenv.lib.optional enableWebDAV libuuid; + + configureFlags = [ "--with-openssl" ] + ++ stdenv.lib.optional enableMagnet "--with-lua" + ++ stdenv.lib.optional enableMysql "--with-mysql" + ++ stdenv.lib.optional enableLdap "--with-ldap" + ++ stdenv.lib.optional enableWebDAV "--with-webdav-props" + ++ stdenv.lib.optional enableWebDAV "--with-webdav-locks"; + + preConfigure = '' + sed -i "s:/usr/bin/file:${file}/bin/file:g" configure + ''; + + checkInputs = [ perl ]; + doCheck = false; # fails 2 tests + + postInstall = '' + mkdir -p "$out/share/lighttpd/doc/config" + cp -vr doc/config "$out/share/lighttpd/doc/" + # Remove files that references needless store paths (dependency bloat) + rm "$out/share/lighttpd/doc/config/Makefile"* + rm "$out/share/lighttpd/doc/config/conf.d/Makefile"* + rm "$out/share/lighttpd/doc/config/vhosts.d/Makefile"* + ''; + + meta = with stdenv.lib; { + description = "Lightweight high-performance web server"; + homepage = http://www.lighttpd.net/; + license = stdenv.lib.licenses.bsd3; + platforms = platforms.linux; + maintainers = [ maintainers.bjornfor ]; + }; +} diff --git a/nixpkgs/pkgs/servers/http/lwan/default.nix b/nixpkgs/pkgs/servers/http/lwan/default.nix new file mode 100644 index 000000000000..878211ebf024 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/lwan/default.nix @@ -0,0 +1,35 @@ +{ stdenv, fetchFromGitHub, pkgconfig, zlib, cmake, jemalloc }: + +stdenv.mkDerivation rec { + pname = "lwan"; + version = "0.1"; + name = "${pname}-${version}"; + + src = fetchFromGitHub { + owner = "lpereira"; + repo = pname; + rev = "v${version}"; + sha256 = "1mckryzb06smky0bx2bkqwqzpnq4pb8vlgmmwsvqmwi4mmw9wmi1"; + }; + + nativeBuildInputs = [ cmake pkgconfig ]; + + buildInputs = [ jemalloc zlib ]; + + meta = with stdenv.lib; { + description = "Lightweight high-performance multi-threaded web server"; + longDescription = "A lightweight and speedy web server with a low memory + footprint (~500KiB for 10k idle connections), with minimal system calls and + memory allocation. Lwan contains a hand-crafted HTTP request parser. Files are + served using the most efficient way according to their size: no copies between + kernel and userland for files larger than 16KiB. Smaller files are sent using + vectored I/O of memory-mapped buffers. Header overhead is considered before + compressing small files. Features include: mustache templating engine and IPv6 + support. + "; + homepage = "https://lwan.ws/"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = with maintainers; [ leenaars ]; + }; +} diff --git a/nixpkgs/pkgs/servers/http/micro-httpd/default.nix b/nixpkgs/pkgs/servers/http/micro-httpd/default.nix new file mode 100644 index 000000000000..b636f79e6c60 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/micro-httpd/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation rec { + name = "micro-httpd-20140814"; + + src = fetchurl { + url = "https://acme.com/software/micro_httpd/micro_httpd_14Aug2014.tar.gz"; + sha256 = "0mlm24bi31s0s8w55i0sysv2nc1n2x4cfp6dm47slz49h2fz24rk"; + }; + + preBuild = '' + makeFlagsArray=(BINDIR="$out/bin" MANDIR="$out/share/man/man8") + mkdir -p $out/bin + mkdir -p $out/share/man/man8 + ''; + + meta = with stdenv.lib; { + homepage = "http://acme.com/software/micro_httpd/"; + description = "A really small HTTP server"; + license = licenses.bsd2; + platforms = platforms.unix; + maintainers = with maintainers; [ copumpkin ]; + }; +} + diff --git a/nixpkgs/pkgs/servers/http/mini-httpd/default.nix b/nixpkgs/pkgs/servers/http/mini-httpd/default.nix new file mode 100644 index 000000000000..37a0a98d4e01 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/mini-httpd/default.nix @@ -0,0 +1,22 @@ +{ stdenv, fetchurl, boost }: + +stdenv.mkDerivation rec { + name = "mini-httpd-1.7"; + + src = fetchurl { + url = "https://download-mirror.savannah.gnu.org/releases/mini-httpd/${name}.tar.gz"; + sha256 = "0jggmlaywjfbdljzv5hyiz49plnxh0har2bnc9dq4xmj1pmjgs49"; + }; + + buildInputs = [ boost ]; + + enableParallelBuilding = true; + + meta = { + homepage = http://mini-httpd.nongnu.org/; + description = "minimalistic high-performance web server"; + license = stdenv.lib.licenses.gpl3; + platforms = stdenv.lib.platforms.linux; + maintainers = [ stdenv.lib.maintainers.peti ]; + }; +} diff --git a/nixpkgs/pkgs/servers/http/myserver/default.nix b/nixpkgs/pkgs/servers/http/myserver/default.nix new file mode 100644 index 000000000000..b18e1ea162f0 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/myserver/default.nix @@ -0,0 +1,52 @@ +{ lib, fetchurl, stdenv, libgcrypt, libevent, libidn, gnutls +, libxml2, zlib, guile, texinfo, cppunit, killall }: + +let version = "0.11"; in + +stdenv.mkDerivation rec { + name = "myserver-${version}"; + + src = fetchurl { + url = "mirror://gnu/myserver/${version}/${name}.tar.xz"; + sha256 = "02y3vv4hxpy5h710y79s8ipzshhc370gbz1wm85x0lnq5nqxj2ax"; + }; + + patches = + [ ./disable-dns-lookup-in-chroot.patch ]; + + buildInputs = [ + libgcrypt libevent libidn gnutls libxml2 zlib guile texinfo + ]; + + checkInputs = [ cppunit ]; + + makeFlags = [ "V=1" ]; + + doCheck = true; + + enableParallelBuilding = true; + + # On GNU/Linux the `test_suite' process sometimes stays around, so + # forcefully terminate it. + postCheck = "${killall}/bin/killall test_suite || true"; + + meta = { + description = "GNU MyServer, a powerful and easy to configure web server"; + + longDescription = '' + GNU MyServer is a powerful and easy to configure web server. Its + multi-threaded architecture makes it extremely scalable and usable in + large scale sites as well as in small networks, it has a lot of + built-in features. Share your files in minutes! + ''; + + homepage = https://www.gnu.org/software/myserver/; + + license = lib.licenses.gpl3Plus; + + # libevent fails to build on Cygwin and Guile has troubles on Darwin. + platforms = lib.platforms.gnu ++ lib.platforms.linux; + + broken = true; # needs patch for gets() + }; +} diff --git a/nixpkgs/pkgs/servers/http/myserver/disable-dns-lookup-in-chroot.patch b/nixpkgs/pkgs/servers/http/myserver/disable-dns-lookup-in-chroot.patch new file mode 100644 index 000000000000..31b24915c4da --- /dev/null +++ b/nixpkgs/pkgs/servers/http/myserver/disable-dns-lookup-in-chroot.patch @@ -0,0 +1,12 @@ +Disable this test because it attempts to do a DNS lookup, which fails +in a chroot. + +--- myserver-0.10/tests/test_socket.cpp 2010-10-19 00:12:59.000000000 +0200 ++++ myserver-0.10/tests/test_socket.cpp 2010-10-19 00:13:07.000000000 +0200 +@@ -56,7 +56,6 @@ class TestSocket : public CppUnit::TestF + + CPPUNIT_TEST (testGethostname); + CPPUNIT_TEST (testRecv); +- CPPUNIT_TEST (testGetLocalIPsList); + + CPPUNIT_TEST_SUITE_END (); diff --git a/nixpkgs/pkgs/servers/http/nginx/generic.nix b/nixpkgs/pkgs/servers/http/nginx/generic.nix new file mode 100644 index 000000000000..25ff20635aff --- /dev/null +++ b/nixpkgs/pkgs/servers/http/nginx/generic.nix @@ -0,0 +1,80 @@ +{ stdenv, fetchurl, openssl, zlib, pcre, libxml2, libxslt +, gd, geoip +, withDebug ? false +, withStream ? true +, withMail ? false +, modules ? [] +, version, sha256, ... +}: + +with stdenv.lib; + +stdenv.mkDerivation { + name = "nginx-${version}"; + + src = fetchurl { + url = "https://nginx.org/download/nginx-${version}.tar.gz"; + inherit sha256; + }; + + buildInputs = [ openssl zlib pcre libxml2 libxslt gd geoip ] + ++ concatMap (mod: mod.inputs or []) modules; + + configureFlags = [ + "--with-http_ssl_module" + "--with-http_v2_module" + "--with-http_realip_module" + "--with-http_addition_module" + "--with-http_xslt_module" + "--with-http_geoip_module" + "--with-http_sub_module" + "--with-http_dav_module" + "--with-http_flv_module" + "--with-http_mp4_module" + "--with-http_gunzip_module" + "--with-http_gzip_static_module" + "--with-http_auth_request_module" + "--with-http_random_index_module" + "--with-http_secure_link_module" + "--with-http_degradation_module" + "--with-http_stub_status_module" + "--with-threads" + "--with-pcre-jit" + # Install destination problems + # "--with-http_perl_module" + ] ++ optional withDebug [ + "--with-debug" + ] ++ optional withStream [ + "--with-stream" + "--with-stream_geoip_module" + "--with-stream_realip_module" + "--with-stream_ssl_module" + "--with-stream_ssl_preread_module" + ] ++ optional withMail [ + "--with-mail" + "--with-mail_ssl_module" + ] + ++ optional (gd != null) "--with-http_image_filter_module" + ++ optional (with stdenv.hostPlatform; isLinux || isFreeBSD) "--with-file-aio" + ++ map (mod: "--add-module=${mod.src}") modules; + + NIX_CFLAGS_COMPILE = [ "-I${libxml2.dev}/include/libxml2" ] ++ optional stdenv.isDarwin "-Wno-error=deprecated-declarations"; + + preConfigure = (concatMapStringsSep "\n" (mod: mod.preConfigure or "") modules); + + hardeningEnable = optional (!stdenv.isDarwin) "pie"; + + enableParallelBuilding = true; + + postInstall = '' + mv $out/sbin $out/bin + ''; + + meta = { + description = "A reverse proxy and lightweight webserver"; + homepage = http://nginx.org; + license = licenses.bsd2; + platforms = platforms.all; + maintainers = with maintainers; [ thoughtpolice raskin fpletz ]; + }; +} diff --git a/nixpkgs/pkgs/servers/http/nginx/mainline.nix b/nixpkgs/pkgs/servers/http/nginx/mainline.nix new file mode 100644 index 000000000000..8f33fa8d33b1 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/nginx/mainline.nix @@ -0,0 +1,6 @@ +{ callPackage, ... }@args: + +callPackage ./generic.nix (args // { + version = "1.15.7"; + sha256 = "14yz5cag9jdi088kdyammpi0ixrzi91bc0nwdldj42hfdhpyl8lg"; +}) diff --git a/nixpkgs/pkgs/servers/http/nginx/mainline.upstream b/nixpkgs/pkgs/servers/http/nginx/mainline.upstream new file mode 100644 index 000000000000..7bb025499592 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/nginx/mainline.upstream @@ -0,0 +1,8 @@ +url http://nginx.org/en/download.html +version_link '.*-([0-9]+[.][0-9]+([.][0-9]+)*)[.]tar[.][a-z0-9]*$' + +do_overwrite() { + ensure_hash + set_var_value version "$CURRENT_VERSION" + set_var_value sha256 "$CURRENT_HASH" +} diff --git a/nixpkgs/pkgs/servers/http/nginx/modules.nix b/nixpkgs/pkgs/servers/http/nginx/modules.nix new file mode 100644 index 000000000000..6b4510bfe824 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/nginx/modules.nix @@ -0,0 +1,312 @@ +{ fetchFromGitHub, lib, pkgs }: + +{ + brotli = { + src = let gitsrc = pkgs.fetchFromGitHub { + owner = "eustas"; + repo = "ngx_brotli"; + rev = "v0.1.2"; + sha256 = "19r9igxm4hrzrhxajlxw2ccq0057h8ipkfiif725x0xqbxjskl6c"; + }; in pkgs.runCommandNoCC "ngx_brotli-src" {} '' + cp -a ${gitsrc} $out + substituteInPlace $out/config \ + --replace /usr/local ${lib.getDev pkgs.brotli} + ''; + inputs = [ pkgs.brotli ]; + }; + + dav = { + src = fetchFromGitHub { + owner = "arut"; + repo = "nginx-dav-ext-module"; + rev = "v0.1.0"; + sha256 = "1ifahd69vz715g3zim618jbmxb7kcmzykc696grskxm0svpy294k"; + }; + inputs = [ pkgs.expat ]; + }; + + develkit = { + src = fetchFromGitHub { + owner = "simpl"; + repo = "ngx_devel_kit"; + rev = "v0.3.1rc1"; + sha256 = "00vqvpx67qra2hr85hkvj1dha4h7x7v9sblw7w1df11nq1gzsdbb"; + }; + }; + + echo = { + src = fetchFromGitHub { + owner = "openresty"; + repo = "echo-nginx-module"; + rev = "v0.61"; + sha256 = "0brjhhphi94ms4gia7za0mfx0png4jbhvq6j0nzjwp537iyiy23k"; + }; + }; + + fancyindex = { + src = fetchFromGitHub { + owner = "aperezdc"; + repo = "ngx-fancyindex"; + rev = "v0.4.3"; + sha256 = "12xdx6a76sfrq0yciylvyjlnvyczszpadn31jqya8c2dzdkyyx7f"; + }; + }; + + fastcgi-cache-purge = { + src = fetchFromGitHub { + owner = "FRiCKLE"; + repo = "ngx_cache_purge"; + rev = "2.3"; + sha256 = "0ib2jrbjwrhvmihhnzkp4w87fxssbbmmmj6lfdwpm6ni8p9g60dw"; + }; + }; + + fluentd = { + src = fetchFromGitHub { + owner = "fluent"; + repo = "nginx-fluentd-module"; + rev = "8af234043059c857be27879bc547c141eafd5c13"; + sha256 = "1ycb5zd9sw60ra53jpak1m73zwrjikwhrrh9q6266h1mlyns7zxm"; + }; + }; + + ipscrub = { + src = fetchFromGitHub { + owner = "masonicboom"; + repo = "ipscrub"; + rev = "v1.0.1"; + sha256 = "0qcx15c8wbsmyz2hkmyy5yd7qn1n84kx9amaxnfxkpqi05vzm1zz"; + } + "/ipscrub"; + inputs = [ pkgs.libbsd ]; + }; + + lua = { + src = fetchFromGitHub { + owner = "openresty"; + repo = "lua-nginx-module"; + rev = "v0.10.13"; + sha256 = "19mpc76lfhyyvkfs2n08b4rc9cf2v7rm8fskkf60hsdcf6qna822"; + }; + inputs = [ pkgs.luajit ]; + preConfigure = '' + export LUAJIT_LIB="${pkgs.luajit}/lib" + export LUAJIT_INC="${pkgs.luajit}/include/luajit-2.0" + ''; + }; + + lua-upstream = { + src = fetchFromGitHub { + owner = "openresty"; + repo = "lua-upstream-nginx-module"; + rev = "v0.07"; + sha256 = "1gqccg8airli3i9103zv1zfwbjm27h235qjabfbfqk503rjamkpk"; + }; + inputs = [ pkgs.luajit ]; + }; + + modsecurity = { + src = "${pkgs.modsecurity_standalone.nginx}/nginx/modsecurity"; + inputs = [ pkgs.curl pkgs.apr pkgs.aprutil pkgs.apacheHttpd pkgs.yajl ]; + preConfigure = '' + export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${pkgs.aprutil.dev}/include/apr-1 -I${pkgs.apacheHttpd.dev}/include -I${pkgs.apr.dev}/include/apr-1 -I${pkgs.yajl}/include" + ''; + }; + + modsecurity-nginx = { + src = fetchFromGitHub { + owner = "SpiderLabs"; + repo = "ModSecurity-nginx"; + rev = "v1.0.0"; + sha256 = "0zzpdqhbdqqy8kjkszv0mrq6136ah9v3zwr1jbh312j8izmzdyi7"; + }; + inputs = [ pkgs.curl pkgs.geoip pkgs.libmodsecurity pkgs.libxml2 pkgs.lmdb pkgs.yajl ]; + }; + + moreheaders = { + src = fetchFromGitHub { + owner = "openresty"; + repo = "headers-more-nginx-module"; + rev = "v0.33"; + sha256 = "1cgdjylrdd69vlkwwmn018hrglzjwd83nqva1hrapgcfw12f7j53"; + }; + }; + + ngx_aws_auth = { + src = fetchFromGitHub { + owner = "anomalizer"; + repo = "ngx_aws_auth"; + rev = "2.1.1"; + sha256 = "10z67g40w7wpd13fwxyknkbg3p6hn61i4v8xw6lh27br29v1y6h9"; + }; + }; + + opentracing = { + src = + let src' = fetchFromGitHub { + owner = "opentracing-contrib"; + repo = "nginx-opentracing"; + rev = "v0.7.0"; + sha256 = "16jzxhhsyfjaxb50jy5py9ppscidfx1shvc29ihldp0zs6d8khma"; + }; + in "${src'}/opentracing"; + inputs = [ pkgs.opentracing-cpp ]; + }; + + pagespeed = + let + version = pkgs.psol.version; + + moduleSrc = fetchFromGitHub { + owner = "pagespeed"; + repo = "ngx_pagespeed"; + rev = "v${version}-stable"; + sha256 = "0ry7vmkb2bx0sspl1kgjlrzzz6lbz07313ks2lr80rrdm2zb16wp"; + }; + + ngx_pagespeed = pkgs.runCommand + "ngx_pagespeed" + { + meta = { + description = "PageSpeed module for Nginx"; + homepage = "https://developers.google.com/speed/pagespeed/module/"; + license = pkgs.stdenv.lib.licenses.asl20; + }; + } + '' + cp -r "${moduleSrc}" "$out" + chmod -R +w "$out" + ln -s "${pkgs.psol}" "$out/psol" + ''; + in { + src = ngx_pagespeed; + inputs = [ pkgs.zlib pkgs.libuuid ]; # psol deps + }; + + pam = { + src = fetchFromGitHub { + owner = "stogh"; + repo = "ngx_http_auth_pam_module"; + rev = "v1.5.1"; + sha256 = "031q006bcv10dzxi3mzamqiyg14p48v0bzd5mrwz073pbf0ba2fl"; + }; + inputs = [ pkgs.pam ]; + }; + + push-stream ={ + src = fetchFromGitHub { + owner = "wandenberg"; + repo = "nginx-push-stream-module"; + rev = "0.5.4"; + sha256 = "0izn7lqrp2zfl738aqa9i8c5lba97wkhcnqg8qbw3ipp5cysb2hr"; + }; + }; + + rtmp ={ + src = fetchFromGitHub { + owner = "arut"; + repo = "nginx-rtmp-module"; + rev = "v1.2.1"; + sha256 = "0na1aam176irz6w148hnvamqy1ilbn4abhdzkva0yrm35a3ksbzn"; + }; + }; + + set-misc = { + src = fetchFromGitHub { + owner = "openresty"; + repo = "set-misc-nginx-module"; + rev = "v0.32"; + sha256 = "048a6jwinbjgxiprjj9ml3fdp0mhkx89g6ggams57fsx9m5vaxax"; + }; + }; + + shibboleth = { + src = fetchFromGitHub { + owner = "nginx-shib"; + repo = "nginx-http-shibboleth"; + rev = "48b70d87bf7796d7813813a837e52b3a86e6f6f4"; + sha256 = "0k8xcln5sf0m4r0m550dkhl07zhncp285dpysk6r4v6vqzqmhzdc"; + }; + }; + + sla = { + src = fetchFromGitHub { + owner = "goldenclone"; + repo = "nginx-sla"; + rev = "7778f0125974befbc83751d0e1cadb2dcea57601"; + sha256 = "1x5hm6r0dkm02ffny8kjd7mmq8przyd9amg2qvy5700x6lb63pbs"; + }; + }; + + statsd = { + src = fetchFromGitHub { + owner = "apcera"; + repo = "nginx-statsd"; + rev = "b970e40467a624ba710c9a5106879a0554413d15"; + sha256 = "1x8j4i1i2ahrr7qvz03vkldgdjdxi6mx75mzkfizfcc8smr4salr"; + }; + }; + + stream-sts = { + src = fetchFromGitHub { + owner = "vozlt"; + repo = "nginx-module-stream-sts"; + rev = "v0.1.1"; + sha256 = "1jdj1kik6l3rl9nyx61xkqk7hmqbncy0rrqjz3dmjqsz92y8zaya"; + }; + }; + + sts = { + src = fetchFromGitHub { + owner = "vozlt"; + repo = "nginx-module-sts"; + rev = "v0.1.1"; + sha256 = "0nvb29641x1i7mdbydcny4qwlvdpws38xscxirajd2x7nnfdflrk"; + }; + }; + + sysguard = { + src = fetchFromGitHub { + owner = "vozlt"; + repo = "nginx-module-sysguard"; + rev = "e512897f5aba4f79ccaeeebb51138f1704a58608"; + sha256 = "19c6w6wscbq9phnx7vzbdf4ay6p2ys0g7kp2rmc9d4fb53phrhfx"; + }; + }; + + upstream-check = { + src = fetchFromGitHub { + owner = "yaoweibin"; + repo = "nginx_upstream_check_module"; + rev = "9aecf15ec379fe98f62355c57b60c0bc83296f04"; + sha256 = "1cjisxw1wykll683nw09k0i1nvzslp4dr59x58cvarpk43paim2y"; + }; + }; + + upstream-tarantool = { + src = fetchFromGitHub { + owner = "tarantool"; + repo = "nginx_upstream_module"; + rev = "v2.7"; + sha256 = "05dwj0caj910p7kan2qjvm6x2x601igryhny2xzr47hhsk5q1cnx"; + }; + inputs = [ pkgs.msgpuck.dev pkgs.yajl ]; + }; + + url = { + src = fetchFromGitHub { + owner = "vozlt"; + repo = "nginx-module-url"; + rev = "9299816ca6bc395625c3683fbd2aa7b916bfe91e"; + sha256 = "0mk1gjmfnry6hgdsnlavww9bn7223idw50jlkhh5k00q5509w4ip"; + }; + }; + + vts = { + src = fetchFromGitHub { + owner = "vozlt"; + repo = "nginx-module-vts"; + rev = "v0.1.18"; + sha256 = "1jq2s9k7hah3b317hfn9y3g1q4g4x58k209psrfsqs718a9sw8c7"; + }; + }; +} diff --git a/nixpkgs/pkgs/servers/http/nginx/stable.nix b/nixpkgs/pkgs/servers/http/nginx/stable.nix new file mode 100644 index 000000000000..f4cb22a38f61 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/nginx/stable.nix @@ -0,0 +1,6 @@ +{ callPackage, ... } @ args: + +callPackage ./generic.nix (args // { + version = "1.14.2"; + sha256 = "15wppq12qmq8acjs35xfj61czhf9cdc0drnl5mm8hcg3aihryb80"; +}) diff --git a/nixpkgs/pkgs/servers/http/nginx/stable.upstream b/nixpkgs/pkgs/servers/http/nginx/stable.upstream new file mode 100644 index 000000000000..c20139017436 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/nginx/stable.upstream @@ -0,0 +1,8 @@ +url http://nginx.org/en/download.html +version_link '.*-([0-9]+[.][0-9]*[02468]([.][0-9]+)*)[.]tar[.][a-z0-9]*$' + +do_overwrite() { + ensure_hash + set_var_value version "$CURRENT_VERSION" + set_var_value sha256 "$CURRENT_HASH" +} diff --git a/nixpkgs/pkgs/servers/http/nix-binary-cache/default.nix b/nixpkgs/pkgs/servers/http/nix-binary-cache/default.nix new file mode 100644 index 000000000000..479c9e41aa91 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/nix-binary-cache/default.nix @@ -0,0 +1,61 @@ +{stdenv +, coreutils, findutils, nix, xz, bzip2, gnused, gnugrep, openssl +, lighttpd, iproute }: +stdenv.mkDerivation rec { + version = "2014-06-29-1"; + name = "nix-binary-cache-${version}"; + + phases = ["installPhase"]; + + installPhase = '' + mkdir -p "$out/bin" + substitute "${./nix-binary-cache.cgi.in}" "$out"/bin/nix-binary-cache.cgi \ + --replace @out@ "$out/bin" \ + --replace @shell@ "${stdenv.shell}" \ + --replace @coreutils@ "${coreutils}/bin" \ + --replace @findutils@ "${findutils}/bin" \ + --replace @nix@ "${nix.out}/bin" \ + --replace @xz@ "${xz.bin}/bin" \ + --replace @bzip2@ "${bzip2.bin}/bin" \ + --replace @gnused@ "${gnused}/bin" \ + --replace @gnugrep@ "${gnugrep}/bin" \ + --replace @openssl@ "${openssl.bin}/bin" \ + --replace @lighttpd@ "${lighttpd}/sbin" \ + --replace @iproute@ "${iproute}/sbin" \ + --replace "xXxXx" "xXxXx" + + chmod a+x "$out/bin/nix-binary-cache.cgi" + + substitute "${./nix-binary-cache-start.in}" "$out"/bin/nix-binary-cache-start \ + --replace @out@ "$out/bin" \ + --replace @shell@ "${stdenv.shell}" \ + --replace @coreutils@ "${coreutils}/bin" \ + --replace @findutils@ "${findutils}/bin" \ + --replace @nix@ "${nix.out}/bin" \ + --replace @xz@ "${xz.bin}/bin" \ + --replace @bzip2@ "${bzip2.bin}/bin" \ + --replace @gnused@ "${gnused}/bin" \ + --replace @gnugrep@ "${gnugrep}/bin" \ + --replace @openssl@ "${openssl.bin}/bin" \ + --replace @lighttpd@ "${lighttpd}/sbin" \ + --replace @iproute@ "${iproute}/sbin" \ + --replace "xXxXx" "xXxXx" + + chmod a+x "$out/bin/nix-binary-cache-start" + ''; + + meta = { + description = ''A set of scripts to serve the Nix store as a binary cache''; + longDescription = '' + This package installs a CGI script that serves Nix store path in the + binary cache format. It also installs a launcher called + nix-binary-cache-start that can be run without any setup to launch + a binary cache and get the example arguments for its usage. + ''; + maintainers = [stdenv.lib.maintainers.raskin]; + license = stdenv.lib.licenses.gpl2Plus; + inherit version; + platforms = stdenv.lib.platforms.all; + hydraPlatforms = []; + }; +} diff --git a/nixpkgs/pkgs/servers/http/nix-binary-cache/nix-binary-cache-start.in b/nixpkgs/pkgs/servers/http/nix-binary-cache/nix-binary-cache-start.in new file mode 100644 index 000000000000..13b62a8829da --- /dev/null +++ b/nixpkgs/pkgs/servers/http/nix-binary-cache/nix-binary-cache-start.in @@ -0,0 +1,117 @@ +#! @shell@ + +parse_opts () { + while @coreutils@/test -n "$1" && @coreutils@/test "x$1" != x-- ; do + case "$1" in + --store-dir) + shift; + echo "STORE_DIR='$1'" + shift; + ;; + --priority) + shift; + echo "PRIORITY=$1"; + shift; + ;; + --compression) + shift; + echo "COMPRESSION=$1"; + shift; + ;; + --key) + shift; + echo "KEY=${1#*:}" + echo "KEYNAME=${1%%:*}" + shift; + ;; + --nix-remote) + shift; + echo "NIX_REMOTE=$1" + shift; + ;; + --mass-query) + shift; + echo "MASS_QUERY=$1" + shift; + ;; + --port) + shift; + echo "PORT=$1" + shift; + ;; + --ipv6) + shift; + echo "USE_IPV6=enable" + ;; + --help) + cat <<EOF >&2 +"$0": start the Nix binary cache serving the Nix store dynamically. + +Recognized options: + +--port server port +--store-dir served Nix store + +--priority binary cache priority +--mass-query 0 or 1 - whether binary cache expects queries for nix-env -qas + +--compression compression to use: bzip2 or xz +--key name:/path/to/key - key to use for narinfo signing + +--nix-remote 'daemon' or empty string '' - whether to use daemon for store + operations + +--ipv6 enable ipv6 + +--help show help and exit +EOF + exit 1; + ;; + *) shift ;; + esac; + done +} + +workingdir="$(@coreutils@/mktemp -d)" +cd "$workingdir" + +PORT=8080 +(echo "STORE_DIR=${NIX_STORE_DIR:-/nix/store}"; parse_opts "$@" + ) > nix-binary-cache.conf || exit +. "$workingdir/nix-binary-cache.conf" + +echo " +server.port = $PORT +server.modules = ( \"mod_cgi\", \"mod_setenv\", ) +server.document-root = \"$workingdir\" +cgi.assign = ( \".cgi\" => \"@shell@\" ) +setenv.add-request-header = ( \"NIX_BINARY_CACHE_CONFIG\" => \"$workingdir/nix-binary-cache.conf\" ) +" > lighttpd.conf + +test -n "$USE_IPV6" && echo " +\$SERVER[\"socket\"] == \"[::]:$PORT\" { +server.use-ipv6 = \"enable\" +} +" >> lighttpd.conf + +cp @out@/nix-binary-cache.cgi . +cp @out@/nix-binary-cache.cgi ./nix-bc.cgi + +ip="$(@iproute@/ip a | @gnugrep@/grep 'inet .* scope global' | @coreutils@/head -n 1)" +ip="${ip%%/*}" +ip="${ip##* }" + +url="http://$ip:$PORT/nix-bc.cgi?" + +echo "Working directory: $workingdir" +echo +echo "Address of the binary cache: $url" +echo +echo "Usage example: NIX_REMOTE= nix-store --option binary-caches '$url'" +echo +echo + +@lighttpd@/lighttpd -D -f "$workingdir/lighttpd.conf" + +cd / +@coreutils@/rm -rf "$workingdir" diff --git a/nixpkgs/pkgs/servers/http/nix-binary-cache/nix-binary-cache.cgi.in b/nixpkgs/pkgs/servers/http/nix-binary-cache/nix-binary-cache.cgi.in new file mode 100644 index 000000000000..890e68765b40 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/nix-binary-cache/nix-binary-cache.cgi.in @@ -0,0 +1,105 @@ +#! @shell@ + +STORE_DIR="${NIX_STORE_DIR:-/nix/store}" +MASS_QUERY=0 +PRIORITY=75 +COMPRESSION=bzip2 +KEY= +KEYNAME=na + +export NIX_REMOTE=daemon + +config="${NIX_BINARY_CACHE_CONFIG:-${HTTP_NIX_BINARY_CACHE_CONFIG:-/etc/nix/nix-binary-cache.cgi.conf}}" +config="$(cd "$(@coreutils@/dirname "$config")"; + @coreutils@/pwd)/$(@coreutils@/basename "$config")" +@coreutils@/test -e "$config" && . "$config" + +header(){ + echo "Content-Type: text/plain; charset=utf-8" + echo +} + +header404(){ + echo "Status: 404 Not Found" + echo +} + +clean_path() { + @gnused@/sed -re "s@^$STORE_DIR/?@@" | @findutils@/xargs +} + +storeq(){ + @nix@/nix-store -q "$@" +} + +sign(){ + test -n "$1" && + @coreutils@/sha256sum | @gnused@/sed -e 's/ .*//' | + @openssl@/openssl rsautl -sign -inkey "$@" | @coreutils@/base64 -w 0 +} + +case "$QUERY_STRING" in + "") + header + echo "Hello, this is a dynamically-generated Nix binary cache" + ;; + /debug) + header + set + ;; + /nix-cache-info) + header + echo "StoreDir: $STORE_DIR" + echo "WantMassQuery: $MASS_QUERY" + echo "Priority: $PRIORITY" + ;; + *.narinfo) + hash=${QUERY_STRING%.narinfo} + hash=${hash#/} + path="$(echo "$STORE_DIR/$hash-"* | @coreutils@/sort | @coreutils@/head -n 1)" + if [ -n "$path" ] && [ -e "$path" ]; then + header + info="$( + echo "StorePath: $path" + echo "URL: $(@coreutils@/basename "$path" + ).nar.$COMPRESSION" + echo "Compression: $COMPRESSION" + echo "NarHash: $(storeq --hash "$path")" + echo "NarSize: $(storeq --size "$path")" + echo "References: $(storeq --references "$path" | + @coreutils@/tac | clean_path )" + echo "Deriver: $(storeq --deriver "$path" | + clean_path )" + )" + signature="$(echo "$info" | sign "$KEY")" + + echo "$info" + echo "Signature: 1;$KEYNAME;$signature" + + else + header404 + exit 1 + fi + ;; + *.nar.xz) + path="$STORE_DIR${QUERY_STRING%.nar.xz}" + if [ -n "$path" ] && [ -e "$path" ]; then + header + @nix@/nix-store --dump "$path" | @xz@/xz + else + header404 + exit 1 + fi + ;; + *.nar.bzip2) + path="$STORE_DIR${QUERY_STRING%.nar.bzip2}" + echo "$path" >&2; + if [ -n "$path" ] && [ -e "$path" ]; then + header + @nix@/nix-store --dump "$path" | @bzip2@/bzip2 + else + header404 + exit 1 + fi + ;; +esac diff --git a/nixpkgs/pkgs/servers/http/openresty/default.nix b/nixpkgs/pkgs/servers/http/openresty/default.nix new file mode 100644 index 000000000000..1fe48e84fac7 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/openresty/default.nix @@ -0,0 +1,62 @@ +{ stdenv, fetchurl, openssl, zlib, pcre, postgresql, libxml2, libxslt, +gd, geoip, perl }: + +with stdenv.lib; + +stdenv.mkDerivation rec { + name = "openresty-${version}"; + version = "1.13.6.2"; + + src = fetchurl { + url = "https://openresty.org/download/openresty-${version}.tar.gz"; + sha256 = "0hi9zw4344a4i636g3nbnnlm8qbnq37f50irhd1xncih4xc1jvll"; + }; + + buildInputs = [ openssl zlib pcre libxml2 libxslt gd geoip postgresql ]; + nativeBuildInputs = [ perl ]; + + NIX_CFLAGS_COMPILE = ["-I${libxml2.dev}/include/libxml2"]; + + preConfigure = '' + patchShebangs . + ''; + + configureFlags = [ + "--with-pcre-jit" + "--with-http_ssl_module" + "--with-http_v2_module" + "--with-http_realip_module" + "--with-http_addition_module" + "--with-http_xslt_module" + "--with-http_image_filter_module" + "--with-http_geoip_module" + "--with-http_sub_module" + "--with-http_dav_module" + "--with-http_flv_module" + "--with-http_mp4_module" + "--with-http_gunzip_module" + "--with-http_gzip_static_module" + "--with-http_auth_request_module" + "--with-http_random_index_module" + "--with-http_secure_link_module" + "--with-http_degradation_module" + "--with-http_stub_status_module" + "--with-http_postgres_module" + "--with-ipv6" + ]; + + enableParallelBuilding = true; + + postInstall = '' + ln -s $out/luajit/bin/luajit-2.1.0-beta3 $out/bin/luajit-openresty + ln -s $out/nginx/sbin/nginx $out/bin/nginx + ''; + + meta = { + description = "A fast web application server built on Nginx"; + homepage = http://openresty.org; + license = licenses.bsd2; + platforms = platforms.all; + maintainers = with maintainers; [ thoughtpolice lblasc ]; + }; +} diff --git a/nixpkgs/pkgs/servers/http/pshs/default.nix b/nixpkgs/pkgs/servers/http/pshs/default.nix new file mode 100644 index 000000000000..c38ca046a35b --- /dev/null +++ b/nixpkgs/pkgs/servers/http/pshs/default.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libevent, file, qrencode, miniupnpc }: + +stdenv.mkDerivation rec { + name = "pshs-${version}"; + version = "0.3.3"; + + src = fetchFromGitHub { + owner = "mgorny"; + repo = "pshs"; + rev = "v${version}"; + sha256 = "04l03myh99npl78y8nss053gnc7k8q60vdbdpml19sshmwaw3fgi"; + }; + + nativeBuildInputs = [ autoreconfHook pkgconfig ]; + buildInputs = [ libevent file qrencode miniupnpc ]; + + # SSL requires libevent at 2.1 with ssl support + configureFlags = [ "--disable-ssl" ]; + + meta = { + description = "Pretty small HTTP server - a command-line tool to share files"; + homepage = https://github.com/mgorny/pshs; + license = stdenv.lib.licenses.bsd3; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/servers/http/redstore/default.nix b/nixpkgs/pkgs/servers/http/redstore/default.nix new file mode 100644 index 000000000000..7d592d0256b7 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/redstore/default.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchurl, redland, pkgconfig, gmp, zlib, librdf_raptor2 + , librdf_rasqal }: + +stdenv.mkDerivation rec { + name = "redstore-0.5.4"; + + src = fetchurl { + url = "https://www.aelius.com/njh/redstore/${name}.tar.gz"; + sha256 = "0hc1fjfbfvggl72zqx27v4wy84f5m7bp4dnwd8g41aw8lgynbgaq"; + }; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ gmp redland zlib librdf_raptor2 librdf_rasqal ]; + + preConfigure = '' + # Define _XOPEN_SOURCE to enable, e.g., getaddrinfo. + configureFlagsArray+=( + "CFLAGS=-D_XOPEN_SOURCE=600 -I${librdf_raptor2}/include/raptor2 -I${librdf_rasqal}/include/rasqal" + ) + ''; + + meta = { + description = "An HTTP interface to Redland RDF store"; + homepage = https://www.aelius.com/njh/redstore/; + maintainers = [ stdenv.lib.maintainers.raskin ]; + platforms = with stdenv.lib.platforms; + linux ++ freebsd ++ gnu; + license = stdenv.lib.licenses.gpl3Plus; + }; +} diff --git a/nixpkgs/pkgs/servers/http/spawn-fcgi/default.nix b/nixpkgs/pkgs/servers/http/spawn-fcgi/default.nix new file mode 100644 index 000000000000..b5d5d5f7992d --- /dev/null +++ b/nixpkgs/pkgs/servers/http/spawn-fcgi/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchsvn, autoconf, automake }: + +stdenv.mkDerivation rec { + name = "spawn-fcgi-${version}"; + version = "1.6.4"; + + src = fetchsvn { + url = "svn://svn.lighttpd.net/spawn-fcgi/tags/spawn-fcgi-${version}"; + sha256 = "07r6nwbg4881mdgp0hqh80c4x9wb7jg6cgc84ghwhfbd2abc2iq5"; + }; + + buildInputs = [ automake autoconf ]; + + preConfigure = '' + ./autogen.sh + ''; + + meta = with stdenv.lib; { + homepage = "http://redmine.lighttpd.net/projects/spawn-fcgi"; + description = "Provides an interface to external programs that support the FastCGI interface"; + license = licenses.bsd3; + maintainers = with maintainers; [ cstrahan ]; + platforms = with platforms; unix; + }; +} diff --git a/nixpkgs/pkgs/servers/http/tengine/default.nix b/nixpkgs/pkgs/servers/http/tengine/default.nix new file mode 100644 index 000000000000..36f326d5590b --- /dev/null +++ b/nixpkgs/pkgs/servers/http/tengine/default.nix @@ -0,0 +1,85 @@ +{ stdenv, fetchurl, openssl, zlib, pcre, libxml2, libxslt +, gd, geoip +, withDebug ? false +, withMail ? false +, withIPv6 ? true +, modules ? [] +, ... +}: + +with stdenv.lib; + +stdenv.mkDerivation rec { + version = "2.2.2"; + name = "tengine-${version}"; + + src = fetchurl { + url = "https://github.com/alibaba/tengine/archive/${name}.tar.gz"; + sha256 = "1vq73wsldvj7rc61ag85pvnaacrrq9rs0pfqv71z5iyvb5r3bxc2"; + }; + + buildInputs = + [ openssl zlib pcre libxml2 libxslt gd geoip ] + ++ concatMap (mod: mod.inputs or []) modules; + + configureFlags = [ + "--with-http_ssl_module" + "--with-http_v2_module" + "--with-http_realip_module" + "--with-http_addition_module" + "--with-http_xslt_module" + "--with-http_geoip_module" + "--with-http_sub_module" + "--with-http_dav_module" + "--with-http_flv_module" + "--with-http_mp4_module" + "--with-http_gunzip_module" + "--with-http_gzip_static_module" + "--with-http_auth_request_module" + "--with-http_concat_module" + "--with-http_random_index_module" + "--with-http_secure_link_module" + "--with-http_degradation_module" + "--with-http_stub_status_module" + "--with-http_sysguard_module" + "--with-threads" + "--with-pcre-jit" + "--with-http_slice_module" + ] ++ optional withDebug [ + "--with-debug" + ] ++ optional withMail [ + "--with-mail" + "--with-mail_ssl_module" + ] ++ optional (withMail != true) [ + "--without-mail_pop3_module" + "--without-mail_imap_module" + "--without-mail_smtp_module" + ] ++ optional withIPv6 [ + "--with-ipv6" + ] ++ optional (gd != null) "--with-http_image_filter_module" + ++ optional (with stdenv.hostPlatform; isLinux || isFreeBSD) "--with-file-aio" + ++ map (mod: "--add-module=${mod.src}") modules; + + NIX_CFLAGS_COMPILE = [ + "-I${libxml2.dev}/include/libxml2" + "-Wno-error=implicit-fallthrough" + ] ++ optional stdenv.isDarwin "-Wno-error=deprecated-declarations"; + + preConfigure = (concatMapStringsSep "\n" (mod: mod.preConfigure or "") modules); + + hardeningEnable = optional (!stdenv.isDarwin) "pie"; + + enableParallelBuilding = true; + + postInstall = '' + mv $out/sbin $out/bin + ''; + + meta = { + description = "A web server based on Nginx and has many advanced features, originated by Taobao."; + homepage = https://tengine.taobao.org; + license = licenses.bsd2; + platforms = platforms.all; + maintainers = with maintainers; [ izorkin ]; + }; +} diff --git a/nixpkgs/pkgs/servers/http/thttpd/default.nix b/nixpkgs/pkgs/servers/http/thttpd/default.nix new file mode 100644 index 000000000000..6e012c98737e --- /dev/null +++ b/nixpkgs/pkgs/servers/http/thttpd/default.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation rec { + name = "thttpd-${version}"; + version = "2.29"; + + src = fetchurl { + url = "https://acme.com/software/thttpd/${name}.tar.gz"; + sha256 = "15x3h4b49wgfywn82i3wwbf38mdns94mbi4ma9xiwsrjv93rzh4r"; + }; + + prePatch = '' + sed -i -e 's/getline/getlineX/' extras/htpasswd.c + sed -i -e 's/chmod 2755/chmod 755/' extras/Makefile.in + ''; + + preInstall = '' + mkdir -p "$out/man/man1" + sed -i -e 's/-o bin -g bin *//' Makefile + sed -i -e '/chgrp/d' extras/Makefile + ''; + + meta = { + description = "Tiny/turbo/throttling HTTP server"; + homepage = http://www.acme.com/software/thttpd/; + license = stdenv.lib.licenses.bsd2; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/servers/http/tomcat/axis2/builder.sh b/nixpkgs/pkgs/servers/http/tomcat/axis2/builder.sh new file mode 100644 index 000000000000..2e36367e9dcf --- /dev/null +++ b/nixpkgs/pkgs/servers/http/tomcat/axis2/builder.sh @@ -0,0 +1,15 @@ +source $stdenv/setup + +unzip $src +cd axis2-* +mkdir -p $out +cp -av * $out +cd webapp +ant +cd .. +mkdir -p $out/webapps +cp dist/axis2.war $out/webapps +cd $out/webapps +mkdir axis2 +cd axis2 +unzip ../axis2.war diff --git a/nixpkgs/pkgs/servers/http/tomcat/axis2/default.nix b/nixpkgs/pkgs/servers/http/tomcat/axis2/default.nix new file mode 100644 index 000000000000..7f14f6fff195 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/tomcat/axis2/default.nix @@ -0,0 +1,20 @@ +{ stdenv, fetchurl, apacheAnt, jdk, unzip }: + +stdenv.mkDerivation rec { + name = "axis2-${version}"; + version = "1.6.4"; + + src = fetchurl { + url = "http://apache.proserve.nl/axis/axis2/java/core/${version}/${name}-bin.zip"; + sha256 = "12ir706dn95567j6lkxdwrh28vnp6292h59qwjyqjm7ckglkmgyr"; + }; + + buildInputs = [ unzip apacheAnt jdk ]; + builder = ./builder.sh; + + meta = { + description = "Web Services / SOAP / WSDL engine, the successor to the widely used Apache Axis SOAP stack"; + platforms = stdenv.lib.platforms.unix; + license = stdenv.lib.licenses.asl20; + }; +} diff --git a/nixpkgs/pkgs/servers/http/tomcat/default.nix b/nixpkgs/pkgs/servers/http/tomcat/default.nix new file mode 100644 index 000000000000..8fe34cd6183d --- /dev/null +++ b/nixpkgs/pkgs/servers/http/tomcat/default.nix @@ -0,0 +1,56 @@ +{ stdenv, lib, fetchurl }: + +let + + common = { versionMajor, versionMinor, sha256 }: stdenv.mkDerivation (rec { + name = "apache-tomcat-${version}"; + version = "${versionMajor}.${versionMinor}"; + + src = fetchurl { + url = "mirror://apache/tomcat/tomcat-${versionMajor}/v${version}/bin/${name}.tar.gz"; + inherit sha256; + }; + + outputs = [ "out" "webapps" ]; + installPhase = + '' + mkdir $out + mv * $out + mkdir -p $webapps/webapps + mv $out/webapps $webapps/ + ''; + + meta = { + homepage = https://tomcat.apache.org/; + description = "An implementation of the Java Servlet and JavaServer Pages technologies"; + platforms = with lib.platforms; all; + maintainers = with lib.maintainers; [ danbst ]; + license = [ lib.licenses.asl20 ]; + }; + }); + +in { + tomcat7 = common { + versionMajor = "7"; + versionMinor = "0.82"; + sha256 = "0vb7c5i50ral4rr39ss95k7cxnzd7fs21zd7f97d1f3qslzwl69g"; + }; + + tomcat8 = common { + versionMajor = "8"; + versionMinor = "0.47"; + sha256 = "0xv4v3i08rwzfmz7rkhglq5cbjgnfava8dw0i33vsp7dk162a4g4"; + }; + + tomcat85 = common { + versionMajor = "8"; + versionMinor = "5.23"; + sha256 = "1qnww70x75c0qf2wn8mkpz5lszggjnh78dpb4chyw2fnbm3wxain"; + }; + + tomcat9 = common { + versionMajor = "9"; + versionMinor = "0.2"; + sha256 = "0aaykzi0b2xsdmjp60ihcjzh1m95p0a79kn5l2v7vgbkyg449638"; + }; +} diff --git a/nixpkgs/pkgs/servers/http/tomcat/jdbc/mysql/builder.sh b/nixpkgs/pkgs/servers/http/tomcat/jdbc/mysql/builder.sh new file mode 100644 index 000000000000..14829c5e85d8 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/tomcat/jdbc/mysql/builder.sh @@ -0,0 +1,4 @@ +source $stdenv/setup + +mkdir -p $out/lib +ln -s $mysql_jdbc/share/java/mysql-connector-java.jar $out/lib/mysql-connector-java.jar diff --git a/nixpkgs/pkgs/servers/http/tomcat/jdbc/mysql/default.nix b/nixpkgs/pkgs/servers/http/tomcat/jdbc/mysql/default.nix new file mode 100644 index 000000000000..d070a9f17404 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/tomcat/jdbc/mysql/default.nix @@ -0,0 +1,13 @@ +{ stdenv, mysql_jdbc }: + +stdenv.mkDerivation { + name = "tomcat-mysql-jdbc"; + builder = ./builder.sh; + buildInputs = [ mysql_jdbc ]; + + inherit mysql_jdbc; + + meta = { + platforms = stdenv.lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/servers/http/unit/default.nix b/nixpkgs/pkgs/servers/http/unit/default.nix new file mode 100644 index 000000000000..a3948bb69088 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/unit/default.nix @@ -0,0 +1,69 @@ +{ stdenv, fetchFromGitHub, which +, withPython ? true, python +, withPHP71 ? false, php71 +, withPHP72 ? true, php72 +, withPHP73 ? false, php73 +, withPerl ? true, perl +, withPerldevel ? false, perldevel +, withRuby_2_3 ? false, ruby_2_3 +, withRuby_2_4 ? false, ruby_2_4 +, withRuby ? true, ruby +, withSSL ? true, openssl ? null +, withIPv6 ? true +, withDebug ? false +}: + +with stdenv.lib; + +stdenv.mkDerivation rec { + version = "1.7"; + name = "unit-${version}"; + + src = fetchFromGitHub { + owner = "nginx"; + repo = "unit"; + rev = "${version}"; + sha256 = "1klwricr0mxhw5wka35vnl919821vcvaf5w3ixvkbxaisml19qq4"; + }; + + nativeBuildInputs = [ which ]; + + buildInputs = [ ] + ++ optional withPython python + ++ optional withPHP71 php71 + ++ optional withPHP72 php72 + ++ optional withPHP73 php73 + ++ optional withPerl perl + ++ optional withPerldevel perldevel + ++ optional withRuby_2_3 ruby_2_3 + ++ optional withRuby_2_4 ruby_2_4 + ++ optional withRuby ruby + ++ optional withSSL openssl; + + configureFlags = [ + "--control=unix:/run/control.unit.sock" + "--pid=/run/unit.pid" + ] ++ optional withSSL [ "--openssl" ] + ++ optional (!withIPv6) [ "--no-ipv6" ] + ++ optional withDebug [ "--debug" ]; + + postConfigure = '' + ${optionalString withPython "./configure python --module=python --config=${python}/bin/python-config --lib-path=${python}/lib"} + ${optionalString withPHP71 "./configure php --module=php71 --config=${php71.dev}/bin/php-config --lib-path=${php71}/lib"} + ${optionalString withPHP72 "./configure php --module=php72 --config=${php72.dev}/bin/php-config --lib-path=${php72}/lib"} + ${optionalString withPHP73 "./configure php --module=php73 --config=${php73.dev}/bin/php-config --lib-path=${php73}/lib"} + ${optionalString withPerl "./configure perl --module=perl --perl=${perl}/bin/perl"} + ${optionalString withPerldevel "./configure perl --module=perl529 --perl=${perldevel}/bin/perl"} + ${optionalString withRuby_2_3 "./configure ruby --module=ruby23 --ruby=${ruby_2_3}/bin/ruby"} + ${optionalString withRuby_2_4 "./configure ruby --module=ruby24 --ruby=${ruby_2_4}/bin/ruby"} + ${optionalString withRuby "./configure ruby --module=ruby --ruby=${ruby}/bin/ruby"} + ''; + + meta = { + description = "Dynamic web and application server, designed to run applications in multiple languages."; + homepage = https://unit.nginx.org/; + license = licenses.asl20; + platforms = platforms.linux; + maintainers = with maintainers; [ izorkin ]; + }; +} diff --git a/nixpkgs/pkgs/servers/http/webfs/default.nix b/nixpkgs/pkgs/servers/http/webfs/default.nix new file mode 100644 index 000000000000..3fb3890f9c4e --- /dev/null +++ b/nixpkgs/pkgs/servers/http/webfs/default.nix @@ -0,0 +1,34 @@ +{ stdenv, fetchurl, openssl }: +let + # Let's not pull the whole apache httpd package + mime_file = fetchurl { + url = https://raw.githubusercontent.com/apache/httpd/906e419c1f703360e2e8ec077b393347f993884f/docs/conf/mime.types; + sha256 = "ef972fc545cbff4c0daa2b2e6b440859693b3c10435ee90f10fa6fffad800c16"; + }; +in +stdenv.mkDerivation rec { + name = "webfs-${version}"; + version = "1.21"; + + src = fetchurl { + url = "https://www.kraxel.org/releases/webfs/${name}.tar.gz"; + sha256 = "98c1cb93473df08e166e848e549f86402e94a2f727366925b1c54ab31064a62a"; + }; + + patches = [ ./ls.c.patch ]; + + buildInputs = [ openssl ]; + + makeFlags = [ + "mimefile=${mime_file}" + "prefix=$(out)" + ]; + + meta = with stdenv.lib; { + description = "HTTP server for purely static content"; + homepage = http://linux.bytesex.org/misc/webfs.html; + license = licenses.gpl2; + platforms = platforms.all; + maintainers = with maintainers; [ zimbatm ]; + }; +} diff --git a/nixpkgs/pkgs/servers/http/webfs/ls.c.patch b/nixpkgs/pkgs/servers/http/webfs/ls.c.patch new file mode 100644 index 000000000000..78b83b725887 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/webfs/ls.c.patch @@ -0,0 +1,13 @@ +# Source: homebrew +# https://raw.githubusercontent.com/Homebrew/patches/0518a6d1/webfs/patch-ls.c +--- ./ls.c.orig Fri Oct 15 14:20:50 2004 ++++ ./ls.c Fri Oct 15 14:21:13 2004 +@@ -160,7 +160,7 @@ + return buf; + } + +-#if !defined(__FreeBSD__) && !defined(__OpenBSD__) ++#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__APPLE__) + static void strmode(mode_t mode, char *dest) + { + static const char *rwx[] = { diff --git a/nixpkgs/pkgs/servers/http/webhook/default.nix b/nixpkgs/pkgs/servers/http/webhook/default.nix new file mode 100644 index 000000000000..5d6b47d28b5d --- /dev/null +++ b/nixpkgs/pkgs/servers/http/webhook/default.nix @@ -0,0 +1,22 @@ +{ lib, buildGoPackage, fetchFromGitHub }: + +buildGoPackage rec { + name = "webhook-${version}"; + version = "2.6.8"; + + goPackagePath = "github.com/adnanh/webhook"; + excludedPackages = [ "test" ]; + + src = fetchFromGitHub { + owner = "adnanh"; + repo = "webhook"; + rev = version; + sha256 = "05q6nv04ml1gr4k79czg03i3ifl05xq29iapkgrl3k0a36czxlgs"; + }; + + meta = with lib; { + homepage = https://github.com/adnanh/webhook; + license = [ licenses.mit ]; + description = "incoming webhook server that executes shell commands"; + }; +} diff --git a/nixpkgs/pkgs/servers/http/winstone/default.nix b/nixpkgs/pkgs/servers/http/winstone/default.nix new file mode 100644 index 000000000000..6a92c0a228af --- /dev/null +++ b/nixpkgs/pkgs/servers/http/winstone/default.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation rec { + name = "winstone-${version}"; + version = "0.9.10"; + + src = fetchurl { + url = "mirror://sourceforge/winstone/${name}.jar"; + sha256 = "17xvq3yk95335c6ag1bmbmxlvh7gqq35ifi64r2l6rnvrf6pqyan"; + }; + + phases = [ "installPhase" ]; + + installPhase = '' + mkdir -p $out/lib + cp $src $out/lib/winstone.jar + ''; + + meta = { + homepage = http://winstone.sourceforge.net/; + description = "A simple Java Servlet container"; + license = stdenv.lib.licenses.cddl; + platforms = stdenv.lib.platforms.all; + maintainers = [ stdenv.lib.maintainers.rickynils ]; + }; +} diff --git a/nixpkgs/pkgs/servers/http/yaws/default.nix b/nixpkgs/pkgs/servers/http/yaws/default.nix new file mode 100644 index 000000000000..827f6122b573 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/yaws/default.nix @@ -0,0 +1,35 @@ +{stdenv, fetchurl, erlang, pam, perl }: + +stdenv.mkDerivation rec { + name = "yaws-${version}"; + version = "2.0.6"; + + src = fetchurl { + url = "http://yaws.hyber.org/download/${name}.tar.gz"; + sha256 = "03nh97g7smsgm6sw5asssmlq7zgx6y2gnn7jn0lv2x5mkf5nzyb9"; + }; + + # The tarball includes a symlink yaws -> yaws-1.95, which seems to be + # necessary for importing erlang files + unpackPhase = '' + tar xzf $src + cd $name + ''; + + configureFlags = [ "--with-extrainclude=${pam}/include/security" ]; + + buildInputs = [ erlang pam perl ]; + + postInstall = '' + sed -i "s#which #type -P #" $out/bin/yaws + ''; + + meta = with stdenv.lib; { + description = "A high performance HTTP 1.1 server in Erlang"; + homepage = http://yaws.hyber.org; + license = licenses.bsd2; + platforms = platforms.linux; + maintainers = with maintainers; [ goibhniu the-kenny ]; + }; + +} |