regenerate keystore if it's lost
postgresql: accept empty db_host as localhost