DRY: Generate a config file with the right port