tomatenmharksite documentation

documentation of how the tomatenmharksite server works for people who care or people who keep forgetting (me)
go to index without or with debugging information

index

links

In the "running" section on the website, the ids may or may not be links. If a /srv/tomatenmhark-slashinfo/*/index.html entry exists, the link will point to that info site, If only a /srv/tomatenmhark-redirect/* entry exists, the link will follow that redirect, and if neither exist, there will be no link.
In the "everything else" section, every entry links to its info page, if there is one.

texts

Each id has a status text. This can be a file's content or dynamic output, and will be cached for 3 seconds. If a status consists of multiple lines, the all but the first one are additional information. In this case, the first line will be emphasized and the additional lines will be displayed on hover.

customizing

The contents of the index are specified in a template file, index.html. This file is served as-is, but comments like <!-- t: ... --> are given special meaning. See index.html and int.html for usage examples.

files

/tmp/tomatenmhark-status-*

For each file /tmp/tomatenmhark-status-*, an entry will be created on tomatenmhark.org. This entry will have the id * and the file's contents will be shown after that.

/srv/tomatenmhark-dystatus/*

Each file in /srv/tomatenmhark-dystatus/ acts like a /tmp/tomatenmhark-status-* file, but instead of displaying its contents, the tomatenmharksite server will execute the file and display its output.

/srv/tomatenmhark-slashinfo/*

The files in /srv/tomatenmhark-slashinfo/ are served under /info, and index.html will be served when a directory is requested (//index.html, /thing/thing/index.html).
For all directories in /srv/tomatenmhark-slashinfo/ which contain a desc and are not already listed as "running", an entry is created in the "everything else" section.

/srv/tomatenmhark-redirect/*

Each file in /srv/tomatenmhark-redirect/ contains a port number or a domain, leading/trailing whitespace characters are ignored.
If the file contains a port number, /filename/... will be redirected to samedomain:portnumber/....
If the file contains anything else, /filename/... will be redirected to filecontent/....
In the port number case, http is used. Otherwise, the protocol must be included in the file. %DOMAIN% will be replaced with tomatenmhark.org or whatever domain was used in the request. To redirect to port 8000 using https, use https://%DOMAIN%:8000