Skip to content
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

feat: [AXM-334] Allow easily adding Firebase credentials in Tutor #2572

Conversation

KyryloKireiev
Copy link

@KyryloKireiev KyryloKireiev commented Jun 10, 2024

Description

Allow easily adding Firebase credentials in tutor

So, to setup FIREBASE_CREDENTIALS we have to do two things:

  1. Mount firebase_credentials.json to lms and cms containers;
  2. Setup path to firebase_credentials.json in Tutor Plugin.

Detail instruction, how we can setup FIREBASE_CREDENTIALS:

  1. Create file with FIREBASE_CREDENTIALS. For example firebase_credentials.json
  2. Mount created file to LMS and CMS container:
    tutor mounts add lms:<path_to_file>/firebase_credentials.json:/openedx/<path_to_file_in_lms_container>/firebase_credentials.json
    tutor mounts add cms:<path_to_file>/firebase_credentials.json:/openedx/<path_to_file_in_lms_container>/firebase_credentials.json
    tutor config save - docker-compose.yml file will be regenerated. And firebase_credentials.json file will be added to lms volume.
    tutor dev restart lms cms
  3. Now firebase_credentials.json is inside lms and cms containers. We can use path to this file for setup FIREBASE_CREDENTIALS_PATH constant.
    We can setup FIREBASE_CREDENTIALS_PATH in tutor plugin. There is tutor plugin example:
from tutor import hooks

hooks.Filters.ENV_PATCHES.add_item(
    (
        "lms-env",

"""
FCM_APP_NAME: "fcm-edx-platform"
ACE_ENABLED_CHANNELS: 
  - "django_email"
  - "push_notification"
FIREBASE_CREDENTIALS_PATH: "/openedx/<path_to_file_in_lms_container>/firebase_credentials.json"
"""
    )
)

hooks.Filters.ENV_PATCHES.add_item(
    (
        "cms-env",

"""
FCM_APP_NAME: "fcm-edx-platform"
ACE_ENABLED_CHANNELS: 
  - "django_email"
  - "push_notification"
FIREBASE_CREDENTIALS_PATH: "/openedx/edx-platform/firebase_credentials.json"
FIREBASE_CREDENTIALS: ""
"""
    )
)

YouTrack

https://youtrack.raccoongang.com/issue/AXM-334

@KyryloKireiev KyryloKireiev force-pushed the kireiev/AXM-334/feat/allow_easily_adding_Firebase_creds_in_Tutor branch from a2bc08a to 029206b Compare June 11, 2024 11:08
@NiedielnitsevIvan NiedielnitsevIvan force-pushed the kireiev/AXM-334/feat/allow_easily_adding_Firebase_creds_in_Tutor branch from 029206b to 0fda011 Compare June 13, 2024 15:14
@NiedielnitsevIvan NiedielnitsevIvan merged commit 8f0a187 into mob-develop Jun 14, 2024
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants