Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ DDS_UPLOAD_TEST="./run_dir/upload"
DDS_DOWNLOAD_TEST="./run_dir/download"
DDS_TEMP_CACHE_TEST="./run_dir/cache_test"
DDS_DB_TYPE="dev-small" # "dev-big production"
FLASK_MAIL_DDS=nima.rafati@epigenica.se

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Load MAIL_DDS after the default configuration

When a deployment relies on this new FLASK_MAIL_DDS variable, from_prefixed_env() first loads it at dds_web/__init__.py:270, but from_object("dds_web.config.Config") immediately overwrites it at line 273 with Config.MAIL_DDS = "delivery@scilifelab.se" from dds_web/config.py:60. Unless an out-of-repo DDS_APP_CONFIG repeats the override, send-usage and the quota/reporting jobs continue sending Epigenica project-usage CSVs and notices to the old SciLifeLab address (dds_web/commands.py:1004, 1121-1129, and 1340-1343); set the intended recipient in a configuration source that survives this load order.

Useful? React with 👍 / 👎.

Binary file added .github/assets/4_crop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/7_crop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .github/assets/README.me
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Here are files related to logos and website layout for Epigenica.
19 changes: 15 additions & 4 deletions .github/workflows/publish_and_trivyscan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ jobs:
texlive-fonts-recommended
- name: Build troubleshooting guide
run: |
pandoc --output=dds_web/static/dds-troubleshooting.pdf docs/troubleshooting.md
pandoc --output=dds_web/static/dds-troubleshooting.pdf docs/troubleshooting_epigenica.md
- name: Upload troubleshooting PDF
uses: actions/upload-artifact@v7
with:
name: troubleshooting-pdf
path: dds_web/static/dds-troubleshooting.pdf
push_to_registry:
needs: [build_tech_overview, build_troubleshooting]
if: github.repository == 'ScilifelabDataCentre/dds_web'
if: github.repository == 'epigenica/dds_web'
name: Push image
runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -109,12 +109,23 @@ jobs:
with:
name: troubleshooting-pdf
path: dds_web/static
- name: Extract dds_web version
id: dds_version
run: |
VERSION=$(grep -Po '(?<=__version__ = ")[^"]+' dds_web/version.py)
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Docker metadata
id: meta
uses: docker/metadata-action@v6
with:
images: |
ghcr.io/scilifelabdatacentre/dds-backend
ghcr.io/epigenica/dds-backend
tags: |
type=raw,value=${{ steps.dds_version.outputs.version }},enable=${{ github.ref_name == 'dev' }}
type=ref,event=branch,enable=${{ github.ref_name != 'dev' }}
type=ref,event=tag
type=sha
- name: Ensure lowercase name
run: echo IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build for scan
Expand Down Expand Up @@ -147,6 +158,6 @@ jobs:
file: Dockerfiles/backend.Dockerfile
context: .
push: true
build-args: version=${{ github.ref_name }}
build-args: version=${{ steps.dds_version.outputs.version }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
12 changes: 12 additions & 0 deletions dds_web/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

# Installed
import flask
from jinja2 import ChoiceLoader, FileSystemLoader
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
from logging.config import dictConfig
Expand Down Expand Up @@ -253,6 +254,17 @@ def create_app(testing=False, database_uri=None):
# Initiate app object
app = flask.Flask(__name__, instance_relative_config=False)

# Brand override templates — checked before the default templates/ folder.
# Place only the files you want to override in templates_brand/; everything
# else is still served from the upstream templates/ directory.
_brand_templates = pathlib.Path(__file__).parent / "templates_brand"
app.jinja_loader = ChoiceLoader(
[
FileSystemLoader(str(_brand_templates)),
app.jinja_loader,
]
)

# All variables in the env that start with FLASK_* will be loaded into the app config
# 'FLASK_' will be dropped, e.g. FLASK_TESTVAR will be loaded as TESTVAR
app.config.from_prefixed_env()
Expand Down
2 changes: 1 addition & 1 deletion dds_web/api/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ def delete_project_contents(project_id, delete_bucket=False):
) as sqlerr:
error_msg = (
"Project bucket contents were deleted, but they were not deleted from the "
"database. Please contact SciLifeLab Data Centre."
"database. Please contact Epigenica support."
+ (
"Database malfunction."
if isinstance(sqlerr, sqlalchemy.exc.OperationalError)
Expand Down
30 changes: 17 additions & 13 deletions dds_web/api/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,9 @@ def compose_and_send_email_to_user(userobj, mail_type, link=None, project=None):

# Fill in email subject with sentence subject
if mail_type == "invite":
subject = f"{displayed_sender} invites you to the SciLifeLab Data Delivery System"
subject = f"{displayed_sender} invites you to the Epigenica Data Delivery System"
elif mail_type == "project_release":
subject = f"Project made available by {displayed_sender} in the SciLifeLab Data Delivery System"
subject = f"Project made available by {displayed_sender} in the Epigenica Data Delivery System"
project_id = project.public_id
project_title = project.title
deadline = project.current_deadline.astimezone(datetime.timezone.utc).strftime(
Expand All @@ -462,10 +462,11 @@ def compose_and_send_email_to_user(userobj, mail_type, link=None, project=None):

# Need to attach the image to be able to use it
msg.attach(
"scilifelab_logo.png",
"epigenica_logo_light_bg.png",
"image/png",
open(
os.path.join(flask.current_app.static_folder, "img/scilifelab_logo.png"), "rb"
os.path.join(flask.current_app.static_folder, "img/epigenica_logo_light_bg.png"),
"rb",
).read(),
"inline",
headers=[
Expand Down Expand Up @@ -583,7 +584,7 @@ def delete(self):

# Create link for deletion request email
link = flask.url_for("auth_blueprint.confirm_self_deletion", token=token, _external=True)
subject = f"Confirm deletion of your user account {username} in the SciLifeLab Data Delivery System"
subject = f"Confirm deletion of your user account {username} in the Epigenica Data Delivery System"

msg = flask_mail.Message(
subject,
Expand All @@ -592,10 +593,11 @@ def delete(self):

# Need to attach the image to be able to use it
msg.attach(
"scilifelab_logo.png",
"epigenica_logo_light_bg.png",
"image/png",
open(
os.path.join(flask.current_app.static_folder, "img/scilifelab_logo.png"), "rb"
os.path.join(flask.current_app.static_folder, "img/epigenica_logo_light_bg.png"),
"rb",
).read(),
"inline",
headers=[
Expand Down Expand Up @@ -1139,7 +1141,7 @@ def post(self):
recipients = [user.primary_email]

# Fill in email subject with sentence subject
subject = f"Request to activate two-factor with authenticator app for SciLifeLab Data Delivery System"
subject = f"Request to activate two-factor with authenticator app for Epigenica Data Delivery System"

msg = flask_mail.Message(
subject,
Expand All @@ -1148,10 +1150,11 @@ def post(self):

# Need to attach the image to be able to use it
msg.attach(
"scilifelab_logo.png",
"epigenica_logo_light_bg.png",
"image/png",
open(
os.path.join(flask.current_app.static_folder, "img/scilifelab_logo.png"), "rb"
os.path.join(flask.current_app.static_folder, "img/epigenica_logo_light_bg.png"),
"rb",
).read(),
"inline",
headers=[
Expand Down Expand Up @@ -1204,7 +1207,7 @@ def post(self):
recipients = [user.primary_email]

# Fill in email subject with sentence subject
subject = f"Request to activate two-factor authentication with email for SciLifeLab Data Delivery System"
subject = f"Request to activate two-factor authentication with email for Epigenica Data Delivery System"

msg = flask_mail.Message(
subject,
Expand All @@ -1213,10 +1216,11 @@ def post(self):

# Need to attach the image to be able to use it
msg.attach(
"scilifelab_logo.png",
"epigenica_logo_light_bg.png",
"image/png",
open(
os.path.join(flask.current_app.static_folder, "img/scilifelab_logo.png"), "rb"
os.path.join(flask.current_app.static_folder, "img/epigenica_logo_light_bg.png"),
"rb",
).read(),
"inline",
headers=[
Expand Down
2 changes: 1 addition & 1 deletion dds_web/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class RegistrationForm(flask_wtf.FlaskForm):
)

policy_checkbox = wtforms.BooleanField(
"I have read and agree to the Privacy Policy and User Agreement documents linked above.",
"I have read and agree to the Privacy Policy linked above.",
validators=[
wtforms.validators.DataRequired(message="Please agree to the conditions."),
],
Expand Down
Binary file added dds_web/static/img/epigenica_logo_dark_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions dds_web/static/img/epigenica_logo_dark_bg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dds_web/static/img/epigenica_logo_light_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions dds_web/static/img/epigenica_logo_light_bg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions dds_web/static/scss/_brand_overrides.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// =============================================================================
// Brand overrides
// =============================================================================
// This file is intentionally NOT present in the upstream SciLifeLab/dds_web
// repository. It is the single place to customise colours, typography, and
// other Bootstrap/DDS variables for this deployment.
//
// HOW IT WORKS
// _variables.scss (upstream) – sets SciLifeLab defaults
// _brand_overrides.scss (this) – shadows any variable you uncomment below
// bootstrap/scss/bootstrap – Bootstrap !default declarations lose to both
//
// USAGE
// Uncomment a line, set your value, done. Upstream merges will never touch
// this file, so conflicts are impossible.
//
// COLOUR REFERENCE (upstream SciLifeLab palette)
// Teal #045C64 $primary
// Grape #491F53 $secondary
// Lime #A7C947 $success
// Aqua #4C979F $info
// =============================================================================

// -- Light-mode colours -------------------------------------------------------
// $primary: #045c64;
// $secondary: #491f53;
// $success: #a7c947;
// $info: #4c979f;

// -- Dark-mode colour variants ------------------------------------------------
// $primary-alt: #75b3b9;
// $secondary-alt: #491f53;
// $success-alt: #a7c947;
// $info-alt: #4c979f;
// $light-alt: #343a40;

// -- Typography ---------------------------------------------------------------
// Replace the first entry to swap the primary web font.
// Keep the rest of the stack intact so fallbacks still work.
//
// $font-family-sans-serif:
// "Your Font Here",
// system-ui,
// -apple-system,
// BlinkMacSystemFont,
// "Segoe UI",
// Roboto,
// "Helvetica Neue",
// Arial,
// "Noto Sans",
// "Liberation Sans",
// sans-serif,
// "Apple Color Emoji",
// "Segoe UI Emoji",
// "Segoe UI Symbol",
// "Noto Color Emoji" !default;

// -- Bootstrap component tweaks -----------------------------------------------
// $border-radius: 0.2rem;
// $navbar-nav-link-padding-x: 1rem;
// $form-floating-label-opacity: 0.4;
3 changes: 3 additions & 0 deletions dds_web/static/scss/dds_dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
// Import our variables - stuff like colours etc
@import "variables";

// Brand-specific overrides (not present in upstream — safe to sync)
@import "brand_overrides";

//
// Bootstrap-5-dark
// Based on bootstrap-night.scss with fixed import paths
Expand Down
3 changes: 3 additions & 0 deletions dds_web/static/scss/dds_light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
// Import our variables - stuff like colours etc
@import "variables";

// Brand-specific overrides (not present in upstream — safe to sync)
@import "brand_overrides";

// Import all of Bootstrap's SCSS
@import "bootstrap/scss/bootstrap";

Expand Down
18 changes: 18 additions & 0 deletions dds_web/templates_brand/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends 'base.html' %}

{% block page_title -%}
404: Page not found
{%- endblock %}

{% block body %}

<span class="h1"><i class="fad fa-map-marker-question fa-5x float-end text-primary d-none d-md-inline" style="opacity: 0.2;"></i></span>

<p class="lead">Sorry, that page cannot be found: <code class="ms-2">{{ request.base_url }}</code></p>

<p>
You can get back to the homepage <a href="{{ url_for('pages.home') }}">here</a>.
If in doubt, please get in touch with support at <a href="mailto:data.team@epigenica.se">data.team@epigenica.se</a>.
</p>

{% endblock %}
Loading
Loading