Browse Source

Support linux and mod_openssl in lighttpd test

cached_fs_rom
Christian Helmuth 4 months ago
parent
commit
53f32e4ba3
1 changed files with 85 additions and 11 deletions
  1. 85
    11
      repos/ports/run/lighttpd.run

+ 85
- 11
repos/ports/run/lighttpd.run View File

@@ -4,6 +4,22 @@
4 4
 # \date   2012-08-16
5 5
 #
6 6
 
7
+proc ip_stack { } { return lwip }
8
+
9
+proc socket_fs_plugin { } {
10
+	set result "<[ip_stack]"
11
+
12
+	if {[have_spec linux]} {
13
+		append result { ip_addr="10.0.2.55" netmask="255.255.255.0"}
14
+		append result { gateway="10.0.2.1" nameserver="1.1.1.1"}
15
+	} else {
16
+		append result { dhcp="yes"}
17
+	}
18
+
19
+	append result {/>}
20
+	return $result
21
+}
22
+
7 23
 create_boot_directory
8 24
 import_from_depot [depot_user]/src/[base_src] \
9 25
                   [depot_user]/pkg/[drivers_nic_pkg] \
@@ -15,7 +31,7 @@ import_from_depot [depot_user]/src/[base_src] \
15 31
                   [depot_user]/src/lighttpd \
16 32
                   [depot_user]/src/posix \
17 33
                   [depot_user]/src/vfs \
18
-                  [depot_user]/src/vfs_lwip \
34
+                  [depot_user]/src/vfs_[ip_stack] \
19 35
                   [depot_user]/src/zlib
20 36
 
21 37
 install_config {
@@ -60,19 +76,20 @@ install_config {
60 76
 			<arg value="-D" />
61 77
 			<vfs>
62 78
 				<dir name="dev">
63
-					<log/>
64
-					<null/>
79
+					<log/> <null/> <inline name="rtc">2000-01-01 00:00</inline>
80
+					<inline name="random">0123456789012345678901234567890123456789</inline>
65 81
 				</dir>
66
-				<dir name="socket">
67
-					<lwip dhcp="yes"/> </dir>
82
+				<dir name="socket"> } [socket_fs_plugin] { </dir>
68 83
 				<dir name="etc">
69 84
 					<dir name="lighttpd">
70 85
 						<inline name="lighttpd.conf">
71 86
 # lighttpd configuration
72
-server.port          = 80
73
-server.document-root = "/website"
74
-server.event-handler = "select"
87
+server.port            = 80
88
+server.document-root   = "/website"
89
+server.event-handler   = "select"
75 90
 server.network-backend = "write"
91
+server.upload-dirs     = ( "/tmp" )
92
+server.modules         = ("mod_openssl")
76 93
 index-file.names     = (
77 94
   "index.xhtml", "index.html", "index.htm"
78 95
 )
@@ -80,6 +97,61 @@ mimetype.assign      = (
80 97
   ".html"         =>      "text/html",
81 98
   ".htm"          =>      "text/html"
82 99
 )
100
+$SERVER["socket"] == ":443" {
101
+	ssl.engine  = "enable"
102
+	ssl.pemfile = "/etc/lighttpd/example.pem"
103
+}
104
+						</inline>
105
+						<inline name="example.pem">
106
+-----BEGIN PRIVATE KEY-----
107
+MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4KHUZjDRew89c
108
+wDlYPz9XFigcMDnDlHzdg2ByrGZIOUNYC5LH1QUK0TDbPP45Xx455niA0QY85dMQ
109
+4DQx0Qk6+TDpVD3F2MYQgbIX6YkX9kgqX+jiHgsNzRD4KamNYmfUY+dJhlZEXWAF
110
+uNSnRLvg4EH72AVKLLKiruGwkisW/AYU6dNE8iFOYL8Q75bBUADiQSDdD8vkpeXg
111
+1NqxNyHPR6YRbA+vqcK0kbC8btKR9wG6m99OhTR4x3M87vtFFLNtJNEf54fYxi+L
112
+1rljSqHbaXD+XJsVKgX+UlI1ZlYW4KqlMciMemkBp0CovCxLfsbMmkXAW2RONpkm
113
++sdO3CXFAgMBAAECggEAIKv00nqAVAuzP0ZPJivaZe3lYdLgfKVcXcRQGSgi4U9f
114
+dkBfYxqU0W15mHvCspUAfM85s8jhrW4suwK739axJ4hMOCkc6Hvj78vCt+FT1C96
115
+cCIh4/PmjCVEjHJ/xTifKRwsTWwK5AgY4AsBl0dneabvremOTrGNY7VZDwVvpZz1
116
+qXkSNjQ63tZKj9cESO5ceGLzuBAG6JDDpqJM5fmdsQ36/QVz9Gogr8bXEWFM1TOo
117
+lWVAPB/l6nqKurfMv+5th354+owv9CGKxqLBE1fujwE2VogBz7mkR/rnABOPU5ev
118
+wQVLXoUkO2bI8Uvc28lChaiG6ih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rMq2vfqQv+W2FZGCsHgXkAZO2E0jyQ
152
+5eOrwzgWRtMc5PvoGvqQfefseaLs0fvSQdcPqfv88Eqk5NGTOCIW8/KEsBwFJuwa
153
+EpA5DBBklj8UE2CdONvN
154
+-----END CERTIFICATE-----
83 155
 						</inline>
84 156
 					</dir>
85 157
 				</dir>
@@ -96,14 +168,16 @@ mimetype.assign      = (
96 168
 </html>
97 169
 					</inline>
98 170
 				</dir>
171
+				<dir name="tmp"> <ram/> </dir>
99 172
 			</vfs>
100 173
 			<libc stdin="/dev/null" stdout="/dev/log" stderr="/dev/log"
101
-			      socket="/socket" />
174
+			      rtc="/dev/rtc/" rng="/dev/random" socket="/socket"/>
102 175
 		</config>
103 176
 	</start>
104 177
 </config>}
105 178
 
106
-build_boot_image {}
179
+#build            { }
180
+build_boot_image { }
107 181
 
108 182
 proc qemu_nic_model {} {
109 183
 	if [have_spec x86]     { return e1000 }
@@ -112,7 +186,7 @@ proc qemu_nic_model {} {
112 186
 	return nic_model_missing
113 187
 }
114 188
 
115
-append qemu_args " -netdev user,id=net0,hostfwd=tcp::5555-:80 "
189
+append qemu_args " -netdev user,id=net0,hostfwd=tcp::5555-:80,hostfwd=tcp::5556-:443 "
116 190
 append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 "
117 191
 append qemu_args " -nographic "
118 192
 append xen_args  { sdl=0\; vif=\["model=e1000,mac=02:00:00:00:01:01,bridge=xenbr0"\] }

Loading…
Cancel
Save