Jump to content

Drift/Web

From Programvareverkstedet
Revision as of 08:34, 17 November 2026 by Oysteikt (talk | contribs) (Remove package lists, it's better to keep live versions hosted on temmie directly. Also remove temmie-specific stuff, belongs to a different page)

English

Denne siden inneholder diverse informasjon om webserveren for PVVs brukere.

Brukernettsidene hostes for tiden på Maskiner/temmie.

Apache-konfigurasjon

Relevant apache-konfigurasjon finner du i pvv-nixos-config under hosts/temmie/services/userweb/httpd.nix. Det finnes ingen editerbar /etc/apache2-katalog lenger, endringer gjøres i git-repoet og rulles ut med NixOS.

userdir-oppsettet ligger i samme fil, og serverer filer fra /home/pvv/<bokstav>/<bruker>/web-docs.

PHP-konfigurasjon

Visning av feilmeldinger

I utgangspunktet er ikke php-feilmeldinger vist. For at feilmeldinger skal vises, lag filen .htaccess med følgende innhold:

php_flag display_errors on
php_value error_reporting E_ALL

Filen lages i katalogen til scriptet som skal kjøres.

Opplastingsgrense

Maks størrelse på filopplasting i PHP er satt til 40 MB (post_max_size og upload_max_filesize).

Maintenance/Web

This page contains various information about the web-server for PVVs users.

The user web pages are currently hosted on Maskiner/temmie.

Apache-configuration

The relevant apache configuration can be found in pvv-nixos-config under hosts/temmie/services/userweb/httpd.nix. There is no longer an editable /etc/apache2 directory, changes are made in the git repository and rolled out with NixOS.

The userdir setup lives in the same file, and serves files from /home/pvv/<letter>/<user>/web-docs.

PHP-configuration

Displaying of error messages

By default php error messages are not shown. For error messages to be shown, make the file .htaccess with the following content:

php_flag display_errors on
php_value error_reporting E_ALL

The file must be made in the directory of the script that is to be run.

Upload limit

The maximum size for PHP file uploads is 40 MB (post_max_size and upload_max_filesize).

Available software

CGI and PHP scripts run in a sandbox with a fixed set of programs and libraries. The full definition can be found in hosts/temmie/services/userweb/packages.nix in pvv-nixos-config; if you miss something, ask drift to add it there.

Programming languages

  • PHP (both as mod_php and php on the command line)
  • Perl
  • Python 3
  • Ruby
  • Common Lisp (SBCL)
  • Bash

PHP extensions

bz2, curl, decimal, gd, imagick, mysqli, mysqlnd, pgsql, posix, protobuf, sqlite3, pdo (pdo_mysql, pdo_pgsql, pdo_sqlite), uuid, xml, xsl, zlib and zstd

Perl modules

CGI, DBI with DBD::mysql, DBD::Pg and DBD::SQLite, Git, ImageMagick, JSON, Template Toolkit, as well as the perl bindings for ikiwiki, ExifTool, irssi and Nix

Python modules

cgi, matplotlib, requests

Homepage tools

  • ikiwiki
  • ImageMagick (e.g. convert and identify)
  • ExifTool and jhead (EXIF data from images)
  • gnuplot
  • source-highlight (source code highlighting)

Version control

git, cvs, rcs

Networking and file transfer

curl, wget, xdg-utils

E-mail

sendmail (for scripts that send e-mail)

Cryptography

GnuPG

Compression and archives

tar, gzip, bzip2, xz, zstd, lz4, zip, unzip

Other tools

coreutils, findutils, grep, gawk, sed, diffutils, make, file, less, vim, man, util-linux, which, getfacl/setfacl (acl)

If you need anything custom, you migth use nix flakes to create a custom environment a cgi script can utilise.

Security and versions

  • Preferably place the packages outside web-docs. If they must live under web-docs, name the directory .venv or similar — directories named .venv and __pycache__ are already blocked from download in the apache setup, but a venv named just venv is not.
  • The Python version on temmie follows nixpkgs and may change on upgrades. You can check it with a minimal CGI script printing sys.version.
  • Make sure to keep software uppdated.