Skip to main content

Endpoint

Authentication

Requires Bearer token authentication via the Authorization header.

Path Parameters

string
required
The UUID of the server

Request Body

string
required
The root directory for chmod operations (all paths are relative to this)
array
required
Array of file chmod operations

Response

Returns 204 No Content on success.

Example Request

Common Permission Modes

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
For shell scripts and other executables, use mode 0755 to make them executable. For configuration files, use 0644.

Error Responses

Invalid mode format (must be octal string like “0755”)
Missing or invalid Bearer token
Server or file does not exist
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)