Lada: Difference between revisions

From Personal wiki
(add forced php section, add podcast feed section)
(add intrapage link)
Line 21: Line 21:


=== Podcast feeds ===
=== Podcast feeds ===
<code>/feeds</code> 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 <code>/data/audio/podcasts/{db_audio:podcasts:directory}/{db_audio:episodes:filename}</code>.
<code>/feeds</code> is a [[Lada#Forced php scripts|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 <code>/data/audio/podcasts/{db_audio:podcasts:directory}/{db_audio:episodes:filename}</code>.


== Forced php scripts ==
== Forced php scripts ==

Revision as of 11:33, 8 April 2022

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.

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

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 to localhost:8000/
  • /dewa to [dewa]:8051/