Roxen.git / server / base_server / configuration.pike

version» Context lines:

Roxen.git/server/base_server/configuration.pike:1:   // A vitual server's main configuration   // Copyright © 1996 - 2000, Roxen IS.   //   // German translation by Kai Voigt    - constant cvs_version = "$Id: configuration.pike,v 1.323 2000/07/15 02:27:41 lange Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.324 2000/07/17 16:55:47 lange Exp $";   constant is_configuration = 1;   #include <module.h>   #include <module_constants.h>   #include <roxen.h>   #include <request_trace.h>      inherit "basic_defvar";      mapping enabled_modules = ([]);   mapping(string:array(int)) error_log=([]);      #ifdef PROFILE   mapping profile_map = ([]);   #endif      #define CATCH(P,X) do{mixed e;if(e=catch{X;})report_error("While "+P+"\n"+describe_backtrace(e));}while(0)      // Locale support...   //<locale-token project="config_interface">LOCALE</locale-token> -  + //<locale-token project="config_interface">DLOCALE</locale-token>   #define LOCALE(X,Y) _STR_LOCALE("config_interface",X,Y)   USE_DEFERRED_LOCALE;   #define DLOCALE(X,Y) _DEF_LOCALE("config_interface",X,Y)   #define CALL(X,Y) _LOCALE_FUN("config_interface",X,Y)      #ifdef THROTTLING_DEBUG   #undef THROTTLING_DEBUG   #define THROTTLING_DEBUG(X) werror("Throttling: "+X+"\n")   #else   #define THROTTLING_DEBUG(X)
Roxen.git/server/base_server/configuration.pike:2364:       module_type = moduleinfo->type;    if (module_type & (MODULE_LOCATION|MODULE_EXTENSION|    MODULE_CONFIG|MODULE_FILE_EXTENSION|MODULE_LOGGER|    MODULE_URL|MODULE_LAST|MODULE_PROVIDER|    MODULE_FILTER|MODULE_PARSER|MODULE_FIRST))    {    if(module_type != MODULE_CONFIG)    {    if (err = catch { -  me->defvar("_priority", 5, DLOCALE("", "Priority"), TYPE_INT_LIST, -  DLOCALE("", "The priority of the module. 9 is highest and 0 is lowest." +  me->defvar("_priority", 5, DLOCALE("bH", "Priority"), TYPE_INT_LIST, +  DLOCALE("bI", "The priority of the module. 9 is highest and 0 is lowest."    " Modules with the same priority can be assumed to be "    "called in random order"),    ({0, 1, 2, 3, 4, 5, 6, 7, 8, 9}));    }) {    throw(err);    }    }       if(module_type != MODULE_LOGGER && module_type != MODULE_PROVIDER)    {    if(!(module_type & MODULE_PROXY))    { -  me->defvar("_sec_group", "user", DLOCALE("", "Security: Realm"), TYPE_STRING, -  DLOCALE("", "The realm to use when requesting password from the " +  me->defvar("_sec_group", "user", DLOCALE("bJ", "Security: Realm"), TYPE_STRING, +  DLOCALE("bK", "The realm to use when requesting password from the "    "client. Usually used as an informative message to the "    "user."));    -  me->defvar("_seclvl", 0, DLOCALE("", "Security: Security level"), TYPE_INT, -  DLOCALE("", "The modules security level is used to determine if a " +  me->defvar("_seclvl", 0, DLOCALE("bL", "Security: Security level"), TYPE_INT, +  DLOCALE("bM", "The modules security level is used to determine if a "    " request should be handled by the module."    "\n<p><h2>Security level vs Trust level</h2>"    " Each module has a configurable <i>security level</i>."    " Each request has an assigned trust level. Higher"    " <i>trust levels</i> grants access to modules with higher"    " <i>security levels</i>."    "\n<p><h2>Definitions</h2><ul>"    " <li>A requests initial Trust level is infinitely high.</li>"    " <li> A request will only be handled by a module if its"    " <i>trust level</i> is higher or equal to the"
Roxen.git/server/base_server/configuration.pike:2417:    "\n<p>A request handled by \"User filesystem\" is assigned"    " a <i>trust level</i> of one after the <i>security"    " level</i> of that module. That request can then not be"    " handled by the \"CGI module\" since that module has a"    " higher <i>security level</i> than the requests trust"    " level.</p>"    "\n<p>On the other hand, a request handled by the the"    " \"Filsystem module\" could later be handled by the"    " \"CGI module\".</p>"));    -  me->defvar("_seclevels", "", DLOCALE("", "Security: Patterns"), TYPE_TEXT_FIELD, -  DLOCALE("", "This is the 'security level=value' list.<br />" +  me->defvar("_seclevels", "", DLOCALE("bN", "Security: Patterns"), TYPE_TEXT_FIELD, +  DLOCALE("bP", "This is the 'security level=value' list.<br />"    "Each security level can be any or more from this list:"    "<hr noshade=\"noshade\" />"    "allow ip=<i>IP</i>/<i>bits</i><br />"    "allow ip=<i>IP</i>:<i>mask</i><br />"    "allow ip=<i>pattern</i><br />"    "allow user=<i>username</i>,...<br />"    "deny ip=<i>IP</i>/<i>bits</i><br />"    "deny ip=<i>IP</i>:<i>mask</i><br />"    "deny ip=<i>pattern</i><br />"    "<hr noshade=\"noshade\" />"    "In patterns: * matches one or more characters, "    "and ? matches one character."    "<p>In username: 'any' stands for any valid account "    "(from .htaccess"    " or an auth module. The default (used when _no_ "    "entries are present) is 'allow ip=*', allowing"    " everyone to access the module.</p>"));    } else {    me->definvisvar("_seclvl", -10, TYPE_INT); /* A very low one */    -  me->defvar("_sec_group", "user", DLOCALE("", "Security: Realm"), TYPE_STRING, -  DLOCALE("", "The realm to use when requesting password from the " +  me->defvar("_sec_group", "user", DLOCALE("bJ", "Security: Realm"), TYPE_STRING, +  DLOCALE("bK", "The realm to use when requesting password from the "    "client. Usually used as an informative message to the "    "user."));    -  me->defvar("_seclevels", "", DLOCALE("", "Security: Patterns"), +  me->defvar("_seclevels", "", DLOCALE("bN", "Security: Patterns"),    TYPE_TEXT_FIELD, -  DLOCALE("", "This is the 'security level=value' list.<br />" +  DLOCALE("bQ", "This is the 'security level=value' list.<br />"    "Each security level can be any or more from "    "this list:<br />"    "<hr noshade=\"noshade\" />"    "allow ip=pattern<br />"    "allow user=username,...<br />"    "deny ip=pattern<br />"    "<hr noshade=\"noshade\" />"    "In patterns: * is on or more characters, ? is one "    " character."    "<p>In username: 'any' stands for any valid account"
Roxen.git/server/base_server/configuration.pike:2950:       inited = 1;    report_notice(LOCALE("F", "All modules for %s enabled in %3.1f seconds\n\n"),    query_name(),(gethrtime()-start_time)/1000000.0);   }      void create(string config)   {    name=config;    -  defvar("default_server", 0, DLOCALE("", "Default site"), +  defvar("default_server", 0, DLOCALE("bR", "Default site"),    TYPE_FLAG, -  DLOCALE("", "If true, this site will be selected in preference of " +  DLOCALE("bS", "If true, this site will be selected in preference of "    "other sites when virtual hosting is used and no host "    "header is supplied, or the supplied host header does not "    "match the address of any of the other servers.") );    -  defvar("comment", "", DLOCALE("", "Virtual server comment"), +  defvar("comment", "", DLOCALE("bT", "Virtual server comment"),    TYPE_TEXT_FIELD|VAR_MORE, -  DLOCALE("", "This text will be visible in the administration " +  DLOCALE("bU", "This text will be visible in the administration "    "interface, it can be quite useful to use as a memory helper."));    -  defvar("name", "", DLOCALE("", "Virtual server name"), +  defvar("name", "", DLOCALE("bV", "Virtual server name"),    TYPE_STRING|VAR_MORE, -  DLOCALE("", "This is the name that will be used in the configuration " +  DLOCALE("bW", "This is the name that will be used in the configuration "    "interface. If this is left empty, the actual name of the "    "virtual server will be used."));       defvar("LogFormat",    "404: $host $referer - [$cern_date] \"$method $resource $protocol\" 404 -\n"    "500: $host $referer ERROR [$cern_date] \"$method $resource $protocol\" 500 -\n"    "*: $host - - [$cern_date] \"$method $resource $protocol\" $response $length", -  DLOCALE("", "Logging: Format"), +  DLOCALE("bX", "Logging: Format"),    TYPE_TEXT_FIELD|VAR_MORE, -  DLOCALE("", "What format to use for logging. The syntax is:\n" +  DLOCALE("bY", "What format to use for logging. The syntax is:\n"    "<pre>"    "response-code or *: Log format for that response code\n\n"    "Log format is normal characters, or one or more of the "    "variables below:\n"    "\n"    "\\n \\t \\r -- As in C, newline, tab and linefeed\n"    "$char(int) -- Insert the (1 byte) character specified by the integer.\n"    "$wchar(int) -- Insert the (2 byte) word specified by the integer.\n"    "$int(int) -- Insert the (4 byte) word specified by the integer.\n"    "$^ -- Supress newline at the end of the logentry\n"
Roxen.git/server/base_server/configuration.pike:3008:    "$length -- The length of the data section of the reply\n"    "$bin-length -- Same, but as an 32 bit integer in network byteorder\n"    "$request-time -- The time the request took (seconds)\n"    "$referer -- the header 'referer' from the request, or '-'.\n"    "$user_agent -- the header 'User-Agent' from the request, or '-'.\n\n"    "$user -- the name of the auth user used, if any\n"    "$user_id -- A unique user ID, if cookies are supported,\n"    " by the client, otherwise '0'\n"    "</pre>"), 0, lambda(){ return !query("Log");});    -  defvar("Log", 1, DLOCALE("", "Logging: Enabled"), -  TYPE_FLAG, DLOCALE("", "Log requests")); +  defvar("Log", 1, DLOCALE("bZ", "Logging: Enabled"), +  TYPE_FLAG, DLOCALE("b0", "Log requests"));       // FIXME: Mention it is relative to getcwd(). Can not be localized in pike 7.0.    defvar("LogFile", "$LOGDIR/"+Roxen.short_name(name)+"/Log", -  DLOCALE("", "Logging: Log file"), TYPE_FILE, -  DLOCALE("", "The log file. " +  DLOCALE("b1", "Logging: Log file"), TYPE_FILE, +  DLOCALE("b2", "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("NoLog", ({ }), -  DLOCALE("", "Logging: No Logging for"), TYPE_STRING_LIST|VAR_MORE, -  DLOCALE("", "Don't log requests from hosts with an IP number which " +  DLOCALE("b3", "Logging: No Logging for"), TYPE_STRING_LIST|VAR_MORE, +  DLOCALE("b4", "Don't log requests from hosts with an IP number which "    "matches any of the patterns in this list. This also affects "    "the access counter log."),    0, lambda(){ return !query("Log");});    -  defvar("Domain", roxen->get_domain(), DLOCALE("", "Domain"), TYPE_STRING, -  DLOCALE("", "The domainname of the server. The domainname is used " +  defvar("Domain", roxen->get_domain(), DLOCALE("b5", "Domain"), TYPE_STRING, +  DLOCALE("b6", "The domainname of the server. The domainname is used "    "to generate default URLs, and to generate email addresses."));       defvar("MyWorldLocation", "http://"+gethostname()+"/", -  DLOCALE("", "Primary Server URL"), TYPE_URL, -  DLOCALE("", "This is the main server URL, where your start page is " +  DLOCALE("b7", "Primary Server URL"), TYPE_URL, +  DLOCALE("b8", "This is the main server URL, where your start page is "    "located. Please note that you also have to configure the "    "'URLs' variable."));       defvar("URLs",    Variable.PortList( ({"http://*/"}), VAR_INITIAL, -  DLOCALE("", "URLs"), -  DLOCALE("", "Bind to these URLs. You can use '*' and '?' to perform" +  DLOCALE("b9", "URLs"), +  DLOCALE("ca", "Bind to these URLs. You can use '*' and '?' to perform"    " globbing (using any of these will default to binding to "    "all IP-numbers on your machine). The possible protocols "    "are http, fhttp (a faster version of the normal HTTP "    "protocol, but not 100% compatible with all modules) "    "https, ftp, ftps, gopher and tetris.")));       defvar("InternalLoc", "/_internal/", -  DLOCALE("", "Internal module resource mountpoint"), +  DLOCALE("cb", "Internal module resource mountpoint"),    TYPE_LOCATION|VAR_MORE|VAR_DEVELOPER, -  DLOCALE("", "Some modules may want to create links to internal " +  DLOCALE("cc", "Some modules may want to create links to internal "    "resources. This setting configures an internally handled "    "location that can be used for such purposes. Simply select "    "a location that you are not likely to use for regular "    "resources."));          // Throttling-related variables       defvar("throttle", 0, -  DLOCALE("", "Bandwidth Throttling: Server: Enabled"),TYPE_FLAG, -  DLOCALE("", "If set, per-server bandwidth throttling will be enabled. " +  DLOCALE("cd", "Bandwidth Throttling: Server: Enabled"),TYPE_FLAG, +  DLOCALE("ce", "If set, per-server bandwidth throttling will be enabled. "    "It will allow you to limit the total available bandwidth for "    "this Virtual Server.<br />Bandwidth is assigned using a Token Bucket. "    "The principle under which it works is: for each byte we send we use a token. "    "Tokens are added to a repository at a constant rate. When there's not enough, "    "we can't transmit. When there's too many, they \"spill\" and are lost."));    //TODO: move this explanation somewhere on the website and just put a link.       defvar("throttle_fill_rate", 102400, -  DLOCALE("", "Bandwidth Throttling: Server: Average available bandwidth"), +  DLOCALE("cf", "Bandwidth Throttling: Server: Average available bandwidth"),    TYPE_INT, -  DLOCALE("", "This is the average bandwidth available to this Virtual Server in " +  DLOCALE("cg", "This is the average bandwidth available to this Virtual Server in "    "bytes/sec (the bucket \"fill rate\")."),    0, arent_we_throttling_server);       defvar("throttle_bucket_depth", 1024000, -  DLOCALE("", "Bandwidth Throttling: Server: Bucket Depth"), TYPE_INT, -  DLOCALE("", "This is the maximum depth of the bucket. After a long enough period " +  DLOCALE("ch", "Bandwidth Throttling: Server: Bucket Depth"), TYPE_INT, +  DLOCALE("ci", "This is the maximum depth of the bucket. After a long enough period "    "of inactivity, a request will get this many unthrottled bytes of data, before "    "throttling kicks back in.<br>Set equal to the Fill Rate in order not to allow "    "any data bursts. This value determines the length of the time over which the "    "bandwidth is averaged."), 0, arent_we_throttling_server);       defvar("throttle_min_grant", 1300, -  DLOCALE("", "Bandwidth Throttling: Server: Minimum Grant"), TYPE_INT, -  DLOCALE("", "When the bandwidth availability is below this value, connections will " +  DLOCALE("cj", "Bandwidth Throttling: Server: Minimum Grant"), TYPE_INT, +  DLOCALE("ck", "When the bandwidth availability is below this value, connections will "    "be delayed rather than granted minimal amounts of bandwidth. The purpose "    "is to avoid sending too small packets (which would increase the IP overhead)."),    0, arent_we_throttling_server);       defvar("throttle_max_grant", 14900, -  DLOCALE("", "Bandwidth Throttling: Server: Maximum Grant"), TYPE_INT, -  DLOCALE("", "This is the maximum number of bytes assigned in a single request " +  DLOCALE("cm", "Bandwidth Throttling: Server: Maximum Grant"), TYPE_INT, +  DLOCALE("cn", "This is the maximum number of bytes assigned in a single request "    "to a connection. Keeping this number low will share bandwidth more evenly "    "among the pending connections, but keeping it too low will increase IP "    "overhead and (marginally) CPU usage. You'll want to set it just a tiny "    "bit lower than any integer multiple of your network's MTU (typically 1500 "    "for ethernet)."), 0, arent_we_throttling_server);       defvar("req_throttle", 0, -  DLOCALE("", "Bandwidth Throttling: Request: Enabled"), TYPE_FLAG, -  DLOCALE("", "If set, per-request bandwidth throttling will be enabled.") +  DLOCALE("co", "Bandwidth Throttling: Request: Enabled"), TYPE_FLAG, +  DLOCALE("cp", "If set, per-request bandwidth throttling will be enabled.")    );       defvar("req_throttle_min", 1024, -  DLOCALE("", "Bandwidth Throttling: Request: Minimum guarranteed bandwidth"), +  DLOCALE("cq", "Bandwidth Throttling: Request: Minimum guarranteed bandwidth"),    TYPE_INT, -  DLOCALE("", "The maximum bandwidth each connection (in bytes/sec) can use is determined " +  DLOCALE("cr", "The maximum bandwidth each connection (in bytes/sec) can use is determined "    "combining a number of modules. But doing so can lead to too small "    "or even negative bandwidths for particularly unlucky requests. This variable "    "guarantees a minimum bandwidth for each request."),    0, arent_we_throttling_request);       defvar("req_throttle_depth_mult", 60.0, -  DLOCALE("", "Bandwidth Throttling: Request: Bucket Depth Multiplier"), +  DLOCALE("cs", "Bandwidth Throttling: Request: Bucket Depth Multiplier"),    TYPE_FLOAT, -  DLOCALE("", "The average bandwidth available for each request will be determined by " +  DLOCALE("ct", "The average bandwidth available for each request will be determined by "    "the modules combination. The bucket depth will be determined multiplying "    "the rate by this factor."),    0, arent_we_throttling_request);       defvar("ZNoSuchFile", #"   <html><head>   <title>404 - Page not found</title>   </head>      <body alink=\"#000000\" bgcolor=\"#ffffff\" bottommargin=\"0\" leftmargin=\"0\" link=\"#ce5c00\" marginheight=\"2\" marginwidth=\"0\" rightmargin=\"0\" text=\"#333333\" topmargin=\"2\" vlink=\"#ce5c00\">
Roxen.git/server/base_server/configuration.pike:3165:   <a href=\"&client.referrer;\">referring</a>   </if><else>   referring   </else>   page.      </blockquote>   </font>   </body>   ", -  DLOCALE("", "Messages: No such file"),TYPE_TEXT_FIELD, -  DLOCALE("", "What to return when there is no resource or file " +  DLOCALE("cu", "Messages: No such file"),TYPE_TEXT_FIELD, +  DLOCALE("cv", "What to return when there is no resource or file "    "available at a certain location."));       definvisvar( "no_delayed_load", 0, TYPE_FLAG );       setvars( retrieve("spider#0", this_object()) );       if (query("throttle"))    {    throttler=.throttler();    throttler->throttle(query("throttle_fill_rate"),