= 2) { if ($value[0] === '"' && $value[$len - 1] === '"') { return substr($value, 1, -1); } if ($value[0] === "'" && $value[$len - 1] === "'") { return substr($value, 1, -1); } } return $value; } /** * @return list */ function installParseTemplateForForm(string $templatePath): array { $raw = file($templatePath, FILE_IGNORE_NEW_LINES); if ($raw === false) { return []; } $entries = []; $section = null; foreach ($raw as $line) { $trim = trim($line); if ($trim === '') { continue; } if (strpos($trim, '#') === 0) { $section = trim(substr($trim, 1)); continue; } if (strpos($line, '=') === false) { continue; } [$name, $val] = explode('=', $line, 2); $name = trim($name); $entries[] = [ 'section' => $section, 'key' => $name, 'default' => installUnquoteDefault($val), ]; } return $entries; } function installWriteEnvFromTemplate(string $templatePath, string $envPath, array $postEnv): bool { $raw = file($templatePath, FILE_IGNORE_NEW_LINES); if ($raw === false) { return false; } $out = []; foreach ($raw as $line) { $trim = trim($line); if ($trim === '' || strpos($trim, '#') === 0) { $out[] = $line; continue; } if (strpos($line, '=') === false) { $out[] = $line; continue; } [$name, $templateVal] = explode('=', $line, 2); $name = trim($name); if (array_key_exists($name, $postEnv)) { $submitted = (string) $postEnv[$name]; } else { $submitted = installUnquoteDefault($templateVal); } $out[] = $name . '=' . installFormatEnvValue($submitted); } $bytes = file_put_contents($envPath, implode("\n", $out) . "\n", LOCK_EX); if ($bytes === false) { return false; } @chmod($envPath, 0600); return true; } // Already configured if (file_exists($envPath)) { header('Content-Type: text/html; charset=UTF-8'); ?> Family Hub — Setup

Family Hub

This application is already configured (.env exists).

Go to Family Hub
Family Hub — Setup error

Setup cannot continue

The template file env.example is missing or not readable. Restore it from the repository.

Family Hub — Environment setup

Environment setup

Values are generated from env.example. Fill in your credentials and save.

Could not write .env. Check that the app directory is writable by the web server.