-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
SFTP improvements #40183
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
Merged
Merged
SFTP improvements #40183
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
19daa70
clear sftp stat cache when opening a write stream
icewind1991 9cf732a
fix error during sftp stream close
icewind1991 1dfef9f
sftp optimize file_put_contents, writeStream and copy
icewind1991 b41c8e0
more optimized getPermissions/getMetaData
icewind1991 aa2a3ae
implement fseek for sftp read stream
icewind1991 e3a39f5
add sftp ci test
icewind1991 c264903
psalm suppress
icewind1991 d42d809
sftp psalm fixes
icewind1991 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| name: SFTP unit tests | ||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| - stable* | ||
| paths: | ||
| - 'apps/files_external/**' | ||
| pull_request: | ||
| paths: | ||
| - 'apps/files_external/**' | ||
|
|
||
| env: | ||
| APP_NAME: files_external | ||
|
|
||
| jobs: | ||
| sftp-tests: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| if: ${{ github.repository_owner != 'nextcloud-gmbh' }} | ||
|
|
||
| strategy: | ||
| # do not stop on another job's failure | ||
| fail-fast: false | ||
| matrix: | ||
| php-versions: ['8.0'] | ||
| sftpd: ['openssh'] | ||
|
|
||
| name: php${{ matrix.php-versions }}-${{ matrix.sftpd }} | ||
|
|
||
| steps: | ||
| - name: Checkout server | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| submodules: true | ||
|
|
||
| - name: Set up sftpd | ||
| run: | | ||
| sudo mkdir /tmp/sftp | ||
| sudo chown -R 0777 /tmp/sftp | ||
| if [[ "${{ matrix.sftpd }}" == 'openssh' ]]; then docker run -p 2222:22 --name sftp -d -v /tmp/sftp:/home/test atmoz/sftp "test:test:::data"; fi | ||
| - name: Set up php ${{ matrix.php-versions }} | ||
| uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 | ||
| with: | ||
| php-version: ${{ matrix.php-versions }} | ||
| tools: phpunit:9 | ||
| extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Set up Nextcloud | ||
| run: | | ||
| mkdir data | ||
| ./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password | ||
| ./occ app:enable --force ${{ env.APP_NAME }} | ||
| php -S localhost:8080 & | ||
| - name: PHPUnit | ||
| run: | | ||
| echo "<?php return ['run' => true, 'host' => 'localhost:2222','user' => 'test','password' => 'test', 'root' => 'data'];" > apps/${{ env.APP_NAME }}/tests/config.sftp.php | ||
| phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/SftpTest.php | ||
| - name: sftpd logs | ||
| if: always() | ||
| run: | | ||
| ls -l /tmp/sftp | ||
| docker logs sftp | ||
|
|
||
| sftp-summary: | ||
| runs-on: ubuntu-latest | ||
| needs: sftp-tests | ||
|
|
||
| if: always() | ||
|
|
||
| steps: | ||
| - name: Summary status | ||
| run: if ${{ needs.sftp-tests.result != 'success' }}; then exit 1; fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check notice
Code scanning / Psalm
DeprecatedInterface