Olfaction is a server with storage backend for code smell research data. It exposes GraphQL and REST APIs over stored code smells and the version control information of analyzed repositories.
npm install
npm run buildnpm startThen navigate to http://localhost:4040/graphql to access the interactive query console.
The following environment variables are used to configure the server:
| Name | Default | Description |
|---|---|---|
HOST |
localhost |
Host for the HTTP API server to listen on |
PORT |
4040 |
Port for the HTTP API server to listen on |
REPO_ROOT |
./repos |
Root directory where to find and store uploaded git repositories |
PGHOST |
localhost |
Postgres database host |
PGPORT |
5432 |
Postgres database host |
PGUSER |
Postgres database user name | |
PGPASSWORD |
Postgres database password | |
PGDATABASE |
Postgres database name | |
BASIC_AUTH_USERS |
If set, restricts access through HTTP basic auth. JSON object of usernames as keys and passwords as values. |
Additionally, the optional OpenTracing support using Jaeger is configured through environment variables documented in the Jaeger client documentation.
To disable OpenTracing completely, JAEGER_DISABLED can be set to true.
The following tools need to be installed for the server:
- NodeJS 13.6.0
- Git 2.25.0
- PostgreSQL 12.1
A docker image is also available for the server (does not include the PostgreSQL database). Example command to run the server on macOS, with a Postgres database running on the Docker host:
docker run --init --rm --name olfaction -p 4040:4040 --env PGHOST=host.docker.internal --env PGUSER=$USER --env PGDATABASE=olfaction felixfbecker/olfactionThe way to run the Docker image varies by platform. Please refer to the Docker documentation for more information.
The command above will store repositories inside the container. It is possible to mount a Docker volume instead and set REPO_ROOT to put repositories on that volume.
Make sure the above environment variables are set.
Create a database with PostgreSQL:
createdb olfactionThen initialize the schema:
psql < ./schema/schema.sqlTo optimize performance, it is recommended to tweak the settings postgresql.conf depending on the available system resources.