Skip to content

task: introduce sftp#799

Merged
andi34 merged 3 commits intoPhotoboothProject:devfrom
benjaminkott:task/sftp
Apr 6, 2025
Merged

task: introduce sftp#799
andi34 merged 3 commits intoPhotoboothProject:devfrom
benjaminkott:task/sftp

Conversation

@benjaminkott
Copy link
Copy Markdown
Collaborator

@benjaminkott benjaminkott commented Jul 17, 2024

This patch introduces Flysystem (https://flysystem.thephpleague.com/) as
the underlying package to handle remote storage. For now, we are only
integrating SFTP in addition to FTP to allow more connection options for
FTP uploads. There will now be an option to select FTP or SFTP, and the
correct adapter will be used to create the connection.

The code has been restructured to move logic away from the endpoints
towards a central service. This will make it easier to implement and
maintain in the future.

Some options have been removed as they do not seem to work reliably:

  • ftp:appendDate is a nice idea, but it has a flawed implementation
    as the date is evaluated on each request. This results in a mismatch
    between requested and actual URLs to files.

  • ftp:upload_thumb: Thumbnails are now always uploaded, ensuring all
    files are available on the server for the generated webpage.
    Defaults were introduced for several config settings. This way, we can
    rely on the settings being set and do not need to guess.

The template for the server has been restructured. Instead of parsing
the template and potentially risking breaking it, we are now providing
a dedicated config file that can be loaded without problems.
Additionally, a test template that uses local data is now available.

Comment thread src/Utility/PathUtility.php
@benjaminkott benjaminkott force-pushed the task/sftp branch 12 times, most recently from 7aebe4c to ced9f68 Compare July 20, 2024 09:52
@benjaminkott benjaminkott marked this pull request as ready for review July 20, 2024 09:57
@benjaminkott benjaminkott changed the title wip-task: introduce sftp task: introduce sftp Jul 20, 2024
@benjaminkott
Copy link
Copy Markdown
Collaborator Author

benjaminkott commented Jul 20, 2024

@fmiccolis as you did the original implementation, please check the updated code - I've made some adjustments for the better i guess, as it´s a bit more reliable and adjustable.

@fmiccolis
Copy link
Copy Markdown
Contributor

@benjaminkott ok I'll test the new code!

@benjaminkott benjaminkott force-pushed the task/sftp branch 2 times, most recently from a5b7749 to dde22bf Compare July 22, 2024 13:34
@fmiccolis
Copy link
Copy Markdown
Contributor

Hi @benjaminkott ,
the "old" configuration works fine. The files are uploaded and deleted as before.
I don't have a SFTP server to use to test the new part so I cannot help with it.

I was thinking about something: in the file uploader we can let the user upload it's own template for the webpage by adding the folder /template, what do you think?

@benjaminkott
Copy link
Copy Markdown
Collaborator Author

benjaminkott commented Jul 23, 2024

@fmiccolis

I was thinking about something: in the file uploader we can let the user upload its own template for the webpage by adding the folder /template, what do you think?

I am still unsure about this one, as it requires some kind of expert knowledge.

If you know what you are doing - it should be more or less easy to adjust. Everyone else, should probably only use the provided option.

Did you remove the initial created index.php file and check for the new generated template? I checked yesterday with some collegues and we needed to adjust some stuff to get it working.

@fmiccolis
Copy link
Copy Markdown
Contributor

If you know what you are doing - it should be more or less easy to adjust. Everyone else, should probably only use the provided option.

Yes, maybe You're right..

Did you remove the initial created index.php file and check for the new generated template? I checked yesterday with some collegues and we needed to adjust some stuff to get it working.

I have changed the title so in my ftp server a new folder has been created and the template loaded on.
The template is different from the old one and uses the configuration file uploaded with the index.php template file.
I don't know if I responded to your question.

@andi34 andi34 force-pushed the task/sftp branch 2 times, most recently from ef112ac to 55f0191 Compare January 1, 2025 20:49
@andi34 andi34 force-pushed the task/sftp branch 2 times, most recently from aa8e9c0 to 2fd2b6d Compare January 14, 2025 04:37
@andi34 andi34 added the enhancement New feature or request label Feb 23, 2025
This patch introduces Flysystem (https://flysystem.thephpleague.com/) as
the underlying package to handle remote storage. For now, we are only
integrating SFTP in addition to FTP to allow more connection options for
FTP uploads. There will now be an option to select FTP or SFTP, and the
correct adapter will be used to create the connection.

The code has been restructured to move logic away from the endpoints
towards a central service. This will make it easier to implement and
maintain in the future.

Some options have been removed as they do not seem to work reliably:

- `ftp:appendDate` is a nice idea, but it has a flawed implementation
  as the date is evaluated on each request. This results in a mismatch
  between requested and actual URLs to files.

- `ftp:upload_thumb`: Thumbnails are now always uploaded, ensuring all
  files are available on the server for the generated webpage.
  Defaults were introduced for several config settings. This way, we can
  rely on the settings being set and do not need to guess.

The template for the server has been restructured. Instead of parsing
the template and potentially risking breaking it, we are now providing
a dedicated config file that can be loaded without problems.
Additionally, a test template that uses local data is now available.

Change-Id: Iac24b838617c6d1a4147a385236cd430cad3eb09
Change-Id: Ie21fde75c51c605600a407e6c08de33c8834576c
@andi34 andi34 merged commit 3b60c04 into PhotoboothProject:dev Apr 6, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants