I ran into a similar challenge when setting up SFTP for my site https://devpost.com/software/hdo-box. Here are the things I did to figure it out.
This functionality is indeed essential for flexible and efficient management of SFTP accounts, particularly for developers who rely on automated tools and custom workflows. Here's how it can be approached:
Understanding the Problem:
By default, the root folder for new SFTP accounts in your setup is set to applications/(appname).
This directory is not writable in some cases, causing uploads via software to fail.
There is currently no option to define a custom root directory (e.g., applications/(appname)/public_html/newfolder).
Proposed Solution:
Add a field during the creation of new SFTP accounts that allows users to specify a custom root directory.
Ensure that the specified directory is validated for permissions and exists in the file structure.
Benefits of Implementing This Feature:
Flexibility for Developers: Developers can set up the root directory to match their project’s structure, reducing errors.
Improved Compatibility: Software relying on writable root directories (e.g., automated upload tools) can work seamlessly.
Scalability: As applications grow, having customizable SFTP roots simplifies managing multiple directories for specific tasks or teams.
Enhanced User Experience: Provides control over server resources, making platforms like CloudWays more appealing to developers.
Implementation Example:
During the creation of a new SFTP account, include a field labeled "Root Directory."
Default to the current applications/(appname) directory but allow users to modify it (e.g., `applications/(appname)/public_html/newfolapplications/(appname)/public_html/newfolder).
Perform permission checks to ensure the directory is writable.
I ran into a similar challenge when setting up SFTP for my site https://devpost.com/software/hdo-box. Here are the things I did to figure it out.
This functionality is indeed essential for flexible and efficient management of SFTP accounts, particularly for developers who rely on automated tools and custom workflows. Here's how it can be approached:
Understanding the Problem:
By default, the root folder for new SFTP accounts in your setup is set to applications/(appname).
This directory is not writable in some cases, causing uploads via software to fail.
There is currently no option to define a custom root directory (e.g., applications/(appname)/public_html/newfolder).
Proposed Solution:
Add a field during the creation of new SFTP accounts that allows users to specify a custom root directory.
Ensure that the specified directory is validated for permissions and exists in the file structure.
Benefits of Implementing This Feature:
Flexibility for Developers: Developers can set up the root directory to match their project’s structure, reducing errors.
Improved Compatibility: Software relying on writable root directories (e.g., automated upload tools) can work seamlessly.
Scalability: As applications grow, having customizable SFTP roots simplifies managing multiple directories for specific tasks or teams.
Enhanced User Experience: Provides control over server resources, making platforms like CloudWays more appealing to developers.
Implementation Example:
During the creation of a new SFTP account, include a field labeled "Root Directory."
Default to the current applications/(appname) directory but allow users to modify it (e.g., `applications/(appname)/public_html/newfolapplications/(appname)/public_html/newfolder).
Perform permission checks to ensure the directory is writable.