This chapter describes how to configure a Midori-based device locally through a browser interface or remotely through a network interface. In particular, the user or network administrator can:
Each configuration option can be removed at compile time, or be protected with passwords as described below.
HTTPD_CONF Includes the configuration utility. HTTPD_CONFIG_REMOTE Allows remote client configuration of Midori.
Two different static passwords can be set: a read-only password that allows the user to check the configuration, and a system administrator password that allows full access to all options.
The build-time options are:
HTTPD_CONFIG_PASSWORD=STATIC HTTPD_CONFIG_READONLY_PASSWORD=user:user HTTPD_CONFIG_SYSADMIN_PASSWORD=sysadmin:God
The string before the colon is the username, the string after the colon the password. Because static passwords are compiled into the binary (and not encrypted) it is rather trivial to find them. Static passwords should only be used for development purposes.
Dynamic passwords allow fine grained control. The web server sends a request to some predefined server (with the username and password) and expects in return a list of configuration options that can be changed by that user. The build-time options are:
The server will then send out a request of the formHTTPD_CONFIG_PASSWORD=HTTP HTTPD_CONFIG_PASSWORD_SERVER=servername HTTPD_CONFIG_PASSWORD_PORT=port HTTPD_CONFIG_PASSWORD_PATH=/somepath
and in return expectsGET /somepath HTTP/1.1 Host: servername Authorization: Basic username:password Connection: close
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 formHTTP/1.1 200 OK
with 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 withx script
to get the list. An example would be'PRG' (execute egrep 'PRG[+=]' src/cgi/Makefile
which would allow the user to reboot or power off his device, change the time and date, and check the network configuration but not change it.w poweroff w reboot w timezone w time w date w disconnect w reconnect r network
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.
The build-time options are:
UPGRADE_PORT defines where the HTTP server will listen and UPGRADE_HOST defines where the upgrade program will look for the new images. There is an option to overwrite this when upgrading.UPGRADE_SRC=yes UPGRADE_HOST=hostname UPGRADE_PORT=portnumber
The simplest way to start an upgrade daemon is to run:
in the top-level directory. It will first create the files necessary for the upgrade, and then start the httpd server. Once the server is running you can upgrade Midori as follows:# make upgrade
all upgrade everything packed upgrade the complete packed partition new upgrade only new packages (see below)
If you upgrade the root package, your system will reboot after the upgrade.upgrade package_name
After an upgrade the system will restart all the services that were stopped (for example X).upgrade -h host:port
When done upgrading, you can type Ctrl-C in the shell where you ran make upgrade to kill the upgrade server.
However, by defining
in the config file one can define an edition number for the root partition, the main (/) packed partition and the usr partition. The same number is also used for cramfs images created for directories defined in image/images. In order to change the edition number for a specific directory, create a file called .edition which contains the edition number in this directory.EDITION=nnnn
Example: to create a netscape partition with an edition number 1445 use:
Note that the special file .edition will not be part of the cramfs files.echo "usr/lib/netscape" >> ../image/images cd ../root/usr/lib tar xzf ../../../tar/netscape.tar.gz echo 1445 > netscape/.edition