Roxen.git / server / base_server / configuration.pike

version» Context lines:

Roxen.git/server/base_server/configuration.pike:921:    //    // foo.txt/..namedfork/data (same as foo.txt)    // foo.txt/..namedfork/rsrc (resource fork of foo.txt)    // foo.txt/rsrc (resource fork of foo.txt)    // .DS_Store (Finder info file with catalog data)    if (has_value(id->not_query, "..namedfork/") ||    has_suffix(id->not_query, "/rsrc") ||    has_value(lower_case(id->not_query), ".ds_store"))    // Skip elaborate error page since we get these e.g. for WebDAV    // mounts in OS X Finder. -  return Roxen.http_string_answer("No such file", "text/plain"); +  return Roxen.http_status(404, "No such file.");    }       array a = id->not_query/"::";    // FIX: Must not subtract ":" chars since it breaks proper URL:s,    // e.g. "/internal-roxen-colorbar:x,y,z" and several others.    // id->not_query = a[0]-":";    id->not_query = a[0];    id->misc->fork_information = a[1..];    return 0;   }
Roxen.git/server/base_server/configuration.pike:1508:    otomod[m], describe_backtrace(err));   }      // Returns tuple < image, mime-type >   protected array(string) draw_saturation_bar(int hue,int brightness, int where,    int small_version)   {    Image.Image bar =    small_version ? Image.Image(16, 128) : Image.Image(30, 256);    +  hue &= 0xff; +  brightness &= 0xff; +     for(int i=0;i<128;i++)    {    int j = i * 2;    array color = hsv_to_rgb(hue, 255 - j, brightness);    if (small_version) {    bar->line(0, i, 15, i, @color);    } else {    bar->line(0, j, 29, j, @color);    bar->line(0, j + 1,29, j + 1, @color);    }
Roxen.git/server/base_server/configuration.pike:2259:   #endif    PROF_ENTER(Roxen.get_owning_module(tmp[1])->module_name,"location");    TRACE_ENTER("Calling find_file()...", 0);    LOCK(tmp[1]);    fid=tmp[1]( file[ strlen(loc) .. ] + id->extra_extension, id);    UNLOCK();    TRACE_LEAVE("");    PROF_LEAVE(Roxen.get_owning_module(tmp[1])->module_name,"location");    if(fid)    { +  if (id)    id->virtfile = loc;       if(mappingp(fid))    {    TRACE_LEAVE(""); // Location module [...]    TRACE_LEAVE(examine_return_mapping(fid));    TIMER_END(location_modules);    return fid;    }    else
Roxen.git/server/base_server/configuration.pike:2514:    root_id->misc->_request_depth++;    if(sub_req_limit && root_id->misc->_request_depth > sub_req_limit)    error("Subrequest limit reached. (Possibly an insertion loop.)");       mapping|int res;    mapping res2;    function tmp;    res = low_get_file(id, no_magic);    TIMER_END(get_file);    +  // Note: id may be destructed at this point already (when the +  // request is handled asynchronously, +  // i.e. Roxen.http_pipe_in_progress() is returned, but +  // id->send_result() finishes in another thread before the calling +  // thread gets to this point.) +  if (id && (!mappingp (res) || !res->pipe)) {    // finally map all filter type modules.    // Filter modules are like TYPE_LAST modules, but they get called    // for _all_ files.    TIMER_START(filter_modules);    foreach(filter_module_cache||filter_modules(), tmp)    {    TRACE_ENTER("Filter module", tmp);    PROF_ENTER(Roxen.get_owning_module(tmp)->module_name,"filter");    if(res2=tmp(res,id))    {    if(mappingp(res) && res->file && (res2->file != res->file))    destruct(res->file);    TRACE_LEAVE("Rewrote result.");    res=res2;    } else    TRACE_LEAVE("");    PROF_LEAVE(Roxen.get_owning_module(tmp)->module_name,"filter");    }    TIMER_END(filter_modules); -  +  }    -  +  if (root_id)    root_id->misc->_request_depth--; -  +  +  if (id)    id->misc->internal_get = orig_internal_get; -  +     return res;   }      array(string) find_dir(string file, RequestID id, void|int(0..1) verbose)   {    array dir;    TRACE_ENTER(sprintf("List directory %O.", file), 0);       if(!sizeof (file) || file[0] != '/')    file = "/" + file;
Roxen.git/server/base_server/configuration.pike:2588: Inside #if defined(URL_MODULES)
   else    error("Too deep recursion in roxen::find_dir() while mapping "    +file+".\n");    };    id->misc->find_dir_nest = 0;    TRACE_LEAVE("");    if(err)    throw(err);    return dir;    } +  TRACE_LEAVE("");    id->not_query=of;    }   #endif /* URL_MODULES */       array | mapping d;    array(string) locks=({});    RoxenModule mod;    string loc;    foreach(location_modules(), array tmp)    {
