Skip to main content

Configuration

JAX-RS Jersey doesn't specify how application configurations are to be loaded. jersey-webservice-template, however, utilizes a library called owner.

The configurations in this page can be set from several sources in the following order:

  1. the operating system's environment variables; for instance, an environment variable can be set with export DB_URL="jdbc:mysql://db/elide?serverTimezone=UTC"
  2. the Java system properties; for example, a Java system property can be set using System.setProperty("DB_URL", "jdbc:mysql://db/elide?serverTimezone=UTC")
  3. a .properties file placed under CLASSPATH. This file can be put under src/main/resources source directory with contents, for example, DB_URL=jdbc:mysql://db/elide?serverTimezone=UTC

Note that environment config has higher priority than Java system properties. Java system properties have higher priority than file based configuration.

CI/CD

The following GitHub Action Secrets needs to be setup:

Secret NameDefinitionHow to Get
DOCKERHUB_USERNAMEYou Docker Hub usernameFor example, this user's is jack20191124
DOCKERHUB_TOKENA personal access token (PAT) to use as an Docker CLI authentication from within GitHub ActionCreating an access token
AWS_WS_PKRVARS_HCLThe HashiCorp Packer variable values file contentshashicorp-aws
SSL_CERTIFICATESSL cert file for exposing webservice API via secure HTTPSInstalling Free SSL Certificates with Certbot running on Nginx
SSL_CERTIFICATE_KEYSSL cert key file for exposing webservice API via secure HTTPSInstalling Free SSL Certificates with Certbot running on Nginx
NGINX_CONFIG_FILEConfig file for Nginx as a HTTPS reverse proxyDefine Nginx Reverse Proxy Config File
FILEBEAT_CONFIG_FILEThe standard filebeat.yml file contentsConfigure Filebeat
AWS_WS_TFVARSThe HashiCorp Terraform variable values file contentshashicorp-aws
MAVEN_SETTINGS_XMLThe contents of Maven settings file for the Webservice projectThe exact settings.xml contents containing these meta tags
OAUTH_PROPERTIESThe contents of the src/main/resources/oauth.properties mentioned aboveSee Security section above
AWS_ACCESS_KEY_IDThe exact same AWS_ACCESS_KEY_ID as mentioned in Environment variables to configure the AWS CLIHow to create and configure AWS credentials for Amazon Keyspaces
AWS_SECRET_ACCESS_KEYThe exact same AWS_SECRET_ACCESS_KEY as mentioned in Environment variables to configure the AWS CLIHow to create and configure AWS credentials for Amazon Keyspaces
AWS_REGIONThe exact same AWS_REGION as mentioned in Environment variables to configure the AWS CLIHow to create and configure AWS credentials for Amazon Keyspaces