The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2017-12-01

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:28 jacoby joined #mojo
00:36 marty joined #mojo
00:49 jacoby joined #mojo
00:51 aborazmeh joined #mojo
01:11 rickbol_ joined #mojo
01:16 jacoby joined #mojo
02:06 CandyAngel joined #mojo
02:08 Xyem joined #mojo
02:21 Grinnz https://github.com/Grinnz/Mojolicious-Plugin-Log-Any
02:23 Grinnz needs more tests, and i'm not totally sure about prepending the log level to the messages, but
02:59 itaipu joined #mojo
04:37 aborazmeh joined #mojo
04:56 jberger ok well no going back now: https://twitter.com/joelaberger/status/936458617221468160
05:12 dim0 joined #mojo
05:14 kivilahtio joined #mojo
05:46 aborazmeh joined #mojo
06:08 genio joined #mojo
06:33 sri Have a retweet \o/
06:33 jberger ah, but it is past midnight in Chicago, so I need two: https://twitter.com/joelaberger/status/936481191578030080
06:44 geospeck joined #mojo
06:51 sri you got it
06:52 inokenty-w joined #mojo
06:55 jberger I need to fill in some content on the main page tomorrow
06:55 jberger and of course write another post :-P
06:55 jberger but for now, time for bed
06:55 Leffe joined #mojo
06:59 marcus jberger++ # ambitious boy
07:00 jberger I might take contributions if people have ideas
07:00 jberger but if not, I can handle it
07:00 jberger what doesn't come through is that I've spent basically all my free waking time in the last week getting that theme onto statocles
07:01 jberger it isn't totally done yet, but it has most of the important stuff
07:01 Leffe joined #mojo
07:02 marcus oh, neat :)
07:03 jberger starting to tweet these now, I see that I'm going to want opengraph sooner than later too
07:11 Vandal joined #mojo
07:12 dod joined #mojo
07:17 jamesaxl joined #mojo
07:17 geospeck joined #mojo
07:18 dod joined #mojo
07:20 mohawk jberger, nice calendar entries!
07:54 Leffe joined #mojo
07:54 karjala_ joined #mojo
08:39 geospeck joined #mojo
08:40 geospeck joined #mojo
08:54 sri jberger: send something to the mailing list
08:55 sri or i do it later
08:56 sri will spend the next few hours at the airport...
08:56 ghenry joined #mojo
09:10 batman PsimanX1, Grinnz: thanks for your help!
09:23 PsimanX1 np!
09:29 sdq joined #mojo
09:35 sdq hello ! I have a question regarding running Mojolicious as a background job. It seems that when I close the console, the job tends to hold but never renders anything... netstat shows that the process is still listening on port 3000 but that's all. I tried to disown the process from my shell before closing it but i doesn't change a thing. How can I make it wor
09:36 sdq *work ?
09:38 CandyAngel sdq: I usually run it in screen (or tmux)
09:39 CandyAngel You can use a systemd unit if you use systemd
09:40 sdq screen may be a good option ! I didn't think of it, I don't know why.
09:42 CandyAngel I don't have any big deployments yet, so it could be pretty suboptimal :P
09:42 CandyAngel So probably worth sticking around and seeing how someone who does have such deployments handles it?
09:42 dim0 joined #mojo
09:43 sdq well actually, I'm not the sysadmin so that won't be my job anyway, but I'm creating a web service mock-up to show him why Perl might be a better option than PHP for my need
09:43 sdq so screen seems to be a good option for now
09:43 CandyAngel Oh, coolies :)
09:44 sdq I never heard of systemd, I'm gonna look into it but I guess it will be screen anyway
09:44 sdq thanks for your answers :)
09:45 CandyAngel systemd is an init system
09:45 CandyAngel For bringing up services.. something the sysadmin would deal with
09:46 CandyAngel You're welcome, happy I could help :D
09:47 sdq ok ! well systemd'll be for later then !
09:47 CandyAngel Hopefully not
09:47 * CandyAngel doesn't like it :P
09:47 sdq ?
09:48 CandyAngel Just haven't had a pleasant experience with systemd
09:48 CandyAngel Enough for me to look to change Linux distro, but not enough for me to have switched yet
09:49 CandyAngel Kind of like how Firefox was getting worse and worse, but it going PulseAudio exclusive and thus losing sound was the point I switched to Pale Moon :P
09:50 sdq :D if that's so I let the decision of a better way than screen for production to the sysadmin ; that's if he agrees to let me use Mojolicious
09:50 CandyAngel ^_^
09:52 CandyAngel Hope so, Mojo is gooooood
09:52 sdq I know ^^
09:52 CandyAngel Good enough that I do odd things with it, which probably drives the devs up the walls because it makes me ask weird questions!
09:55 bobkare sdq: you can also try running your app with hypnotoad, it backgrounds by itself
09:55 sdq I was forced to work with PHP for years but it turns out PHP is much too slow for the jobs I have to do, so I've been aloud to go back to Perl \o/ I used to create my web apps with Dancer but it turns out Mojolicious seems more fun than Dancer 2 so I switched
09:57 sdq bobkare: I read about hypnotoad but I found it a bit dangerous to create a job by worker
09:57 CandyAngel Oh? I haven't used any other frameworks than Mojo.. found it first, does all the things
09:58 sdq aloud => allowed :-| (sorry for my poor English btw)
10:01 CandyAngel You're understandable, it's fine :)
10:02 sdq I've got an update : my sysadmin is suggesting to use nohup and it turns out it's working and straightforward !
10:05 mfontani except it won't restart on failure, handle seamless reload via sending it a signal, etc.
10:07 jamesaxl joined #mojo
10:08 sdq @mfontani: for my current needs, I don't think it is so much a problem but I'll take it into account if my mock-up grows up too much
10:09 CandyAngel nohup for demo should be fine? Not so much for production..
10:09 sdq that's my point ;-)
10:09 mfontani for "production", I just "hypnotoad app" and off I go
10:11 mfontani Can't stress how simple (and powerful) that is. A real breeze compared to LAMP / mod_perl2 backends
10:11 sdq then I'll look more closely to hypnotoad
10:20 sdq well, I'm gonna leave now and read about all those things and pick up what suits me best  ! Thank you all for your answers ! :)
10:25 Leffe joined #mojo
10:41 dabudabu joined #mojo
10:42 tchaves joined #mojo
11:02 itaipu joined #mojo
11:24 jnbek joined #mojo
12:19 ghandi joined #mojo
12:21 ghandi Hi there! I've got a helper which validates an uploaded file and sets ->flash("error_msg" => "..."); in case of an error. I wanted to unit test this now, but looks like the $t->app() of Test::Mojo isn't capable of doing this, since the flash() only makes sense with a Request and a Controller, right?
12:24 CandyAngel Flash message is done using cookies, so yeah..
12:25 CandyAngel Maybe change it to set a stash value instead, or just make the helper return an error value
12:26 CandyAngel Actually, stash might not work either :P
12:27 CandyAngel Are you doing the validation/error set in a lot of places?
12:27 ghandi I don't need the cookie. It would be good enough if i could simply inspect the flash after calling the helper. That would make testing easy. That the flash get's serialized correctly to a cookie is the responibility of mojo which is tested there hopefully ;)
12:28 ghandi I just wan't to clobber my Controller with this kind of work. Because i can't unit test the controller either (yeah, i can send a real HTTP-Request with Test::Mojo, but that's not the spirit of a unit test :) )
12:29 ghandi *don't want to clobber ...
12:29 CandyAngel Yeah, but what are you actually testing? That the flash message is set or your helper checks are correct?
12:30 ghandi Both. In case of the helper indicating an error, i wan't to check if it set the falsh correctly to prevent accidential "showing an error wihtout content"-Problems.
12:30 ghandi Because there is no hard link between calling "falsh('myKey')" and retrieving it later. Making it errorprone to typos...
12:32 CandyAngel Sounds like that should be separate tests
12:32 CandyAngel One that tests your helper is correct and another to check that the controller is setting the flash message when it should
12:33 ghandi Which forces me to setup the test-environment twice...
12:33 CandyAngel So the latter would be checking the returned DOM when you submit with a error file
12:33 CandyAngel Because there is no hard link between setting a flash message and it being displayed either :P
12:34 ghandi But i can write an easy test for my template that it support "error_msg" and "success_msg" as expected ;)
12:34 trippeh left #mojo
12:37 CandyAngel I'm pretty sure the Mojo self-tests do both these things without setting itself up twice
12:38 CandyAngel So I'm not sure what you mean when you say you'll have to
12:38 CandyAngel As in, the test suite both checks helper output and that rendered pages contain certain content
12:41 ghandi Well, i could only go with the Controller test via HTTP. Than i only would need to have a set of good/bad files to upload and check. But by my definitions that is an integration test, not a unit test :D
12:44 CandyAngel Err.. what you described is an integration test anyway.. the integration between your helper code and Mojo's ->flash()
12:44 CandyAngel Umless your helper code can run without Mojo.. it is integration, right?
12:44 CandyAngel Unless*
12:51 CandyAngel Err.. if you have an app helper and that changes the controller, you must be passing the controller in for it to set the flash message anyway..?
12:52 ghandi Yeah, i wasn't aware of this implication, since i always only used helpers from controllers :D
12:52 ghandi Until i started to get my feet wet with unit testing ;)
12:52 CandyAngel :)
12:53 CandyAngel I'd say like.. maybe move the checker to a module and unit test that
12:54 CandyAngel Or have 2 helpers, one which does the check and returns an error, and the other that calls that one and sets the flash message..?
12:54 CandyAngel So like check_file and check_file_flash_error
12:55 CandyAngel But you still can't check the latter without a controller :P
13:18 geospeck joined #mojo
13:23 geospeck_ joined #mojo
13:27 dim0 joined #mojo
13:38 Leffe joined #mojo
13:51 marty joined #mojo
13:52 marty_ joined #mojo
14:00 cafe joined #mojo
14:07 CandyAngel Oh yeah.. I don't think my workflow thing will work, because I don't think I can host a server and multiple instances + SQLite on shared drive is bad :(
14:07 CandyAngel So I can probably make it, but not deploy it..
14:08 CandyAngel Unless IT will give me a database, but I think they only do Microsoft SQL servers
14:18 geospeck joined #mojo
14:19 geospeck joined #mojo
14:19 geospeck joined #mojo
14:20 geospeck joined #mojo
14:21 geospeck joined #mojo
14:22 geospeck joined #mojo
14:25 gryphon joined #mojo
14:26 gizmomathboy joined #mojo
14:30 dim0 joined #mojo
14:33 cafe_ joined #mojo
14:39 cafe__ joined #mojo
14:43 Leffe joined #mojo
14:48 Leffe joined #mojo
15:09 Leffe joined #mojo
15:17 Leffe joined #mojo
15:18 dim0 joined #mojo
15:38 sh14 joined #mojo
15:52 dod joined #mojo
15:52 maschine I can't make flash or stash values appear when I redirect under a subprocess - http://bit.ly/2i6pR8W
15:52 maschine when I just do $self->render, it works fine, what am I missing?
15:55 CandyAngel maschine: What happens if you remove the 'say' on the error?
15:56 CandyAngel Oh
15:56 Leffe joined #mojo
15:56 CandyAngel You need to return if it errors
15:56 dod joined #mojo
15:56 Grinnz CandyAngel: maybe you could do something hacky with mercury websocket pubsub? dunno what the problem description is but wild guess :P
15:59 maschine that line is really internal mojo errors IIRC
16:00 maschine it doesn't do anything if my convertbin detects that the binary file is invalid
16:00 CandyAngel maschine: Yeah, not used Subprocess so I mis-followed your code :P
16:01 maschine unfortunately it doesn't work in Windows :(
16:01 maschine fortunately this project doesn't run on Windows :)
16:01 maschine I did comment that line out but it doesn't change anything
16:02 CandyAngel I can never remember if 'and' binds less than postfix 'if' :|
16:02 CandyAngel is it doing (say and redirect) if
16:02 CandyAngel or: say and (redirect if)
16:03 CandyAngel Grinnz: Maybe? Don't really want to run the system off my work laptop though :P
16:04 maschine I'm not sure it matters in this case - if I 'say stash->('error');' after that line, it prints the error message
16:04 Grinnz postfix modifiers are always the lowest precedence
16:04 maschine I'd think it should work as long as the stash value is saved before the redirect?
16:05 CandyAngel Grinnz: Ah, okie. Thankies >.<
16:09 CandyAngel Wait.. are you doing this?
16:10 CandyAngel Err
16:11 CandyAngel Stash won't be there after the redirect
16:14 CandyAngel So that's why you don't see anything in the template
16:15 CandyAngel Also
16:15 CandyAngel -.-
16:15 sri Grinnz: since we recently talked about what console to get, another huge ps4 exclusive is coming early next year, they are remaking shadow of the colossus
16:16 CandyAngel Sorry, work is frying my brain :P
16:16 ChmEarl joined #mojo
16:17 Grinnz guess I'd probably be leaning ps4 anyway if Microsoft annoyed me enough to drop Windows finally :P
16:17 CandyAngel maschine: What are returning in $results->[0] if there is an error?
16:17 CandyAngel what are you returning*
16:20 CandyAngel maschine: I'd change the unless to if just to see if it sets the flash message when it is successful :P
16:21 geospeck joined #mojo
16:27 maschine 0
16:28 maschine CandyAngel: sorry, '0'
16:28 maschine normally $results->[0] will be the file name
16:29 maschine I have to return something in $results otherwise I get a bunch of (real) errors
16:29 maschine so I though it was an easy way to return my error message. :)
16:30 maschine I know I want to use flash - but it wasn't working, I tested with stash just to see if it would do anything (I could print it, but not see it in the rendered results)
16:31 maschine right now it's not 'broken' - the redirect works fine.  But the user won't know why they were redirected...
16:32 karjala_ joined #mojo
16:37 maschine I tried setting the flash first - http://bit.ly/2ANJtu7
16:38 maschine still says it's uninitialized
16:52 maschine OK so this is strange - it works when I run it under hypnotoad, but not under morbo.  hah.  must have something to do with my cookie settings.
17:00 disputin joined #mojo
17:22 CandyAngel Sorry, travelling home from work
17:48 jberger maschine you can't check the flash that you just set
17:49 jberger in each request the flash method does two different things
17:49 jberger the setter sets the flash for the next request
17:49 jberger the getter gets the flashed values from the last request
17:49 jberger (the storage is in the session btw)
17:49 Grinnz yeah, you need to use stash (or the session normally) for the current request
17:54 disputin joined #mojo
17:56 maschine well the real reason it wasn't working is because I was using app->sessions->secure(1);
17:57 maschine but when I test with morbo, I'm using HTTP and not HTTPS
17:58 maschine so it wasn't saving to flash at all (even if me checking flash was wrong)
17:58 Grinnz yeah, we have the same problem with morbo and with local test files using Test::Mojo
17:59 Grinnz the HTTPS terminates on a load balancer, not even on the server
17:59 maschine I think it would work if I set secure sessions to 0?
17:59 Grinnz it's just a flag on the session cookie
17:59 Grinnz but yeah
17:59 maschine but I usually just leave it as 1 because sometimes I forget to set it back
18:00 Grinnz it's not so much "secure sessions"
18:00 Grinnz sessions are signed either way
18:00 Grinnz https://stackoverflow.com/questions/13729749/how-does-cookie-secure-flag-work
18:01 maschine right, it won't let it work on an HTTP connection
18:01 Grinnz basically just means the clients won't send it over HTTP
18:01 Grinnz could be a concern if you put sensitive data in the cookie
18:02 maschine I get attacked all the time which is funny because my app is nothing at the moment - mostly people looking for Wordpress or PHP weaknesses lol
18:02 Grinnz yeah, there's bots constantly spamming those on every site
18:02 Grinnz theres enough of them out there to be worth it
18:03 maschine the #1 file extension in my logs is PHP.. and I don't have PHP anywhere
18:03 Grinnz yep
18:03 Grinnz ever used fail2ban?
18:03 Grinnz it has an nginx-botsearch preset that will ban those IPs
18:03 Grinnz at least in theory, i havent checked if it works :P
18:04 dod joined #mojo
18:04 maschine no, I should check that out
18:06 sh14|2 joined #mojo
18:07 Grinnz i have it watching logs for nginx, postfix, dovecot, ssh
18:07 Grinnz the last one gets the most hits, heh
18:20 Grinnz batman: the BUILD_REQUIRES really should be TEST_REQUIRES, but that Makefile.PL is generated from git-ship right? so how can we fix it?
18:24 geospeck joined #mojo
18:24 batman Grinnz: you can change it manually, Just make sure it’s in sync with cpanfile
18:25 Grinnz ok
18:43 Seth joined #mojo
18:50 Grinnz batman: do you mind if i also set meta-spec 2/dynamic_config 0 to help older clients?
18:51 Grinnz er, older perl
18:58 geospeck joined #mojo
20:33 Leffe joined #mojo
21:06 Grinnz PsimanX1: why do you keep having a weird merge commit in your pull requests? I'm squashing them anyway but you should try to start pull requests from a clean branch off master
21:10 PsimanX1 Git newbie.  Still finding my way.  Been using svn for years so getting used to the different workflow
21:10 Grinnz ah, yeah its definitely different from svn
21:11 PsimanX1 Yup
21:11 Grinnz way simpler IMO, but i mostly started with git
21:12 Grinnz you might just have extra merge commits in your master branch, you might want to hard-reset it to upstream master
21:12 PsimanX1 Was really tired last night and ended up adding a pull request to Mojo::mysql while try to bring my local fork up to date.  Still don't know how I did it.. :)
21:13 PsimanX1 Gave up and went to bed at that point!
21:13 brunoramos joined #mojo
21:13 Grinnz I really wish that git had buttons to update your branch in your fork from the upstream automatically
21:13 PsimanX1 I think I ended up just deleting the local fork and re-forking
21:13 Grinnz assuming it can do it with a fast-forward
21:13 Grinnz er... that github had*
21:14 PsimanX1 Yeah - you'd think it would do that.  It seems to be a fairly common thing to want to do.
21:14 Grinnz actually the merge commits are in your github fork, thats where you're pulling them from. https://github.com/jhthorsen/mojo-redis2/compare/master...mikemagowan:master
21:15 Grinnz so you want to reset that too
21:17 PsimanX1 So do what the answer here suggests?  https://stackoverflow.com/questions/42332769/how-do-i-reset-the-git-master-branch-to-the-upstream-branch-in-a-forked-reposito
21:18 Grinnz yes, that should work
21:18 PsimanX1 great thanks
21:18 Grinnz your existing PRs will still have those commits, so you could either recreate them or rebase them on your new master
21:19 Grinnz git checkout pr-branch; git rebase master; git push --force origin pr-branch
21:19 Grinnz (after fixing master)
21:21 PsimanX1 ok cool - will give it a try
21:30 trone joined #mojo
21:32 PsimanX1 Yayy!  That did it!  Sweet.  Thanks Grinnz!
21:32 Grinnz cool
21:33 Grinnz the key is never doing anything on master directly in your forks so it stays clean :P that was a hard lesson the first time
21:35 PsimanX1 I think I get that now.  I have to admit to being reluctant to branch under svn as it's such a pain to merge.  With git you really have to.
21:35 genio took me a while to get that one
21:35 Grinnz yeah. branches are first-class in git, and it makes a huge difference
21:35 Grinnz they're light and easy
21:36 Grinnz you get a branch, you get a branch, everyone gets a branch!
21:36 PsimanX1 :)
21:36 PsimanX1 Definitely a steeper learning curve to git tho
21:36 Grinnz in some ways, yeah
21:37 Grinnz i'd say it's a little harder to do easy stuff, but easier to do hard stuff
21:37 Grinnz ... assuming you find the right commands and read the git man page for it :)
21:38 Grinnz they mostly have real nice examples at the end in recent versions
21:39 PsimanX1 Need to find the time to go through the docs more closely in a morning with a coffee.  It all seems clearer with caffeine somehow.
21:41 Grinnz branches in svn are kinda like threads in perl. its just a copy of everything that it puts somewhere else
21:43 Grinnz and yeah, it manages to make use of more cores/keeps separate state, but its ugly and cumbersome
22:36 good_news_everyon joined #mojo
22:36 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vbmzn
22:36 good_news_everyon mojo/master 1801917 Sebastian Riedel: there does not appear to be a good solution for using route placeholders with embedded applications (closes #1148)
22:36 good_news_everyon left #mojo
22:36 sri i've worded it in a way that will allow us to change it in the future if someone finds a way
22:38 sri and i think it's fair to mention caveats in an advanced section
22:39 sri i'm kinda scared of jberger though, since he wants everything documented to count as a feature
22:41 sri that makes it hard to add little hints like that for things we might be able to fix in the future
22:53 jberger I don't know what you mean, it is fair to say that placeholders don't get passed through
22:53 jberger oh are you saying if people were to eventually rely on them being passed through
22:53 jberger rely on them **not** being
22:54 Grinnz i think the "currently" is a good hint that the behavior shouldn't be relied on
22:54 jberger agreed
22:54 Grinnz you can even be more explicit to that effect with a followup sentence
22:54 Grinnz if necessary
22:54 Grinnz (don't think it's necessary here)
22:55 sri jberger: yea, people relying on the (maybe temporary) caveats we mention in the docs
22:56 jberger not sure which way I fall on that, but either way I'd say that's quite a different thing than the catch changes
22:56 jberger a lot of it goes to potential for damage
23:01 sri well, we have this discussion today for future reference in case it ever comes up :)
23:02 karjala_ joined #mojo
23:04 sri oh, linux journal is no more
23:05 sri dead tree is truly dead
23:16 karjala_ they gave me 6 free issues of Linux Pro magazine, in exchange for being a subscriber to them
23:18 dim0 joined #mojo
23:44 Leffe joined #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary