kaivai has quit [Quit: ZNC - https://znc.in]
kaivai has joined #ruby
<splud> I've examined the source for webrick, not possible to accomplish here.
<splud> a large POST = DoS.
<adam12> splud: Without seeing what you're doing, I can only guess, but I was basing it off this here: https://github.com/ruby/webrick/blob/3515081a51b91b730267ba2b224039ecfbf8bd7b/lib/webrick/httprequest.rb#L255-L259
<adam12> splud: It's rare to see WEBrick in the wild anymore tho, so I can't even really begin to speculate.
<splud> Not in a position to upgrade the devices, but can push a script - and WEBrick is available.
<splud> You're basing the IO stuff on httpREQUEST. That'd be where webrick is sending a request to another host. httpSERVER is what is at play here.
<aighearach> splud: Can you push binary gems?
<adam12> splud: Hmm? Do you get arguments to do_POST?
<splud> I get req, rsp args - which are arrays. req of course is an absolute whopper if the POSTed file is large.
<adam12> What kind of class is `req`? Maybe I'm not following.
<splud> Can't push gems.
<adam12> Ah. So `req` is provided but you can't use it because the body is large?
<adam12> What kind of class is req? do you know?
<splud> trying to avoid having the module even put stuff there - I want to shunt the data to a file.
<splud> req = create_request(@config)
<adam12> I'm kind of surprised you couldn't do something like: def do_POST(req, res); f = Tempfile.new; IO.copy_stream(req, f); end
<splud> surely WEBrick still has req['data'] in a memory block? That's what I'm trying to avoid
<splud> 60MB archive being pushed.
<aighearach> splud: if you can receive a POST and you can open a file, can you execute a binary?
<splud> the device does not necessarily have a connection to the outside world. A client is connecting via a private network.
<splud> just in case said binary is something to fetch remote gem files.
<splud> otherwise, the device would be _retrieving_ this resource instead of having it POSTed to it.
<splud> I gave something that works _for now_, it's just that is it ugly on RAM.
sdfuiojklqaz has quit [Remote host closed the connection]
sdfuiojklqaz has joined #ruby
sdfuiojklqaz has quit [Ping timeout: 240 seconds]
<aighearach> splud: if you're not also on the same private network how would you upload a script? It seems odd to have an appliance running Ruby that lets you upload scripts and create sockets but not execute binaries.
kaivai has quit [Quit: ZNC - https://znc.in]
kaivai has joined #ruby
<splud> what binary are you suggesting? I'm working with what is in the rootfs of the device, and am not at liberty to change that.
<splud> adam12 - I should have been clear - I'm already able to take the req and dump it into a file. This happens AFTER the WEBrick is already holding (at this time) over 60MB in RAM due to the ENTIRE package having been POSTed
<splud> I was rather hoping there was a mechanism to have WEBrick _supply_ the req as a stream. Allowing for it to be written as it is received (after the HTTPServer has processed the headers, though yes, I get that multipart affords some complications)
<adam12> Are you sure that's not what's happening? How are you measuring memory use?
drincruz has joined #ruby
drincruz_ has quit [Ping timeout: 265 seconds]
drincruz has quit [Ping timeout: 252 seconds]
ur5us has quit [Ping timeout: 240 seconds]
<aighearach> splud: I was thinking a web server
<aighearach> But there were some fairly robust WEBrick setups once upon a time, like 2005, it can be done
<splud> watching the process grow in memory consumption with top. or checking in /proc/{pid}/ for memory statistics.
<splud> once do_POST has those variables, they are x size, not a stream - they're IN RAM.
<splud> Anyway, I have some meetings here (and have been doing further investigations at a different workstation and checking here, thus lag).
Garb00 has joined #ruby
Garb0 has quit [Ping timeout: 272 seconds]
lunarkitty has quit [Quit: Connection closed for inactivity]
lunarkitty has joined #ruby
ur5us has joined #ruby
drincruz has joined #ruby
[jamez] has joined #ruby
finsternis has quit [Read error: Connection reset by peer]
drincruz has quit [Ping timeout: 252 seconds]
lucf117 has quit [Remote host closed the connection]
lad has joined #ruby
jetchisel has quit [Ping timeout: 265 seconds]
neshpion has quit [Quit: neshpion]
kaivai has quit [Quit: ZNC - https://znc.in]
kaivai has joined #ruby
kaivai has quit [Client Quit]
kaivai has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
justache has quit [Quit: Ping timeout (120 seconds)]
pwnd_sfw has quit [Ping timeout: 258 seconds]
ur5us has joined #ruby
justache has joined #ruby
pwnd_sfw has joined #ruby
MalkbabY_ has joined #ruby
MalkbabY has quit [Ping timeout: 252 seconds]
jetchisel has joined #ruby
lunarkitty has quit [Quit: Connection closed for inactivity]
sdfuiojklqaz has joined #ruby
sdfuiojklqaz has quit [Ping timeout: 258 seconds]
Garb00 has quit [Quit: Garb00]
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
saba_sedigh has quit [Ping timeout: 246 seconds]
saba_sedigh has joined #ruby
relyks has quit [Quit: relyks]
ur5us has quit [Ping timeout: 240 seconds]
[jamez] has quit [Ping timeout: 252 seconds]
rg has joined #ruby
jamesmartinez has left #ruby [#ruby]
Guest2015 has joined #ruby
Guest2015 has quit [Client Quit]
jmcgnh has quit [Ping timeout: 258 seconds]
jmcgnh has joined #ruby
dka has joined #ruby
_ht has joined #ruby
drincruz has joined #ruby
drincruz has quit [Ping timeout: 272 seconds]
relyks has joined #ruby
teclator has joined #ruby
dvgorod has joined #ruby
relyks1 has joined #ruby
relyks has quit [Ping timeout: 240 seconds]
relyks1 is now known as relyks
relyks1 has joined #ruby
relyks has quit [Ping timeout: 240 seconds]
relyks1 is now known as relyks
relyks has quit [Ping timeout: 272 seconds]
relyks1 has joined #ruby
relyks1 is now known as relyks
<nakilon> > arguments forwarding now supports leading arguments.
<nakilon> def method_missing(meth, ...)
<nakilon> send(:"do_#{ meth }", ...)
<nakilon> what is the "leading arguments" term? is it somewhere else I can read about it?
<nakilon> I need it for translation from English
<nakilon> фnd why not "trailing"?
<nakilon> ah, it means the that leading were forwarded
saba_sedigh has quit [Ping timeout: 252 seconds]
saba_sedigh has joined #ruby
MalkbabY has joined #ruby
MalkbabY_ has quit [Ping timeout: 252 seconds]
<nakilon> * Promote default gems to bundled gems. (rexml, rss) -- what does this mean?
reset has quit [Quit: reset]
saba_sedigh has quit [Ping timeout: 256 seconds]
saba_sedigh has joined #ruby
saba_sedigh has quit [Ping timeout: 258 seconds]
mollerup has quit [Read error: Connection reset by peer]
mollerup has joined #ruby
mollerup has quit [Ping timeout: 240 seconds]
weaksauce has quit [Ping timeout: 265 seconds]
jetchisel has quit [Ping timeout: 252 seconds]
jetchisel has joined #ruby
drincruz has joined #ruby
gr33n7007h has quit [Quit: WeeChat 3.2]
drincruz has quit [Ping timeout: 256 seconds]
dvgorod_ has joined #ruby
dvgorod has quit [Ping timeout: 252 seconds]
rassoc has joined #ruby
dvgorod has joined #ruby
dvgorod_ has quit [Ping timeout: 258 seconds]
jacktar has quit [Ping timeout: 244 seconds]
jacktar has joined #ruby
drincruz has joined #ruby
[jamez] has joined #ruby
MalkbabY_ has joined #ruby
MalkbabY has quit [Ping timeout: 256 seconds]
lad has quit [Ping timeout: 252 seconds]
<nakilon> >> {b: 0, c: 1} => {b:} ; b
<ruby[bot]> nakilon: # => (https://carc.in/#/r/bgmv)
<aesthetikx> what just happened
<nakilon> I wish I knew
<nakilon> it's a code from ruby-lang.com news page
<nakilon> an old one
<nakilon> relatively
<aesthetikx> which page
<aesthetikx> you have piqued my interest
jetchisel has quit [Ping timeout: 252 seconds]
jetchisel has joined #ruby
<aesthetikx> woah
finsternis has joined #ruby
<havenwood> nakilon: https://stdgems.org/ is a nice site
<nakilon> havenwood you say it because it is relevant to something I asked?
jwr has joined #ruby
<jwr> We have a need to build our docker images using a vanilla ubuntu:20.04 image instead of the offical ruby images on docker hub. Then, to be able to install whichever ruby version we want, I'm thinking of using rvm in the vanilla 20.04 image. Is rvm inside of docker a terrible idea?
dvgorod has quit [Ping timeout: 258 seconds]
<nakilon> I believe docker tells you that you can do the same things inside it that you usually do outside so there should be nothing wrong
<jwr> Right, but IIRC rvm will compile from source, so I need gcc and probably a bunch of other dependencies. I'm wondering how messy it would be to install rvm in a build image and then copy the desired ruby version into a slimmed down image without build deps.
goldfish has joined #ruby
chonkbit has joined #ruby
<adam12> jwr: rvm might _not_ compile from source. It will try to use a binary. Depends on platform.
<adam12> jwr: aarch64 or mips, probably source. But for x86_64, probably binary.
<adam12> jwr: And don't forget about multi-stage build files, tho I'm not sure they'd help you here a lot.
<jwr> adam12: oh, if rvm will attempt to use a binary then maybe this is all way easier than i thought. that's good to know.
kaivai has quit [Quit: ZNC - https://znc.in]
kaivai has joined #ruby
jetchisel has quit [Ping timeout: 265 seconds]
reset has joined #ruby
<jwr> adam12: it did use a binary, that's cool. is there a way that i can know which files rvm installed when it installed ruby? eg so that i can do `COPY --from=builder /usr/local/rvm /usr/local/rmv`?
vos has joined #ruby
sdfuiojklqaz has joined #ruby
<adam12> jwr: I'm not sure to be honest.
<jwr> looks like `rvm info` shows most of that, and it does appear to have installed everything inside /usr/local/rvm.
vos has quit [Quit: WeeChat 3.2]
Garb0 has joined #ruby
vos has joined #ruby
Garb0 has quit [Ping timeout: 256 seconds]
jamesmartinez has joined #ruby
Guest49 has joined #ruby
[jamez] has quit [Ping timeout: 258 seconds]
Guest49 has quit [Client Quit]
Toledo is now known as TomNook
AriT93 has joined #ruby
lucf117 has joined #ruby
MalkbabY has joined #ruby
MalkbabY_ has quit [Ping timeout: 240 seconds]
<jidar> why would you have a COPY command that you're really trying to just do a RUN command?
<jidar> is_confused
<jidar> > Is rvm inside of docker a terrible idea?
<jidar> so it's not that it's a terrible idea, it's that the use of a container negates any need for it
<jidar> ie: containers are entirely about setting up an environment (just one) to run or execute something, using rvm on top of a container is or at least to me, feels dirty because why not just install whatever you're going to use, why install something that's going to install something else
AriT93 has quit [Remote host closed the connection]
kaivai has quit [Quit: ZNC - https://znc.in]
kaivai has joined #ruby
<nakilon> why run if it's copy?
<nakilon> it looks like a multistep dockerfile directive
<jidar> because you're literally (in this example) using COPY for what was installed via a RUN
<nakilon> why not?
<jidar> I don't know how to explain it any better than that..
<jidar> also likely not the channel
<nakilon> dude did RUN and then he wants to do COPY -- this is two step build
<nakilon> because he wants to copy to a different context
<nakilon> or image, whatever tt's called
AriT93 has joined #ruby
[jamez] has joined #ruby
lad has joined #ruby
elf_fortrez has joined #ruby
weaksauce has joined #ruby
AriT93 has quit [Remote host closed the connection]
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
TomyWork has joined #ruby
wyrran has joined #ruby
Garb0 has joined #ruby
elf_fortrez has quit [Quit: Client closed]
AriT93 has joined #ruby
TomyWork has quit [Remote host closed the connection]
vos has quit [Quit: WeeChat 3.2]
kaivai has quit [Quit: ZNC - https://znc.in]
kaivai has joined #ruby
wyrran has quit [Ping timeout: 256 seconds]
kaivai has quit [Quit: ZNC - https://znc.in]
wyrran has joined #ruby
lucf117 has quit [Read error: Connection reset by peer]
kaivai has joined #ruby
lad has quit [Remote host closed the connection]
lad has joined #ruby
Garb00 has joined #ruby
Garb0 has quit [Ping timeout: 258 seconds]
Garb00 has quit [Ping timeout: 258 seconds]
wyrran has quit [Ping timeout: 256 seconds]
wyrran has joined #ruby
Rounin has joined #ruby
wyrran has quit [Ping timeout: 252 seconds]
wyrran has joined #ruby
drincruz_ has joined #ruby
drincruz has quit [Ping timeout: 258 seconds]
nebiros has joined #ruby
<nebiros> quick question, there's a yardoc tag to add documentation for a constant?
<rg> nebiros: you should just add documentation above the constant for that or what do you mean?
<nebiros> rg: ok, I thought there was something like @constant
MalkbabY_ has joined #ruby
MalkbabY has quit [Ping timeout: 268 seconds]
<rg> not that i'm aware of.
<nebiros> rg: cool, thanks
<nebiros> weaksauce: ++
_ht has quit [Remote host closed the connection]
<rg> sorry to ask, but is freenode now offline? irc.freenode.net doesn't seem to work anymore
<nebiros> guess is irc.com now?, or chit.something
<newton> that rr works for me
<nakilon> it's online, chat.freenode.net
<nakilon> this is the domain I was always connected to
<nakilon> at least it's in my thelounge settings
<rg> ah my error - thanks
neshpion has joined #ruby
jwr has quit [Remote host closed the connection]
drincruz has joined #ruby
drincruz_ has quit [Ping timeout: 258 seconds]
[jamez] has quit [Ping timeout: 265 seconds]
ur5us has joined #ruby
lunarkitty has joined #ruby
drincruz has quit [Ping timeout: 272 seconds]
drincruz has joined #ruby
drincruz has quit [Ping timeout: 252 seconds]
mrkz_c has quit [Quit: Connection closed for inactivity]
AriT93 has quit [Remote host closed the connection]