Lada
LXC container
Webserver contents
Scripts in php display youtube, videos (TV series), movies, dlw and more. Video files are usually directly served but the php scripts always link to them as vlc://[lada https domain]/path/to/movie.mkv
to be handled on the client-side browser in a specific way, for example opening vlc
and streaming the https file over the network directly 'on-screen'.
Uploadable storage
/ram.php
shows downloadeable files and provides an uploading form, /ramulpoad.php
handes form and writes uploaded files to /var/www/html/ram/{filename}
. Under /var/www/html/ram/
there is a tmpfs
RAM filesystem mounted, to allow volatile operations, and therefore erasure across server reboots. It is mounted at boot by the systemd unit uploader
in /etc/systemd/system/uploader.service
.
Map
Makes cartography user-available in an interactive worldmap. /leaflet.html
handles display of the maps from raster tiles and manages all the layers. It uses the leaflet
javascript library, which is statically available in /leaflet/
. Rendered map layers are specified by a tile URL in the format /osm/{layername}/{z}/{x}/{y}.png
and any tile request will then be redirected to osm. Static raster tiles are directly mounted in the webserver, this is the case for one layer, /satellite/{z}/{x}/{y}.jpg
. /leaflet.html
also needs /leaflet.tilelayer.fallback.js
[1] for fallback-enabled layers, this is currently used for the /satellite/
layer as it does not have all tiles available. Instead of displaying the error tile whenever a specific tile is missing (/satellite/ocean.jpg
for /satellite/
), it reuses upper-zoom tiles and pixellates them.
Stats
Reads stats.json
from webserver root and displays it with Javascript library plotly
. Plotly.js
is statically loaded from the webserver to allow completely internet-less operation. stats.json
contains json data but it isprepended with "alldata=
" so that it is valid javascript and can be simply used in HTML:
<script src="/stats.json"></script>
The display then shows an interactive graph that allows zooming, panning and exporting view to .png
.
Arch and artix package mirror
Makes software zfs dataset available, all static files allow for package mirror operations. Use
Server = https://lada.tizarne.com/artix/$repo/os/$arch
for artix and
Server = https://lada.tizarne.com/arch/$repo/os/$arch
for arch in /etc/pacman.d/mirrorlist
. To make the two directories available in the webserver root, symlinks are used :
arch -> data/software/arch
artix -> data/software/artix
PHP scripts displaying data as user-accessible
These scripts may connect to a database and generate a HTML webpage to display video or audio data for display in a browser or as xml. This data is mostly readonly and for consumption, though the database may sometimes be written to regarding metadata like watching progress.
TV series
/videos
is a forced-php script that tracks watching progress in the database under dbname=video
. It displays all series on the landing page and makes a "watch next" vlc://
link available for each series. Some series that do not have ordered seasons will not have a global natch-next link, but on opening the series all seasons are shown and thos will have "watch next" links if the episodes are ordered. Unordered episodes means that in a season all episodes displayed have a green tick in the upper right corner if they have been watched. The entire script is server-side only and does not use javascript. It also features language track selection support by passing the ?audiolanguage={lang}
URL parameter in the vlc://
links and title specification through the URL parameter &title={urlencode(title)}
to be displayed in vlc
. The vlc opening script also needs to carefully parse URL parameters and only take those that refer to it, like audiolanguage
and title
. This is because the next
, next_season
and watch
URL parameters specify the mechanism to count episode progress. This takes place when vlc
fetches the URL: it will be to the /videos
script itself with some $_GET
parameters. This script will then update the database accordingly and only after that set the HTTP header 302 redirect to point to the video file for vlc
to start playing. This also allows for vlc to play the next track whenever the user presses "next", because the vlc
playlist has only one item, it will just refetch the same url. But because the php script has previously updated the database, it will again update the watching progress, and then redirect to the next video file in the sequence.
Podcast feeds
/feeds
is a forced-php script that connects to the database under dbname=audio
. It generates podcast xml feeds from the database. The audio files are also assumed to be under /data/audio/podcasts/{db_audio:podcasts:directory}/{db_audio:episodes:filename}
.
Forced php scripts
For cosmetic reasons and url shortness, some php scripts do not have a .php
extension. They are then manually forced to be php-interpreted in the server. This also allows to reference nonexisting subdirectories "under" the script : /youtube
is forced-php, and then /youtube/video/{videoid}
and /youtube/channel/{channelid}
are valid urls (that are also in practical use). Apache2 server configuration in /etc/apache2/apache2.conf
:
<FilesMatch "youtube|redirect|feeds|movies|dvd|videos">
ForceType application/x-httpd-php
SetHandler application/x-httpd-php
</FilesMatch>
The FilesMatch
section accepts regexes, so the a|b|c
syntax allows a shorthand for repeated <File a>...</File><File b>...</File>...
sections. This can become a security issue if the regex is edited to include wider syntax and more complicated regex parsing.
External redirects
Main website entry point and redirects some subdirectories to other webservers
/osm
to[osm]:80/
/kiwix
tolocalhost:8000/
/dewa
to[dewa]:8051/