Skip to content

Commit

Permalink
Fix CI (#544)
Browse files Browse the repository at this point in the history
* Re-encrypt file

* Fix tests

* Fix pyup safety
  • Loading branch information
c-w authored May 12, 2021
1 parent 59d3d1f commit dd0ec07
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
Binary file modified .github.env.gpg
Binary file not shown.
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ default: build
@gpg --decrypt --batch --passphrase "$(GPG_PASSPHRASE)" .github.env.gpg >.github.env

github-env: .github.env
@echo "SUFFIX=$(shell cat /proc/sys/kernel/random/uuid)" >"$(GITHUB_ENV)"
@sed 's/^export //' <.github.env >"$(GITHUB_ENV)"
@docker run --rm python:3.7 python -c 'import uuid; print("SUFFIX=%s" % uuid.uuid4())' >>"$(GITHUB_ENV)"
@sed 's/^export //' <.github.env >>"$(GITHUB_ENV)"

integration-tests:
docker-compose -f docker-compose.yml -f docker/docker-compose.test.yml build integtest && \
Expand Down
2 changes: 1 addition & 1 deletion opwen_email_client/webapp/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class AppConfig(object):
SQLALCHEMY_MIGRATE_REPO = path.join(STATE_BASEDIR, 'app.migrate')
SQLALCHEMY_TRACK_MODIFICATIONS = False

SECRET_KEY = env('OPWEN_SESSION_KEY', None)
SECRET_KEY = env('OPWEN_SESSION_KEY', 'NoSecret')

CELERY_SQLITE_PATH = path.join(STATE_BASEDIR, 'celery.sqlite3')
CELERY_BROKER_URL = env('CELERY_BROKER_URL', 'sqlalchemy+sqlite:///' + CELERY_SQLITE_PATH)
Expand Down
23 changes: 12 additions & 11 deletions opwen_email_server/services/sendgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,18 @@ def _create_email(self, email: dict, email_id: str) -> Mail:
# so that the email still gets routed back to the original client
# ...this is a pretty ugly hack and the real fix is to change the logic of
# how we sign up users on clients to use the new format {user}-{client}@{domain}
from_email = email['from']
user, client_domain = from_email.split('@')
client_domain_parts = client_domain.split('.')
if len(client_domain_parts) == 3:
client = client_domain_parts[0]
domain = '.'.join(client_domain_parts[1:])
mail.from_email = Email('{}-{}@{}'.format(user, client, domain))
mail.reply_to = Email(from_email)
else:
mail.from_email = Email(from_email)
self.log_debug('added from to email %s', email_id)
from_email = email.get('from')
if from_email:
user, client_domain = from_email.split('@')
client_domain_parts = client_domain.split('.')
if len(client_domain_parts) == 3:
client = client_domain_parts[0]
domain = '.'.join(client_domain_parts[1:])
mail.from_email = Email('{}-{}@{}'.format(user, client, domain))
mail.reply_to = Email(from_email)
else:
mail.from_email = Email(from_email)
self.log_debug('added from to email %s', email_id)

for i, attachment in enumerate(email.get('attachments', [])):
mail.add_attachment(self._create_attachment(attachment))
Expand Down
2 changes: 1 addition & 1 deletion requirements-webapp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ typing==3.7.4.3
tzlocal==2.1
watchdog==0.10.4
xtarfile[zstd]==0.0.4
Pillow==8.1.1
Pillow==8.1.2
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Flask==1.1.2
Flask-Cors==3.0.9
Pillow==8.1.1
Pillow==8.1.2
apache-libcloud==3.2.0
applicationinsights==0.11.9
beautifulsoup4==4.9.3
Expand Down

0 comments on commit dd0ec07

Please sign in to comment.