Skip to content

Configuration

Andrew Dunn edited this page Sep 8, 2017 · 4 revisions

Configuration

Configuration of the service is controlled with an application.yml file that by convention sits next to the application jar file. Spring Boot provides the framework for enabling the external configuration of the application.

RCloud Specific Configuration

The following are settings used to define how the application runs, some of the settings are provided by Spring Boot but have been included here as they directly impact running the service.

Configuring Port Numbers

The Gist API and Management API by default run on different ports, the specific ports can be changed with the following configuration.

gist api port

server:
  port: 13020

management api port

management:
  port: 13021

management api security

The management endpoints that are accessible on the management port are protected by Basic Authentication. By default the user is admin and the password is generated and logged when the service starts so each time the service starts the password changes. You should set the password in the configuration.

security:
  user:
    name: admin
    role: ADMIN
    password: secret

gist service configuration

gist repositories root folder
gists:
  root: /var/rcloud-gist-service/gists/
gist lock timeout

The internal timeout used to acquire a read/write lock on the gist repository in seconds.

gists:
  lockTimeout: 30
gist keyservers

The service can authenticate a user against multiple Session Key Servers, this is based upon the client_id parameter specified in the request to the gist service. It can also be configured with a default key server to use if it does not fine a match with the client_id.

The following shows the default values, it is only necessary to specify the values when they are different.

gists:
  keyservers:
    default: # default key server
      host: 127.0.0.1 # default host
      port: 4301 # default port
      realm: rcloud # default realm
      url: http://{host}:{port}/valid?token={token}&realm={realm} #default URL pattern
      active: true # defaults to true if not specified
    abc123: # key server for client_id abc123
      port: 5678 # different port, using all other defaults

Whilst the service is running these changes will not be live until either the service is restarted or the service is told to reload its configuration (see Configuration Reloading).

gist collaborations

The configuration allows for mapping of gist owners to other users who can access and get write access the owners gists. The following settings can be applied in the application.yml file.

gists:
  users:
    collaborations:
      james: # the username of the gist owner
        - steve # a list of users who can access and change the owners gists
        - angela
      grace:
        - david
        - hannah
        - evan

Whilst the service is running these changes will not be live until either the service is restarted or the service is told to reload its configuration (see Configuration Reloading).

gist redirect

The gist service can perform a redirect if necessary on a URL.

gists:
   route:
    redirect:
      from: '/login/*'
      to: 'http://example.com'
      copyparams: true
gists section full reference
gists:
  root: /var/rcloud-gist-service/gists/
  lockTimeout: 30
  keyservers:
    default:
      host: 127.0.0.1
      port: 4301
      realm: rcloud
      url: http://{host}:{port}/valid?token={token}&realm={realm}
      active: true
  route:
    redirect:
      from: '/login/*'
      to: 'http://example.com'
      copyparams: true
  users:
    collaborations:
      james: # the username of the gist owner
        - steve # a list of users who can access and change the owners gists
        - angela
      grace:
        - david
        - hannah
        - evan

For a complete reference to the application yaml file, see this application.yml

Reloading configuration

The service supports reloading certain parts of the configuration without the need to restart the application, see Configuration Reloading.

General Spring Boot configuration options

Spring Boot provides many configurations options out of the box. The full list can be found in the Spring Boot Common Application Properties documentation