Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SFTP improvements #40183

Merged
merged 8 commits into from
Sep 18, 2023
Merged

SFTP improvements #40183

merged 8 commits into from
Sep 18, 2023

Conversation

icewind1991
Copy link
Member

@icewind1991 icewind1991 commented Aug 31, 2023

  • Fix outdated stat cache being used in some cases
  • Fix an error when closing a readable stream that wasn't at eof
  • Optimize file_put_contents, writeStream and copy
  • Optimize getPermissions/getMetaData
  • implement fseek for readable stream
  • misc fixes
  • add tests to ci

@icewind1991 icewind1991 force-pushed the sftp-fixes branch 2 times, most recently from f0c0d09 to 485fe4e Compare August 31, 2023 14:03
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Psalm found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

@icewind1991 icewind1991 force-pushed the sftp-fixes branch 8 times, most recently from b1b5390 to 871be23 Compare September 1, 2023 15:27
@icewind1991 icewind1991 added the 3. to review Waiting for reviews label Sep 1, 2023
@icewind1991 icewind1991 requested review from a team, ArtificialOwl, sorbaugh and come-nc and removed request for a team September 1, 2023 15:31
@icewind1991 icewind1991 added this to the Nextcloud 28 milestone Sep 1, 2023
@icewind1991 icewind1991 marked this pull request as ready for review September 1, 2023 15:31
use phpseclib\Net\SFTP\Stream;

/**
* Uses phpseclib's Net\SFTP class and the Net\SFTP\Stream stream wrapper to
* provide access to SFTP servers.
*/
class SFTP extends \OC\Files\Storage\Common {
class SFTP extends Common {

Check notice

Code scanning / Psalm

DeprecatedInterface Note

OCP\Files\Storage is marked deprecated
apps/files_external/lib/Lib/Storage/SFTP.php Fixed Show fixed Hide fixed
apps/files_external/lib/Lib/Storage/SFTP.php Fixed Show fixed Hide fixed
apps/files_external/lib/Lib/Storage/SFTP.php Fixed Show fixed Hide fixed
apps/files_external/lib/Lib/Storage/SFTP.php Fixed Show fixed Hide fixed
apps/files_external/lib/Lib/Storage/SFTP.php Fixed Show fixed Hide fixed
apps/files_external/lib/Lib/Storage/SFTP.php Show resolved Hide resolved
apps/files_external/lib/Lib/Storage/SFTP.php Outdated Show resolved Hide resolved
apps/files_external/lib/Lib/Storage/SFTP.php Outdated Show resolved Hide resolved
apps/files_external/lib/Lib/Storage/SFTPReadStream.php Outdated Show resolved Hide resolved
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991 icewind1991 force-pushed the sftp-fixes branch 2 times, most recently from 66a0b5c to dfa17a0 Compare September 4, 2023 15:05
Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991
Copy link
Member Author

failures unrelated sftp/kerberos/#40485

@icewind1991 icewind1991 merged commit cf73440 into master Sep 18, 2023
47 of 50 checks passed
@icewind1991 icewind1991 deleted the sftp-fixes branch September 18, 2023 17:14
@icewind1991
Copy link
Member Author

/backport to stable27

@icewind1991
Copy link
Member Author

/backport to stable26

@icewind1991
Copy link
Member Author

/backport to stable25

@backportbot-nextcloud
Copy link

The backport to stable26 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable26
git pull origin stable26

# Create the new backport branch
git checkout -b fix/foo-stable26

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable26

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@backportbot-nextcloud
Copy link

The backport to stable25 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable25
git pull origin stable25

# Create the new backport branch
git checkout -b fix/foo-stable25

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable25

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@icewind1991
Copy link
Member Author

/backport to stable26

@backportbot-nextcloud
Copy link

The backport to stable27 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable27
git pull origin stable27

# Create the new backport branch
git checkout -b fix/foo-stable27

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable27

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@backportbot-nextcloud
Copy link

The backport to stable26 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable26
git pull origin stable26

# Create the new backport branch
git checkout -b fix/foo-stable26

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable26

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SFTP External Storage error
4 participants