Skip to content
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

Many fixes to allow use inside kubernetes + webdav working #187

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cr1st1p
Copy link

@cr1st1p cr1st1p commented Nov 2, 2019

Fixes:

  • patch applied to one seafdav file to make seafdav start
  • export more environment variables to child processes so that they
    really are taken into account (like USE_EXISTING_DB, etc)
  • use MEMCACHED_* environment variables to allow changing the server name
    from hardcoded value
  • use 'ENABLE_WEBDAV' environment variable to enable/disable this feature
  • on container start, ALWAYS update seahub_settings.py and seafdav.conf
    based on environment variables. This is a requirement to allow it
    to work inside a kubernetes cluster
  • nginx configuration for webdav/seafdav changed to NOT use fastcgi mode
  • small change in nginx configuration in case it is behind a SSL termination
    proxy
  • allow using mysql as non root, if using already existing db
    Others:
  • a little bit of refactoring nginx related functions from bootstrap.py
  • docker Makefile changed to take seafile version from the actual
    Dockerfile files, especially since standard and Pro versions can be
    different

Fixes:
- patch applied to one seafdav file to make seafdav *start*
- export more environment variables to child processes so that they
  really are taken into account (like USE_EXISTING_DB, etc)
- use MEMCACHED_* environment variables to allow changing the server name
  from hardcoded value
- use 'ENABLE_WEBDAV' environment variable to enable/disable this feature
- on container start, ALWAYS update seahub_settings.py and seafdav.conf
  based on environment variables. This is a requirement to allow it
  to work inside a kubernetes cluster
- nginx configuration for webdav/seafdav changed to NOT use fastcgi mode
- small change in nginx configuration in case it is behind a SSL termination
  proxy

Others:
- a little bit of refactoring nginx related functions from bootstrap.py
- docker Makefile changed to take seafile version from the actual
  Dockerfile files, especially since standard and Pro versions can be
  different
@GRBurst
Copy link

GRBurst commented Jan 8, 2020

@renfeipeng @lins05 we haven't seen any commits or progress for a while now.

#194 also targets a subset of this pr (e.g).

I think it is a very common use-case to run docker behind a proxy like nginx, so this pr adds some crucial features.

@hasufell
Copy link

Is this repo still maintained?

@freeplant
Copy link
Member

The configuration files like seahub_settings.py and seafdav.conf should not be changed on every start up. They should only be written in the first time when setting up the server. Then they should be updated manually if needed.

I don't understand why in kubernetes they need to be updated on every start up.

@cr1st1p
Copy link
Author

cr1st1p commented Jan 31, 2020

@freeplant
programs run as docker images are configured via environment variables. And, maybe, in more rare cases, if configuration is more complex, still by configuration files.
In case you drive the image via environment variables, then you must reflect that inside the container (in this case, configuration files, nginx config, and so on). I think that even before my changes it was already done by that, I just improved it.
And if environment variables change, you must ensure you reflect that - which means at every container start.

kubernetes runs docker images (well, not only docker, but that's not related to current story), so it drives them via environment variables. And for those cases where you really need configuration files, you generate them from ConfigMap. You still don't manually edit files to apply some change. It does not mean that you can not, but it would be bad practice.
Generally - you'd want all your changes over time to be kept, historically, for reviews, for security analysis, for sharing, etc. In git for example.. Regardless if we're talking about environment variable change, ConfigMap change, or even plain configuration file change (when you'd want the whole config file to be stored in git).

Get this - we're in a world where you try not editing things manually anymore. Code and configuration now stay in a revision control system (git usually) and from there it gets into a live system. Heck - now even whole computer clusters are created directly from config/code stored in git ("infrastructure as a code") - no more manually going to run a new instance and a new database server and configuring things.

Hope that helps.
Regards.

@hasufell
Copy link

I don't understand why in kubernetes they need to be updated on every start up.

That's how it's done in docker. See every major docker image.

OTHERS:
- updated README.md to contain information of the environment variables that can be used
- added a docker-compose/ directory with example to run
- updated README.md to refer to the current docker-compose/ example
- fix situation where an nginx reload could happen before nginx was started
@cr1st1p
Copy link
Author

cr1st1p commented Feb 19, 2020

I updated this PR with:

  • changes to fix conflicts with the master branch
  • documented in README.md, until this gets merged AND I know where to update the documentation, the environment variables that control the behavior of the docker image.
    NOTE: documentation should be in a repo as well, somehow I get the sensation that now documentation has moved from https://github.com/haiwen/seafile-docs to being directly served/edited under a seafile server?
  • one fix for a case where nginx was asked to be reloaded due to config changes before it got the chance to even start.

Until this gets merged, whoever needs the docker image:

@GRBurst
Copy link

GRBurst commented Aug 18, 2021

There is no progress here, sadly the response / community support does not seem to be a high priority here :-(
Thanks for your effort @cr1st1p 👍
Since it is still not possible to get it to run easily with a clean approach, I'll move to another solution.

jesseylin added a commit to jesseylin/seafile-docker that referenced this pull request Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants