chore: docker setup (#1136)
* chore: update docker environment variables and compose file for better readability * dev: update single dockerfile * dev: update WEB_URL configuration * dev: move database settings to environment variable * chore: remove port configuration from default compose file * dev: update example env to add EMAIL_FROM and default values for AWS
This commit is contained in:
parent
16604dd31b
commit
b6321438ce
15 changed files with 204 additions and 195 deletions
|
|
@ -35,8 +35,8 @@ class FileAssetEndpoint(BaseAPIView):
|
|||
|
||||
serializer.save(workspace_id=request.user.last_workspace_id)
|
||||
response_data = serializer.data
|
||||
if settings.DOCKERIZED and "minio:9000" in response_data["asset"]:
|
||||
response_data["asset"] = response_data["asset"].replace("minio:9000", settings.WEB_URL)
|
||||
if settings.DOCKERIZED and settings.AWS_S3_ENDPOINT_URL in response_data["asset"]:
|
||||
response_data["asset"] = response_data["asset"].replace(settings.AWS_S3_ENDPOINT_URL, settings.WEB_URL)
|
||||
return Response(response_data, status=status.HTTP_201_CREATED)
|
||||
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
|
||||
except Exception as e:
|
||||
|
|
@ -86,8 +86,8 @@ class UserAssetsEndpoint(BaseAPIView):
|
|||
if serializer.is_valid():
|
||||
serializer.save()
|
||||
response_data = serializer.data
|
||||
if settings.DOCKERIZED and "minio:9000" in response_data["asset"]:
|
||||
response_data["asset"] = response_data["asset"].replace("minio:9000", settings.WEB_URL)
|
||||
if settings.DOCKERIZED and settings.AWS_S3_ENDPOINT_URL in response_data["asset"]:
|
||||
response_data["asset"] = response_data["asset"].replace(settings.AWS_S3_ENDPOINT_URL, settings.WEB_URL)
|
||||
return Response(response_data, status=status.HTTP_201_CREATED)
|
||||
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
|
||||
except Exception as e:
|
||||
|
|
|
|||
|
|
@ -789,8 +789,8 @@ class IssueAttachmentEndpoint(BaseAPIView):
|
|||
if serializer.is_valid():
|
||||
serializer.save(project_id=project_id, issue_id=issue_id)
|
||||
response_data = serializer.data
|
||||
if settings.DOCKERIZED and "minio:9000" in response_data["asset"]:
|
||||
response_data["asset"] = response_data["asset"].replace("minio:9000", settings.WEB_URL)
|
||||
if settings.DOCKERIZED and settings.AWS_S3_ENDPOINT_URL in response_data["asset"]:
|
||||
response_data["asset"] = response_data["asset"].replace(settings.AWS_S3_ENDPOINT_URL, settings.WEB_URL)
|
||||
issue_activity.delay(
|
||||
type="attachment.activity.created",
|
||||
requested_data=None,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ def email_verification(first_name, email, token, current_site):
|
|||
|
||||
try:
|
||||
realtivelink = "/request-email-verification/" + "?token=" + str(token)
|
||||
abs_url = "http://" + current_site + realtivelink
|
||||
abs_url = current_site + realtivelink
|
||||
|
||||
from_email_string = settings.EMAIL_FROM
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ def forgot_password(first_name, email, uidb64, token, current_site):
|
|||
|
||||
try:
|
||||
realtivelink = f"/email-verify/?uidb64={uidb64}&token={token}/"
|
||||
abs_url = "http://" + current_site + realtivelink
|
||||
abs_url = current_site + realtivelink
|
||||
|
||||
from_email_string = settings.EMAIL_FROM
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ from sentry_sdk import capture_exception
|
|||
def magic_link(email, key, token, current_site):
|
||||
try:
|
||||
realtivelink = f"/magic-sign-in/?password={token}&key={key}"
|
||||
abs_url = "http://" + current_site + realtivelink
|
||||
abs_url = current_site + realtivelink
|
||||
|
||||
from_email_string = settings.EMAIL_FROM
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ def project_invitation(email, project_id, token, current_site):
|
|||
)
|
||||
|
||||
relativelink = f"/project-member-invitation/{project_member_invite.id}"
|
||||
abs_url = "http://" + current_site + relativelink
|
||||
abs_url = current_site + relativelink
|
||||
|
||||
from_email_string = settings.EMAIL_FROM
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ def workspace_invitation(email, workspace_id, token, current_site, invitor):
|
|||
realtivelink = (
|
||||
f"/workspace-member-invitation/{workspace_member_invite.id}?email={email}"
|
||||
)
|
||||
abs_url = "http://" + current_site + realtivelink
|
||||
abs_url = current_site + realtivelink
|
||||
|
||||
from_email_string = settings.EMAIL_FROM
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ MEDIA_ROOT = os.path.join(BASE_DIR, "uploads")
|
|||
if DOCKERIZED:
|
||||
REDIS_URL = os.environ.get("REDIS_URL")
|
||||
|
||||
WEB_URL = os.environ.get("WEB_URL", "localhost:3000")
|
||||
WEB_URL = os.environ.get("WEB_URL", "http://localhost:3000")
|
||||
PROXY_BASE_URL = os.environ.get("PROXY_BASE_URL", False)
|
||||
|
||||
ANALYTICS_SECRET_KEY = os.environ.get("ANALYTICS_SECRET_KEY", False)
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ if DOCKERIZED:
|
|||
# The name of the bucket to store files in.
|
||||
AWS_STORAGE_BUCKET_NAME = os.environ.get("AWS_S3_BUCKET_NAME", "uploads")
|
||||
# The full URL to the S3 endpoint. Leave blank to use the default region URL.
|
||||
AWS_S3_ENDPOINT_URL = os.environ.get("AWS_S3_ENDPOINT_URL", "http://minio:9000")
|
||||
AWS_S3_ENDPOINT_URL = os.environ.get("AWS_S3_ENDPOINT_URL", "http://plane-minio:9000")
|
||||
# Default permissions
|
||||
AWS_DEFAULT_ACL = "public-read"
|
||||
AWS_QUERYSTRING_AUTH = False
|
||||
|
|
@ -223,7 +223,7 @@ else:
|
|||
}
|
||||
|
||||
|
||||
WEB_URL = os.environ.get("WEB_URL")
|
||||
WEB_URL = os.environ.get("WEB_URL", "https://app.plane.so")
|
||||
|
||||
PROXY_BASE_URL = os.environ.get("PROXY_BASE_URL", False)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue