# # \brief Example for hosting the genode.org website on Genode # \author Norman Feske # \date 2012-08-16 # # This run script uses the lighttpd web server to host the genode.org website. # When executed the first time, the genode.org website is downloaded to # 'bin/genode_org/website'. When the web server is up, you may point your web # browser to http://localhost:5555 # create_boot_directory import_from_depot [depot_user]/src/[base_src] \ [depot_user]/pkg/[drivers_nic_pkg] \ [depot_user]/src/init \ [depot_user]/src/nic_router \ [depot_user]/src/libc \ [depot_user]/src/libssh \ [depot_user]/src/lighttpd \ [depot_user]/src/openssl \ [depot_user]/src/posix \ [depot_user]/src/vfs \ [depot_user]/src/vfs_lwip \ [depot_user]/src/zlib install_config { } # # Create TAR archive containting the web-server configuration and the # website content. # # lighttpd configuration exec mkdir -p bin/genode_org/etc/lighttpd set fd [open "bin/genode_org/etc/lighttpd/lighttpd.conf" w] puts $fd { server.port = 80 server.document-root = "/website" server.event-handler = "select" server.network-backend = "write" server.max-keep-alive-requests = 0 index-file.names = ( "index", "index.html", "index.htm" ) mimetype.assign = ( ".png" => "image/png", ".jpg" => "image/jpeg", ".jpeg" => "image/jpeg", ".gif" => "image/gif", ".css" => "text/css", ".html" => "text/html", ".htm" => "text/html", "" => "text/html", ) } close $fd # mirror of genode.org website if {![file exists bin/genode_org/website/index]} { puts "mirroring genode.org website to bin/genode_org/website..." exec mkdir -p bin/genode_org/website # ignore wget errors catch { exec wget -nH -Lrc -P bin/genode_org/website https://genode.org } } exec tar cfv bin/genode_org.tar -h -C bin/genode_org . build_boot_image { genode_org.tar } append qemu_args " -nographic " append_qemu_nic_args "hostfwd=tcp::5555-:80" run_genode_until forever