Skip to content

Commit

Permalink
Merge pull request #490 from AndersenLab/fix/public-bucket-override
Browse files Browse the repository at this point in the history
Add public bucket override
  • Loading branch information
r-vieira authored Jun 3, 2024
2 parents 504e0a6 + a1a5e72 commit 18cf7e7
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/modules/site-v2/base/utils/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import markdown
import requests

from caendr.utils.env import get_env_var_with_fallback

from caendr.services.logger import logger
from caendr.models.error import ExternalMarkdownRenderError
from flask import Markup, render_template_string


MODULE_SITE_BUCKET_PUBLIC_NAME = os.environ.get('MODULE_SITE_BUCKET_PUBLIC_NAME')
MODULE_SITE_BUCKET_PUBLIC_NAME = get_env_var_with_fallback('MODULE_SITE_BUCKET_PUBLIC_NAME_OVERRIDE', 'MODULE_SITE_BUCKET_PUBLIC_NAME')



Expand Down
2 changes: 1 addition & 1 deletion src/modules/site-v2/base/views/data/releases.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def data_v01(params, files):
vcf_summary = None

return {
'site_bucket_public_name': config.get('MODULE_SITE_BUCKET_DATASET_RELEASE_NAME', config.get('MODULE_SITE_BUCKET_PUBLIC_NAME', 'NONE')),
'site_bucket_public_name': config.get('MODULE_SITE_BUCKET_DATASET_RELEASE_NAME', config.get('MODULE_SITE_BUCKET_PUBLIC_NAME_OVERRIDE', config.get('MODULE_SITE_BUCKET_PUBLIC_NAME', 'NONE'))),
'browser_tracks_path': get_browser_tracks_path().get_string_safe(),
'vcf_summary_url': vcf_summary_url,
'vcf_summary': vcf_summary,
Expand Down
1 change: 1 addition & 0 deletions src/modules/site-v2/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
'MODULE_SITE_BUCKET_PHOTOS_NAME',
'MODULE_SITE_BUCKET_ASSETS_NAME',
'MODULE_SITE_BUCKET_PUBLIC_NAME',
'MODULE_SITE_BUCKET_PUBLIC_NAME_OVERRIDE',
'MODULE_SITE_BUCKET_PRIVATE_NAME',
'MODULE_SITE_BUCKET_DATASET_RELEASE_NAME',
'MODULE_SITE_SENTRY_NAME',
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/caendr/caendr/models/datastore/dataset_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

V1_V2_Cutoff_Date = 20200101

DATASET_RELEASE_BUCKET_NAME = get_env_var_with_fallback('MODULE_SITE_BUCKET_DATASET_RELEASE_NAME', 'MODULE_SITE_BUCKET_PUBLIC_NAME')
DATASET_RELEASE_BUCKET_NAME = get_env_var_with_fallback('MODULE_SITE_BUCKET_DATASET_RELEASE_NAME', 'MODULE_SITE_BUCKET_PUBLIC_NAME_OVERRIDE', 'MODULE_SITE_BUCKET_PUBLIC_NAME')

FASTA_FILENAME_TEMPLATE = get_env_var('FASTA_FILENAME_TEMPLATE', as_template=True)
FASTA_EXTENSION_FILE = get_env_var('FASTA_EXTENSION_FILE')
Expand Down
4 changes: 2 additions & 2 deletions src/pkg/caendr/caendr/models/datastore/indel_primer.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import os

from caendr.services.logger import logger
from caendr.utils.env import get_env_var
from caendr.utils.env import get_env_var, get_env_var_with_fallback

from caendr.models.datastore import ReportEntity, HashableEntity, Species
from caendr.services.dataset_release import get_dataset_release



# Get environment variables
MODULE_SITE_BUCKET_PUBLIC_NAME = get_env_var('MODULE_SITE_BUCKET_PUBLIC_NAME')
MODULE_SITE_BUCKET_PUBLIC_NAME = get_env_var_with_fallback('MODULE_SITE_BUCKET_PUBLIC_NAME_OVERRIDE', 'MODULE_SITE_BUCKET_PUBLIC_NAME')
SOURCE_FILENAME = get_env_var('INDEL_PRIMER_SOURCE_FILENAME', as_template=True)


Expand Down
4 changes: 3 additions & 1 deletion src/pkg/caendr/caendr/models/datastore/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

from caendr.services.logger import logger

from caendr.utils.env import get_env_var, get_env_var_with_fallback

from caendr.models.datastore import Entity
from caendr.services.cloud.storage import BlobURISchema, generate_blob_uri

MODULE_SITE_BUCKET_PUBLIC_NAME = os.environ.get('MODULE_SITE_BUCKET_PUBLIC_NAME')
MODULE_SITE_BUCKET_PUBLIC_NAME = get_env_var_with_fallback('MODULE_SITE_BUCKET_PUBLIC_NAME_OVERRIDE', 'MODULE_SITE_BUCKET_PUBLIC_NAME')
PROFILE_PHOTO_PATH_PREFIX = 'profile/photos'


Expand Down
4 changes: 3 additions & 1 deletion src/pkg/caendr/caendr/models/datastore/protocol.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import os

from caendr.utils.env import get_env_var_with_fallback

from caendr.models.datastore import Entity

MODULE_SITE_BUCKET_PUBLIC_NAME = os.environ.get('MODULE_SITE_BUCKET_PUBLIC_NAME')
MODULE_SITE_BUCKET_PUBLIC_NAME = get_env_var_with_fallback('MODULE_SITE_BUCKET_PUBLIC_NAME_OVERRIDE', 'MODULE_SITE_BUCKET_PUBLIC_NAME')
PROTOCOL_PDF_PATH_PREFIX = 'protocol/pdf'


Expand Down

0 comments on commit 18cf7e7

Please sign in to comment.