diff --git a/openwrt/package/Makefile b/openwrt/package/Makefile index 3c5662022d1df86d61104e5392d2ad7c66c0ad89..5e5087d92515e562cf669a67868889051f379dc1 100644 --- a/openwrt/package/Makefile +++ b/openwrt/package/Makefile @@ -107,7 +107,7 @@ package-$(BR2_PACKAGE_MARADNS) += maradns package-$(BR2_PACKAGE_MATRIXSSL) += matrixssl package-$(BR2_PACKAGE_MICROCOM) += microcom package-$(BR2_PACKAGE_MICROPERL) += microperl -package-$(BR2_PACKAGE_MINI_HTTPD) += mini_httpd +package-$(BR2_COMPILE_MINI_HTTPD) += mini_httpd package-$(BR2_PACKAGE_MINI_SENDMAIL) += mini_sendmail package-$(BR2_PACKAGE_MONIT) += monit package-$(BR2_PACKAGE_MPD) += mpd @@ -248,7 +248,6 @@ libvorbis-compile: libogg-compile libxml2-compile: zlib-compile libxslt-compile: libxml2-compile lighttpd-compile: openssl-compile pcre-compile -mini_httpd-compile: matrixssl-compile mt-daapd-compile: howl-compile libgdbm-compile libid3tag-compile mtr-compile: ncurses-compile mysql-compile: ncurses-compile zlib-compile @@ -314,6 +313,13 @@ ifneq ($(BR2_PACKAGE_FREERADIUS_MOD_SQL_PGSQL),) freeradius-compile: postgresql-compile endif +ifneq ($(BR2_PACKAGE_MINI_HTTPD_MATRIXSSL),) +mini_httpd-compile: matrixssl-compile +endif +ifneq ($(BR2_PACKAGE_MINI_HTTPD_OPENSSL),) +mini_httpd-compile: openssl-compile +endif + ifneq ($(BR2_PACKAGE_MPD_MP3),) mpd-compile: libid3tag-compile libmad-compile endif diff --git a/openwrt/package/mini_httpd/Config.in b/openwrt/package/mini_httpd/Config.in index 484924f791bc64ef097e69f438bb1618abb30cb7..fb319ae12a070a109379b15472559813992639e7 100644 --- a/openwrt/package/mini_httpd/Config.in +++ b/openwrt/package/mini_httpd/Config.in @@ -1,6 +1,66 @@ +config BR2_COMPILE_MINI_HTTPD + bool + default n + depends BR2_PACKAGE_MINI_HTTPD || BR2_PACKAGE_MINI_HTTPD_MATRIXSSL || BR2_PACKAGE_MINI_HTTPD_OPENSSL + config BR2_PACKAGE_MINI_HTTPD tristate "mini-httpd - A small web server" default m if CONFIG_DEVEL + select BR2_COMPILE_MINI_HTTPD + help + mini_httpd is a small HTTP server. Its performance is not great, but for + low or medium traffic sites it's quite adequate. It implements all the + basic features of an HTTP server, including: + + * GET, HEAD, and POST methods. + * CGI. + * Basic authentication. + * Security against ".." filename snooping. + * The common MIME types. + * Trailing-slash redirection. + * index.html, index.htm, index.cgi + * Directory listings. + * Multihoming / virtual hosting. + * Standard logging. + * Custom error pages. + + It can also be configured to do IPv6. + + http://www.acme.com/software/mini_httpd/ + + +config BR2_PACKAGE_MINI_HTTPD_MATRIXSSL + tristate "mini-httpd-matrixssl - A small web server, built with SSL support using MatrixSSL" + default m if CONFIG_DEVEL + select BR2_COMPILE_MINI_HTTPD + select BR2_PACKAGE_LIBMATRIXSSL + help + mini_httpd is a small HTTP server. Its performance is not great, but for + low or medium traffic sites it's quite adequate. It implements all the + basic features of an HTTP server, including: + + * GET, HEAD, and POST methods. + * CGI. + * Basic authentication. + * Security against ".." filename snooping. + * The common MIME types. + * Trailing-slash redirection. + * index.html, index.htm, index.cgi + * Directory listings. + * Multihoming / virtual hosting. + * Standard logging. + * Custom error pages. + + It can also be configured to do SSL/HTTPS and IPv6. + + http://www.acme.com/software/mini_httpd/ + + +config BR2_PACKAGE_MINI_HTTPD_OPENSSL + tristate "mini-httpd-openssl - A small web server, built with SSL support using OpenSSL" + default m if CONFIG_DEVEL + select BR2_COMPILE_MINI_HTTPD + select BR2_PACKAGE_LIBOPENSSL help mini_httpd is a small HTTP server. Its performance is not great, but for low or medium traffic sites it's quite adequate. It implements all the diff --git a/openwrt/package/mini_httpd/Makefile b/openwrt/package/mini_httpd/Makefile index aa9d89b1bda89da1b6b4e56024c5001da1652eda..2261b54cd681b131ac886374bab1bd977891d246 100644 --- a/openwrt/package/mini_httpd/Makefile +++ b/openwrt/package/mini_httpd/Makefile @@ -16,6 +16,8 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/mini_httpd-$(PKG_VERSION) include $(TOPDIR)/package/rules.mk $(eval $(call PKG_template,MINI_HTTPD,mini-httpd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) +$(eval $(call PKG_template,MINI_HTTPD_MATRIXSSL,mini-httpd-matrixssl,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) +$(eval $(call PKG_template,MINI_HTTPD_OPENSSL,mini-httpd-openssl,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) $(PKG_BUILD_DIR)/.configured: @@ -23,18 +25,43 @@ $(PKG_BUILD_DIR)/.configured: touch $@ $(PKG_BUILD_DIR)/.built: + # with MatrixSSL +ifneq ($(BR2_PACKAGE_MINI_HTTPD_MATRIXSSL),) $(MAKE) -C $(PKG_BUILD_DIR) \ CC=$(TARGET_CC) \ OFLAGS="$(TARGET_CFLAGS)" \ + SSL_DEFS="-DUSE_SSL -DHAVE_MATRIXSSL" \ SSL_INC="-I$(STAGING_DIR)/usr/include" \ SSL_LIBS="-L$(STAGING_DIR)/usr/lib -lmatrixssl" \ + SSL_OBJS="matrixssl_helper.o" \ all + (cd $(PKG_BUILD_DIR); mv mini_httpd mini_httpd-matrixssl; ) + $(MAKE) -C $(PKG_BUILD_DIR) clean +endif + # with OpenSSL +ifneq ($(BR2_PACKAGE_MINI_HTTPD_OPENSSL),) + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC=$(TARGET_CC) \ + OFLAGS="$(TARGET_CFLAGS)" \ + SSL_DEFS="-DUSE_SSL -DHAVE_OPENSSL" \ + SSL_INC="-I$(STAGING_DIR)/usr/include" \ + SSL_LIBS="-L$(STAGING_DIR)/usr/lib -lssl -lcrypto" \ + all + (cd $(PKG_BUILD_DIR); mv mini_httpd mini_httpd-openssl; ) + $(MAKE) -C $(PKG_BUILD_DIR) clean +endif + # without SSL +ifneq ($(BR2_PACKAGE_MINI_HTTPD),) + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC=$(TARGET_CC) \ + OFLAGS="$(TARGET_CFLAGS)" \ + all +endif touch $@ $(IPKG_MINI_HTTPD): install -d -m0755 $(IDIR_MINI_HTTPD)/etc - install -m0644 ./files/mini_httpd.conf $(IDIR_MINI_HTTPD)/etc/ - install -m0600 ./files/mini_httpd.pem $(IDIR_MINI_HTTPD)/etc/ + install -m0644 ./files/mini_httpd.conf $(IDIR_MINI_HTTPD)/etc/mini_httpd.conf install -d -m0755 $(IDIR_MINI_HTTPD)/etc/default install -m0644 ./files/mini_httpd.default $(IDIR_MINI_HTTPD)/etc/default/mini_httpd install -d -m0755 $(IDIR_MINI_HTTPD)/etc/init.d @@ -43,3 +70,29 @@ $(IPKG_MINI_HTTPD): install -m0755 $(PKG_BUILD_DIR)/mini_httpd $(IDIR_MINI_HTTPD)/usr/sbin/ $(RSTRIP) $(IDIR_MINI_HTTPD) $(IPKG_BUILD) $(IDIR_MINI_HTTPD) $(PACKAGE_DIR) + +$(IPKG_MINI_HTTPD_MATRIXSSL): + install -d -m0755 $(IDIR_MINI_HTTPD_MATRIXSSL)/etc + install -m0644 ./files/mini_httpd-ssl.conf $(IDIR_MINI_HTTPD_MATRIXSSL)/etc/mini_httpd.conf + install -m0600 ./files/mini_httpd.pem $(IDIR_MINI_HTTPD_MATRIXSSL)/etc/ + install -d -m0755 $(IDIR_MINI_HTTPD_MATRIXSSL)/etc/default + install -m0644 ./files/mini_httpd.default $(IDIR_MINI_HTTPD_MATRIXSSL)/etc/default/mini_httpd + install -d -m0755 $(IDIR_MINI_HTTPD_MATRIXSSL)/etc/init.d + install -m0755 ./files/mini_httpd.init $(IDIR_MINI_HTTPD_MATRIXSSL)/etc/init.d/mini_httpd + install -d -m0755 $(IDIR_MINI_HTTPD_MATRIXSSL)/usr/sbin + install -m0755 $(PKG_BUILD_DIR)/mini_httpd-matrixssl $(IDIR_MINI_HTTPD_MATRIXSSL)/usr/sbin/mini_httpd + $(RSTRIP) $(IDIR_MINI_HTTPD_MATRIXSSL) + $(IPKG_BUILD) $(IDIR_MINI_HTTPD_MATRIXSSL) $(PACKAGE_DIR) + +$(IPKG_MINI_HTTPD_OPENSSL): + install -d -m0755 $(IDIR_MINI_HTTPD_OPENSSL)/etc + install -m0644 ./files/mini_httpd-ssl.conf $(IDIR_MINI_HTTPD_OPENSSL)/etc/mini_httpd.conf + install -m0600 ./files/mini_httpd.pem $(IDIR_MINI_HTTPD_OPENSSL)/etc/ + install -d -m0755 $(IDIR_MINI_HTTPD_OPENSSL)/etc/default + install -m0644 ./files/mini_httpd.default $(IDIR_MINI_HTTPD_OPENSSL)/etc/default/mini_httpd + install -d -m0755 $(IDIR_MINI_HTTPD_OPENSSL)/etc/init.d + install -m0755 ./files/mini_httpd.init $(IDIR_MINI_HTTPD_OPENSSL)/etc/init.d/mini_httpd + install -d -m0755 $(IDIR_MINI_HTTPD_OPENSSL)/usr/sbin + install -m0755 $(PKG_BUILD_DIR)/mini_httpd-openssl $(IDIR_MINI_HTTPD_OPENSSL)/usr/sbin/mini_httpd + $(RSTRIP) $(IDIR_MINI_HTTPD_OPENSSL) + $(IPKG_BUILD) $(IDIR_MINI_HTTPD_OPENSSL) $(PACKAGE_DIR) diff --git a/openwrt/package/mini_httpd/files/mini_httpd-ssl.conf b/openwrt/package/mini_httpd/files/mini_httpd-ssl.conf new file mode 100644 index 0000000000000000000000000000000000000000..1cd7022d5405550a514c6a77e343113022f4475b --- /dev/null +++ b/openwrt/package/mini_httpd/files/mini_httpd-ssl.conf @@ -0,0 +1,7 @@ +cgipat=cgi-bin/**|**.sh +dir=/www +nochroot +pidfile=/var/run/mini_httpd.pid +user=root +ssl +certfile=/etc/mini_httpd.pem diff --git a/openwrt/package/mini_httpd/files/mini_httpd.conf b/openwrt/package/mini_httpd/files/mini_httpd.conf index 2e784520ac75b6005c7dd99992cd76c8ebd31285..d636a4378bd52b87c57290361f5e85f79ecd8daa 100644 --- a/openwrt/package/mini_httpd/files/mini_httpd.conf +++ b/openwrt/package/mini_httpd/files/mini_httpd.conf @@ -1,7 +1,5 @@ -cgipat=cgi-bin/* +cgipat=cgi-bin/**|**.sh dir=/www nochroot pidfile=/var/run/mini_httpd.pid user=root -ssl -certfile=/etc/mini_httpd.pem diff --git a/openwrt/package/mini_httpd/files/mini_httpd.init b/openwrt/package/mini_httpd/files/mini_httpd.init index a6905591db25f6a97dfbc9094ea003df742152c4..77bd6fd3b7c4c01cd01d878ae5b9867d87a676dc 100644 --- a/openwrt/package/mini_httpd/files/mini_httpd.init +++ b/openwrt/package/mini_httpd/files/mini_httpd.init @@ -1,20 +1,25 @@ #!/bin/sh -DEFAULT=/etc/default/mini_httpd +BIN=mini_httpd +DEFAULT=/etc/default/$BIN RUN_D=/var/run -PID_F=$RUN_D/mini_httpd.pid +PID_F=$RUN_D/$BIN.pid [ -f $DEFAULT ] && . $DEFAULT case $1 in start) [ -d $RUN_D ] || mkdir -p $RUN_D - mini_httpd $OPTIONS + $BIN $OPTIONS 2>/dev/null ;; stop) [ -f $PID_F ] && kill $(cat $PID_F) ;; + restart) + $0 stop + $0 start + ;; *) - echo "usage: $0 (start|stop)" + echo "usage: $0 (start|stop|restart)" exit 1 esac diff --git a/openwrt/package/mini_httpd/ipkg/mini-httpd-matrixssl.conffiles b/openwrt/package/mini_httpd/ipkg/mini-httpd-matrixssl.conffiles new file mode 100644 index 0000000000000000000000000000000000000000..36a86b957c7e85abfb61c5b7fd09e3139e3eac18 --- /dev/null +++ b/openwrt/package/mini_httpd/ipkg/mini-httpd-matrixssl.conffiles @@ -0,0 +1,3 @@ +/etc/default/mini_httpd +/etc/mini_httpd.conf +/etc/mini_httpd.pem diff --git a/openwrt/package/mini_httpd/ipkg/mini-httpd-matrixssl.control b/openwrt/package/mini_httpd/ipkg/mini-httpd-matrixssl.control new file mode 100644 index 0000000000000000000000000000000000000000..92129971548f8b0d947f555b431cc02be91ab82f --- /dev/null +++ b/openwrt/package/mini_httpd/ipkg/mini-httpd-matrixssl.control @@ -0,0 +1,9 @@ +Package: mini-httpd-matrixssl +Priority: optional +Section: net +Version: [TBDL] +Architecture: [TBDL] +Maintainer: OpenWrt Developers Team <openwrt-devel@openwrt.org> +Source: buildroot internal +Description: A small HTTP server, built with SSL support using MatrixSSL. +Depends: libmatrixssl diff --git a/openwrt/package/mini_httpd/ipkg/mini-httpd-openssl.conffiles b/openwrt/package/mini_httpd/ipkg/mini-httpd-openssl.conffiles new file mode 100644 index 0000000000000000000000000000000000000000..36a86b957c7e85abfb61c5b7fd09e3139e3eac18 --- /dev/null +++ b/openwrt/package/mini_httpd/ipkg/mini-httpd-openssl.conffiles @@ -0,0 +1,3 @@ +/etc/default/mini_httpd +/etc/mini_httpd.conf +/etc/mini_httpd.pem diff --git a/openwrt/package/mini_httpd/ipkg/mini-httpd-openssl.control b/openwrt/package/mini_httpd/ipkg/mini-httpd-openssl.control new file mode 100644 index 0000000000000000000000000000000000000000..97bc916a8071b66c13b01a36238a37420801e27d --- /dev/null +++ b/openwrt/package/mini_httpd/ipkg/mini-httpd-openssl.control @@ -0,0 +1,9 @@ +Package: mini-httpd-openssl +Priority: optional +Section: net +Version: [TBDL] +Architecture: [TBDL] +Maintainer: OpenWrt Developers Team <openwrt-devel@openwrt.org> +Source: buildroot internal +Description: A small HTTP server, built with SSL support using OpenSSL. +Depends: libopenssl diff --git a/openwrt/package/mini_httpd/ipkg/mini-httpd.conffiles b/openwrt/package/mini_httpd/ipkg/mini-httpd.conffiles index 36a86b957c7e85abfb61c5b7fd09e3139e3eac18..d1123c2a377f0bc57db1dadb0c421d98e89832c4 100644 --- a/openwrt/package/mini_httpd/ipkg/mini-httpd.conffiles +++ b/openwrt/package/mini_httpd/ipkg/mini-httpd.conffiles @@ -1,3 +1,2 @@ /etc/default/mini_httpd /etc/mini_httpd.conf -/etc/mini_httpd.pem diff --git a/openwrt/package/mini_httpd/ipkg/mini-httpd.control b/openwrt/package/mini_httpd/ipkg/mini-httpd.control index 5084053179dac33ddaaf862b075eb88071e0aefe..2082aad7e2d1895b47b83bc908193b86be3df4fa 100644 --- a/openwrt/package/mini_httpd/ipkg/mini-httpd.control +++ b/openwrt/package/mini_httpd/ipkg/mini-httpd.control @@ -3,7 +3,7 @@ Priority: optional Section: net Version: [TBDL] Architecture: [TBDL] -Maintainer: OpenWrt Developers Team <bugs@openwrt.org> -Source: http://openwrt.org/cgi-bin/viewcvs.cgi/openwrt/package/mini_httpd/ +Maintainer: OpenWrt Developers Team <openwrt-devel@openwrt.org> +Source: buildroot internal Description: A small HTTP server, built with SSL support using MatrixSSL. Depends: libmatrixssl diff --git a/openwrt/package/mini_httpd/patches/001-cgi_path.patch b/openwrt/package/mini_httpd/patches/001-cgi_path.patch new file mode 100644 index 0000000000000000000000000000000000000000..c847d948b47bc65c64f5d89ef009209597552df4 --- /dev/null +++ b/openwrt/package/mini_httpd/patches/001-cgi_path.patch @@ -0,0 +1,16 @@ +diff -ruN mini_httpd-1.19-old/mini_httpd.c mini_httpd-1.19-new/mini_httpd.c +--- mini_httpd-1.19-old/mini_httpd.c 2005-10-19 01:11:24.000000000 +0200 ++++ mini_httpd-1.19-new/mini_httpd.c 2005-10-19 01:13:05.000000000 +0200 +@@ -138,10 +138,10 @@ + #define CGI_NICE 10 + #endif /* CGI_NICE */ + #ifndef CGI_PATH +-#define CGI_PATH "/usr/local/bin:/usr/ucb:/bin:/usr/bin" ++#define CGI_PATH "/usr/bin:/bin:/usr/sbin:/sbin" + #endif /* CGI_PATH */ + #ifndef CGI_LD_LIBRARY_PATH +-#define CGI_LD_LIBRARY_PATH "/usr/local/lib:/usr/lib" ++#define CGI_LD_LIBRARY_PATH "/usr/lib:/lib" + #endif /* CGI_LD_LIBRARY_PATH */ + #ifndef AUTH_FILE + #define AUTH_FILE ".htpasswd" diff --git a/openwrt/package/mini_httpd/patches/500-matrixssl.patch b/openwrt/package/mini_httpd/patches/500-matrixssl.patch index e2d83af88e6744d32e5e267c775ae72282ca491c..0ab8d683311eaf029fcab4df243212a82d816ebe 100644 --- a/openwrt/package/mini_httpd/patches/500-matrixssl.patch +++ b/openwrt/package/mini_httpd/patches/500-matrixssl.patch @@ -14,11 +14,11 @@ diff -ruN mini_httpd-1.19-orig/Makefile mini_httpd-1.19-3/Makefile +#SSL_OBJS = + +# MatrixSSL -+SSL_TREE = -+SSL_DEFS = -DUSE_SSL -DHAVE_MATRIXSSL -+SSL_INC = -+SSL_LIBS = -lmatrixssl -+SSL_OBJS = matrixssl_helper.o ++#SSL_TREE = ++#SSL_DEFS = -DUSE_SSL -DHAVE_MATRIXSSL ++#SSL_INC = ++#SSL_LIBS = -lmatrixssl ++#SSL_OBJS = matrixssl_helper.o -BINDIR = /usr/local/sbin