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

Append extra settings for seahub #6158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xxbillouxx
Copy link

If seahub_settings_extra.py exists, it is automatically added at the end of the generated seahub_settings.py

By this way, it is no more required :

  • to write manually the extra settings at the end of the seahub_settings.py
  • and to restart the service

as described here.

This is useful when seafile is deployed with a docker compose file: instead of starting the container and manually doing a docker exec to edit the seahub_settings.py inside the container and restarting the service, we just provide a seahub_settings_extra.py with the docker 'volume' feature.

If seahub_settings_extra.py exists, it is automatically added
at the end of the generated seahub_settings.py

By this way, it is no more required to write manually the extra
settings at the end of the seahub_settings.py

This is useful when seafile is deployed with a docker compose file:
instead of starting the service and manually doing a 'docker exec'
to edit the seahub_settings.py inside the container, we just
provide a seahub_settings_extra.py with the docker 'volume' feature
@freeplant
Copy link
Member

seahub_extra_settings.py are no longer used anymore since version 10.0.

In which case do you need this file?

@xxbillouxx
Copy link
Author

xxbillouxx commented Jun 3, 2024

Hi @freeplant

Thanks for your feedback.

My seahub_settings_extra.py is a new file that I created, there is no link with the seahub_extra_settings.py that existed in the previous versions of Seafile.
I realize my new file has a name that could be confusing with the old seahub_extra_settings.py 😕

I re-explain below the context for which I created this file:

I use the docker-compose.yml (as detailed here) to create a Seafile container and all its related containers (database and memcached).

And I have another docker-compose.yml (on another server) to create an Onlyoffice container.

As specified here , to be able to link a Seafile server to a Onlyoffice server:

  • I must add some extra configuration in the seahub_settings.py
  • and I need to restart the Seafile server after.

=> this add some manual operations:

  • I must do manually a docker compose up -> setup-seafile-mysql.py will generate the seahub_settings.py
  • I must do manually a docker exec -it <seafile container> bash to manually edit the generated seahub_settings.py to add the extra configuration for Onlyoffice
  • I must restart manually the Seafile service

I would like to avoid these manual steps and do all of that automatically at the first Seafile container startup.

So this is why I would like to do that:

  • creating a file seahub_settings_extra.py
# Enable OnlyOffice
ENABLE_ONLYOFFICE = True
VERIFY_ONLYOFFICE_CERTIFICATE = False
ONLYOFFICE_APIJS_URL = 'http{s}://{your OnlyOffice server's domain or IP}/web-apps/apps/api/documents/api.js'
ONLYOFFICE_FILE_EXTENSION = ('doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'odt', 'fodt', 'odp', 'fodp', 'ods', 'fods')
ONLYOFFICE_EDIT_FILE_EXTENSION = ('docx', 'pptx', 'xlsx')

# Enable force save to let user can save file when he/she press the save button on OnlyOffice file edit page.
ONLYOFFICE_FORCE_SAVE = True

# if JWT enabled
ONLYOFFICE_JWT_SECRET = 'your-secret-string'
  • adding in the docker compose:
  seafile:
    image: seafileltd/seafile-mc:11.0-latest
    [...]
    volumes:
      [...] 
      - ./seahub_settings_extra.py:/shared/seafile/conf/seahub_settings_extra.py
    [...]

So at the Seafile container startup, the setup-seafile-mysql.py will check if there is an seahub_settings_extra.py and will append its content to the end of the seahub_settings.py.

This new seahub_settings_extra.py could be used for any customization that requires today to manually edit the seahub_settings.py 😃 : no more manual editing, no need to restart the Seafile server anymore.

Let me know if it makes sense.

Thank you.

@freeplant
Copy link
Member

Thanks for the explanation. I see your logic now. We will think about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants