Fork me on GitHub
#luminus
<
2016-05-06
>
thug.nasty01:05:32

i’ve got to be doing something wrong here: when I try to print out the form params of a POST request, it yields ‘nil’.

surreal.analysis16:05:37

I deployed a luminus app to Heroku today, and when loading you see a flash of the lein-figwheel prompt. Any idea how to avoid that?

juliobarros17:05:44

If I have a lot of configuration variables that I don’t want to have to set/export in production, whats the best place to put them so they get ‘included’ in my uberjar? Profiles.clj doesn’t seem to work out of the box for :profiles/prod with uberjar.

richiardiandrea17:05:45

@juliobarros: are these things like db, redis,... username/endpoints?

juliobarros17:05:19

@richiardiandrea: yeah, and a ton of access keys to external apis.

richiardiandrea17:05:30

usually in prod these are environment variables that you launch script sets, so you should not persist them anywhere

juliobarros17:05:44

yeah, I don’t want to set all those env vars.

richiardiandrea17:05:06

I think that's how Luminus assumes you should do it, a simple bash script:

export DB_USER= ...
...
...
java -cp my-app-standalone.jar my-app.core

juliobarros17:05:41

Thats not how I want to start up the jar file. I’d like all the config info already baked in.

juliobarros17:05:05

and to manage the keys in an edn data structure.

richiardiandrea17:05:30

so basically you want to have a read at how cprop handles the merging of configs

juliobarros17:05:41

{:service1 {:key “” :token “”}}

richiardiandrea17:05:44

there is the possibility to read from a system property

juliobarros17:05:56

I can put them in env/prod/resources/config.edn … but I had already been using profiles for dev and test so was not sure what the best and minimal change would be.

richiardiandrea17:05:12

no but that file is then persisted to git

richiardiandrea17:05:27

you don't want that right?

juliobarros17:05:30

right. I can unpersist it though simple_smile

richiardiandrea17:05:07

yes that's true 😉

richiardiandrea17:05:41

with this conf system property basically you launch your jar with java -Dconf=...path.... ....

richiardiandrea18:05:14

and store this file on the server, potentially persisted to another "encrypted" repo with all the config files

juliobarros18:05:18

Really want a self contained jar without having to set env vars … so that I can say “ALL you have to do is run the jar.” no env vars, no files outside of the jar.

richiardiandrea18:05:51

maybe there is a way with lein, but in boot you could basically do it at build time

richiardiandrea18:05:16

I include a version file every time and this file might or not be persisted to git

juliobarros18:05:43

ok. Thanks. Wanted to check there was not an easy approach I was missing.

richiardiandrea18:05:04

probably an "unpersisted" file in resources would do

juliobarros18:05:54

and then change my config.clj to have cprops read that file?

richiardiandrea18:05:36

cprop can read from anywhere, just add the right key: https://github.com/tolitius/cprop#loading-from-the-source

thug.nasty18:05:05

when I send a request with form parameters, the request is nil

thug.nasty18:05:21

like, when I do (println (str “request ->” request)), it’s empty

thug.nasty18:05:30

it just shows “request ->"

thug.nasty18:05:04

is there a log level I can increase to output verbose messages to see what the request looks like coming in?

thug.nasty19:05:49

nvm, fixed the problem

thug.nasty19:05:05

I noticed that when I receive a request, all the numbers come in as strings

thug.nasty19:05:32

so, when I use bouncer to validate, it always fails on number validation

staypufd20:05:33

Hello I’m trying to use Selmer 1.0.4 and getting errors using the join tag

staypufd20:05:51

wanted to see if anyone else is seeing that at all

staypufd20:05:06

I’m using it like so {{ item.subcategories|join:\”, \” }}

staypufd21:05:22

figured it out. The object being passed was a PersistantVector not a Seq