From: Waldemar Kozaczuk <jwkozac...@gmail.com>
Committer: Waldemar Kozaczuk <jwkozac...@gmail.com>
Branch: master

Added version of lighttpd that takes files from host

Signed-off-by: Waldemar Kozaczuk <jwkozac...@gmail.com>

---
diff --git a/lighttpd-from-host/Makefile b/lighttpd-from-host/Makefile
--- a/lighttpd-from-host/Makefile
+++ b/lighttpd-from-host/Makefile
@@ -0,0 +1,20 @@
+.PHONY: module clean
+
+SRC = $(shell readlink -f ../..)
+
+lighttpd_path = $(shell realpath $$(which lighttpd))
+
+ifneq "$(wildcard /usr/lib64/lighttpd)" ""
+lighttpd_lib_path = /usr/lib64/lighttpd
+else
+lighttpd_lib_path = /usr/lib/lighttpd
+endif
+
+module:
+       $(SRC)/scripts/manifest_from_host.sh $(lighttpd_path) > usr.manifest
+       echo '/www-data/**: $${MODULE_DIR}/www-data/**' >> usr.manifest
+       echo '/lighttpd.conf: $${MODULE_DIR}/lighttpd.conf' >> usr.manifest
+ @if [ -d $(lighttpd_lib_path) ]; then echo '/usr/lib/lighttpd/**: $(lighttpd_lib_path)/**' >> usr.manifest; else echo 'ERROR: Failed to find lighttpd libraries'; fi
+
+clean:
+       rm -rf usr.manifest
diff --git a/lighttpd-from-host/lighttpd.conf b/lighttpd-from-host/lighttpd.conf
--- a/lighttpd-from-host/lighttpd.conf
+++ b/lighttpd-from-host/lighttpd.conf
@@ -0,0 +1,13 @@
+server.document-root = "/www-data/"
+
+server.port = 80
+
+mimetype.assign = (
+    ".html" => "text/html",
+    ".txt" => "text/plain",
+    ".jpg" => "image/jpeg",
+    ".png" => "image/png"
+)
+
+index-file.names = ( "index.html" )
+dir-listing.activate = "enable"
diff --git a/lighttpd-from-host/module.py b/lighttpd-from-host/module.py
--- a/lighttpd-from-host/module.py
+++ b/lighttpd-from-host/module.py
@@ -0,0 +1,3 @@
+from osv.modules import api
+
+default = api.run('/lighttpd -D -f /lighttpd.conf')
diff --git a/lighttpd-from-host/www-data/index.html b/lighttpd-from-host/www-data/index.html
--- a/lighttpd-from-host/www-data/index.html
+++ b/lighttpd-from-host/www-data/index.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <title>lighttpd test</title>
+    </head>
+    <body>
+        Hello, world!
+    </body>
+</html>

--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/000000000000b903d3058fc8c4a6%40google.com.

Reply via email to