Skip to content

Commit

Permalink
Merge d4e90fb into 0b89f46
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe committed Apr 7, 2021
2 parents 0b89f46 + d4e90fb commit 2f4aff3
Show file tree
Hide file tree
Showing 25 changed files with 122 additions and 5,613 deletions.
2 changes: 0 additions & 2 deletions beaconsite/templates/beaconsite/site_detail.html
Expand Up @@ -154,8 +154,6 @@ <h5 class="modal-title">Modal title</h5>
{% block javascript %}
{{ block.super }}

<script type="text/javascript" src="{% static 'js/vendor/axios-0.18.0.min.js' %}"></script>

<script type="application/javascript">
$(function () {
$("#button-get-info").click(function () {
Expand Down
34 changes: 34 additions & 0 deletions config/settings/base.py
Expand Up @@ -566,6 +566,40 @@ def fixed_array_type(field):
ENABLED_BACKEND_PLUGINS = ["timeline_backend"]
ENABLED_BACKEND_PLUGINS += env.list("ENABLED_BACKEND_PLUGINS", None, [])

# Warn about unsupported browsers (IE)
PROJECTROLES_BROWSER_WARNING = True

# Disable default CDN JS/CSS includes to replace with local files. This
# is primarily used for Docker-based deployments.
PROJECTROLES_DISABLE_CDN_INCLUDES = env.bool("PROJECTROLES_DISABLE_CDN_INCLUDES", False)

if PROJECTROLES_DISABLE_CDN_INCLUDES:
PROJECTROLES_CUSTOM_JS_INCLUDES = [
"/static/local/js/jquery-3.5.1.min.js",
"/static/local/js/tether.min.js",
"/static/local/js/shepherd.min.js",
"/static/local/js/clipboard.min.js",
"/static/local/js/bundle.tracing.min.js",
"/static/local/js/jquery.dataTables.min.js",
"/static/local/js/bootstrap-select.min.js",
"/static/local/js/tagsinput.js",
"/static/local/js/jsrender.min.js",
"/static/local/js/plotly-1.54.5.min.js",
"/static/local/js/axios.min.js",
"/static/local/js/palette.min.js",
"/static/local/js/lodash.min.js",
]
PROJECTROLES_CUSTOM_CSS_INCLUDES = [
"/static/local/css/font-awesome.min.css",
"/static/local/css/bootstrap.min.css",
"/static/local/css/bootstrap-select.min.css",
"/static/local/css/dataTables.jqueryui.min.css",
"/static/local/css/tagsinput.css",
]
else:
PROJECTROLES_CUSTOM_JS_INCLUDES = []
PROJECTROLES_CUSTOM_CSS_INCLUDES = []


def set_logging(debug):
return {
Expand Down
8 changes: 5 additions & 3 deletions config/settings/production.py
Expand Up @@ -27,9 +27,6 @@
# This ensures that Django will be able to detect a secure connection
# properly on Heroku.
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
# raven sentry client
# See https://docs.sentry.io/clients/python/integrations/django/
INSTALLED_APPS += ["raven.contrib.django.raven_compat"]

# Use Whitenoise to serve static files
# See: https://whitenoise.readthedocs.io/
Expand Down Expand Up @@ -89,6 +86,11 @@
# ------------------------
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"

# Add Samplesheets vue.js app assets
STATICFILES_DIRS.append(str(ROOT_DIR("varfish/vueapp/dist")))

# Add optonal custom directory for static includes at deployment stage
STATICFILES_DIRS += env.list("CUSTOM_STATIC_DIR", default=[])

# EMAIL CONFIGURATION
# ------------------------------------------------------------------------------
Expand Down
6 changes: 1 addition & 5 deletions config/wsgi.py
Expand Up @@ -23,9 +23,6 @@
app_path = os.path.dirname(os.path.abspath(__file__)).replace("/config", "")
sys.path.append(os.path.join(app_path, "varfish"))

if os.environ.get("DJANGO_SETTINGS_MODULE") == "config.settings.production":
from raven.contrib.django.raven_compat.middleware.wsgi import Sentry

# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
# if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use
Expand All @@ -36,8 +33,7 @@
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
application = get_wsgi_application()
if os.environ.get("DJANGO_SETTINGS_MODULE") == "config.settings.production":
application = Sentry(application)

# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)
44 changes: 41 additions & 3 deletions docker/Dockerfile
Expand Up @@ -4,6 +4,7 @@ ARG app_git_url=https://github.com/bihealth/varfish-server.git
ARG app_git_tag

ENV DEBIAN_FRONTEND noninteractive
ENV CUSTOM_STATIC_DIR /usr/src/app/local-static

## Add the wait script to the image
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.7.3/wait /usr/local/bin/wait
Expand All @@ -16,14 +17,14 @@ RUN git clone --depth 1 --branch $app_git_tag $app_git_url /usr/src/app
# Install system dependencies.
RUN apt-get update && \
apt-get install -y \
apt-utils
RUN apt-get install -y \
apt-utils \
gcc \
ldap-utils \
libldap2-dev \
libsasl2-dev \
make \
postgresql-client
postgresql-client \
wget

# Install Python dependencies.
RUN cd /usr/src/app && \
Expand All @@ -38,6 +39,43 @@ RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
RUN cd /usr/src/app/varfish/vueapp && \
npm ci

# Download files from CDN.
RUN mkdir -p /usr/src/app/local-static/local/css && \
mkdir -p /usr/src/app/local-static/local/fonts && \
mkdir -p /usr/src/app/local-static/local/js && \
cd /usr/src/app/local-static/local/fonts && \
wget \
https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/FontAwesome.otf \
https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.eot \
https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.svg \
https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.ttf \
https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff \
https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff2 && \
\
cd /usr/src/app/local-static/local/css && \
wget \
https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css \
https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css \
https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.18/css/bootstrap-select.min.css \
https://cdn.datatables.net/1.10.24/css/dataTables.jqueryui.min.css \
https://cdn.jsdelivr.net/npm/bootstrap4-tagsinput@4.1.3/tagsinput.css && \
\
cd /usr/src/app/local-static/local/js && \
wget \
https://code.jquery.com/jquery-3.5.1.min.js \
https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.4/js/tether.min.js \
https://cdnjs.cloudflare.com/ajax/libs/shepherd/1.8.1/js/shepherd.min.js \
https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js \
https://browser.sentry-cdn.com/6.2.5/bundle.tracing.min.js \
https://cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js \
https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.18/js/bootstrap-select.min.js \
https://cdn.jsdelivr.net/npm/bootstrap4-tagsinput@4.1.3/tagsinput.js \
https://cdnjs.cloudflare.com/ajax/libs/jsrender/1.0.11/jsrender.min.js \
https://cdn.plot.ly/plotly-1.54.5.min.js \
https://cdnjs.cloudflare.com/ajax/libs/axios/0.21.1/axios.min.js \
https://cdnjs.cloudflare.com/ajax/libs/google-palette/1.1.0/palette.min.js \
https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js

# Prepare static files
RUN cd /usr/src/app && \
mkdir -p /usr/src/app/varfish/vueapp/dist && \
Expand Down
2 changes: 0 additions & 2 deletions requirements/base.txt
Expand Up @@ -119,8 +119,6 @@ django-su
# Sentry client.
sentry-sdk ==0.14.0

raven ==6.10.0

# Redis support
redis==3.3.8

Expand Down
2 changes: 2 additions & 0 deletions requirements/local.txt
Expand Up @@ -9,6 +9,8 @@ django-debug-toolbar-alchemy==0.1.5

# improved REPL
ipdb==0.13.4, <0.14
# downgrade jedi to fix tb_frame problem
jedi==0.17.2

pytest-django==3.4.2
pytest-sugar==0.9.1
Expand Down
1 change: 0 additions & 1 deletion svs/templates/svs/scripts.html
Expand Up @@ -30,7 +30,6 @@
let variant_flags_url = "{% url 'svs:sv-flags-api' project=project.sodar_uuid case="--abcef--" sv="--bbccee--" %}";
let variant_comment_url = "{% url 'svs:sv-comment-api' project=project.sodar_uuid case="--abcef--" sv="--bbccee--" %}";
</script>
<script type="text/javascript" src="{% static "js/vendor/lodash-4.17.15.min.js" %}"></script>
<script type="text/javascript" src="{% static "js/helpers.js" %}"></script>
<script type="text/javascript" src="{% static "js/filter_form.js" %}"></script>
<script type="text/javascript" src="{% static "js/flags_comments.js" %}"></script>
Expand Down
7 changes: 0 additions & 7 deletions varfish/static/css/vendor/bootstrap-4.1.3.min.css

This file was deleted.

1 change: 0 additions & 1 deletion varfish/static/css/vendor/bootstrap-4.1.3.min.css.map

This file was deleted.

0 comments on commit 2f4aff3

Please sign in to comment.