Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Synapse v0.33.6 Docker image lacks res/templates #4014

Closed
spantaleev opened this issue Oct 7, 2018 · 7 comments
Closed

Synapse v0.33.6 Docker image lacks res/templates #4014

spantaleev opened this issue Oct 7, 2018 · 7 comments
Assignees
Labels
A-Docker Docker images, or making it easier to run Synapse in a container.

Comments

@spantaleev
Copy link
Contributor

Ever since #3972 (the first final build of which appears to be v0.33.6), the Docker image does not include the /synapse directory anymore.

All the code is still in /usr/local/lib/python2.7/site-packages/synapse and it works as expected, but res/templates is not available anywhere anymore (used to be in /synapse/res/templates).

This means that container users (such as matrix-docker-ansible-deploy) which want to use the default email templates cannot easily do it anymore.

@ptman
Copy link
Contributor

ptman commented Oct 7, 2018

There was some slimming down, maybe it was a bit too aggressive

@neilisfragile neilisfragile added the A-Docker Docker images, or making it easier to run Synapse in a container. label Oct 8, 2018
@spantaleev
Copy link
Contributor Author

Seems like this:

RUN pip install --prefix="/install" --no-warn-script-location \
        lxml \
        psycopg2 \
        /synapse

will not copy any of the files specified in MANIFEST.in, thus ignoring the files in res/.

Those files would be part of the source distribution archive, but not part of the installed files.

Some more information about it is here: https://stackoverflow.com/questions/3596979/manifest-in-ignored-on-python-setup-py-install-no-data-files-installed

Seems like one solution is to move the res directory into synapse/ (thus making it "package data") and to change MANIFEST.in like this:

-recursive-include res *
+recursive-include synapse/res *

Another simple solution might be to just fix the Dockerfile, so that it would copy the res/ directory. However, that's probably fixing a symptom, rather than the actual deeper problem.

Perhaps making res/ part of the Synapse package data is better, as it will provide email templates for everyone, no matter how they install/use Synapse. Looking at the Archlinux package right now (which also does a fairly simple installation like the above), it does suffer from the same problem - no email templates included. It doesn't feel like there's a good reason to keep them out.

I'm not sure which solution you'd prefer or whether there are any downsides to relocating res/ like that.

@richvdh
Copy link
Member

richvdh commented Oct 17, 2018

fixed by #4052, I hope

@richvdh richvdh closed this as completed Oct 17, 2018
spantaleev added a commit to spantaleev/matrix-docker-ansible-deploy that referenced this issue Oct 18, 2018
We skipped v0.33.6 because of matrix-org/synapse#4014,
but v0.33.7rc2 fixed the problem.
@spantaleev
Copy link
Contributor Author

It does fix it and I can confirm email-sending works!
Thanks for taking care of it so quickly!

@richvdh
Copy link
Member

richvdh commented Oct 19, 2018

well, it turns out that I've made a right old mess of this, as per #4065. @spantaleev: I'm a bit surprised it works for you: could you clarify what your setup is (in particular, what have you set email_templates to be)?

@spantaleev
Copy link
Contributor Author

Since the upgrade to 0.33.7rc2, the playbook no longer defines email_templates and that seems to work fine. Hmm..

@richvdh
Copy link
Member

richvdh commented Oct 19, 2018

I am mystified :/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Docker Docker images, or making it easier to run Synapse in a container.
Projects
None yet
Development

No branches or pull requests

5 participants