sbs20 / scanservjs

SANE scanner nodejs web ui
https://sbs20.github.io/scanservjs/
GNU General Public License v2.0
689 stars 137 forks source link

improve system endpoint #632

Closed NyCodeGHG closed 9 months ago

NyCodeGHG commented 9 months ago

This PR improves the /system endpoint to not execute 2 processes on every request, which is pretty resource heavy. Instead it reads the npm version on startup, and uses the cached value afterwards.

I also fixed the docker detection, as it did use a method which didn't work anymore.

It also detects now if it's running inside a podman or systemd-nspawn container in addition to docker. I left the docker field untouched for backwards compatibility and added a new field in /system which contains the containerization technology or null if none is detected.