--- parser3/etc/auto.p.in 2021/01/15 20:43:05 1.9 +++ parser3/etc/auto.p.in 2024/12/24 04:53:23 1.17 @@ -1,4 +1,4 @@ -#$Id: auto.p.in,v 1.9 2021/01/15 20:43:05 moko Exp $ +#$Id: auto.p.in,v 1.17 2024/12/24 04:53:23 moko Exp $ @auto[] #source/client charsets @@ -18,8 +18,8 @@ $response:content-type[ @conf[filespec] $confdir[^file:dirname[$filespec]] -$charsetsdir[$confdir/charsets] -$sqldriversdir[$confdir/lib] +$charsetsdir[@datarootdir@/charsets] +$sqldriversdir[@libdir@] $CHARSETS[ # $.cp866[$charsetsdir/cp866.cfg] @@ -96,7 +96,11 @@ zip application/zip }] $LIMITS[ - $.post_max_size(10*0x400*0x400) + $.post_max_size(64*0x400*0x400) +# $.max_file_size(512*0x400*0x400) +# $.max_loop(100000) +# $.max_array(1000000) +# $.max_recursion(1000) ] #$HTTPD[ @@ -164,7 +168,7 @@ $result(def $env:REMOTE_ADDR && ^env:REM }{ ^if($exception.type eq "file.missing"){ # $response:location[/404/] - $response:status(404) + ^httpd:404[] }{ ^unhandled_exception_release[$exception;$stack] } @@ -174,6 +178,14 @@ $result(def $env:REMOTE_ADDR && ^env:REM @CLASS httpd +@OPTIONS +partial + +@auto[] +^if(-f "/httpd.p"){ + ^use[/httpd.p] +} + @include[filename] ^use[$filename; $.main(true) ] ^MAIN:main[] @@ -204,24 +216,28 @@ $line[$env:REMOTE_ADDR [^now.sql-string[ $response:status[404] The requested URL was not found on this server. +@config[result] + +@preprocess[return] -@main[][basic] + +@main[result][basic] #$request:document-root[/website/folder] -$cfg[ +$cfg[^config[ $.parser[\.(html)^$] $.index[index.html] # $.autoindex(true) $.404[$404] -# $.404[/_doc.html] +# $.404[/404.html] # $.fix-trailing-slash(true) # $.auth[ $.url[^^/\.?admin/] $.login[admin] $.password[change me] $.realm[site administration] ] $.deny[(/\.ht[^^/]+|\.p|\.cfg)^$] $.403[Permission denied] $.memory(64000) # $.log[/access.log] -] +]] $response:server[Parser$env:PARSER_VERSION] $response:date[^date::now[]] @@ -240,23 +256,27 @@ $uri[^string:unescape[uri;$uri; $.charse $basic[$cfg.auth.login:$cfg.auth.password] ^if($env:HTTP_AUTHORIZATION ne "Basic ^basic.base64[]"){ $response:WWW-Authenticate[Basic realm="$cfg.auth.realm"] - ^return[$response:status[401]] + $response:status[401] + ^return[Authorization Required] } $env:REMOTE_USER[$cfg.auth.login] } ^if(def $cfg.deny && ^uri.match[$cfg.deny]){ $response:status[403] - $result[^option[$cfg.403]] + ^return[^option[$cfg.403]] }(def $cfg.[fix-trailing-slash] && ^uri.match[^^[^^.]+[^^/.]^$]){ - $result[$response:location[$uri/^if(def $request:query){?^taint[as-is;$request:query]}]] -}(def $cfg.index && -f "$uri/$cfg.index"){ + ^return[$response:location[$uri/^if(def $request:query){?^taint[as-is;$request:query]}]] +} + +^preprocess{^return[]} + +^if(def $cfg.index && -f "$uri/$cfg.index"){ $result[^file[$uri/$cfg.index]] }($cfg.autoindex && -d "$uri"){ $result[^index[$uri]] }(-f $uri){ $result[^file[$uri]] }{ -# $form:request[^uri.mid(1)] $result[^option[$cfg.404]] }