AsavarTzeth / docker-sftp

This project isn't being actively maintained. That also means it is not supported. It is provided for archival and academic purposes only and should never be used in a production environment.
BSD 2-Clause "Simplified" License
9 stars 10 forks source link

Make operation more closely reflect README/spec #5

Closed bradjones1 closed 6 years ago

bradjones1 commented 9 years ago

A few quick changes to make the behaviour match the spec outlined in the README. Also primes a .ssh directory for users to add authorized keys.

AsavarTzeth commented 9 years ago

Okay I actually had the time to look into this. I will try to do a proper comment on each change in the same order Github presents them.

Also, could you explain why we would need to set an expire date several thousand years into the future? Sure I could consider adding an expire date env variable as a feature. But under no circumstances should this be hard coded. It should be a variable, based on current date + x and it should be user configurable if needed.

Then you got me thinking, would it not be safer and more flexible to split up the check and adding of $SFTP_CHROOT/$user and $SFTP_CHROOT/$user/.ssh. Just in case someone customizes the configuration and/or stores data externally? Simply put, make as few assumptions as possible.

The problem is if you set the default value at build time like this is your data cannot be copied to an external data storage by the script. The README value is still the default, but it needs to check what kind of storage solution you are using before it actually sets it in the config file. This therefor has to be done at runtime.

I also feel I need to repeat that I cannot accept merges into master. If you would rebase against beta it would be no issue. In the future projects I will probably have a "stable" tag that is reused instead of using master as a stable branch.