photobooth icon indicating copy to clipboard operation
photobooth copied to clipboard

task: introduce sftp

Open benjaminkott opened this issue 1 year ago • 5 comments

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.

benjaminkott avatar Jul 17 '24 21:07 benjaminkott

@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.

benjaminkott avatar Jul 20 '24 10:07 benjaminkott

@benjaminkott ok I'll test the new code!

fmiccolis avatar Jul 20 '24 10:07 fmiccolis

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?

fmiccolis avatar Jul 22 '24 16:07 fmiccolis

@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.

benjaminkott avatar Jul 23 '24 06:07 benjaminkott

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.

fmiccolis avatar Jul 23 '24 06:07 fmiccolis