2023-10-26 15:54:56 +00:00
|
|
|
type: update
|
|
|
|
name: Add SFTP User
|
|
|
|
|
|
|
|
targetNodes:
|
|
|
|
nodeGroup: cp
|
|
|
|
|
|
|
|
user: root
|
|
|
|
|
|
|
|
settings:
|
|
|
|
sfpform:
|
|
|
|
fields:
|
|
|
|
- type: string
|
|
|
|
inputType: text
|
|
|
|
name: root_directory
|
|
|
|
caption: Root Directory
|
|
|
|
default: "/var/www/webroot/ROOT"
|
|
|
|
required: true
|
|
|
|
- type: checkbox
|
|
|
|
name: enable_ssh
|
|
|
|
caption: Also enable SSH access
|
|
|
|
default: false
|
|
|
|
|
|
|
|
globals:
|
|
|
|
username: "user${fn.random(10000,99999)}"
|
|
|
|
password: ${fn.password(min)}
|
|
|
|
sftpHost: ${env.domain}
|
|
|
|
sftpPort: 22
|
|
|
|
|
|
|
|
onInstall:
|
|
|
|
- cmd[cp]: |
|
2023-10-26 16:06:58 +00:00
|
|
|
curl -O https://deploy-proxy.mightybox.io/addons/add-sftp-user/raw/branch/main/add-sftp.sh
|
2023-10-26 16:21:57 +00:00
|
|
|
chmod +x add-sftp.sh # Corrected the filename here
|
2023-10-26 15:54:56 +00:00
|
|
|
- success: |
|
|
|
|
Add-on installed successfully!
|
|
|
|
To create additional SFTP accounts, click on the "Add new SFTP user" button.
|
|
|
|
|
2023-10-26 16:08:55 +00:00
|
|
|
onUninstall:
|
2023-10-26 16:21:57 +00:00
|
|
|
- cmd[cp]: rm -f ./add-sftp.sh
|
2023-10-26 16:08:55 +00:00
|
|
|
- return:
|
|
|
|
result: 0
|
|
|
|
message: "Add-on uninstalled successfully and script file removed."
|
|
|
|
|
2023-10-26 15:54:56 +00:00
|
|
|
actions:
|
|
|
|
add_sftp_user:
|
2023-10-26 16:21:57 +00:00
|
|
|
- cmd[cp]: ./add-sftp.sh
|
2023-10-26 16:06:58 +00:00
|
|
|
- return:
|
|
|
|
result: 0
|
|
|
|
output: "SFTP user added successfully!"
|
2023-10-26 15:54:56 +00:00
|
|
|
|
|
|
|
success:
|
|
|
|
email: |
|
|
|
|
Connection Details<br><br>
|
|
|
|
SFTP Host: ${globals.sftpHost}<br><br>
|
|
|
|
Port: ${globals.sftpPort}<br>
|
|
|
|
<br><br>
|
|
|
|
Login Credentials<br>
|
|
|
|
Username: ${globals.username}<br><br>
|
|
|
|
Password: ${globals.password}
|
|
|
|
text:
|
|
|
|
en: |
|
|
|
|
Connection Details
|
|
|
|
|
|
|
|
SFTP Host: ${globals.sftpHost}
|
|
|
|
|
|
|
|
Port: ${globals.sftpPort}
|
|
|
|
|
|
|
|
|
|
|
|
Login Credentials
|
|
|
|
|
|
|
|
Username: ${globals.username}
|
|
|
|
|
|
|
|
Password: ${globals.password}
|
|
|
|
|
|
|
|
buttons:
|
|
|
|
- settings: sfpform
|
|
|
|
action: add_sftp_user
|
|
|
|
caption: Add SFTP/SSH User
|
2023-10-26 16:06:58 +00:00
|
|
|
confirmText: "Are you sure you want to add this SFTP user?"
|