Configuration#
Before building the project, it is important to create a .env file on the project root and set the following variables:
General variables#
REACT_APP_AUTOSUBMIT_API_SOURCE: Defines the API URI. For more information check autosubmit_api.PUBLIC_URL: This allows to serve the GUI from another subpath. See more in CRA advanced configuration.REACT_APP_DARK_MODE_SWITCHER(experimental feature): Defaultfalse. Set it totrueif you want to enable the Dark mode feature.
Authentication variables#
REACT_APP_AUTHENTICATION: Defaultfalse. You can set it tofalseto avoid the requirement of an authentication in the GUI. However, some API calls might require that you have a valid token. In case is set totrue, you have to specifyREACT_APP_AUTH_PROVIDER.REACT_APP_AUTH_PROVIDER: Can be set tocas,github, oroidc.If
casis set, you have to specifyREACT_APP_CAS_THIRD_PARTY_LOGIN_URLandREACT_APP_CAS_SERVICE_ID.If
githubyou have to specifyREACT_APP_GITHUB_CLIENT_ID.If
oidcyou have to specifyREACT_APP_OIDC_AUTHORIZATION_ENDPOINTandREACT_APP_OIDC_CLIENT_ID.
REACT_APP_CAS_THIRD_PARTY_LOGIN_URL: This is the login endpoint to request credentials to the user according to the CAS protocol.REACT_APP_CAS_SERVICE_ID: This will specify the service parameter during the request of credentials according to the CAS protocol.REACT_APP_GITHUB_CLIENT_ID: Client ID that will be used to link with the Oauth app. See more on Github Oauth.REACT_APP_OIDC_AUTHORIZATION_ENDPOINT: Authorization endpoint for the OpenID Connect protocol. See more on OpenID Connect Authorization Endpoint.REACT_APP_OIDC_CLIENT_ID: Client ID for the OpenID Connect protocol. See more on OpenID Connect Terminology.
Note
If you want to have different sets of .env files for different purposes (production, development, testing, etc), refer to the Enviroment variables CRA documentation.
Here is an example of .env file:
REACT_APP_AUTOSUBMIT_API_SOURCE=https://earth.bsc.es/autosubmitapi
REACT_APP_AUTHENTICATION=true
REACT_APP_AUTH_PROVIDER=cas
REACT_APP_CAS_THIRD_PARTY_LOGIN_URL=https://cas.bsc.es/cas/login
REACT_APP_CAS_SERVICE_ID=https://earth.bsc.es/autosubmitapp/login