-
Notifications
You must be signed in to change notification settings - Fork 10
/
easy.xml
170 lines (169 loc) · 5.69 KB
/
easy.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!DOCTYPE html>
<html lang="en" prefix="og: http://ogp.me/ns#">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>BCHS: an easy example</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Alegreya+Sans:400,400italic" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="highlight.css" />
<link rel="stylesheet" href="easy.css" />
<link rel="shortcut icon" type="image/png" href="/favicon-196x196.png" />
<link rel="shortcut icon" sizes="196x196" href="/favicon-196x196.png" />
<link rel="apple-touch-icon" href="/favicon-196x196.png" />
<meta property="og:title" content="BCHS: an easy example" />
<meta property="og:image" content="https://learnbchs.org/logo-blue.png" />
<meta property="og:url" content="https://learnbchs.org/easy.html" />
<meta property="og:type" content="website" />
<meta property="og:description" content=""Hello, World!" primer for BCHS." />
<meta name="description" content=""Hello, World!" primer for BCHS." />
</head>
<body>
<header>
<a href="index.html">
<img src="logo-white.png" alt="BCHS Logo" />
</a>
<h1>
<a href="index.html" itemprop="name">BSD, C, httpd, SQLite</a>
</h1>
<nav>
<div>
Navigate: <a href="index.html">home</a>, <a href="tools.html">tools</a>, <span>example</span>.
</div>
<div>
<a href="https://github.com/kristapsdz/bchs"><i class="fa fa-fw fa-github"></i></a>
<a href="report/index.html"><i class="fa fa-fw fa-server"></i></a>
</div>
</nav>
</header>
<input type="radio" name="steps" id="slider1" value="step1" checked="checked" />
<input type="radio" name="steps" id="slider2" value="step2" />
<input type="radio" name="steps" id="slider3" value="step3" />
<nav>
<label for="slider1">
cgi.c
<img src="arrow-left.png" alt="left" />
</label>
<label for="slider2">
<img src="arrow-right.png" alt="right" />
httpd.conf
</label>
<label for="slider3">
<img src="arrow-right-long.png" class="long" alt="riiiiight" />
setup
</label>
</nav>
<div class="slides">
<div class="overflow">
<div class="slidesinner">
<section>
<div>
<figure>
<article data-sblg-permlink="0" data-sblg-article="1"></article>
</figure>
<p>
This is your code.
Read it: it’s exactly what’s going to happen.
No mysticism.
</p>
<p>
What’s going on?
<a href="https://man.openbsd.org/pledge.2">pledge(2)</a> makes sure
you’re only doing what you want to do: work with existing descriptors.
The rest is just HTTP.
Don’t want to work with HTTP?
Use <a href="https://kristaps.bsd.lv/kcgi">kcgi(3)</a> or equivalent.
</p>
<p>
Want more examples?
See <a href="https://kristaps.bsd.lv/absdcon2016">Secure CGI Applications in C
on BSD</a> and <a href="https://kristaps.bsd.lv/absdcon2017/">Secure
CGI</a>.
</p>
<footer>
<div>
<a href="https://creativecommons.org/licenses/by/4.0/">
<i class="fa fa-fw fa-creative-commons"></i>
</a>
<a rel="author" href="https://github.com/kristapsdz">
Kristaps Dzonsons
</a>
</div>
</footer>
</div>
</section>
<section>
<div>
<figure>
<article data-sblg-permlink="0" data-sblg-article="1"></article>
</figure>
<p>
<a href="https://man.openbsd.org/httpd.conf.5">httpd.conf(5)</a>
is so… <i>simple</i>.
Server tells us the name.
Listen tells us to listen.
Location tells us a location.
Where we have FastCGI.
Relative to the root.
</p>
<p>
Don’t like FastCGI?
Neither do we.
But we’re not using it for this example: in the next snippet,
we’ll use <a href="https://man.openbsd.org/slowcgi.8">slowcgi(8)</a> to
invoke our CGI.
So relax.
</p>
<p>
Want more examples?
See <a href="https://kristaps.bsd.lv/absdcon2016">Secure CGI Applications in C
on BSD</a> and <a href="https://kristaps.bsd.lv/absdcon2017/">Secure
CGI</a>.
</p>
<footer>
<div>
<a href="https://creativecommons.org/licenses/by/4.0/">
<i class="fa fa-fw fa-creative-commons"></i>
</a>
<a rel="author" href="https://github.com/kristapsdz">
Kristaps Dzonsons
</a>
</div>
</footer>
</div>
</section>
<section>
<div>
<figure>
<article data-sblg-permlink="0" data-sblg-article="1"></article>
</figure>
<p>
Wow. Very configure.
Compiles the script. Installs it.
Makes sure <a href="https://man.openbsd.org/slowcgi.8">slowcgi(8)</a> and of
course <a href="https://man.openbsd.org/httpd.8">httpd(8)</a> are running.
Done.
</p>
<p>
Want more examples?
See <a href="https://kristaps.bsd.lv/absdcon2016">Secure CGI Applications in C
on BSD</a> and <a href="https://kristaps.bsd.lv/absdcon2017/">Secure
CGI</a>.
</p>
<footer>
<div>
<a href="https://creativecommons.org/licenses/by/4.0/">
<i class="fa fa-fw fa-creative-commons"></i>
</a>
<a rel="author" href="https://github.com/kristapsdz">
Kristaps Dzonsons
</a>
</div>
</footer>
</div>
</section>
</div>
</div>
</div>
</body>
</html>