MIT Bento aims to search multiple data sources and return a summary of results to aid a user towards a successful discovery experience.
It currently searches Ebsco Discovery Services API (EDS) and Google Custom Search API. Appropriate credentials for both are required (see below).
https://mitlibraries.atlassian.net/wiki/x/CoAeAw
Tasks exist to reload hints from supported sources. Example to reload Aleph hints in a development environment:
heroku local:run bin/rails reloadhints:aleph
note: reloadhints:aleph
requires ENV ALEPH_HINT_SOURCE
To reload custom hints in a development environment:
heroku local:run bin/rails reloadhints:custom[https://www.dropbox.com/blah/blah]
To reload custom hints in a heroku environment:
heroku run bin/rails reloadhints:custom['https://www.dropbox.com/blah/blah'] --app your-appname-staging
Depending on your shell, you may need single-quotes around the URL.
This expects to find a world-readable CSV file at the Dropbox location. Instructions for generating that file are in the Google sheet where we gather custom hint metadata.
ALEPH_API_URI
: endpoint URI for Aleph Realtime Availability checksALEPH_UI_HOST
: hostname for Aleph UI. Defaults to productionALEPH_KEY
: we use a custom API adapter to aleph that restricts via key instead of IP addressEDS_ARTICLE_FACETS
: facets to apply to create an articles search ex: &facetfilter=1,SourceType:Academic+Journals,SourceType:MagazinesEDS_BOOK_FACETS
: facets to apply to create a book search ex: &facetfilter=1,SourceType:Books,SourceType:eBooks,SourceType:AudiobooksEDS_PASSWORD
: your EDS API passwordEDS_PLINK_APPEND
: string to append to extracked PLink from EDSEDS_PROFILE
: profile for your EDS API endpointEDS_PROFILE_URI
: URI for the EDS UI (not API) profileEDS_URL
: the root EDS API URLEDS_USER_ID
: your EDS API user idGOOGLE_API_KEY
: your Google Custom Search API keyGOOGLE_CUSTOM_SEARCH_ID
: your Google Custom Search engine IDMAX_AUTHORS
: the maximum number of authors displayed in any record. If exceeded, 'et al' will be appended after this number.RECAPTCHA_SITE_KEY
RECAPTCHA_SECRET_KEY
TIMDEX_URL
: The GraphQL endpoint for Timdex/ArchiveSpaceASPACE_SEARCH_URI
: the base search URL for the Timdex/ArchiveSpace application
ALEPH_HINT_SOURCE
: HTTP GET accessible marcxml source for HintsALEPH_HOLD_TYPE
: Switches between links to Alephitem-hold-request
anditem-global
. Defaults toitem-hold-request
.EDS_TIMEOUT
: value to override the 6 second default for EDS timeoutEDS_GEM_HOSTS_LIST
: override list of hosts to use for our full record views defaults to the (theoretically) load balanced EDS API endpoint. The protocol is not included, so useexample.com
instead ofhttps://example.com
FLIPFLOP_KEY
: set this to enable access to the flipflop dashboardGLOBAL_ALERT
: html message to display as a global headerHINT_SOURCES
: Comma-separated Hint source names, in descending order of priority. (If unset, will default tocustom
).JS_EXCEPTION_LOGGER_KEY
: Enables and logs JavaScript errors.- Hints will only be displayed to the user if they are in
HINT_SOURCES
.
- Hints will only be displayed to the user if they are in
LOG_LIKE_PROD
: uses prod-like logging in development if setLOG_LEVEL
: set log level for development, default is:debug
RESULTS_PER_BOX
: defaults to 3SENTRY_DSN
: logs exceptions to SentrySFX_HOST
: URL to SFX Host. Defaults to productionSFX_ALEPH_HOST
: domain (not full URL) of Aleph server SFX uses to do MARC lookups. Defaults to production.DISABLE_SCANS
: if set will disable scans for local aleph itemsDISABLE_HOLDS
: if set will disable holds for local aleph itemsDISABLE_ILLS
: if set will disable ILLs for local aleph itemsDISABLE_RECALLS
: if set will disable recalls for local aleph itemsDISABLE_REQUEST_DIGITAL
: if set will disable request digital copy buttonREQUESTS_PER_PERIOD
: number of requests per time period we allow from a single non-MIT IP address. Defaults to 100. Example: "100".REQUEST_PERIOD
: sets time period for number of requests per time period in minutes. Defaults to 1 minute. Example: "1". NOTE: for throttles to work in development make sure to enable the dev cache
A Dockerfile is provided that is intended solely for development work as it is not optimized for production environments (and in fact doesn't install production required dependencies so for real don't use it for anything else).
To build the container:
docker build -t bento .
To run the application while actively developing:
docker run -it -p 3000:3000 --mount type=bind,source=$(pwd),target=/bento bento
should mount your local copy of the code in a way in which
your changes are immediately reflected in the running app.
To run the tests it seems useful to mount your local code into a bash shell to pick up changes live:
docker run -it --mount type=bind,source=$(pwd),target=/bento --entrypoint /bin/bash bento
Once in the containers shell:
bundle exec rails test
should do the trick
If you just leave those running, you should see changes you make locally reflected immediately in the running container.
docker-compose
will load your .env
file automatically for your config and
we use /config/environment/test.rb
for test env stuff.