Skip to content
Open
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
2 changes: 2 additions & 0 deletions kerckhoff/kerckhoff/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,9 @@

S3_SITE_UPLOAD_BUCKET = env('S3_SITE_UPLOAD_BUCKET')
S3_ASSETS_UPLOAD_BUCKET = env('S3_ASSETS_UPLOAD_BUCKET')
S3_DOMAIN_OF_UPLOADED_IMAGES = env('S3_DOMAIN_OF_UPLOADED_IMAGES') or 'https://assets.dailybruin.com'
REPOSITORY_FOLDER_ID = env("REPOSITORY_FOLDER_ID")
LIVE_PUSH_SERVER = env('LIVE_PUSH_SERVER')

LOGIN_REDIRECT_URL = '/manage/'

3 changes: 2 additions & 1 deletion kerckhoff/packages/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from requests_oauthlib import OAuth2Session

from .google_drive_actions import get_file
from kerckhoff.settings import S3_DOMAIN_OF_UPLOADED_IMAGES

IMAGE_REGEX = re.compile(r"!\[[^\]]+\]\(([^)]+)\)")
S3_BUCKET = settings.S3_ASSETS_UPLOAD_BUCKET
Expand Down Expand Up @@ -80,7 +81,7 @@ def transfer_to_s3(session: OAuth2Session, package):
)

package.images["s3"][image["title"]] = {
"url": "https://assets.dailybruin.com/{0}".format(fn), # TODO: replace with something configurable
"url": "{0}/{1}".format(S3_DOMAIN_OF_UPLOADED_IMAGES, fn),
"key": fn,
"hash": image_hash,
"s3_fields": response
Expand Down