Skip to content

Commit

Permalink
Better inline html/changelog support
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadia committed Nov 11, 2015
1 parent b9a0c86 commit 707204a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
8 changes: 8 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ RUN mkdir /service/tad/config
USER explorer
COPY supervisord.conf /home/explorer/memex-explorer/source/supervisord.conf
COPY docker_settings.py /home/explorer/memex-explorer/source/memex/settings.py
# patched in
WORKDIR /home/explorer/memex-explorer
RUN conda install markdown
RUN markdown_py CHANGES.md > source/base/changes.html
WORKDIR /home/explorer/memex-explorer/docs
RUN make html
RUN mv build/html ../source/base/static/docs

# TAD configuration
COPY tad.cfg /service/tad/config/tad.cfg
Expand Down Expand Up @@ -138,4 +145,5 @@ USER explorer
WORKDIR /home/explorer/memex-explorer/source
ENV HTTP_PROTOCOL http
ENV WS_PROTOCOL ws
ENV INLINE 1
ENTRYPOINT "supervisord"
10 changes: 8 additions & 2 deletions docker/docker_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,24 @@
from common_settings import *
import os

# SECURITY WARNING: Not setting VIRTUAL_HOST prevents Django from being able to verify headers
ALLOWED_HOSTS = [os.environ.get('VIRTUAL_HOST', '*')]

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '0#t((zq66&3*87djaltu-pn34%0p!*v_332f2p!$2i)w5y17f8'

# SECURITY WARNING: don't run with debug turned on in production!
PRODUCTION = os.environ.get('PRODUCTION')
PRODUCTION = os.environ.get('PRODUCTION', False)

# when INLINE is true point to local sources for changes/documentation instead of remote ones
INLINE = os.environ.get('INLINE', False)

if PRODUCTION:
DEBUG = False
TEMPLATE_DEBUG = False
DEPLOYMENT = True
else:
DEBUG = os.environ.get('DEBUG', )
DEBUG = True
TEMPLATE_DEBUG = True
INSTALLED_APPS += ('debug_toolbar',)
DEPLOYMENT = False
Expand Down
17 changes: 17 additions & 0 deletions source/base/templates/base/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,29 @@
<li>
<a href ="{% url 'base:seeds_list' %}" style="color: white; margin-left:60px;"> Seeds </a>
</li>
{% if settings.INLINE %}
<li>
<a href ="{% static 'docs/index.html' %}" target="_blank" style="color: white; margin-left:60px"> Docs </a>
</li>
{% else %}
<li>
<a href ="http://memex-explorer.readthedocs.org/en/latest/" target="_blank" style="color: white; margin-left:60px"> Docs </a>
</li>
{% endif %}

<li>
<a href ="/about" target="_blank" style="color: white; margin-left:60px"> About </a>
</li>
{% if settings.INLINE %}
<li>
<a href ="{% static 'changes.html' %}" target="_blank" style="color: white; margin-left:60px"> Changes </a>
</li>
{% else %}
<li>
<a href ="https://github.com/memex-explorer/memex-explorer/blob/master/CHANGES.md" target="_blank" style="color: white; margin-left:60px"> Changes </a>
</li>
{% endif %}

</ul>
</div>
</div>
Expand Down

0 comments on commit 707204a

Please sign in to comment.