Fork me on GitHub
#hoplon
<
2017-08-14
>
chromalchemy02:08:04

@flyboarder I am still stuck on setting the environment variables for Firebase. You told me to use adzerk-oss/env, but more specifically, how? what are best practices? I have tried in a .clj file:

(env/def
  FIREBASE_API_KEY "aaa"
  FIREBASE_AUTH_DOMAIN "bbb"
  FIREBASE_DATABASE_URL "ccc"
  FIREBASE_STORAGE_BUCKET "ddd")
and..
(alter-var-root #'FIREBASE_API_KEY (constantly "aaa"))
(alter-var-root #'FIREBASE_AUTH_DOMAIN (constantly "bbb"))
(alter-var-root #'FIREBASE_DATABASE_URL (constantly "ccc"))
(alter-var-root #'FIREBASE_STORAGE_BUCKET (constantly "ddd"))
But I keep getting error: Required env vars: [FIREBASE_API_KEY FIREBASE_AUTH_DOMAIN FIREBASE_DATABASE_URL FIREBASE_STORAGE_BUCKET] In a previous version of hoplon.firebase I just used (fb/init) in a .cljs file like:
(fb/init
  { :apiKey "aaa"
    :authDomain "bbb"
    :databaseURL "ccc"
    :storageBucket "ddd"})
Should I even be trying to set these from my source code? or in my general Windows/Java config? Where? Thanks!

flyboarder02:08:39

FIREBASE_API_KEY=XXXXXXXXXX FIREBASE_AUTH_DOMAIN= FIREBASE_DATABASE_URL= FIREBASE_STORAGE_BUCKET= boot develop

flyboarder02:08:11

the idea behind adzerk/env is that there are no config files

chromalchemy02:08:56

Oh. Are those vars set persistantly? or do you have to re-enter them on every terminal session?

flyboarder02:08:35

you could set them to your env i guess, I personally rely on terminal history and good old copy paste 😉

flyboarder02:08:57

but then in testing or on CI you set them as env vars

flyboarder02:08:14

like on travis or something

flyboarder02:08:28

so you only have to update the env vars if the config changes

chromalchemy03:08:17

Ok, It's working now:joy:. I fumbled with entering the vars individually, and before boot develop. But I see now that it must all be entered together

chromalchemy03:08:16

With firebase.hoplon https://github.com/hoplon/brew/blob/master/src/hoplon/firebase.cljs I am only using (fb-cell) What is the general use-case of the other cell functions? I do not understand the prase "Returns a formula cell unbound to the Firebase Reference..."

alandipert14:08:53

it's also worth knowing that you can set adzerk/env vars from the REPL with e.g. (System/setProperty "SOME_VAR" "foobar123")

alandipert14:08:49

it works because when you declare env vars with env/def it looks for system properties (jvm global name->string mapping) in addition to environment variables (per-process unix kind)

alandipert14:08:16

the System/setProperty way is also how you can set them in your build.boot if you want

flyboarder18:08:31

@chromalchemy unbound means it will not receive updates if the db changes directly, bound means that it's 2-way binding from cell to db

flyboarder18:08:35

I.e. Unbound only load once or when they make changes to the DB, you'll need to refresh to see other changes, this is good for loading things once, instead of continuously watching for changes