Friendica
  • Anmelden
elrido
elrido

elrido

elrido@social.dssr.ch

elrido

elrido@social.dssr.ch
C/C++/Rust Entwickler mit Schwerpunkt Sicherheit (C/C++/Rust developer, focused on security)
Folge
Atom-Feed
Netzwerkbeiträge

Zurich, Switzerland

-----BEGIN PUBLIC KEY----- MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA2qxPfkKa7qzrJvPfebd8 c93clvwF1fGO0bLs1ma0FXLK6FjeWAF4yDTEeir/P3LBer1Sr/nJkoCYAbYuxD4G sEJSvojRN2Xz+NqNtxeMCg3ZjjWBVA2jrMQ6yWUb9nn/9v3rhRP7mBGriJHaMA1Q mneCUc/yaKQnb18cxM2pqk4reCNyPezOYA3pPiiqMF77/Yn/HIGqvbsaOyex/CX6 1KmZATvUhnEAnuZl76GGaMP8LNHFGzjLUihCb5PkgWAt0e2XTdvaa7Qw2vregXc6 T/JltiSn024r/k2JsNX+HDKZ/+BpdNl2Lu8WU3hgcoh9EZ082cUIyQNKRkE9Qta3 hCSefMe97kNs/MGTqHDfRACKOUAEJyy0m/diHg9QR7btnvlFXqyxw18yK0qCiBnv URbGB18+E4/zuo/zvGFH217FrG7Jt4lAmhsIEDXfTp+8Es0QCkuScm3/pDbeLN5p mDAYsjIEtJ7YmprcjpIzK76PUZn49Msih3Ea9DswQS7VzpphtiyIVTttbx3rRWPJ rfgUow6uLNvid84q0uFHgBpElFe9HajAqb4V4V4IdrR9oW3t5rWRs5EKT7/DuWVg o+pHMU0Vx6Se2zSXoFmF3ljeNhIltgVMbIs+onlunGXCXLoLs+qZWK+PD5nEEaVu CO+6fDET/pX1Bv0a8yq3+TUCAwEAAQ== -----END PUBLIC KEY-----
2026-01-27T06:41:28+00:00
http://simon.rupf.net/
Über:
C/C++/Rust Entwickler mit Schwerpunkt Sicherheit (C/C++/Rust developer, focused on security)
Uid
b763998230b4da3d
Nickname
elrido
Full_name
elrido
Searchable
true
First_name
elrido
Family_name
Url
https://social.dssr.ch/
Photo
Photo_medium
Photo_small
2023-04-23 13:32:18 2023-04-23 13:31:53 2023-04-23 13:31:53 1447839

elrido
elrido
friendica (DFRN) - Link zum Originalbeitrag

elrido

Sunday, April 23, 2023, 13:31 •
(Schweiz)

elrido

Sunday, April 23, 2023, 13:31  — (Schweiz) •


For over 15 years, most PHP setups I maintained were based on a stack of nginx webserver and PHP-fpm. So, unsurprisingly, the container images I maintain for PrivateBin also use this setup. A while ago, I stumbled on the nginx unit project, which describes itself as:

Unit is a lightweight and versatile application runtime [and] was created by nginx team members from scratch [...].

There is a package for it and it's PHP 8.1 module in the stable Alpine Linux repositories (and soon also for PHP 8.2, when Alpine 3.18 releases). It's installed size is about half of the regular nginx package and because it is a single service one no longer needs a service manager in the container, to keep the two services alive.

Tw

... mehr anzeigen

For over 15 years, most PHP setups I maintained were based on a stack of nginx webserver and PHP-fpm. So, unsurprisingly, the container images I maintain for PrivateBin also use this setup. A while ago, I stumbled on the nginx unit project, which describes itself as:

Unit is a lightweight and versatile application runtime [and] was created by nginx team members from scratch [...].

There is a package for it and it's PHP 8.1 module in the stable Alpine Linux repositories (and soon also for PHP 8.2, when Alpine 3.18 releases). It's installed size is about half of the regular nginx package and because it is a single service one no longer needs a service manager in the container, to keep the two services alive.

Two weeks ago I started toying with it and last weekend I finalized the work. It lets you configure all deviations from the default php.ini via it's own service configuration file, so I now got all the configurations in a single file. It took a bit of work to replicate most former settings over to it. Nginx unit doesn't (yet) allow to set custom HTTP headers, which we use to improve security on the static resources and to prevent cloudflare users getting errors (cloudflare will by default try to optimize all Javascript files for performance, but that breaks the SRI-hashes of our application, so the app doesn't load). It also doesn't allow configuring inline gzip compression of text-based resources.

For now I've documented these limitations in the forked repository and have started testing it first on a personal PrivateBin instance and since that worked well, now switched the main demo instance over to it. The HTTP port and all volumes still attach at the same places, the same UID & GID are used and both logs and included maintenance scripts work the same as before, so it is as close to a drop-in replacement as possible.

So far I've observed slightly higher RAM usage (223 MiB vs 190 MiB used, for a VM that also runs the nginx webserver, for TLS termination, serves the static project webpage and runs the PrivateBin directory application server, all in docker containers) and no observable difference in load (still idles at less than 1%). The images are all about 1 MiB less in compressed size (as displayed on the docker hub in the tags).

I'll probably start migrating my other PHP-fpm containers over to unit, but I'll probably wait for that Alpine 3.18 release, so I can switch to PHP 8.2 at the same time. It's a much simpler stack to maintain.

  •  Sprache erkennen
  •  Rohdaten
  •  Teile mit...
⇧