-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
Emmer uses environment variables (prefixed with 'EM_') for all configuration options.
The API uses basic auth to verify requests. The username and password for this basic auth can be set with the variables EM_USERNAME and EM_PASSWORD. If you don't set these variables, emmer will auto-generate a username and password.
Note, you can (partially) disable authentication using the EM_ACCESS env variable. By default, it's 2 (so authentication needed on all requests). If it's 1, you don't need authentication for get requests. If it's 0, you don't need authentication for any request.
Caching is done by writing to memory instead of writing to the filesystem (which is expensive). In emmer, we have a caching strategy by writing to memory after every n requests. This n can be set using the EM_COMMITS variable. For example, if EM_COMMITS=2, then cache is written to the filesystem every second put/delete request.
Note, you can set EM_COMMITS=-1 if you never want to automatically write to the filesystem. In that scenario, you can use the '/commit' endpoint to manually write all cache.
A connector refers to a storage provider. For example, we can write the JSON files to our local filesystem, but also to Minio or AWS S3. Emmer supports multiple connectors. You can switch between the connectors by setting the 'EM_CONNECTOR' variable.
- Local filesystem. By default, writes to ~/.emmer or ~/.local/share/emmer (if you have XDG set).
- You can write to a custom folder path by setting EM_FOLDER env variable. Use absolute paths!
Note, if you run emmer in a docker container, the default EM_FOLDER is /data. Hence, mount this path if you want to create persistent storage.
- Requires standard AWS stuff, like AWS_SECRET_ACCESS_KEY, AWS_ACCESS_KEY_ID, AWS_SESSION_TOKEN, AWS_REGION
- EM_S3_BUCKET: Name of the S3 bucket that stores the JSON files.
The default port is 2112. If you want to change this, you can set the EM_PORT variable or add the -p flag when invoking emmer.
You can see debug logs (in json format) by setting EM_DEBUGMODE=true.