Thumbnail

mod/u.buni.party.git

Clone URL: https://git.buni.party/mod/u.buni.party.git

Viewing file on branch master

1!!
2$DPP "Groupnix User Websites" "User Websites" <template/head.html #>
3$DPP <template/bar.html #>
4!!
5
6<p>
7Each user on Groupnix has access to their own website. If your user is USER,
8then your website can be found at <code>https://u.buni.party/USER</code>.
9</p>
10
11<h3>Filesystem Structure</h3>
12<p>
13Your user website is stored in <code>~/web</code>. This directory has the
14following hierarchy:
15</p>
16<pre><code>
17~/web/
18|__ noserv/
19| |__ secrets
20|__ cgi-bin/
21| |__ hello.sh*
22|__ index.html
23</code></pre>
24<p>
25Your <code>web</code> directory should be owned by your user but have the group
26<code>www-data</code>. It will also have the SGID bit. These two things should
27not be changed since they allow nginx (which is the HTTP server being used on
28Groupnix) to actually access your website and serve it. Additionally, you should
29not change the owner/group of any files you add in the <code>web</code>
30directory.
31</p>
32<p>
33The <code>cgi-bin</code> directory can hold
34<a class="out" href="https://en.wikipedia.org/wiki/Common_Gateway_Interface">CGI scripts</a>.
35This means that files in that directory (if they are marked executable) will be
36run as scripts instead of being served statically. This allows you to create
37dynamic websites. Note, however, that CGI scripts will run as the www-data user
38and so only have access to your <code>~/web</code> directory, not your whole
39user directory.
40</p>
41<p>
42Finally, the <code>noserv</code> directory contains anything that you do not
43want nginx to serve. So, if you have a file <code>noserv/secrets</code>, then
44the endpoint <code>https://u.buni.party/USER/noserv/secrets</code> will fail.
45</p>
46
47<h3>Using the Web</h3>
48<p>
49Given a URL, the web server will either try to find a matching file in your web
50directory or, if it finds a directory instead, will try to serve
51<code>index.html</code> in that directory. If the path is in the
52<code>cgi-bin</code> directory, the CGI script will be executed and its output
53will be served as the web page. It is important to note that paths in your HTML
54documents must be relative or absolute with respect to your current user. For
55instance, if you are USER and you want to link your stylesheet, you must use a
56relative path of the form <code>style.css</code> or an absolute path of the form
57<code>/USER/style.css</code>.
58</p>
59
60!!$DPP <template/foot.html #>
61