| Search internet |
Pages may contain free text mixed with machine intelligible objects like computer programs, testsuites, and formal proofs. The compiler can compile embedded computer programs, run testsuites, and check the correctness of formal proofs.
The compiler takes a source file as input and produces a 'vector', a 'rack', and a 'rendering' as output. Source, vector, rack, and rendering all represent the same Logiweb page. The source format is suited for authoring of Logiweb pages using an ordinary text editor. The vector is a condensed representation suited for transmission over the Internet. The rack is a comprehensive representation suited for storing on a local disk. The rendering is a human readable representation suited for reading in a web browser.
The compiler assigns a world-wide unique 'reference' to each page it translates. A reference comprises around 30 bytes. Having the reference of a page one may retrieve the vector of the page via an untrusted network from an untrusted repository. This is so since the reference contains a RIPEMD-160 hash code which allows to verify the authenticity of the page.
References are expressed in 'mixed endian hexadecimal': Each byte is written with the most significant hex digit first, bytes are given in network byte order, and capital letters are used for the hex digits A to F.
GRD-<year>-<month>-<day>[+1|-1].The year, month, and day are given as a Gregorian date. Days go from UTC midnight to UTC midnight. The month and day have two digits. The year has four until year 9999. A leapspec indicates that the length of the given day is altered by the given amount (+1 second or -1 second). The leap affects the last minute of the last hour of the given UTC day. See LIST OPTIONS below on how to give this option more than once.
Options like HELP, VERSION, and so on have default value 'no'. Such options take effect when they differ from 'no'. As an example, -h translates to --help which sets HELP to the empty list which differs from 'no'.
Options like SITECONFIG, USERCONFIG, and RENDERING only use the first string in the list. As an example, '-s file' translates to '--siteconfig=file' which sets the first (and only) element of SITECONFIG to file.
A source file foo given on the command line translate to --source=foo. The compiler only uses the first string of the SOURCE option.
The compiler processes the command line left to right. Long options are case insensitive. Short options are case sensitive. Short options are translated to long options before processing.
> more /usr/bin/lgc #!/usr/bin/lgwam script string 015F43BE4A17DAD915936B7A773154A80946AEC82EFBEECDA4A7D7B80806 lgc execute siteconfig=/etc/logiweb/lgc.confThe first five lines identify the lgc compiler. The remaining lines define options exactly like long options do on the command line except that the leading two hyphens are omitted. Blank lines and lines starting with a hashmark (#) are ignored. Lines may be ended by an arbitrary sequence of CR and LF characters.
Options from the six sources above are treated as one long list of option transformations. As an example, --path+foo on the command line adds foo in front of whatever the five other sources have defined PATH to be.
The compiler reads options once but process them three times: First for finding the value of SITECONFIG ignoring the site and user configuration files. Second for finding the value of USERCONFIG ignoring the user configuration file. And finally for finding the value of all the other options.
The compiler does not restrict the set of possible options to those it knows itself. Hence, 'lgc --foo=bar source' will define the FOO option to equal 'bar'. Such user defined options can be picked up by user defined rendering functions in the source and may affect the outcome of rendering. Note that if the rendering is put on WWW this may expose the options used to the outside world. This includes the environment variable HOME and variables starting with LGC_. Use 'lgc --options' to see what might get exposed to the outside world.
When looking up a page by name or reference, lgc considers the locations in NAMEPATH and PATH, respectively, one at a time as follows.
(1) If the item does not start with "file:" or "http:", then "file:" is prepended.
(2) The item is divided in scheme and contents at the leftmost colon character. Hence, the scheme is either "file" or "http".
(3) If the scheme is "file" and the contents starts with a tilde, then the tilde is replaced by the value of $HOME.
(4) The rightmost colon character (if any) is replaced by the name (for NAMEPATH) or reference (for PATH) of the page. The reference is expressed in mixed endian hexadecimal.
(5) The page is looked up as a file or using http depending on the scheme. A page with extension .lgr is treated as a Logiweb rack. A page with extension .lgw is treated as a Logiweb vector. A page with extension .lgu is treated as an URL which points at the page to be fetched. That URL is supposed to have extension .lgr or .lgw or .lgu. The .lgu extension is intended for future uses involving CGI scripts.
As an example, if the item is ~/.logiweb/cache/:/page.lgr and the referenced page has reference 01AB then .logiweb/cache/01AB/page.lgr under the users home catalogue is retrieved and is interpretted as a Logiweb rack.
The site configuration file typically resides in /etc/logiweb/lgc.conf. It is considered to be blank if it does not exist.
The user configuration file typically resides in ~/.logiweb/lgc.conf. It is considered to be blank if it does not exist.
Example source files typically reside in /usr/share/doc/logiweb/examples.
Source files should have extension .lgs (this may become mandatory in the future).
Links to rendering output typically have no extension.
Logiweb vectors (compact representations of Logiweb pages suited for transmission over the internet) have extension .lgw.
Logiweb racks (precompiled representations of Logiweb pages suited for fast loading) have extension .lgr.
Logiweb pointers (page references in mixed endian hexadecimal) have extension .lgp.
Logiweb URL indirections have extension .lgu.
All transitively referenced pages are rendered locally. Local rendering may involve invokation of latex, bibtex, makeindex, and dvipdfm. Local rendering should occur in a chroot jail, but this has not yet been implemented. Thus: only reference trusted pages.
All pages may define executable code. Executables end up under the rendering directory. Such executables can do anything if they are invoked. The lgc compiler never itself invokes an executable, but an attacker could either persuade or fool you to run it or could exploit security holes in latex to do so. Thus: only reference trusted pages.
When loading a Logiweb vector, lgc uses the RIPEMD-160 hash function to verify the authenticity of the received vector. lgc makes no check of racks. Thus, only load racks from trusted places (typically your own harddisk and nowhere else).
Feel free to include locations like http://untrusted.com/:/vector.lgw in PATH. RIPEMD-160 will protect you. But never include .lgr references to untrusted places and never include references to untrusted places in NAMEPATH.
| Search logiweb.eu |