| examples | ||
| public | ||
| src | ||
| sudoers | ||
| .gitignore | ||
| config.example.php | ||
| README.md | ||
tinyauth-web
A small PHP web UI to edit the tinyauth environment file, and to start, stop, restart and check the tinyauth systemd service. Login goes through tinyauth itself (OIDC).
Features
- Login with tinyauth (OIDC). Only members of one chosen group may use the tool.
- First run: the first person to log in picks the allowed group from their own groups.
- Edit, add and delete variables in the env file. Secret values are never shown; leave blank to keep.
- Every save writes a backup to
data/backups/first. - Start, stop, restart and status, through a narrow sudoers rule.
- Permission checks page shows what is missing.
Layout
| Path | Purpose |
|---|---|
public/ |
Web root. Only this directory should be served. |
src/ |
Shared code (not served). |
config.example.php |
Template. Copy to config.php. |
sudoers/tinyauth-web.sudoers |
Sudo rule for the web user. |
data/ |
Created at runtime: settings and backups. |
Install
-
Register an OIDC client in tinyauth. In the tinyauth env file, add a client, for example:
TINYAUTH_OIDC_CLIENTS_TINYAUTHWEB_CLIENTID=tinyauth-web TINYAUTH_OIDC_CLIENTS_TINYAUTHWEB_CLIENTSECRET=<generate a long random secret> TINYAUTH_OIDC_CLIENTS_TINYAUTHWEB_NAME=tinyauth-web TINYAUTH_OIDC_CLIENTS_TINYAUTHWEB_TRUSTEDREDIRECTURIS=https://tinyauth-web.example.com/callback.phpThen restart tinyauth. Use the same client secret in
config.php. -
Copy the app to the server, then:
cp config.example.php config.phpEdit
config.php:tinyauth_url,client_id,client_secret,redirect_uri,env_file, andservice. -
Point the web server at
public/. Use HTTPS. The app sets secure cookies only over HTTPS. -
Sudo rule (as root):
install -m 0440 sudoers/tinyauth-web.sudoers /etc/sudoers.d/tinyauth-web visudo -cf /etc/sudoers.d/tinyauth-webCheck that the systemctl path matches
command -v systemctl. -
Let the web user edit the env file (keep the file owned by root, and only group-writable by the web user):
chgrp www-data /etc/tinyauth/tinyauth.env chmod 660 /etc/tinyauth/tinyauth.envMake sure the
data/directory is writable bywww-data, and that it is not inside the web root. -
Set file permissions (as root). PHP runs as
www-data, so it needs to read the code and config and writedata/. Pre-createdata/, because the checkout is usually owned by your own user:install -d -o www-data -g www-data -m 0750 /path/to/tinyauth-web/data chown root:www-data /path/to/tinyauth-web/config.php chmod 640 /path/to/tinyauth-web/config.phpconfig.phpholds the client secret, so it must not be world-readable. -
Open the page, log in, and pick the access group. Check the Permission checks section.
Managing entries
- Config table: Every variable in the env file. Each one shows a short description where it's known. Secrets are masked. Add new variables in the bottom row. The Key reference at the bottom lists every key tinyauth accepts, with defaults. It's filterable.
- New OIDC client: Fills in
TINYAUTH_OIDC_CLIENTS_<NAME>_*for you. Leave the secret blank to generate one. The generated secret is shown once, so copy it then. - New app ACL: Fills in
TINYAUTH_APPS_<NAME>_*for forward-auth apps. Set the domain and whichever users or groups should have access. - Local users: Tinyauth hashes passwords, so create users on the server with
tinyauth user create --interactive. Add the printedusername:hashline toTINYAUTH_AUTH_USERS(comma-separated), then restart. Hashes are masked here. - Blank values: Saving or leaving a blank required value is allowed, but the page warns about every blank variable. Blank values can break tinyauth, so fill them in or delete them.
- Paste multiple variables: Paste
KEY=VALUElines in one box, then click Review. A popup lists what's new and what already exists. For existing keys, choose Keep or Update. Any malformed or duplicated line, or an unfilled<placeholder>, fails the whole paste and the popup says why. Nothing is written until you click Apply. - Help icons (?): Hover or focus a ? to see a plain-language explanation, an expert explanation, and an example. The most common keys and the tool's forms have them.
- Collapsible sections: Paste, the client and app forms, local users, and the key reference start closed. Click the heading to open.
Every change writes a backup to data/backups/ first.
Notes
- Saved changes take effect only after tinyauth is restarted. The page reminds you of this.
- The group is read from the
groupsclaim of the OIDC userinfo response. If your tinyauth uses a different claim, setgroups_claim. - To clear the access group, use Change access group on the page (only available to members of the current group).
- To clear a secret value, edit the file in a terminal. The web form doesn't clear secrets.