Endpoint
Authentication
Requires Bearer token authentication via theAuthorization header.
Path Parameters
The UUID of the server
Request Body
The root directory for chmod operations (all paths are relative to this)
Array of file chmod operations
Response
Returns204 No Content on success.
Example Request
Common Permission Modes
| Mode | Permission | Description |
|---|---|---|
0644 | -rw-r--r-- | Standard file (owner read/write, others read) |
0755 | -rwxr-xr-x | Executable file or directory (owner all, others read/execute) |
0600 | -rw------- | Private file (owner read/write only) |
0700 | -rwx------ | Private executable or directory (owner only) |
0777 | -rwxrwxrwx | Fully accessible (not recommended) |
Behavior
- Operations are performed concurrently for better performance
- Both files and directories can have permissions changed
- Mode must be a valid octal string (e.g., “0755”, “0644”)
- Directories are not processed recursively - only the specified path is modified
- Symlinks have their target’s permissions modified
- Path traversal is prevented
Error Responses
400 Bad Request
400 Bad Request
Invalid mode format (must be octal string like “0755”)
401 Unauthorized
401 Unauthorized
404 Not Found
404 Not Found
Server or file does not exist
500 Internal Server Error
500 Internal Server Error
Failed to change permissions (permission denied, etc.)
Use Cases
- Make shell scripts executable
- Secure configuration files
- Fix permission issues preventing server startup
- Set proper permissions after file upload
- Prepare files for execution
Source Reference
Implementation:router/router_server_files.go (postServerChmodFile function)