ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Check also http://www.picolisp.com for more information
peterhil has joined #picolisp
aw- has quit [Quit: Leaving.]
orivej has joined #picolisp
rob_w has joined #picolisp
theruran has joined #picolisp
mtsd has joined #picolisp
<Nistur> mornin'
<beneroth> Good morning
<Nistur> :)
<Regenaxer> Hi all!
<Nistur> how goes things?
<Regenaxer> As ever :)
<mtsd> Hello all
<mtsd> Good here
<Regenaxer> Great!
<Nistur> \o/
libertas has quit [Ping timeout: 256 seconds]
libertas has joined #picolisp
theruran has quit [Quit: Connection closed for inactivity]
libertas has left #picolisp [#picolisp]
libertas has joined #picolisp
peterhil has quit [Read error: Connection reset by peer]
peterhil has joined #picolisp
<beneroth> [dev culture] Conway died of covid-19 :( https://en.wikipedia.org/wiki/John_Horton_Conway
<beneroth> his Game of Life will live forever
<Regenaxer> yeah, a few days ago. Saw in twitter
<Regenaxer> T
<Nistur> :(
peterhil has quit [Quit: Must not waste too much time here...]
mtsd has quit [Ping timeout: 256 seconds]
<tankf33der> hi all
<Regenaxer> Hi tankf33der
<tankf33der> Regenaxer: i would like read sources of webframework. what should i read first of three file: html, http or form?
<Regenaxer> First http
<tankf33der> i feel the energy.
<tankf33der> ok
<Regenaxer> :)
<Regenaxer> They depend on each other http -> xhtml -> form
<tankf33der> i tried load benchmarking
<tankf33der> skudra code was ok, but when i testing simple ht:Prin “mike” benchmarker cant get numbers :)
<tankf33der> looks like it expect something and fails to count
<Regenaxer> hmm, what numbers?
<Regenaxer> Content-Size perhaps? Do you use ht:Out *Chunked?
<tankf33der> i get always zeroes
<tankf33der> afk
<tankf33der> no
<tankf33der> just ht.Prin
<tankf33der> i will play again then
<Regenaxer> ok
<Regenaxer> 'respond' sends "Content-Length: "
<Regenaxer> Otherwise it depends
<Regenaxer> (html ...) is OK
mtsd has joined #picolisp
f8l has quit [Remote host closed the connection]
<tankf33der> playing with benchmarking
<tankf33der> again
<tankf33der> (httpHead "text/plain; charset=utf-8")
f8l has joined #picolisp
<tankf33der> how to print Hello world this httpHeader ?
<tankf33der> how to print Hello world after this httpHeader ?
<Regenaxer> Better use 'html' from @lib/xhtml.l
<Regenaxer> It does all
<tankf33der> no documentation for html
<Regenaxer> (html 0 "Test" NIL NIL (prinl "OK"))
<Regenaxer> Perhaps doc/app.html
<Regenaxer> A bit outdated, but the html stuff still fits
<tankf33der> http://ix.io/2i01
<tankf33der> see, still zeroes
<tankf33der> i tried another tool, the same.
<Regenaxer> Sending zeros?
<tankf33der> no cant count requests
<Regenaxer> Can you see with curl http://127.0.0.1:8080 |hd or so?
<tankf33der> no, cant count requests
<tankf33der> of course.
<Regenaxer> ah
<Regenaxer> I don't know wrk
<tankf33der> curl http://127.0.0.1:8080
<tankf33der> curl: (56) Illegal or missing hexadecimal sequence in chunked-encoding
<tankf33der> curl fails, firefox ok
<tankf33der> $ cat myapp.l
<tankf33der> (html 0 "Hello" "@lib.css" NIL
<tankf33der> "Hello World!" )
<tankf33der> (httpHead "text/plain; charset=utf-8")
<Regenaxer> (html 0 "Test" NIL NIL "OK") ?
<Regenaxer> ik
<Regenaxer> ah
<Regenaxer> no
<Regenaxer> No (httpHead ...
<Regenaxer> html does all
<tankf33der> ok
<Regenaxer> see lib/xhtml.l
<tankf33der> curl works now
<Regenaxer> (vi 'html)
<Regenaxer> You can pass NIL instead of "@lib.css"
<tankf33der> i got numbers
<tankf33der> http://ix.io/2i05
<Regenaxer> "read 115234" means errors?
<tankf33der> i think is total read counters in 30 seconds
<Regenaxer> true, "115236 requests"
xkapastel has joined #picolisp
<tankf33der> i will learn http and will be smarter
alexshendi has joined #picolisp
<Regenaxer> good thing
<tankf33der> i want this, but i dont known how to enable db level
<Regenaxer> You started it already iirc
<alexshendi> Hi, just a quick question regarding pil21. Are user visible functions defined only in src/glob.l or also in other places?
<Regenaxer> Just 'store' and 'fetch', no E/R is needed
<Regenaxer> Hi alexshendi
<Regenaxer> They are all in the symbol table in src/glob.l
<alexshendi> Regenaxer: Hi and thanp you <3
<Regenaxer> :)
<alexshendi> s/thanp/thank/
<DKordic> tankf33der: W:Common_Gateway_Interface seems to be an implementatin of Remote Procedure Call of execve.
<DKordic> httpGate seem to be like the inetd.
mtsd has quit [Quit: Leaving]
<Regenaxer> My next goal for pil21 is to implement all functions needed for misc/bigtest, so that bignum tests can run
<Regenaxer> And after that the goal is to self-bootstrap, so that pil64 is not needed
<beneroth> :)
<beneroth> <3
<Regenaxer> But first more I/O stuff
<Regenaxer> as ever hard to get system-independent
<beneroth> aye-o
<tankf33der> Regenaxer: i am waiting for test function.
<Regenaxer> Too early
<Regenaxer> Only perhaps bignums
<Regenaxer> They are finished I think
<tankf33der> then i can use diff to compare two outputs from pil21 vs. pil64
<Regenaxer> true
<Regenaxer> Flow functions (loops) are missing
<Regenaxer> So no good way to do useful tests I'm afraid
<Regenaxer> I'm still struggling with I/O
rob_w has quit [Quit: Leaving]
<tankf33der> Regenaxer: after playing i found i should call (commit) after (store)
<tankf33der> right ?
<Regenaxer> Yes, that's needed
<Regenaxer> Is it single-user?
<Regenaxer> If not, (dbSync) (store ..) (commit 'upd)
<tankf33der> its URL shortener task.
<tankf33der> so multi fork mode
<Regenaxer> yeah
<tankf33der> Regenaxer: psh question
<tankf33der> should i here somehow protect something ?
<tankf33der> i dont know what
<tankf33der> via allow
<Regenaxer> Yes, that's necessary if the server is public
<tankf33der> and what should be in list then ?
<Regenaxer> What is allowed?
<Regenaxer> Which URL may be called?
<tankf33der> nothing, iiuc.
<Regenaxer> But the directory where files may be sent from
<Regenaxer> only that
<Regenaxer> (allow ("pub/"))
<Regenaxer> Otherwise all files are accessible
<tankf33der> in my example from README.md pastes to store and fetch in /home/user/skudra-root dir
<Regenaxer> Absolute pathes are forbidden iirc
<tankf33der> it works.
<tankf33der> *ServRoot "http://127.0.0.1:8080/"
<tankf33der> *DirRoot "/home/mpech/skudra-root/"
<tankf33der> *KBLimit (* 256 1024) )
<tankf33der> (setq
<tankf33der> ...
<Regenaxer> yes, because *Allow is NIL
<Regenaxer> then everything is allowed
<tankf33der> so i must add something to allow and test again.
<Regenaxer> ok, absolute is OK, but must be in *Allow
<Regenaxer> ".." is never allowed
<Regenaxer> see 'disallow'
<tankf33der> see disallow where ?
<Regenaxer> 'disallowed'
<Regenaxer> lib/http.l
<tankf33der> ok
<tankf33der> so (allow ("skudra-root/")) ?
<Regenaxer> Only if "skudra-root/" is relativ (local)
freemint has joined #picolisp
<Regenaxer> (allow '("/full/path/" might work
<Regenaxer> Never tried
<Regenaxer> I never use absolute pathes
<tankf33der> and I never used web frameworks.
<Regenaxer> Me neither
<Regenaxer> No "real" frameworks ;)
<tankf33der> and I never used web programming in picolisp.
<Regenaxer> No problem
<Regenaxer> You can easily test
<Regenaxer> *if* you set *Allow to anything
<Regenaxer> you get an error for every access that is *not* allowed
<Regenaxer> So you can easily fix
<tankf33der> $ curl -F 'f=@/etc/issue' 127.0.0.1:8080
<tankf33der> as you can see i dont use anything related to lisp code here.
<tankf33der> even pastebin.l hidden.
<Regenaxer> yes, good
<Regenaxer> But you must set *Allow to something
<Regenaxer> otherwise http://127.0.0.1:8080/some/path works
<Regenaxer> or http://127.0.0.1:8080/!function
<tankf33der> trying.
<Regenaxer> http://127.0.0.1:8080/!call&rm&-r&.
<tankf33der> ^^^ not found
<Regenaxer> http://127.0.0.1:8080/!msg&Hello
<freemint> So i want to try to setup a PicoLisp websever again. I want to install it from a fresh OS. Any reason why CentOs vs Debian vs Fedora vs Ubuntu would matter?
<Regenaxer> http://127.0.0.1:8080/etc/issue gives just etc/issue (relative)
<tankf33der> ^^
<tankf33der> (apply (val (intern (ht:Pack (cdr U) T))) L)
<tankf33der> msg&Hello -- Undefined
<Regenaxer> hi freemint
<freemint> Hi Regenaxer
<Regenaxer> tankf33der, did you escape the & ?
<tankf33der> freemint: no
<Regenaxer> ah
<tankf33der> Regenaxer: no
<Regenaxer> http://127.0.0.1:8080/!msg?Hello
<tankf33der> I see 10 times "Hello" in debug log
<tankf33der> firefox failed
<tankf33der> like this:
<tankf33der> The connection was reset
<tankf33der> The connection to the server was reset while the page was loading.
<Regenaxer> msg does not send to client
<Regenaxer> it sends to stdout
<Regenaxer> yes, of course
<Regenaxer> no respond to the client
<Regenaxer> But you see how dangerous it is
<Regenaxer> The user can do http://127.0.0.1:8080/!call?...
<Regenaxer> any system command
<tankf33der> thats why i am asking about this after 24 hours.
<Regenaxer> if nothing is allowed
<Regenaxer> oh
<tankf33der> but at the same time i dont know what to add to allow
<Regenaxer> OK, then just (allow NIL "mike")
<Regenaxer> if there is no file "mike" of course ;)
<tankf33der> where exactly ?
<tankf33der> where pastebin.l file ?
<Regenaxer> ./mike
<Regenaxer> no, working directory
<Regenaxer> (pwd)
<tankf33der> I inserted (allow NIL "mike") as first line of pastebin.l and still can call date to console
<Regenaxer> Thats too late
<Regenaxer> pastebin.l is loaded as the *default*
<Regenaxer> Better make a function
<Regenaxer> (allow NIL "!pastebin")
<Regenaxer> (de pastebin () ...
<Regenaxer> (server (port ...) "!pastebin")
<Regenaxer> pil pastebin.l -wait
<Regenaxer> or
<Regenaxer> pil pastebin.l +
<Regenaxer> Something like that
<Regenaxer> In this way it is also a lot faster
<Regenaxer> because pastebin.l is not loaded each time
<tankf33der> playing.
<freemint> Is there anything wrong with 18-12 as pil version?
<tankf33der> download latest and recompile.
<Regenaxer> Not sure, a lot changed meanwhile
<freemint> Thanks
<tankf33der> http://ix.io/2i2k
<tankf33der> modified, now pastebin is function
<tankf33der> starting pil pastebin.l +
<Regenaxer> Looks good
<tankf33der> and still can call !call?date
<tankf33der> to console
<Regenaxer> oh
<Regenaxer> hmm, needs a path then
<tankf33der> path to what ?
<Regenaxer> *Allow needs a value
<Regenaxer> I always have the source directory there
<Regenaxer> (allow '("app/" "img/") ...
<Regenaxer> (allowed ...
<Regenaxer> Sorry, I did not check
<Regenaxer> (allowed ("app/" "img" ...) ...
<Regenaxer> 'allow' is to *later* allow additional things
<Regenaxer> So 'allow' is the wrong function
<tankf33der> works, now call denied and i see rejected warning in log
<tankf33der> "!call" [::ffff:127.0.0.1] not allowed
<tankf33der> perfect.
<Regenaxer> Great
<tankf33der> but now i cant post
<tankf33der> f [::ffff:127.0.0.1] not allowed
<tankf33der> $ curl -F 'f=@/home/mpech/utf.cr' http://127.0.0.1:8080
<tankf33der> curl: (52) Empty reply from server
<Regenaxer> yes, the 'f'
<Regenaxer> Why do you pass it?
<Regenaxer> (allowed () f ...)
<Regenaxer> then (get 'f 'http)
<Regenaxer> ie 'f' is a variable
<tankf33der> `(== 64 64)
<tankf33der> (allowed NIL "!pastebin" "f")
<tankf33der> (load "@lib/http.l" "@lib/xhtml.l" "@lib/form.l")
<tankf33der> this three first lines of files works.
<Regenaxer> Not sure if "f" works. I thought f
<Regenaxer> (internal symbol)
<Regenaxer> might be ok
<Regenaxer> checks via 'idx' right?
<tankf33der> right.
<Regenaxer> But internal symbol is ok, I use *Var usually
<tankf33der> now GET is broken
<tankf33der> on this always returns index welcome text
<Regenaxer> now you have a function
<Regenaxer> So it is passed as an argument
<Regenaxer> (de pastebin (Var) ...
<Regenaxer> or
<Regenaxer> (de pastebin @ ... (next) ...
<tankf33der> (de pastebin @ helped.
<tankf33der> phew
<Regenaxer> (Var) is more clean
<Regenaxer> the normal way
<tankf33der> not for first time.
<Regenaxer> unless you really want to support variable args
<Regenaxer> Did it get faster with a pre-loaded pastebin.l file?
<tankf33der> +10%
<tankf33der> commited.
<tankf33der> with URL shortener i could experiment again and more.
<tankf33der> afk.
<tankf33der> thanks a lot.
<Regenaxer> :)
orivej has quit [Ping timeout: 264 seconds]
orivej has joined #picolisp
alexshendi has quit [Quit: leaving]
<tankf33der> damn, cant sleep
<tankf33der> playing with server function
<Regenaxer> hehe
freemint has quit [Remote host closed the connection]
freemint has joined #picolisp
theruran has joined #picolisp
xkapastel has quit [Quit: Connection closed for inactivity]
orivej has quit [Ping timeout: 256 seconds]
freemint has quit [Ping timeout: 240 seconds]
freemint has joined #picolisp
freemint has quit [Remote host closed the connection]
freemint has joined #picolisp
xkapastel has joined #picolisp
freemint has quit [Ping timeout: 240 seconds]
f8l has quit [Remote host closed the connection]
f8l has joined #picolisp