backport web-ui auto-configuration from Debian packaging