Skip to content

Cleanup env keys #1735

@tyler-dane

Description

@tyler-dane

Follow-up improvements to the self-hosting workflow from #1736

Create apparmor profile

  • TBD. Not sure what this even is at this point

Backup & Restore

Document detailed backup and restore process. Keep things standard, but this is for peace-of-mind

Cleanup ENV values and naming:

  • CORS in the .env is renamed to ORIGINS_ALLOWED inside the backend — the schema splits it on commas, so the env key and the code name differ.
  • CHANNEL_EXPIRATION_MIN=10 -> GOOGLE_CALENDAR_SYNC_EXPIRATION_MIN
  • TOKEN_GCAL_NOTIFICATION -> GOOGLE_CALENDAR_SYNC_TOKEN. Or remove — doesn't seem like this is used anywhere?
  • TOKEN_COMPASS_SYNC -> COMPASS_SYNC_TOKEN or SYNC_TOKEN
  • BASEURL -> API_URL or API_BASEURL
  • PORT -> API_PORT
  • TZ. Remove if possible The backend will only work with it as UTC / Etc/UTC, so why even expose it?
  • urls.backendApi -> urls.api
  • urls.googleWebhook -> google.TBD
  • tokens.googleCalendarNotification -> google.TBD <-might be duplicate of the above
  • NOTE: EMAILER_* key removal is part of Replace EMAILER envs and code with background job #1730
  • Organize yaml keys under top-level groups that correspond to their containers: web, mongo, supertokens, api

Add derivative constant values from user-provided keys

Purpose: parse all the config values you need once, so you don't have to do so much parsing in the business logic.

Example of the smell:

  if (CONFIG.NODE_ENV === NodeEnv.Test) {
    logger.info(`Password reset link for ${input.user.email}: ${resetLink}`);
    return;
  }

This could instead be CONFIG.IS_TEST or isTest(CONFIG.NODE_ENV)

Cleanup docker img name

  • from backend to api

Be sure to update GitHub repo variables/secrets to keep CI/CD working: https://github.com/SwitchbackTech/compass/settings/secrets/actions

Metadata

Metadata

Assignees

Labels

devopsCI/CD, e2e tests, infra

Projects

Status

In progress

Relationships

None yet

Development

No branches or pull requests

Issue actions