Fork me on GitHub
#boot
<
2015-12-13
>
tcrawley00:12:44

deraen: clojars should ignore creds if you are resolving deps, since you are only talking to nginx to get static files for that

juhoteperi12:12:53

Got the 2.5.0-RC working with Lein creds file:

(configure-repositories!
  (fn [m]
    (merge m (some (fn [[regex cred]]
                     (if (re-find regex (:url m))
                       cred))
                   (gpg-decrypt ( (System/getProperty "user.home") ".lein/credentials.clj.gpg") :as :edn)))))

juhoteperi12:12:36

I was a bit suspicious about calling repo-config-fn when repos are set instead of when credentials are used, but it seems to work fine

juhoteperi12:12:09

And Clojars does indeed work fine even if creds are provided for downloading deps

juhoteperi12:12:51

Hmh, running it always has some small runtime penalty. Because config fn and gpg-decrypt is always ran when calling set-env :repositories it always adds about 100ms to runtime, even when only running boot help

thomas12:12:06

Hello people

thomas12:12:42

I just downloaded the latest version of boot.sh (the one linked from https://github.com/boot-clj/boot)

thomas12:12:52

and then I do boot -h I am getting this error:

thomas12:12:47

any idea what I could be doing wrong?

juhoteperi13:12:10

@thomas: Probably you have old boot.properties file at /.boot or /.boot/cache

juhoteperi13:12:04

Delete it and boot should create new one when you next run it

thomas13:12:49

thanks @juhoteperi that did the trick

micha16:12:11

@juhoteperi: yeah the 100ms isn't great, but it does simplify the whole thing considerably

micha16:12:33

also you can use tasks to get finer grained control

micha16:12:42

like profiles with different creds

micha16:12:50

like maybe you have a push profile

micha16:12:18

if you call configure-repositories! in a task it will update repo configs

micha16:12:33

there's a watch on the atom that holds the fn

micha16:12:49

so you could have one fn for push and one for pull

micha16:12:00

what do you think?

micha16:12:42

so if i have that repo in my :repositories it'll look in the env vars and throw if not found

micha16:12:13

a nice thing about this whole thing is that it dispatches on url instead of name, so you won't acidentally send creds to non-https endpoints

juhoteperi17:12:39

I think it's quite confusing that get-env now does two different things

micha17:12:53

you don't think it's useful?

juhoteperi17:12:44

it can be useful but I think there should be separate functions for accesing Boot env and system env

micha17:12:45

i had a really hard time thinking of a name simple_smile

micha17:12:05

get-env was a terrible choice

micha17:12:28

in for the boot fn name

juhoteperi17:12:53

Also, instead of list destructuring I think it would be preferred to define multiple arities, it prevents some bad uses

micha17:12:14

how do you mean?

micha17:12:35

oh like more than the accepted number of arguments

juhoteperi17:12:40

(defn get-env ([] ...) ([k] (get-env k nil)) ([k not-found] ...))

juhoteperi17:12:14

And the arglists will be more accurate

juhoteperi18:12:16

How about get-system-env? It's quite long but I think it would be better than get-env doing two things

juhoteperi18:12:37

Will probably be impossible or really hard to change this later if get-env is changed now

micha18:12:04

sys-env perhaps?

micha18:12:36

or maybe jvm-env?

juhoteperi18:12:05

Both are okay, I would maybe keep the get- prefix so it would match get-env

juhoteperi18:12:57

But if opinion is that get-env is bad name, maybe there is no need to match that name