haiwen / seafile-docker

A Docker image for Seafile server
Other
536 stars 181 forks source link

Allow recreation configuration files #320

Closed undergroundwires closed 1 year ago

undergroundwires commented 1 year ago

(Re)creation of configuration files now depend on existence of seafile-data folder. However, one could still have this folder but miss the configurations. Checking for the right folder makes Seafile more resilient against data availability issues, but also allows for container users to force recreation of the configurations on demand.

This commit allows re-installing the container end keeping the data. It provides a way to separate user data from recreatable configurations. So one does not need to delete everything and re-upload all the data to get new configuration, see (e.g. mentioned here).

The environment variables are only relevant for the first deployment. Existing configuration in the volumes is not overwritten. After this PR, one can regenerate configurations by deleting seafile-data/seafile/conf. It is helpful in scenarios where docker-compose variables are updated frequently, e.g. by using CI/CD. This way, docker-compose configurations will stay in sync with the configurations inside the container.

The similar behavior already exists when seafile-data/nginx folder is deleted, then recreates the folder regardless of seafile-data exists or not.

undergroundwires commented 1 year ago

Closing this as configuration files are not recreated after this. Hopefully we can get a proper and more extensive implementation to this as a stateless and immutable solution.