Add overwritehost config on setup and upgrade

~~overwritehost should always be configured to prevent Host Header Poisoning, this commit adds the config option on upgrade and on new installations automatically.~~

~~Backport to stable5 and stable6 requested. But I assume the code base is too different for a simple cherry pick.~~

This PR adds a new "trusted_domains" config option, on update and setup the config is automatically set with the current host header if no value is provided.