Configuration

Overview

The server configuration is mainly done in a file named application.yml

General

The general Crane Server configuration options are children of the app property:

  • app.audit-logging: activate auditing logs and store them in the specified file
  • app.default-cache: configures the default method of handling cache headers in the HTTP responses
  • app.logo-url: URL to an image used as the icon in the top left of the Crane website
  • app.openid-groups-claim: claim name used to determine the group names of users
  • app.openid-issuer-uri: URI of the OpenID issuer for example www.my-keycloak.test
  • app.openid-logout-url: logout URI of the OpenID provider for example www.my-keycloak.test/logout
  • app.openid-posix-uid-claim: claim name used to extract the user identifier (UID) of users; only used with POSIX access control
  • app.openid-posix-gids-claim: claim name used to extract the group identifiers (GID) of users; only used with POSIX access control
  • app.openid-username-claim: claim name used to determine alternative username; only used with POSIX access control
  • app.repositories: a map of repository names defining the access control and possible sub-paths. Example:
    app:
      repositories:
        first_repository:
          read-access:
            users: [ jack, jeff ]
          write-access:
            groups: [ writter, author ]
        second_repository:
          read-access:
            public: true
    
  • app.repositories.[REPOSITORY_NAME].cache: configures the method of handling cache headers in the HTTP responses on a repository level
  • app.repositories.[REPOSITORY_NAME].storage-location: location of the repositories files and directories
  • app.repositories.[REPOSITORY_NAME].on-error-expression: SpEL expression that allows changing the behaviour of Crane when an error occurs.
  • app.repositories.[REPOSITORY_NAME].cache: configure cache headers in the HTTP responses on a repository level
        report1:
          index-file-name: "1-introduction.html"
          cache:
            - pattern: "/**/*.gif"   # Ant Path pattern: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/util/AntPathMatcher.html
              max-age: "P30D"        # ISO-8601 duration: https://en.wikipedia.org/wiki/ISO_8601#Durations
            - pattern: "/**/*.jpg"
              max-age: "P30D"
            - pattern: "/**/*.jpeg"
              max-age: "P30D"
            - pattern: "/**/*.png"
              max-age: "P30D"
            - pattern: "/**/*.svg"
              max-age: "P30D"
            - pattern: "/**/*.css"
              max-age: "P1D"
            - pattern: "/**/*.js"
              max-age: "P1D"
            - pattern: "/**/*.json"
              max-age: "P1D"
            - pattern: "/**/*.html"
              max-age: "PT5M"
    
  • app.repositories.[REPOSITORY_NAME].storage-location: optional property specifying the location of the repositories files and directories
  • app.repositories.[REPOSITORY_NAME].on-error-expression: SpEL expression that allows changing the behaviour of Crane when an error occurs
  • app.repositories.[REPOSITORY_NAME].index-file-name: filename that Crane uses as the landing page of the repository. If the file isn’t present Crane uses default-index.html instead. This property has index.html as its default value
  • app.storage-location: Crane uses the defined location as a default place to look for files. Each repository appends its name to the storage location. E.g. if the storage location is /some/path and a repository called test_repo Crane then shows the files and directories in /some/path/test_repo.
  • app.s3-endpoint: endpoint to the s3 provider
  • app.template-path: optional path used to customize the landing page (listing of the apps) of Crane; it refers to the folder that contains the index.html page and all assets needed to serve the custom landing page

Besides the default option there also are some extra properties used by Crane Server:

  • server.servlet.context-path: by default Crane runs on the / context path; the context path can be configured using this property. Note that it should always start with a slash (as in /abcd):
    server:
      servlet:
        context-path: /abcd
    
  • logging.level.eu: if something weird is happening with your Crane Server you can have a look at the logs by changing the log level to one of the following values ERROR, WARN, INFO and DEBUG. Don’t use this option in a production environment.