Giter Club home page Giter Club logo

search-api's Introduction

search-api

Using the Search API

If you want to access the Search API see this topic.

Setup for development

TL;TR: Run source ./setup.sh

  1. Configure the folloing environment variables.

    Name Default Description
    API_SERVER_URL https://kubernetes.default.svc Kubernetes API server. oc cluster-info
    SERVICEACCT_TOKEN "" Get this token with oc whoami -t
    redisEndpoint //localhost:6379 RedisGraph server. Use only whith RedisGraph on local machine.
    redisSSLEndpoint redisgraph-route:443 RedisGraph server with SSL.
    redisPassword "" RedisGraph password. `oc get secret redisgraph-user-secret -n open-cluster-management -o=jsonpath='{.data.redispwd}'
  2. Generate self-signed certificates for development.

    openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout searchapi.key -out searchapi.crt -config req.conf -extensions 'v3_req'
  3. Start the dev server

    npm i
    npm start
  4. Start the production server

npm i
npm run build
npm run start:production

Environment variables

Name Default Description
defaultImageQueryLimit 2500 Limits the images returned by the searchComplete query.
defaultQueryLimit 10000 Limits the resources returned by a search query.
defaultQueryLoopLimit 5000 Chunk size used by the keyword search logic.
RBAC_POLL_INTERVAL 60000 Interval at which we revalidate the RBAC cache.
RBAC_INACTIVITY_TIMEOUT 600000 Stop revalidating RBAC cache after user is inactive for this period.

Developing with RedisGraph in a live cluster

  1. Create a route to expose the search-redisgraph service.

    RG_SERVICE_NAME=$(oc get service -n open-cluster-management |grep search-redisgraph | awk '{print $1;}')
    oc create route passthrough redisgraph --service=$RG_SERVICE_NAME --insecure-policy='Redirect' --port='redisgraph' -n open-cluster-management
  2. Set redisSSLEndpoint on your config.json. The format is <redisgraph-route>:443

  3. Set redisPassword on your config.json. Use this command to get the redisPassword from your cluster.

    oc get secret redisgraph-user-secret -o json | jq -r '.data.redispwd' | base64 -D | pbcopy
  4. Copy the redis certificate to the local machine.

    oc get secrets search-redisgraph-certs -n open-cluster-management -o json |jq -r '.data["ca.crt"]' | base64 -d > ./rediscert/redis.crt
  5. Allow unsecured TLS connection.

    export NODE_TLS_REJECT_UNAUTHORIZED=0
    -- OR --
    process.env.NODE_TLS_REJECT_UNAUTHORIZED= '0'

Rebuild: 2022-08-16

search-api's People

Contributors

jlpadilla avatar zack-layne avatar zlayne avatar sherinv avatar kevinfcormier avatar dislbenn avatar anxhela21 avatar mqhackett avatar nweathe avatar robdolares avatar dependabot[bot] avatar schmidtd avatar jtaylorgreen avatar birsanv avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.