As the survey definitions will no longer be stored in files
under etc/surveys/ but directly on the database, this
function replaces configuration.surveys()
The Dougal database will no longer store physical file paths
but rather logical ones, relative to (config.yaml).imports.paths.
These functions translate between physical and logical paths.
Used to download files. It relies on `imports.paths` being set
appropriately in `etc/config.yaml` to indicate which parts of
the filesystem are accessible to users via Dougal.
NOTE: this endpoint is redundant with db.project.configuration.get()
except for its ability to return a partial tree.
TODO: merge this with db.project.configuration.get().
Instead of storing the project configuration in a YAML file
under `etc/surveys/`, this is now stored in public.projects.meta.
NOTE: as of this commit, the runner scripts (`bin/*.py`) are not
aware of this change and they will keep looking for project info
under `etc/surveys`. This means that projects created directly
in the database will be invisible to Dougal until the runner
scripts are changed accordingly.
The old db.project.list() function is now db.project.get()
and the old db.project.get() is not db.project.summary.get().
If a project does not exist, db.project.summary.get() now
throws a 404 rather than a database error.
A configuration item `imports.mounts` is added to
`etc/config.yaml`. This should be a list of paths
which must be non-empty. If any of the paths in that
list is empty, runner.sh will abort.
Closes#200.
Running on bare metal, 127.0.0.1 is a sensible choice of address
to bind on, but that is not the case when running inside a
container, so we add the ability to choose which IP to listen on.
This can be given via the environment variable HTTP_HOST when
starting the server or, if used as a module, as the second
argument of the start(port, host, path) function.