Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
server:web [2014/04/03 03:47] – [webctrl.ini per-directory configuration file] Upcoming per-directory constraints (3.17+) deuce | server:web [2023/12/19 19:12] – [Startup INI [Web] Section Keys] Create a quick-reference settings table digital man | ||
---|---|---|---|
Line 15: | Line 15: | ||
===== Configuration ===== | ===== Configuration ===== | ||
- | ==== Startup INI [Web] Section Keys ==== | + | ==== Initialization Settings |
- | The '' | + | The '' |
+ | |||
+ | ^ Key ^ Default | ||
+ | | AutoStart | ||
+ | | HostName | ||
+ | | LogLevel | ||
+ | | TLSErrorLevel | ||
+ | | Interface | ||
+ | | TLSInterface | ||
+ | | Port | '' | ||
+ | | TLSPort | ||
+ | | BindRetryCount | ||
+ | | BindRetryDelay | ||
+ | | MaxClients | ||
+ | | MaxInactivity | ||
+ | | MaxCgiInactivity | ||
+ | | SemFileCheckFrequency | ||
+ | | IndexFileNames | ||
+ | | RootDirectory | ||
+ | | ErrorDirectory | ||
+ | | CGIDirectory | ||
+ | | DefaultCGIContent | ||
+ | | CGIExtensions | ||
+ | | JavaScriptExtension | ||
+ | | Authentication | ||
+ | | HttpLogFile | ||
+ | | FileIndexScript | ||
+ | | FileVPathPrefix | ||
+ | | FileVPathForVHosts | ||
+ | | OutbufDrainTimeout | ||
+ | | TempDirectory | ||
+ | | Options | ||
+ | |||
+ | **Detailed setting descriptions ** | ||
=== RootDirectory === | === RootDirectory === | ||
Line 49: | Line 82: | ||
=== Authorization === | === Authorization === | ||
- | Default value: '' | + | Default value: '' |
A comma-separated list of authentication mechanisms in order of preference. | A comma-separated list of authentication mechanisms in order of preference. | ||
Line 108: | Line 141: | ||
store Common Logfile Format logs in. The current virtual host | store Common Logfile Format logs in. The current virtual host | ||
(if enabled, see next item), date, and '' | (if enabled, see next item), date, and '' | ||
+ | |||
+ | === FileVPathPrefix === | ||
+ | Default value: "" | ||
+ | |||
+ | Suggested value: ''/ | ||
+ | |||
+ | A virtual sub-directory of your web root to provide direct HTTP[S] access to your file bases. HTTP-AUTH is used for conditional access/ | ||
+ | |||
+ | === FileVPathForVHosts === | ||
+ | Default value: '' | ||
+ | |||
+ | By default, virtual hosts will not have the virtual file path (if enabled). Set this to '' | ||
+ | |||
+ | === FileIndexScript === | ||
+ | Default value: "" | ||
+ | |||
+ | Suggested value: '' | ||
+ | |||
+ | A Server-side JavaScript (SSJS) file to execute and provide HTML/CSS indexes to file libraries and directories accessed via virtual file paths. | ||
=== Options === | === Options === | ||
- | Default value: '' | + | Default value: '' |
The '' | The '' | ||
- | '' | + | **'' |
Log all received data to the console log, as well as various | Log all received data to the console log, as well as various | ||
extra bits related to receiving data. | extra bits related to receiving data. | ||
- | '' | + | **'' |
Log all transmitted data except the reply body itself, as well | Log all transmitted data except the reply body itself, as well | ||
Line 126: | Line 178: | ||
data. | data. | ||
- | '' | + | **'' |
+ | |||
+ | Log server-side JavaScript execution details. | ||
+ | |||
+ | **'' | ||
Supports name-based virtual hosts. | Supports name-based virtual hosts. | ||
Line 159: | Line 215: | ||
</ | </ | ||
- | '' | + | **'' |
Disable CGI script execution. | Disable CGI script execution. | ||
- | '' | + | **'' |
Enable logging to a Common Logfile Format log as described in | Enable logging to a Common Logfile Format log as described in | ||
Line 169: | Line 225: | ||
programs (like Webalizer: http:// | programs (like Webalizer: http:// | ||
- | '' | + | **'' |
Disable SSJS execution. | Disable SSJS execution. | ||
+ | **'' | ||
+ | |||
+ | Enable TLS support. | ||
+ | |||
+ | **'' | ||
+ | |||
+ | Indicates that all URLs available via http are also available via https and redirects clients who want a TLS session to the https location. | ||
==== Other configuration files ==== | ==== Other configuration files ==== | ||
Line 222: | Line 285: | ||
Specifices an ARS string which all users must match to be able to access | Specifices an ARS string which all users must match to be able to access | ||
files in this directory. | files in this directory. | ||
+ | |||
+ | For example, to require a login, but allow **any** user to access files in a | ||
+ | directory, but only a sysop to access '' | ||
+ | <file webctrl.ini> | ||
+ | AccessRequirements=level 0 | ||
+ | [*.log] | ||
+ | AccessRequirements=level 90 | ||
+ | [*.git] | ||
+ | AccessRequirements=level 90 | ||
+ | </ | ||
=== Realm === | === Realm === | ||
Line 249: | Line 322: | ||
current directory. | current directory. | ||
- | For example, to require a login, but allow **any** user to access files in a | + | === FastCGISocket === |
- | directory, but only a sysop to access | + | Specifies the socket address of a FastCGI listener in either < |
<file webctrl.ini> | <file webctrl.ini> | ||
- | AccessRequirements=level 0 | + | [*.php] |
- | [*.log] | + | FastCGISocket=127.0.0.1:9000 |
- | AccessRequirements=level 90 | + | |
- | [*.git] | + | |
- | AccessRequirements=level 90 | + | |
</ | </ | ||
+ | See [[howto: | ||
+ | |||
+ | === Rewrite* === | ||
+ | Specifies a Javascript snippet which can modify the http_request.request_string. | ||
+ | |||
+ | <file webctrl.ini> | ||
+ | RewriteDetail=var n=http_request.request_string.replace(/ | ||
+ | </ | ||
+ | |||
+ | If the expression returns " | ||
+ | an internal redirect. | ||
+ | |||
+ | Added on November 3rd, 2015 to CVS (in 3.17a). ([[https:// | ||
+ | |||
+ | === JSPreExec === | ||
+ | A JavaScript snippet which is executed in the same context as Rewrite* lines, but before any Rewrites are executed. | ||
+ | |||
+ | Added on November 3rd, 2015 to CVS (in 3.17a). | ||
===== JavaScript Objects ===== | ===== JavaScript Objects ===== | ||
Line 333: | Line 421: | ||
is the remote hostname. | is the remote hostname. | ||
+ | === scheme === | ||
+ | " | ||
==== http_reply object ==== | ==== http_reply object ==== | ||
Line 367: | Line 457: | ||
[, bool secure ]]]]) | [, bool secure ]]]]) | ||
- | ===== The SSJS Template System ===== | ||
- | The default web pages use a SSJS Template engine which also allows for Theme | ||
- | support. | ||
- | |||
- | [Note: | ||
- | |||
- | |||
- | ==== The SSJS Template Scheme ==== | ||
- | |||
- | Each page consists of four parts: | ||
- | |||
- | === The Header | ||
- | ../ | ||
- | |||
- | This file contains the basic requirements for the HTML page. | ||
- | The opening HTML, doctype, title, CSS file link, etc. The | ||
- | header file includes the open body, System Name, and User | ||
- | greeting plus the initial page layout table start. | ||
- | of the layout is continued in the next files. | ||
- | |||
- | === Top Navigation === | ||
- | |||
- | ../ | ||
- | ../ | ||
- | |||
- | The '' | ||
- | The links are dynamically generated by '' | ||
- | files need to be addressed when modifying or creating themes. | ||
- | In the case of the default layout, '' | ||
- | graphic and a middle section that the dynamic content goes. The | ||
- | background image is handled by CSS. You can change this to anything | ||
- | you like. | ||
- | |||
- | The '' | ||
- | pretty straight forward. | ||
- | check the current page location and sets up the breadcrumbs based | ||
- | on what you want it to say. | ||
- | |||
- | For example: | ||
- | You want to add a Links page called links.html in the main | ||
- | directory. | ||
- | as: | ||
- | |||
- | <code javascript> | ||
- | if(http_request.virtual_path=="/ | ||
- | template.topnav.push({html: | ||
- | </ | ||
- | | ||
- | === Left Side Navigation === | ||
- | |||
- | ../ | ||
- | ../ | ||
- | ../ | ||
- | |||
- | This starts the main table layout in the default layout and also | ||
- | provides two other things -- the main navigation links and a brief | ||
- | nodelisting that displays when users are online via telnet. | ||
- | The links are dynamically created as in the Top Navigation example | ||
- | above with the exception of the two static links. | ||
- | |||
- | === Main Content (various files) === | ||
- | |||
- | This is where the layout of the main content is created. | ||
- | to look at the various files in '' | ||
- | '' | ||
- | various functions of the Web side of Synchronet. | ||
- | each of the special codes contained in those files do will follow. | ||
- | |||
- | === Footer === | ||
- | | ||
- | ../ | ||
- | | ||
- | This file contains the closing HTML and whatever bottom information | ||
- | you would like. In the case of the default layout, the | ||
- | Web Server/ | ||
- | privacy statements or anything else can be placed here and they will | ||
- | be displayed at the bottom of each page. | ||
- | |||
- | |||
- | ==== SSJS Theme Support ==== | ||
- | |||
- | Theme Layouts can be added to Synchronet by creating them and placing the | ||
- | *.inc files in their own directory under ../ | ||
- | |||
- | Themes are activated by editing the ../ | ||
- | This file contains: | ||
- | <code javascript> | ||
- | /* Set default theme name */ | ||
- | var DefaultTheme=" | ||
- | |||
- | /* Edit this bit to add/ | ||
- | Themes[" | ||
- | Themes[" | ||
- | Themes[" | ||
- | Themes[" | ||
- | </ | ||
- | |||
- | Themes are added by editing below the Default Theme such as: | ||
- | <code javascript> | ||
- | Themes[" | ||
- | Themes[" | ||
- | Themes[" | ||
- | Themes[" | ||
- | </ | ||
- | To change the Default Theme, change: | ||
- | |||
- | <code javascript> | ||
- | var DefaultTheme=" | ||
- | </ | ||
- | to: | ||
- | <code javascript> | ||
- | var DefaultTheme=" | ||
- | </ | ||
- | |||
- | ==== Special Codes Used in the SSJS Template System ==== | ||
- | |||
- | By looking at at the message related files located in templates/ | ||
- | it can be seen that some special codes are used to display dynamically created | ||
- | content. It is very important to maintain the information EXACTLY as seen in | ||
- | each file or else the messaging system will fail. While how it is displayed | ||
- | can be changed, the correct information will only be dispayed by following the | ||
- | format in the *.inc files. | ||
- | |||
- | For example the groups.inc: | ||
- | <code html> | ||
- | <!-- Main Content --> | ||
- | | ||
- | <td class=" | ||
- | |||
- | <table class=" | ||
- | <tr> | ||
- | <th class=" | ||
- | </tr> | ||
- | << | ||
- | <tr> | ||
- | <td class=" | ||
- | <a class=" | ||
- | %%groups: | ||
- | <td class=" | ||
- | @@JS: | ||
- | </tr> | ||
- | <<END REPEAT groups>> | ||
- | </ | ||
- | <br /> | ||
- | |||
- | <!-- end Main Content --> | ||
- | </ | ||
- | |||
- | While the table layout can be changed or even eliminated, the information | ||
- | within the << | ||
- | To remove the table yet keep the correct infomation, the resulting groups.inc | ||
- | would be changed to (while maintaining the main table layout in this case) to: | ||
- | <code html> | ||
- | <!-- Main Content --> | ||
- | | ||
- | <td class=" | ||
- | |||
- | << | ||
- | <a class=" | ||
- | %%groups: | ||
- | @@JS: | ||
- | <<END REPEAT groups>> | ||
- | |||
- | <br /> | ||
- | |||
- | <!-- end Main Content --> | ||
- | </ | ||
- | |||
- | This principle applies to all the .inc files in msgs respectively. | ||
- | |||
- | ==== The SSJS Template Library ==== | ||
- | |||
- | '' | ||
- | |||
- | i.e.; Spaces are replaced with: '' | ||
- | |||
- | '' | ||
- | |||
- | i.e.; Spaces are replaced with: '' | ||
- | | ||
- | '' | ||
- | |||
- | No changes or encoding is performed. | ||
- | |||
- | '' | ||
- | (^^ and %% are also supported) | ||
- | |||
- | '' | ||
- | (^^ and %% are also supported) | ||
- | |||
- | <code javascript> | ||
- | << | ||
- | @@name: | ||
- | <<END REPEAT name>> | ||
- | </ | ||
- | |||
- | Iterates over the array/ | ||
- | the value of '' | ||
- | (^^ and %% are also supported) | ||
- | |||
- | |||
- | ==== SSJS Message Configuration ==== | ||
- | |||
- | Configuration settings for the SSJS Messaging system is located in the | ||
- | '' | ||
- | <code javascript> | ||
- | max_messages=20; | ||
- | max_pages=30; | ||
- | next_msg_html=" | ||
- | prev_msg_html=" | ||
- | next_page_html=" | ||
- | prev_page_html=" | ||
- | showall_subs_enable_html=" | ||
- | showall_subs_disable_html=" | ||
- | show_messages_all_html=" | ||
- | show_messages_yours_html=" | ||
- | show_messages_your_unread_html=" | ||
- | show_messages_spacer_html="& | ||
- | anon_only_message=" | ||
- | anon_allowed_message='< | ||
- | anon_reply_message='< | ||
- | private_only_message=" | ||
- | private_allowed_message='< | ||
- | private_reply_message='< | ||
- | </ | ||
- | |||
- | Each of these are configurable. | ||
- | |||
- | See the actual file for the defaults currently in use. | ||
- | |||
- | ==== Embedded Javascript ==== | ||
- | |||
- | The '' | ||
- | which is parsed by the JavaScript engine. | ||
- | number of embedded JavaScript in the *.inc files slow down overall processing | ||
- | of pages. | ||
- | |||
- | Anything contained within '' | ||
- | engine. | ||
- | |||
- | For example, it can check if the user is Guest or an actual user with this line: | ||
- | |||
- | <code javascript> | ||
- | @@JS: | ||
- | else '< | ||
- | </ | ||
- | | ||
- | What this does is display links specific for Registered Users only to them | ||
- | and not Guest. | ||
- | Note, it also can be used to display HTML based on location as in the | ||
- | node listing stuff. In this case, it checks for whether or not a user is | ||
- | online, or if the user is anywhere but the Who's Online page before displaying | ||
- | the Left side node listing. | ||
- | |||
- | IMPORTANT! | ||
- | will be errors in parsing. | ||
- | |||
- | ==== global_defs.ssjs ==== | ||
- | |||
- | This version of the Web Layout now includes a new file called | ||
- | '' | ||
- | be used for creating global definitions that span all pages of a site. | ||
- | For example: | ||
- | |||
- | <code javascript> | ||
- | template.user_alias=user.alias; | ||
- | </ | ||
- | Now '' | + | ==== Extra global variables ==== |
- | user's alias. | + | |
- | Care should be exercised when using this file as loading it up with hundreds | + | === web_root_dir === |
- | of predefined definitions may slow down overall page rendering as the file is | + | The path to the web server' |
- | loaded on every page. It would be better | + | |
- | definitions that are truly global rather many definitions. | + | |
- | inefficient to have thirty of forty message definitions being loaded when a | + | |
- | user is looking at the statistics page. | + | |
+ | See also: the RootDirectory key under [Web] in [[config: | ||
===== XJS files ===== | ===== XJS files ===== |