-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Enable to set callback_url via environment variables #5533
Conversation
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.
LGTM
@mats16 , thanks for your contribution! |
@nmanovic @Marishka17 Can I add the environmental variable such as |
@mats16 , there is one more opportunity. You can import our settings file into your my_settings.py and redefine what even you want. Will it work for you? |
I feel it is not good option... Because CVAT project provide container images officially, it is better to configure via environment variables. I want use official container images. If you need more time to discuss about |
@mats16, Why is the approach of using |
@Marishka17
How about the following code? CVAT_HOST = os.getenv('CVAT_HOST', 'localhost')
CVAT_BASE_URL = os.getenv('CVAT_BASE_URL', f'http://{CVAT_HOST}:8080').rstrip('/')
SOCIAL_APP_LOGIN_REDIRECT_URL = f'{CVAT_BASE_URL}/auth/login-with-social-app'
GITHUB_CALLBACK_URL = f'{CVAT_BASE_URL}/api/auth/github/login/callback/'
GOOGLE_CALLBACK_URL = f'{CVAT_BASE_URL}/api/auth/google/login/callback/' |
@mats16, Hi, sorry for the long response. Okay, it looks good to me. |
@mats16 , could you please remove trailing spaces? Pylint isn't happy. |
Sorry, I fixed it. |
@mats16 , thanks for the contribution! |
The callback url is hardcoded, so I cannot run CVAT on Cloud platform. This patch enable to replace these parameters via environment variables. cvat-ai#5526
Motivation and context
The callback url is hardcoded, so I cannot run CVAT on Cloud platform.
This patch enable to replace these parameters via environment variables.
#5526
How has this been tested?
Run on AWS Fargate with Google auth.
Checklist
develop
branchcvat-core, cvat-data and cvat-ui)
License
Feel free to contact the maintainers if that's a concern.