Roxen.git/server/base_server/configuration.pike:5026:    <tr><td>nocache</td>    <td>No hit in any known cache, and not added to the HTTP    protocol cache.</td></tr>    </tbody></table></td></tr>      <tr><td>$eval-status</td>    <td>A comma separated list of words (containing no whitespace)    that describes how the page has been evaluated:       <table class='hilite-1stcol'><tbody valign='top'> +  <tr><td>bad-charset</td> +  <td>Detected invalid charset in declared content-type.</td></tr>    <tr><td>xslt</td>    <td>XSL transform.</td></tr>    <tr><td>rxmlsrc</td>    <td>RXML evaluated from source.</td></tr>    <tr><td>rxmlpcode</td>    <td>RXML evaluated from compiled p-code.</td></tr>    </tbody></table></td></tr>      <tr><td>$protcache-cost</td>    <td>The lookup depth in the HTTP protocol module low-level cache.</td></tr>
Roxen.git/server/base_server/configuration.pike:5109:    all crawled variants and the saving of the entry to the    database.</td></tr>    </tbody></table></dd>   </dl>"), 0, lambda(){ return !query("Log");});       // Make the widget above a bit larger.    getvar ("LogFormat")->rows = 20;    getvar ("LogFormat")->cols = 80;       // FIXME: Mention it is relative to getcwd(). Can not be localized in pike 7.0. -  defvar("LogFile", "$LOGDIR/"+Roxen.short_name(name)+"/Log", +  string log_suffix = ".%y-%m-%d"; +  if (name == "Administration Interface") log_suffix = ".%y-%m"; +  defvar("LogFile", "$LOGDIR/"+Roxen.short_name(name)+"/Log" + log_suffix,    DLOCALE(30, "Logging: Log file"), TYPE_FILE,    DLOCALE(31, "The log file. "    "A file name. Some substitutions will be done:"    "<pre>"    "%y Year (e.g. '1997')\n"    "%m Month (e.g. '08')\n"    "%d Date (e.g. '10' for the tenth)\n"    "%h Hour (e.g. '00')\n"    "%H Hostname\n"    "</pre>")    ,0, lambda(){ return !query("Log");});    -  defvar("LogFileCompressor", "", +  string default_compressor = ""; +  foreach(({ "/bin/bzip2", "/usr/bin/bzip2", "/bin/gzip", "/usr/bin/gzip", }), +  string bin) { +  if (Stdio.is_file(bin)) { +  default_compressor = bin; +  break; +  } +  } +  defvar("LogFileCompressor", default_compressor,    DLOCALE(258, "Logging: Compress log file"), TYPE_STRING,    DLOCALE(259, "Path to a program to compress log files, "    "e.g. <tt>/usr/bin/bzip2</tt> or <tt>/usr/bin/gzip</tt>. "    "<b>Note&nbsp;1:</b> The active log file is never compressed. "    "Log rotation needs to be used using the \"Log file\" "    "filename substitutions "    "(e.g. <tt>$LOGDIR/mysite/Log.%y-%m-%d</tt>). "    "<b>Note&nbsp;2:</b> Compression is limited to scanning files "    "with filename substitutions within a fixed directory (e.g. "    "<tt>$LOGDIR/mysite/Log.%y-%m-%d</tt>, "
Roxen.git/server/base_server/configuration.pike:5324:    ({ 1 }) * sizeof(exact_mimes));    http_compr_main_mimes = mkmapping(main_mimes,    ({ 1 }) * sizeof(main_mimes));    };    defvar("http_compression_mimetypes",    ({ "text/*",    "application/javascript",    "application/x-javascript",    "application/json",    "application/xhtml+xml", +  "image/x-icon",    "image/svg+xml" }),    DLOCALE(1002, "Compression: Enabled MIME-types"),    TYPE_STRING_LIST,    DLOCALE(1003, "The MIME types for which to enable compression. The "    "forms \"maintype/*\" and \"maintype/subtype\" are allowed, "    "but globbing on the general form (such as "    "\"maintype/*subtype\" or \"maintype/sub*\") is not allowed "    "and such globs will be silently ignored."))    ->add_changed_callback(lambda(object v)    { set_mimetypes(v->query());
Roxen.git/server/base_server/configuration.pike:5423:    </if>    </emit>    </if>   </emit>   </nooutput><if variable='var.errfile'><eval><insert file='&var.errfile;?orig-url=&page.url:url;&amp;orig-file=&page.virtfile:url;'/></eval></if><else><eval>&modvar.site.404-message:none;</eval></else>", 0, 0, 0 );    }    };       defvar("ZNoSuchFile", NoSuchFileOverride() );    -  defvar("404-message", #"<html> +  defvar("404-message", #"<!DOCTYPE html> + <html>    <head>    <title>404 - Page Not Found</title> -  +  <meta name='viewport' content='width=device-width, initial-scale=1'>    <style> -  .msg { font-family: verdana, helvetica, arial, sans-serif; -  font-size: 12px; -  line-height: 160% } -  .url { font-family: georgia, times, serif; -  font-size: 18px; -  padding-top: 6px; -  padding-bottom: 20px } -  .info { font-family: verdana, helvetica, arial, sans-serif; -  font-size: 10px; -  color: #999999 } +  body { +  background: #f2f1eb; +  color: #000; +  margin: 0 0 49px; +  padding: 30px 30px 0; +  font-family: Verdana, Helvetica, Arial, sans-serif; +  font-size: 12px; +  line-height: 160%; +  } +  html { position: relative; min-height: 100%; } +  a { color: #2331d1; } +  .number { float: left; margin-right: 30px; } +  .header { display: block; margin: 34px 0 30px; max-width: 100%; height: auto; } +  .main { float: left; width: 387px; max-width: 100%; } +  .url { display: block; font-family: Georgia, Times, serif; font-size: 18px; font-weight: normal; margin: 6px 0 20px; } +  .separator { color: #ffbe00; } +  .footer { position: absolute; bottom: 0; height: 49px; } +  .footer img { vertical-align: middle; margin-right: 3px; } +  .info { font-size: 10px; color: #999; }    </style>    </head> - <body bgcolor='#f2f1eb' vlink='#2331d1' alink='#f6f6ff' -  leftmargin='0' rightmargin='0' topmargin='0' bottommargin='0' -  style='margin: 0; padding: 0'> -  - <table border='0' cellspacing='0' cellpadding='0' height='99%'> -  <colgroup> -  <col span='3' /> -  <col width='356' /> -  <col width='0*' /> -  </colgroup> -  <tr> -  <td><img src='/internal-roxen-unit' height='30' /></td> -  </tr><tr> -  <td></td> -  <td><img src='/internal-roxen-404' /></td> -  <td><img src='/internal-roxen-unit' width='30' /></td> -  <td valign='bottom'><img src='/internal-roxen-page-not-found-2' /></td> -  <td></td> -  </tr><tr> -  <td><img src='/internal-roxen-unit' height='30' /></td> -  </tr><tr> -  <td colspan='3'></td> -  <td colspan='2'> -  <div class='msg'>Unable to retrieve</div> -  <div class='url'>&page.virtfile;</div> -  </td> -  </tr><tr> -  <td colspan='3'></td> -  <td width='356'> -  <div class='msg'> -  If you feel this is a configuration error, please contact +  <body> +  <img src='/internal-roxen-404' class='number' alt='404' width='142' height='57'/> +  <div class='main'> +  <img src='/internal-roxen-page-not-found-2' class='header' alt='Page Not Found' width='356' height='23'/> +  <p>Unable to retrieve <b class='url'>&page.virtfile;</b></p> +  <p>If you feel this is a configuration error, please contact    the administrators of this server or the author of the -  <if referrer=''> -  <a href='&client.referrer;'>referring page</a>. -  </if><else> -  referring page. -  </else> -  </div> -  </td> -  <td>&nbsp;</td> -  </tr><tr valign='bottom' height='100%'> -  <td colspan='3'></td> -  <td> -  <img src='/internal-roxen-unit' height='20' /> -  <table border='0' cellspacing='0' cellpadding='0'> -  <tr> -  <td><img src='/internal-roxen-roxen-mini.gif' /></td> -  <td class='info'> -  &nbsp;&nbsp;<b>&roxen.product-name;</b> <font color='#ffbe00'>|</font> +  <if referrer=''><a href='&client.referrer;'>referring page</a>.</if> +  <else>referring page.</else> +  </p> +  <div class='footer'> +  <img src='/internal-roxen-roxen-mini.gif' width='19' height='15'/> +  <span class='info'> +  <strong>&roxen.product-name;</strong> <span class='separator'>|</span>    version &roxen.dist-version; -  </td> -  </tr> -  </table> -  <img src='/internal-roxen-unit' height='15' /> -  </td> -  <td></td> -  </tr> - </table> -  +  </span> +  </div> +  </div> +  <br clear='all'/>    </body> - </html>", + </html> + ",    DLOCALE(58, "No such file message"),    TYPE_TEXT_FIELD|VAR_PUBLIC,    DLOCALE(59, "What to return when there is no resource or file "    "available at a certain location."));          class AuthFailedOverride    {    // compatibility with old config-files.    inherit Variable.Variable;
Roxen.git/server/base_server/configuration.pike:5545:    </if>    </emit>    </if>   </emit>   </nooutput><if variable='var.errfile'><eval><insert file='&var.errfile;?orig-url=&page.url:url;&amp;orig-file=&page.virtfile:url;'/></eval></if><else><eval>&modvar.site.401-message:none;</eval></else>", 0, 0, 0 );    }    };       defvar("ZAuthFailed", AuthFailedOverride() );    -  defvar("401-message", #"<html> +  defvar("401-message", #"<!DOCTYPE html> + <html>    <head>    <title>401 - Authentication Failed</title> -  +  <meta name='viewport' content='width=device-width, initial-scale=1'>    <style> -  .msg { font-family: verdana, helvetica, arial, sans-serif; -  font-size: 12px; -  line-height: 160% } -  .url { font-family: georgia, times, serif; -  font-size: 18px; -  padding-top: 6px; -  padding-bottom: 20px } -  .info { font-family: verdana, helvetica, arial, sans-serif; -  font-size: 10px; -  color: #999999 } +  body { +  background: #f2f1eb; +  color: #000; +  margin: 0 0 49px; +  padding: 30px 30px 0; +  font-family: Verdana, Helvetica, Arial, sans-serif; +  font-size: 12px; +  line-height: 160%; +  } +  html { position: relative; min-height: 100%; } +  a { color: #2331d1; } +  .number { float: left; margin-right: 30px; } +  .header { display: block; margin: 34px 0 30px; max-width: 100%; height: auto; } +  .main { float: left; width: 387px; max-width: 100%; } +  .url { display: block; font-family: Georgia, Times, serif; font-size: 18px; font-weight: normal; margin: 6px 0 20px; } +  .separator { color: #ffbe00; } +  .footer { position: absolute; bottom: 0; height: 49px; } +  .footer img { vertical-align: middle; margin-right: 3px; } +  .info { font-size: 10px; color: #999; }    </style>    </head> - <body bgcolor='#f2f1eb' vlink='#2331d1' alink='#f6f6ff' -  leftmargin='0' rightmargin='0' topmargin='0' bottommargin='0' -  style='margin: 0; padding: 0'> -  - <table border='0' cellspacing='0' cellpadding='0' height='99%'> -  <colgroup> -  <col span='3' /> -  <col width='356' /> -  <col width='0*' /> -  </colgroup> -  <tr> -  <td><img src='/internal-roxen-unit' height='30' /></td> -  </tr><tr> -  <td></td> -  <td><img src='/internal-roxen-401' /></td> -  <td><img src='/internal-roxen-unit' width='30' /></td> -  <td valign='bottom'><img src='/internal-roxen-authentication-failed' /></td> -  <td></td> -  </tr><tr> -  <td><img src='/internal-roxen-unit' height='30' /></td> -  </tr><tr> -  <td colspan='3'></td> -  <td colspan='2'> -  <div class='msg'>Unable to retrieve</div> -  <div class='url'>&page.virtfile;</div> -  </td> -  </tr><tr> -  <td colspan='3'></td> -  <td width='356'> -  <div class='msg'> -  If you feel this is a configuration error, please contact +  <body> +  <img src='/internal-roxen-401' class='number' alt='401' width='142' height='57'/> +  <div class='main'> +  <img src='/internal-roxen-authentication-failed' class='header' alt='Authentication Failed' width='387' height='23'/> +  <p>Unable to retrieve <b class='url'>&page.virtfile;</b></p> +  <p>If you feel this is a configuration error, please contact    the administrators of this server or the author of the -  <if referrer=''> -  <a href='&client.referrer;'>referring page</a>. -  </if><else> -  referring page. -  </else> -  </div> -  </td> -  <td>&nbsp;</td> -  </tr><tr valign='bottom' height='100%'> -  <td colspan='3'></td> -  <td> -  <img src='/internal-roxen-unit' height='20' /> -  <table border='0' cellspacing='0' cellpadding='0'> -  <tr> -  <td><img src='/internal-roxen-roxen-mini.gif' /></td> -  <td class='info'> -  &nbsp;&nbsp;<b>&roxen.product-name;</b> <font color='#ffbe00'>|</font> +  <if referrer=''><a href='&client.referrer;'>referring page</a>.</if> +  <else>referring page.</else> +  </p> +  <div class='footer'> +  <img src='/internal-roxen-roxen-mini.gif' width='19' height='15'/> +  <span class='info'> +  <strong>&roxen.product-name;</strong> <span class='separator'>|</span>    version &roxen.dist-version; -  </td> -  </tr> -  </table> -  <img src='/internal-roxen-unit' height='15' /> -  </td> -  <td></td> -  </tr> - </table> -  +  </span> +  </div> +  </div> +  <br clear='all'/>    </body> - </html>", + </html> + ",    DLOCALE(413, "Authentication failed message"),    TYPE_TEXT_FIELD|VAR_PUBLIC,    DLOCALE(420, "What to return when an authentication attempt failed."));       if (!retrieve ("EnabledModules", this)["config_filesystem#0"]) {    // Do not use a handler queue timeout of the administration    // interface. You most probably don't want to get a 503 in your    // face when you're trying to reconfigure an overloaded server... -  defvar("503-message", #"<html> +  defvar("503-message", #"<!DOCTYPE html> + <html>    <head>    <title>503 - Server Too Busy</title> -  +  <meta name='viewport' content='width=device-width, initial-scale=1'>    <style> -  .header { font-family: arial; -  font-size: 20px; -  line-height: 160% } -  .msg { font-family: verdana, helvetica, arial, sans-serif; -  font-size: 12px; -  line-height: 160% } -  .url { font-family: georgia, times, serif; -  font-size: 18px; -  padding-top: 6px; -  padding-bottom: 20px } -  .info { font-family: verdana, helvetica, arial, sans-serif; -  font-size: 10px; -  color: #999999 } +  body { +  background: #f2f1eb; +  color: #000; +  margin: 0 0 49px; +  padding: 30px 30px 0; +  font-family: Verdana, Helvetica, Arial, sans-serif; +  font-size: 12px; +  line-height: 160%; +  } +  html { position: relative; min-height: 100%; } +  .header { font-size: 20px } +  .main { width: 387px; max-width: 100%; } +  .url { display: block; font-family: Georgia, Times, serif; font-size: 18px; font-weight: normal; margin: 6px 0 20px; } +  .separator { color: #ffbe00; } +  .footer { position: absolute; bottom: 0; height: 49px; } +  .info { font-size: 10px; color: #999; }    </style>    </head> - <body bgcolor='#f2f1eb' vlink='#2331d1' alink='#f6f6ff' -  leftmargin='50' rightmargin='0' topmargin='50' bottommargin='0' -  style='margin: 0; padding: 0'> -  - <table border='0' cellspacing='0' cellpadding='0' height='99%'> -  <colgroup> -  <col span='3' /> -  <col width='356' /> -  <col width='0*' /> -  </colgroup> -  <tr><td height='50'></td></tr> -  <tr> -  <td width='100'></td> -  <td> +  <body> +  <div class='main'>    <div class='header'>503 &mdash; Server Too Busy</div> -  </td> -  </tr> -  <tr> -  <td></td> -  <td> -  <div class='msg'>Unable to retrieve</div> -  <div class='url'>&page.virtfile;</div> -  </td> -  </tr> -  <tr> -  <td></td> -  <td> -  <div class='msg'> -  The server is currently too busy to serve your request. Please try again in a few moments. -  </div> -  </td> -  <td>&nbsp;</td> -  </tr> -  <tr valign='bottom' height='100%'> -  <td></td> -  <td> -  <table border='0' cellspacing='0' cellpadding='0'> -  <tr> -  <td class='info'> -  &nbsp;&nbsp;<b>&roxen.product-name;</b> <font color='#ffbe00'>|</font> +  <p>Unable to retrieve <b class='url'>&page.virtfile;</b></p> +  <p>The server is currently too busy to serve your request. +  Please try again in a few moments. +  </p> +  <div class='footer'> +  <span class='info'> +  <strong>&roxen.product-name;</strong> <span class='separator'>|</span>    version &roxen.dist-version; -  </td> -  </tr> -  </table> -  </td> -  <td></td> -  </tr> - </table> -  +  </span> +  </div> +  </div> +  <br clear='all'/>    </body> - </html>", + </html> + ",    DLOCALE(1048, "Server too busy message"),    TYPE_TEXT_FIELD|VAR_PUBLIC,    DLOCALE(1049, "What to return if the server is too busy. See also "    "\"Handler queue timeout\"."));       defvar("handler_queue_timeout", 30,    DLOCALE(1050, "Handler queue timeout"),    TYPE_INT,    DLOCALE(1051, #"Requests that have been waiting this many seconds on   the handler queue will not be processed. Instead, a 503 error code and the