Logo-amall

I need to be able to use a Firebase Admin service account key JSON object as an environment variable but it doesn't seem nhost is letting me paste in the full value. how can i increase the limit so that i can get this working? it looks like the current limit is only 100 chars

Last active 3 months ago

20 replies

10 views

  • SH

    I need to be able to use a Firebase Admin service account key JSON object as an environment variable but it doesn't seem nhost is letting me paste in the full value. how can i increase the limit so that i can get this working? it looks like the current limit is only 100 chars

  • SH

    these service account json credentials files are a few thousand characters

  • SH

    @L3K0V curious how you are managing to authenticate to firebase-admin using nhost since you mentioned you are also using firebase cloud messaging? i was able to run this locally because .env.development doesn't limit the environment variable length, but it looks ilke i'm not going to be able to get it working on my cloud project

  • SH

    update: i was able to override the maxlength in the html and set my environment variables. they seem to work after deploy so it seems like there isn't actually a backend/internal character limit. can the frontend character limit be increased in the dashboard? 100 is really low

  • EL

    @sheena I can't find where we have this 100 chars limit. Where did you experience this exactly?

  • SH

    The input field has a 100 character limit

  • EL

    I was able to add 1k+ chars

  • SH
  • SH

    i can only enter 100

  • EL

    πŸ‘€

  • EL

    https://github.com/nhost/nhost/blob/a71eea09a9755516b0d1577abe0ae740fc42c52d/dashboard/src/components/settings/environmentVariables/BaseEnvironmentVariableForm/BaseEnvironmentVariableForm.tsx#L133

  • EL

    ok found it

  • EL

    ah okey I was never able to

  • EL

    it capped at 100 when I pasted it

  • EL

    What are good limits on variable name and values?

  • SH

    i'm not sure as a general rule but i would guess pretty high in order to make nhost flexible for a lot of uses? e.g. to authenticate with the firebase admin library i have to use a service acount key json string which is like 2500 chars -- guessing other users will also want to use for push notifications

  • SH

    looks like vercel does it by enforcing a total value of all the env vars of 64KB instead of an individual char max https://vercel.com/docs/concepts/projects/environment-variables#environment-variable-size

  • SH

    have not yet run into a max on firebase/google secret manager

  • SH

    (the other option for firebase is a path to the json file, but i don't think there is a way to have a secret file?)

  • EL

    https://github.com/nhost/nhost/issues/1257

Last active 3 months ago

20 replies

10 views