remove usage of fopen/fgets from portal code
simplify params for init_portal_internal()