File tree Expand file tree Collapse file tree 7 files changed +39
-14
lines changed
Expand file tree Collapse file tree 7 files changed +39
-14
lines changed Original file line number Diff line number Diff line change 44$obj = new stdClass();
55$obj->url="";
66$obj->created_at="2023-03-14 16:03 UTC";
7- $obj->updated_at="2024-01-18 11:43 UTC";
7+ $obj->updated_at="2025-04-15 12:49 UTC";
88$obj->ai_compatible=false;
99$obj->ai_only=false;
1010$obj->revision="f51baaed036a40beed9dba71ca8b2ef5";
11- $obj->build="2024-01-18 11:43 UTC";
11+ $obj->build="2025-04-15 12:49 UTC";
1212$obj->uuid="58268850-ddaf-4f29-9794-f289820938f2"; #random from https://www.uuidgenerator.net/version4
1313$obj->code="ls-sftp-access";
1414$obj->name="SFTP Access";
1515$obj->description="SFTP Access extension will allow you to enable SFTP access for additional FTP users";
1616$obj->version="1.0";
17- $obj->release="77 ";
17+ $obj->release="78 ";
1818$obj->author=null;
1919$obj->vendor="Layershift";
2020$obj->example=false;
2121$obj->featured=true;
22- $obj->checksum="43cf5b35977456e91c62da8289badc2d ";
22+ $obj->checksum="1addd170938b71c5e7b139cba655e43c ";
2323$obj->fake=false;
24- $obj->download_url="https://plesk-extension-catalog.layershift.com/extensions//ls-sftp-access/ls-sftp-access-1.0-77 .zip";
24+ $obj->download_url="https://plesk-extension-catalog.layershift.com/extensions//ls-sftp-access/ls-sftp-access-1.0-78 .zip";
2525$obj->buy_url="";
2626$obj->icon="https://plesk-extension-catalog.layershift.com/extensions/ls-sftp-access/64x64.png";
2727$obj->screenshots=array(
Original file line number Diff line number Diff line change 1+ # 1.0-78
2+ Bug fixes:
3+ * Check if CageFS is installed and add the /jail folder to the mount points
4+
15# 1.0-77
26Bug fixes:
37 * sshd_config block breaking new variables added at the end of the file
Original file line number Diff line number Diff line change 44 <name >SFTP Access</name >
55 <description >SFTP Access extension will allow you to enable SFTP access for additional FTP users</description >
66 <version >1.0</version >
7- <release >77 </release >
7+ <release >78 </release >
88 <vendor >Layershift</vendor >
99 <url >https://www.layershift.com</url >
1010 <plesk_min_version >18.0.50</plesk_min_version >
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public function indexAction()
2121 $ this ->view ->tabs = $ this ->_getTabs ();
2222
2323 $ out ="<table> " ;
24- $ out .="<tr><td>SFTP for additional FTP users.<br> Version: 1.0.77 </td></tr> " ;
24+ $ out .="<tr><td>SFTP for additional FTP users.<br> Version: 1.0.78 </td></tr> " ;
2525 $ out .="</table> " ;
2626 $ this ->view ->service_status =$ out ;
2727
Original file line number Diff line number Diff line change 4343 file_put_contents (pm_Context::getVarDir ()."debug.log " , 'done ' ."\n" , FILE_APPEND );
4444
4545
46- if ( $ isUpgrade == 0 ) {
46+
4747 file_put_contents (pm_Context::getVarDir ()."debug.log " , 'executing provision.sh ... ' ."\n" , FILE_APPEND );
4848 // call provision script
4949 try {
5353 exit ;
5454 }
5555 file_put_contents (pm_Context::getVarDir ()."debug.log " , 'done ' ."\n" , FILE_APPEND );
56- }
56+
5757
5858
5959exit (0 );
Original file line number Diff line number Diff line change 11#! /bin/bash
22printenv
3- # create the jail home
3+ # Create the jail home
44mkdir -p -v -m 751 /jail
55chown root.root /jail
66
@@ -9,7 +9,7 @@ if [ $? -ne 0 ]; then
99 groupadd sftpusers
1010fi
1111
12- # configure autofs
12+ # Configure AutoFS
1313if [ -d /etc/auto.master.d ]; then
1414 if [ -f /etc/auto.master.d/ls-sftp-access.autofs ]; then
1515 mv -v /etc/auto.master.d/ls-sftp-access.autofs /etc/auto.master.d/ls-sftp-access.autofs_$( date +%s)
3131fi
3232
3333
34- # configure sshd
34+ # Configure SSHD
3535grep -q " ### ls-sftp-access configuration block begin ###" /etc/ssh/sshd_config
3636if [ $? -eq 0 ]; then
37- cp -v /etc/ssh/sshd_config /etc/ssh/sshd_config_$( date +%s)
37+ cp -p - v /etc/ssh/sshd_config /etc/ssh/sshd_config_$( date +%s)
3838fi
3939
4040grep -q " ### ls-sftp-access configuration block begin ###" /etc/ssh/sshd_config
6262
6363systemctl restart sshd
6464
65- # prepare persistent configuration files
65+ # Check if CageFS is installed and add the jail folder to the mount points
66+ rpm -q cagefs 2>&1 > /dev/null
67+ if [ $? -eq 0 ]; then
68+ cat << EOF >> /etc/cagefs/cagefs.mp
69+ ### ls-sftp-access configuration block begin ###
70+ /jail
71+ ### ls-sftp-access configuration block end ###
72+ EOF
73+ cagefsctl --remount-all
74+ fi
75+
76+ # Prepare persistent configuration files
6677
6778if [ ! -f /usr/local/psa/admin/conf/ls-sftp-access ]; then
6879 touch /usr/local/psa/admin/conf/ls-sftp-access;
Original file line number Diff line number Diff line change 33systemctl stop autofs
44systemctl disable autofs
55
6+ # Remove SSHD configuration block
67grep -q " ### ls-sftp-access configuration block begin ###" /etc/ssh/sshd_config
78if [ $? -eq 0 ]; then
89 grep -q " ### ls-sftp-access configuration block begin ###" /etc/ssh/sshd_config
@@ -12,3 +13,12 @@ if [ $? -eq 0 ]; then
1213 fi
1314fi
1415
16+ # Remove the CageFS mounte point
17+ rpm -q cagefs 2>&1 > /dev/null
18+ if [ $? -eq 0 ]; then
19+ grep -q " ### ls-sftp-access configuration block begin ###" /etc/cagefs/cagefs.mp
20+ if [ $? -eq 0 ]; then
21+ sed -e ' /^### ls-sftp-access configuration block begin ###/,/^### ls-sftp-access configuration block begin ###/d' -i /etc/cagefs/cagefs.mp
22+ cagefsctl --remount-all
23+ fi
24+ fi
You can’t perform that action at this time.
0 commit comments