Configuration Utility
---------------------


Midori Linux includes a configuration utility that can be used
to set and change the way some of the programs work. In particular,
it allows the user to

        - set the time/date/timezone
        - networking parameters
        - upgrade the system (using the upgrade script)
        - reboot/power off
        - open root consoles and xterms

Every single configuration option can be removed at compile time,
or be protected via passwords as described below.


How it works
------------

If the configuration utility has been compiled into the system
(config variable HTTPD_CONF) a small web server is started
whenever Midori Linux boots. The default netscape browser has
been configured so that the main configuration menu can be
opened by clicking on the small icon on the top right of the
screen.

This opens a menu on the left side of the screen that includes
all the possible choices.



Security
--------

Local/Remote config
-------------------

A compile time option (HTTPD_CONFIG_REMORE) can be used to allow remote
configuration of Midori Linux. By default, it will only allow a local browser
to change the configuration. Note that a skilled person may spoof its return
address and be able to change configuration values anyway.

Passwords
---------

By default no passwords are necessary to access any of the options. The 
system supports two types of passwords, either static ones (which are compiled
into the binary), or dynamic ones. In the case of static passwords two
different ones can be set, a readonly that allows the user to check the configuration,
and a system administrator password that allows full access to all options.
The configuration variables are

        HTTPD_CONFIG_PASSWORD=STATIC
        HTTPD_CONFIG_READONLY_PASSWORD=user:user
        HTTPD_CONFIG_SYSADMIN_PASSWORD=sysadmin:God


PLEASE DO NOT USE THE DEFAULT VALUES!! The string before the colon is the
username, the string after the colon the password. Because the passwords are
compiled into the binary (and not encrypted) it is rather trivial to find them
and it is not recommended that you use static passwords.


Dynamic passwords allow fine grained control. What happens is that the web
server send a request to some predefined server (with the username and
password) and expects in return a list of which configuration options may be
changed by that user. For this to work you need to set

        HTTPD_CONFIG_PASSWORD=HTTP
        HTTPD_CONFIG_PASSWORD_SERVER=servername
        HTTPD_CONFIG_PASSWORD_PORT=port
        HTTPD_CONFIG_PASSWORD_PATH=/somepath

The server will then send out a request of the form

        GET /somepath HTTP/1.1
        Host: servername
        Authorization: Basic username:password
        Connection: close

and in return expects

        HTTP/1.1 200 OK

anything else is assumed to be a 'no permission' response. The file sent back
must contain a list of scripts that this particular user may execute as a user
or as sysadmin, of the form

        x script

which x being 'r' for user access (no writes) or 'w' for sysadmin access. The
list of scripts can be found in src/cgi/Makefile, check all lines starting with
'PRG' (execute egrep 'PRG[+=]' src/cgi/Makefile

to get the list. An example would be

        w poweroff
        w reboot
        w timezone
        w time 
        w date
        w disconnect
        w reconnect
        r network

which would allow the user to reboot or power off his machine, change time and
date, and check the network configuration but not change it.

Note that even this scheme is relatively easy to circumvent (how is left as an
exercise for the reader :-).

In order to get truly secure, you would need to implement an ssl connection
that also checks the key of the password server in order to avoid man in the
middle attacks.
