/users/{name}/home-repair
0.1.0Unchanged since publicationRepair ownership and permissions in a customer's home
usersallAdministrators can repair homes for customers and resellers. Resellers can repair their own customers' homes. The repair sets the home container (/home/USER) to 0755 with root:root ownership and the home directory (/home/USER/files) to 0750 with the account as owner and the web server's group. It sets web/, each site directory and each document root to 0755. It sets tmp/, mail/, non-hidden directories directly under mail/ and .ssh/ to 0700, and .ssh/authorized_keys to 0600.
Below the home directory, the repair restores the account as owner and its primary group as group. The recursive walk changes ownership on symbolic links themselves and skips their targets, device nodes and sockets. When checking standard paths and document roots, UrbeStack follows up to 32 root-owned symbolic links in parent path components and reports links that stand in place of an expected file or directory.
Set modes to true to apply 0755 to directories and 0644 to files under web/ and document roots within the home, clearing setuid and setgid bits. The optional content mode repair excludes mail/ and the home directory's dotfiles.
The response contains home, with the old and new values for the first 1000 changes and the total number of entries affected. Use dry_run to preview the report. The repair has a timeout of 1800 seconds and skips accounts with a missing Linux account or home container. Use urbestack-rebuild to create missing paths.
As a command
Run as root on the serverParameters
namepath ·UsernameRequiredRequest body
JSON· 2 fieldsdry_runbooleanmodesbooleanExample
See the API overview for how to set $API and $TOKEN.curl -sS -X POST "$API/users/alice/home-repair" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"dry_run": true,
"modes": true
}'200 OK{
"home": {
"changed": 1,
"changes": [
{
"from": "text",
"path": "public_html/index.php",
"to": "text",
"what": "mode"
}
],
"modes": 1,
"name": "alice",
"skipped": [
{
"path": "public_html/index.php",
"why": "text"
}
]
}
}Errors
7 errors, each a status and a sentence400--name and --all exclude each other400<name> is an administrator, not a customer: administrators have no home400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter400One of --name or --all is required400Username '<value>' is reserved401Authentication required404User '<name>' not foundurbestack.com/docs/api/post-users-name-home-repair/