-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed 'Open task' button doesn't work #1474
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -189,17 +189,19 @@ def generate_ssh_keys(): | |
|
||
# Cross-Origin Resource Sharing settings for CVAT UI | ||
UI_SCHEME = os.environ.get('UI_SCHEME', 'http') | ||
UI_HOST = os.environ.get('UI_HOST', 'localhost') | ||
UI_PORT = os.environ.get('UI_PORT', '3000') | ||
CORS_ALLOW_CREDENTIALS = True | ||
CSRF_TRUSTED_ORIGINS = [UI_HOST] | ||
UI_URL = '{}://{}'.format(UI_SCHEME, UI_HOST) | ||
|
||
if UI_PORT and UI_PORT != '80': | ||
UI_URL += ':{}'.format(UI_PORT) | ||
|
||
CORS_ORIGIN_WHITELIST = [UI_URL] | ||
CORS_REPLACE_HTTPS_REFERER = True | ||
UI_HOST = os.environ.get('UI_HOST') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to remove values by default? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Otherwise we will have to specify twice the same value for CVAT_HOST and UI_HOST that used for redirects by django backend, It's not good from my point of view. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @azhavoro , let's try to move the code to development.py configuration file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nmanovic Great idea! Done. |
||
UI_PORT = os.environ.get('UI_PORT') | ||
UI_URL = '' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where is the URL used? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cvat/apps/authentication/decorators.py |
||
if UI_HOST: | ||
CORS_ALLOW_CREDENTIALS = True | ||
CSRF_TRUSTED_ORIGINS = [UI_HOST] | ||
UI_URL = '{}://{}'.format(UI_SCHEME, UI_HOST) | ||
|
||
if UI_PORT and UI_PORT != '80': | ||
UI_URL += ':{}'.format(UI_PORT) | ||
|
||
CORS_ORIGIN_WHITELIST = [UI_URL] | ||
CORS_REPLACE_HTTPS_REFERER = True | ||
|
||
STATICFILES_FINDERS = [ | ||
'django.contrib.staticfiles.finders.FileSystemFinder', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need these values? I can see that we have the by default in base.py.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. See some changes below. Please ignore the comment.