#$Id: auto.p.in,v 1.19 2025/08/16 14:34:25 moko Exp $ @auto[] #source/client charsets $request:charset[utf-8] $response:charset[utf-8] $response:content-type[ $.value[text/html] $.charset[$response:charset] ] #$SQL.connect-string[mysql://user:pass@host/db?charset=utf8] #$SQL.connect-string[sqlite://db] #$SQL.connect-string[pgsql://user:pass@host/db] #$SQL.connect-string[odbc://DSN=datasource^;UID=user^;PWD=password] @conf[filespec] $confdir[^file:dirname[$filespec]] $charsetsdir[@datarootdir@/charsets] $sqldriversdir[@libdir@] $CHARSETS[ # $.cp866[$charsetsdir/cp866.cfg] # $.koi8-r[$charsetsdir/koi8-r.cfg] # $.koi8-u[$charsetsdir/koi8-u.cfg] # $.windows-1250[$charsetsdir/windows-1250.cfg] # $.windows-1251[$charsetsdir/windows-1251.cfg] # $.windows-1254[$charsetsdir/windows-1254.cfg] # $.windows-1257[$charsetsdir/windows-1257.cfg] # $.x-mac-cyrillic[$charsetsdir/x-mac-cyrillic.cfg] ] #change your client libraries paths to those on your system $SQL[ $.drivers[^table::create{protocol driver client mysql $sqldriversdir/libparser3mysql.@dll_extension@ libmysqlclient.@dll_extension@ #sqlite $sqldriversdir/libparser3sqlite.@dll_extension@ libsqlite3.@dll_extension@ #pgsql $sqldriversdir/libparser3pgsql.@dll_extension@ libpq.@dll_extension@ #oracle $sqldriversdir/libparser3oracle.@dll_extension@ libclntsh.@dll_extension@ }] ] #for ^file::load[name;user-name] mime-type autodetection $MIME-TYPES[^table::create{ext mime-type 7z application/x-7z-compressed avi video/x-msvideo bmp image/bmp css text/css cvs text/csv doc application/msword docx application/vnd.openxmlformats-officedocument.wordprocessingml.document dtd application/xml-dtd gif image/gif gz application/x-gzip htm text/html html text/html ico image/x-icon jpeg image/jpeg jpg image/jpeg js application/javascript json application/json log text/plain mov video/quicktime mp3 audio/mpeg mp4 video/mp4 mpg video/mpeg mpeg video/mpeg mts application/metastream otf font/otf pdf application/pdf png image/png ppt application/powerpoint rar application/vnd.rar rdf application/rdf+xml rss application/rss+xml rtf application/rtf svg image/svg+xml tar application/x-tar tgz application/x-gzip tif image/tiff tiff image/tiff ttf font/ttf txt text/plain wav audio/x-wav xls application/vnd.ms-excel xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xml text/xml xsl text/xml webm video/webm webp image/webp woff font/woff woff2 font/woff2 zip application/zip }] $LIMITS[ $.post_max_size(64*0x400*0x400) # $.max_file_size(512*0x400*0x400) # $.max_loop(100000) # $.max_array_size(1000000) # $.max_recursion(1000) ] #$HTTPD[ # $.mode[threaded] #] #$MAIL[ # $.SMTP[localhost] #] @fatal_error[title;subtitle;body] $response:status(500) $response:content-type[ $.value[text/html] $.charset[$response:charset] ]
^untaint[html]{$exception.comment}
^if(def $exception.file){
^untaint[html]{$exception.file^(${exception.lineno}:$exception.colno^)}
}
^if($stack){
| $stack.name | $stack.file^(${stack.lineno}:$stack.colno^) |
The server encountered an unhandled exception and was unable to complete your request.
Please contact the server administrator, $env:SERVER_ADMIN and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the Parser error log or in debug version of unhandled_exception.
] @is_developer[] #change mask to your ip address $result(def $env:REMOTE_ADDR && ^env:REMOTE_ADDR.match[^^127\.0\.0\.1^$]) @unhandled_exception[exception;stack] #developer? use debug version to see problem details ^if(^is_developer[]){ ^unhandled_exception_debug[$exception;$stack] }{ ^if($exception.type eq "file.missing"){ # $response:location[/404/] ^httpd:404[] }{ ^unhandled_exception_release[$exception;$stack] } } @CLASS httpd @OPTIONS partial @auto[] ^if(-f "/httpd.p"){ ^use[/httpd.p] } @include[filename] ^use[$filename; $.main(true) ] ^MAIN:main[] @index[dir][list] ^fatal_error[Index of $dir;Index of $dir; $list[^file:list[$dir]] ^list.sort{^if($list.dir)[0;1] $list.name} ^list.menu{ ^if($list.dir){/}$list.name