require config_dir env var only where necessary