about summary refs log tree commit diff stats
path: root/wikipages/bchs.wiki
diff options
context:
space:
mode:
authorahriman <ahriman@falte.red>2019-01-04 04:09:50 +0000
committerahriman <ahriman@falte.red>2019-01-04 04:09:50 +0000
commit1720151b96c9f88d4145fca21a23ab8e807d564b (patch)
tree8d03703531163579846127d790c11c356eedc277 /wikipages/bchs.wiki
parent2cff2b45ef8107b04191a1c3658744c8c6abd411 (diff)
downloadsite-1720151b96c9f88d4145fca21a23ab8e807d564b.tar.gz
moved bchs guide to wiki
Diffstat (limited to 'wikipages/bchs.wiki')
-rw-r--r--wikipages/bchs.wiki21
1 files changed, 21 insertions, 0 deletions
diff --git a/wikipages/bchs.wiki b/wikipages/bchs.wiki
new file mode 100644
index 0000000..de41703
--- /dev/null
+++ b/wikipages/bchs.wiki
@@ -0,0 +1,21 @@
+<!--
+    author: ahriman
+    title: BCHS Guide
+    description: a quick intro to what the BCHS stack is
+-->
+<h2>BCHS Guide</h2>
+<p>This will be a quick-and-dirty guide to getting started with the BCHS stack. More information can be found at:</p>
+    <ul>
+        <li><a href="https://learnbchs.org">Learn BCHS</a></li>
+        <li><a href="http://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man2/pledge.2">pledge(2)</a></li>
+        <li><a href="http://man.openbsd.org/unveil.2">unveil(2)</a></li>
+        <li><a href="https://kristaps.bsd.lv/kcgi/">kcgi</a></li>
+        <li><a href="https://kristaps.bsd.lv/ksql/">ksql</a></li>
+        <li><a href="https://kristaps.bsd.lv/kwebapp">kwebapp</a></li>
+    </ul>
+<p>tilde.institute is set up to process all files with the .cgi extension via slowcgi(8). This allows for a multitude of possibilities - any compiled language can be used to develop web applications on an OpenBSD server. It's advised to use C because of the pledge(2) and unveil(2) system calls available, which allow for restricting privileges and restricted filesystem access, respectively.</p>
+<p>Keep in mind that if you don't use the previously listed kcgi/ksql/kwebapp libraries, you will need to work with HTTP's eccentricities manually. For an example, here's <a href="helloworld.c.txt">the Hello World code</a> from the LearnBCHS site. And <a href="helloworld.cgi">here it is running</a> as compiled CGI here at the Tilde Institute.</p>
+<p>Once you've written your software to be served via CGI, be sure to statically link the executables. Sure, there's a larger file size, but the benefits outweigh that in this case - there's no relying on what I may or may not have installed on the Tilde Institute's server. For example:</p>
+<p><code>$ cc -static -g -W -Wall -o app.cgi app.c</code></p>
+<p>When you've completed compilation, make sure to set permissions properly (755) and move it to the public folder in your home directory. httpd(8) is set to use index as the index file, however this can be changed to index.cgi or what-have-you by contacting ahriman via IRC.</p>
+<p>~institute user <code>xvetrd</code> has written a more detailed example on kcgi than is provided on the library's site. It includes an example makefile as well. The KCGI Starter archive <a href="kcgi-start.tar.gz">is available here</a>. Simply <code>curl -O https://tilde.institute/kcgi-start.tar.gz</code> it to your home directory here on ~institute, untar, make, and make install to test the compilation. It installs to ~/public_html with the proper ownership and permissions. View the index.c source and the makefile to see what goes on under the hood! Feel free to adapt it your own projects!</p>