GithubHelp home page GithubHelp logo

mlr-gateway's Introduction

MLR-Gateway

Build Status Coverage Status

Monitoring Location Gateway

Running the Application

Copy the src/main/resources/application.yml file to you project root directory and change the substitution variables as needed. Open a terminal window and navigate to the project's root directory.

Use the maven command mvn spring-boot:run to run the application.

It will be available at http://localhost:8080 in your browser.

Swagger API Documentation is available at http://localhost:8080/swagger-ui.html

ctrl-c will stop the application.

localDev Profile

This application has two built-in Spring Profiles to aid with local development.

The default profile, which is run when either no profile is provided or the profile name "default" is provided, is setup to require the database for Session storage.

The localDev profile, which is run when the profile name "localDev" is provided, is setup to require no external database - Sessions are stored internally.

SSL Configuration

This application must communicate with the Water Auth Server for Authentication and this must be done over https. In order for this to work correctly the Water Auth Server SSL cert must be trusted by the Gateway. The following environemnt variables are used to confirue this store.

  • sslStorePassword_file - The path to the mounted secret file of the SSL trust store password.

  • water_auth_cert_file - The path to the mounted secret file of the Water Auth Server Public Cert.

Spring Security Client Configuration

This is a secured application that must connect to a running instance of the Water Auth Server in order to work. The following environment variables are used to configure the connection to the water auth server via OAuth2.

  • oauthClientId - The ID of the Client that has been configured in the Water Auth Server for this application.

  • oauthClientSecret - The secret associated with the Client that has been configured in the Water Auth Server for this application.

  • oauthClientSecret_file - The path to the mounted secret file containing the secret associated with the Client that has been configured in the Water Auth Server for this application.

  • oauthClientAccessTokenUri - The OAuth2 Token URI that this application should connect to.

  • oauthClientAuthorizationUri - The OAuth2 Authorization URI that this application should connect to.

  • oauthResourceId - The resource ID associated with the Client that has been configured in the Water Auth Server for this application.

  • oauthResourceTokenKeyUri - The OAuth2 Token Key URI that this application should connect to.

Spring Security Client and Session Storage

This service by default stores session data within a database rather than within the application itself. This allows for multiple running instances of this service to share session information, thereby making the service stateless.

When the application first starts it attempts to connect to the configured PostgreSQL database and run a set of initialization scripts to create the relevant tables if they don't already exist

The related environment variables are listed below:

  • dbConnectionUrl - The full JDBC-qualified database URL that the application should connect to. Example: jdbc:postgresql://192.168.99.100:5432/mydb

  • dbUsername - The username that should be used by the application when connecting to the database.

  • dbPassword - The password that should be used by the application when connecting to the database.

  • dbPassword_file - The path to the mounted secret file containing the password that should be used by the application when connecting to the database.

  • dbInitializerEnabled - Whether or not the database initialization scripts should run on application startup. The default value is true.

Using Docker

To build the image you will need to provide the location of the jar within https://cida.usgs.gov/artifactory/mlr-maven/gov/usgs/wma/mlrgateway as follows:

% docker build --build-arg=0.1-SNAPSHOT/mlrgateway-0.1-SNAPSHOT.jar .

To run the image, you will need to provide as environment variables the substitution variables in the application.yml. The application will be available on part 8080 within the container.

Substitution Variables

  • mlrgateway_mlrServicePassword - password for the monitoring user (deprecated)
  • mlrgateway_ddotServers - comma separated list of url(s) for the D dot Ingester Microservice
  • mlrgateway_legacyTransformerServers - comma separated list of url(s) for the Legacy Transformer Microservice
  • mlrgateway_legacyValidatorServers - comma separated list of url(s) for the Legacy Validator Microservice
  • mlrgateway_legacyCruServers - comma separated list of url(s) for the Legacy CRU Microservice
  • mlrgateway_fileExportServers - comma separated list of url(s) for the File Export Microservice
  • mlrgateway_notificationServers - comma separated list of url(s) for the Notification Microservice
  • mlrgateway_ribbonMaxAutoRetries - maximum number of times to retry connecting to a microservice
  • mlrgateway_ribbonConnectTimeout - maximum milliseconds to wait for a connection to a microservice
  • mlrgateway_ribbonReadTimeout - maximum milliseconds to wait for a response from a microservice
  • mlrgateway_hystrixThreadTimeout - maximum milliseconds for a request to process
  • mlrgateway_springFrameworkLogLevel - log level for org.springframework

mlr-gateway's People

Contributors

dsteinich avatar kmschoep-usgs avatar mbucknell avatar skaymen avatar zmoore-usgs avatar

Watchers

 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.