2012-08-17 07:04:00 +00:00
|
|
|
#
|
|
|
|
# \brief Example for running lighttpd
|
|
|
|
# \author Norman Feske
|
|
|
|
# \date 2012-08-16
|
|
|
|
#
|
|
|
|
|
2020-05-28 14:27:24 +00:00
|
|
|
proc ip_stack { } { return lwip }
|
|
|
|
|
|
|
|
proc socket_fs_plugin { } {
|
2024-03-18 11:37:32 +00:00
|
|
|
return "<[ip_stack] dhcp=\"yes\"/>"
|
|
|
|
}
|
2020-05-28 14:27:24 +00:00
|
|
|
|
2024-03-18 11:37:32 +00:00
|
|
|
proc nic_router_uplink { } {
|
|
|
|
# static IP config on Linux
|
2020-05-28 14:27:24 +00:00
|
|
|
if {[have_spec linux]} {
|
2024-03-18 11:37:32 +00:00
|
|
|
return {<domain name="uplink" interface="10.0.2.55/24" gateway="10.0.2.1">}
|
2020-05-28 14:27:24 +00:00
|
|
|
} else {
|
2024-03-18 11:37:32 +00:00
|
|
|
return {<domain name="uplink">}
|
2020-05-28 14:27:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-17 07:04:00 +00:00
|
|
|
create_boot_directory
|
2019-04-24 13:09:49 +00:00
|
|
|
import_from_depot [depot_user]/src/[base_src] \
|
|
|
|
[depot_user]/pkg/[drivers_nic_pkg] \
|
|
|
|
[depot_user]/src/init \
|
2021-01-08 16:27:24 +00:00
|
|
|
[depot_user]/src/nic_router \
|
2019-04-24 13:09:49 +00:00
|
|
|
[depot_user]/src/libc \
|
|
|
|
[depot_user]/src/libssh \
|
|
|
|
[depot_user]/src/lighttpd \
|
2020-03-18 15:27:28 +00:00
|
|
|
[depot_user]/src/openssl \
|
2019-04-24 13:09:49 +00:00
|
|
|
[depot_user]/src/posix \
|
|
|
|
[depot_user]/src/vfs \
|
2023-11-30 21:20:15 +00:00
|
|
|
[depot_user]/src/vfs_jitterentropy \
|
2020-05-28 14:27:24 +00:00
|
|
|
[depot_user]/src/vfs_[ip_stack] \
|
2019-04-24 13:09:49 +00:00
|
|
|
[depot_user]/src/zlib
|
|
|
|
|
|
|
|
install_config {
|
2012-08-17 07:04:00 +00:00
|
|
|
<config>
|
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="IO_PORT"/>
|
|
|
|
<service name="IO_MEM"/>
|
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</default-route>
|
2017-07-25 11:50:05 +00:00
|
|
|
<default caps="100"/>
|
2019-04-24 13:09:49 +00:00
|
|
|
|
2012-08-17 07:04:00 +00:00
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
2019-04-24 13:09:49 +00:00
|
|
|
</start>
|
2012-08-17 07:04:00 +00:00
|
|
|
|
2020-07-10 11:04:12 +00:00
|
|
|
<start name="nic_drv" caps="1000" managing_system="yes">
|
|
|
|
<resource name="RAM" quantum="32M"/>
|
2019-04-24 13:09:49 +00:00
|
|
|
<binary name="init"/>
|
|
|
|
<route>
|
|
|
|
<service name="ROM" label="config"> <parent label="drivers.config"/> </service>
|
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
2021-01-08 16:27:24 +00:00
|
|
|
<service name="Uplink"> <child name="nic_router"/> </service>
|
2019-04-24 13:09:49 +00:00
|
|
|
<any-service> <parent/> </any-service>
|
|
|
|
</route>
|
2021-01-08 16:27:24 +00:00
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="nic_router" caps="200">
|
|
|
|
<resource name="RAM" quantum="10M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="Nic"/>
|
|
|
|
<service name="Uplink"/>
|
|
|
|
</provides>
|
|
|
|
<config verbose_domain_state="yes">
|
|
|
|
|
|
|
|
<policy label_prefix="lighttpd" domain="downlink"/>
|
|
|
|
<policy label_prefix="nic_drv" domain="uplink"/>
|
|
|
|
|
2024-03-18 11:37:32 +00:00
|
|
|
} [nic_router_uplink] {
|
2021-01-08 16:27:24 +00:00
|
|
|
|
|
|
|
<nat domain="downlink"
|
|
|
|
tcp-ports="16384"
|
|
|
|
udp-ports="16384"
|
|
|
|
icmp-ids="16384"/>
|
|
|
|
|
|
|
|
<tcp-forward port="80" domain="downlink" to="10.0.3.2"/>
|
|
|
|
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
<domain name="downlink" interface="10.0.3.1/24">
|
|
|
|
|
|
|
|
<dhcp-server ip_first="10.0.3.2" ip_last="10.0.3.2">
|
|
|
|
<dns-server ip="8.8.8.8"/>
|
|
|
|
<dns-server ip="1.1.1.1"/>
|
|
|
|
</dhcp-server>
|
|
|
|
|
|
|
|
<tcp dst="0.0.0.0/0"><permit-any domain="uplink" /></tcp>
|
|
|
|
<udp dst="0.0.0.0/0"><permit-any domain="uplink" /></udp>
|
|
|
|
<icmp dst="0.0.0.0/0" domain="uplink"/>
|
|
|
|
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
</config>
|
2012-08-17 07:04:00 +00:00
|
|
|
</start>
|
2019-04-24 13:09:49 +00:00
|
|
|
|
2017-08-07 13:24:40 +00:00
|
|
|
<start name="lighttpd" caps="200">
|
2014-04-14 09:57:22 +00:00
|
|
|
<resource name="RAM" quantum="1G" />
|
2012-08-17 07:04:00 +00:00
|
|
|
<config>
|
2014-04-14 09:57:22 +00:00
|
|
|
<arg value="lighttpd" />
|
|
|
|
<arg value="-f" />
|
|
|
|
<arg value="/etc/lighttpd/lighttpd.conf" />
|
|
|
|
<arg value="-D" />
|
2017-03-09 13:03:46 +00:00
|
|
|
<vfs>
|
|
|
|
<dir name="dev">
|
2020-05-28 14:27:24 +00:00
|
|
|
<log/> <null/> <inline name="rtc">2000-01-01 00:00</inline>
|
2023-11-30 21:20:15 +00:00
|
|
|
<jitterentropy name="random"/>
|
2017-03-09 13:03:46 +00:00
|
|
|
</dir>
|
2020-05-28 14:27:24 +00:00
|
|
|
<dir name="socket"> } [socket_fs_plugin] { </dir>
|
2017-03-09 13:03:46 +00:00
|
|
|
<dir name="etc">
|
|
|
|
<dir name="lighttpd">
|
|
|
|
<inline name="lighttpd.conf">
|
2012-08-17 07:04:00 +00:00
|
|
|
# lighttpd configuration
|
2020-05-28 14:27:24 +00:00
|
|
|
server.port = 80
|
|
|
|
server.document-root = "/website"
|
|
|
|
server.event-handler = "select"
|
2012-08-17 07:04:00 +00:00
|
|
|
server.network-backend = "write"
|
2020-05-28 14:27:24 +00:00
|
|
|
server.upload-dirs = ( "/tmp" )
|
|
|
|
server.modules = ("mod_openssl")
|
2023-11-30 21:20:15 +00:00
|
|
|
server.modules += ( "mod_webdav" )
|
2012-08-17 07:04:00 +00:00
|
|
|
index-file.names = (
|
|
|
|
"index.xhtml", "index.html", "index.htm"
|
|
|
|
)
|
|
|
|
mimetype.assign = (
|
|
|
|
".html" => "text/html",
|
|
|
|
".htm" => "text/html"
|
|
|
|
)
|
2023-11-30 21:20:15 +00:00
|
|
|
dir-listing.activate = "enable"
|
|
|
|
webdav.activate = "enable"
|
|
|
|
webdav.is-readonly = "disable"
|
2020-05-28 14:27:24 +00:00
|
|
|
$SERVER["socket"] == ":443" {
|
|
|
|
ssl.engine = "enable"
|
|
|
|
ssl.pemfile = "/etc/lighttpd/example.pem"
|
|
|
|
}
|
|
|
|
</inline>
|
|
|
|
<inline name="example.pem">
|
|
|
|
-----BEGIN PRIVATE KEY-----
|
|
|
|
MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4KHUZjDRew89c
|
|
|
|
wDlYPz9XFigcMDnDlHzdg2ByrGZIOUNYC5LH1QUK0TDbPP45Xx455niA0QY85dMQ
|
|
|
|
4DQx0Qk6+TDpVD3F2MYQgbIX6YkX9kgqX+jiHgsNzRD4KamNYmfUY+dJhlZEXWAF
|
|
|
|
uNSnRLvg4EH72AV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PP45Xx455niA0QY85dMQ4DQx0Qk6+TDpVD3F2MYQgbIX6YkX
|
|
|
|
9kgqX+jiHgsNzRD4KamNYmfUY+dJhlZEXWAFuNSnRLvg4EH72AVKLLKiruGwkisW
|
|
|
|
/AYU6dNE8iFOYL8Q75bBUADiQSDdD8vkpeXg1NqxNyHPR6YRbA+vqcK0kbC8btKR
|
|
|
|
9wG6m99OhTR4x3M87vtFFLNtJNEf54fYxi+L1rljSqHbaXD+XJsVKgX+UlI1ZlYW
|
|
|
|
4KqlMciMemkBp0CovCxLfsbMmkXAW2RONpkm+sdO3CXFAgMBAAGjUzBRMB0GA1Ud
|
|
|
|
DgQWBBQvSHuosL/SDn/8sKl0dpyPeFvOfjAfBgNVHSMEGDAWgBQvSHuosL/SDn/8
|
|
|
|
sKl0dpyPeFvOfjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBR
|
|
|
|
sGYEuRwIU/tmAmTbniptItN9VE0NNj9QeKh+hKQ9cHvhxmlBlf5b7Vb2JaRZdy88
|
|
|
|
kRIFKiNkyjgQVg+5KuEIcg17mHSal7zG+jIZ3c1bIpVCM4AjUe7EXl8LM4+dJ5sX
|
|
|
|
Bwpd34tUk2edOiT8R/dU7uesxCdeIQ2FfvKyrXca73nj+UTvFGXUk/9mWY8KAaYc
|
|
|
|
F/PWBhiZhJD4/dkUHJnrVtjpcqW2Io8bFmrMq2vfqQv+W2FZGCsHgXkAZO2E0jyQ
|
|
|
|
5eOrwzgWRtMc5PvoGvqQfefseaLs0fvSQdcPqfv88Eqk5NGTOCIW8/KEsBwFJuwa
|
|
|
|
EpA5DBBklj8UE2CdONvN
|
|
|
|
-----END CERTIFICATE-----
|
2017-03-09 13:03:46 +00:00
|
|
|
</inline>
|
2012-08-17 07:04:00 +00:00
|
|
|
</dir>
|
2017-03-09 13:03:46 +00:00
|
|
|
</dir>
|
|
|
|
<dir name="website">
|
|
|
|
<inline name="index.html">
|
2012-08-17 07:04:00 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Hello</title>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<p>Hello Genode!</p>
|
|
|
|
<b>I am bold ;-)</b>
|
|
|
|
</body>
|
|
|
|
</html>
|
2017-03-09 13:03:46 +00:00
|
|
|
</inline>
|
2023-11-30 21:19:31 +00:00
|
|
|
<ram/>
|
2017-03-09 13:03:46 +00:00
|
|
|
</dir>
|
2020-05-28 14:27:24 +00:00
|
|
|
<dir name="tmp"> <ram/> </dir>
|
2017-03-09 13:03:46 +00:00
|
|
|
</vfs>
|
2018-08-31 09:03:13 +00:00
|
|
|
<libc stdin="/dev/null" stdout="/dev/log" stderr="/dev/log"
|
2023-11-30 21:19:31 +00:00
|
|
|
rtc="/dev/rtc" rng="/dev/random" socket="/socket"/>
|
2012-08-17 07:04:00 +00:00
|
|
|
</config>
|
2021-01-08 16:27:24 +00:00
|
|
|
|
|
|
|
<route>
|
|
|
|
<service name="Nic"> <child name="nic_router"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
|
2019-04-24 13:09:49 +00:00
|
|
|
</start>
|
2012-08-17 07:04:00 +00:00
|
|
|
</config>}
|
|
|
|
|
2023-11-17 15:46:32 +00:00
|
|
|
build_boot_image [build_artifacts]
|
2012-08-17 07:04:00 +00:00
|
|
|
|
2020-04-06 14:05:54 +00:00
|
|
|
append qemu_args " -nographic "
|
2020-04-02 19:20:50 +00:00
|
|
|
append_qemu_nic_args "hostfwd=tcp::5555-:80,hostfwd=tcp::5556-:443"
|
2012-08-17 07:04:00 +00:00
|
|
|
|
|
|
|
run_genode_until forever
|