' . '
Manage the tinyauth service and its settings. Log in with your tinyauth account.
' . 'Log in with tinyauth' . ''; page_end(); exit; } $groups = $_SESSION['groups'] ?? []; $allowedGroup = load_settings()['allowed_group'] ?? ''; $authorized = is_authorized($groups); $modalHtml = null; if ($_SERVER['REQUEST_METHOD'] === 'POST') { require_csrf(); $action = (string) ($_POST['action'] ?? ''); if ($allowedGroup === '' && $action === 'setup') { handle_setup($groups); } elseif (!$authorized) { http_response_code(403); exit('Forbidden'); } elseif ($action === 'reset_group') { handle_reset_group(); } elseif (in_array($action, SERVICE_ACTIONS, true)) { handle_service($action); } elseif ($action === 'save_config') { handle_save_config(); } elseif ($action === 'create_oidc_client') { handle_create_oidc_client(); } elseif ($action === 'create_app_acl') { handle_create_app_acl(); } elseif ($action === 'paste_preview') { $modalHtml = paste_preview((string) ($_POST['paste'] ?? ''), csrf_token()); } elseif ($action === 'paste_apply') { handle_paste_apply(); } if ($modalHtml === null) { redirect('index.php'); } } $cfg = config(); $flashes = take_flashes(); $lastOutput = $_SESSION['last_output'] ?? ''; unset($_SESSION['last_output']); $token = csrf_token(); $userHtml = '' . h($_SESSION['user']) . '' . 'Log out'; page_start('Dashboard', $userHtml); foreach ($flashes as $flash) { echo 'Choose the tinyauth group whose members may use this tool.
'; if ($groups === []) { echo 'You are not in the required tinyauth group ' . h($allowedGroup) . '.
'; echo '' . h($service) . '' . h($status['output']) . ''; } if ($lastOutput !== '') { echo '
' . h($lastOutput) . ''; } echo '
Missing sudo rules. Install sudoers/tinyauth-web.sudoers '
. 'from this repo and check it with visudo -cf.
' . h($envPath) . 'Paste lines in KEY=VALUE form. You review them before anything is written.
Creates the variables for a client that apps use to log in through tinyauth. ' . 'Leave the secret blank to generate one.
'; echo 'Creates the access rules for an app behind tinyauth (forward auth). ' . 'Fill in what you need; empty fields are skipped.
'; echo 'Tinyauth stores local users as username:hash pairs in '
. 'TINYAUTH_AUTH_USERS (comma-separated). This tool does not create passwords, because tinyauth hashes them.
tinyauth user create --interactive and enter the username and password when asked. '
. 'Avoid typing the password on the command line, so it stays out of your shell history.username:hash line.TINYAUTH_AUTH_USERS in the config above. For several users, separate entries with commas. '
. 'To add a user, append to the existing value. Do not replace it.| Key | Description | Default |
|---|---|---|
' . h($entry['key']) . ' | ' . h($entry['desc']) . ' | '
. ($entry['default'] === '' ? 'none' : '' . h($entry['default']) . '')
. ' |
| Variable | Value | Delete |
|---|---|---|
| No core settings in this file. | ||
' . $name . '' . ($help !== null ? ' ' . help_icon($help) : '');
if ($info !== null) {
$html .= '' . h($info['desc']) . ' ';
}
$html .= ' | '; if (preg_match(SECRET_PATTERN, $key)) { $hint = $value === '' ? '(not set)' : '(set, leave blank to keep)'; $html .= ''; } else { $html .= ''; } $html .= ' | |
| ' . ' | add | |