Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 19 Current »

The application.yml file contain settings which are needed for the basic configuration of Portrait.

Application

This defines the basic setup of Portrait.

Example:

application:
  name: Portrait App
  owner: Treskon GmbH
  env: prod
  description: |
    Build a branded and secure portal with a modern tech-stack. Portrait will provide you with an online portal, branded with your logo for mobile, tablet and desktop. This can be integrated with your enterprise software in minutes, making your customer journey perfect.
  url: https://portrait.customer.xyz
  dashboard:
    showLatest: true
    showFavorites: true
    caption: Start
  auth:
    publicAccess: false
  banner: |
    Important announcement!
  termsAndConditions: |
    This is some legal text with _markdown_.
  theme:
    logoUrl: /icons/logo-full.svg
    heroUrl: /icons/logo-hero.svg
    rasterLogoUrl: /icons/logo-raster.png
    highlightColor: '#f890e7'
    backgroundColor: '#f0f0f0'
    alternateBackgroundColor: '#ffffff'
    textColor: '#3d3d3d'
    labelColor: '#0bd3d3'
    dividerColor: '#eaeaea'
  sectionsCaption: Sections  
  pageSize: 20
  matomoUrl: https://matomo.customer.xyz
  matomoSiteId: 1
  matrixDiagram: true
  polling: 30

Settings

Name

name String

Name of your app.

Your app needs to be short. App drawers on mobile platforms abbreviate long names. Therefore keep it simple.

Examples:

(error) Treskon Self-Service App
(error) Treskon Team-App
(tick) Treskon
(tick) Team-App

owner String

Name of the app provider - usually your company.

env Enum

since 6.X

Optional settings - Default Value is “prod”
Valid Values:

“dev“: enables additional ErrorMessages on the API
”prod”: disables additional ErrorMessages on the API

description String

Intro, which is shown on the dashboard.

url String

Public URL pointing to the app. Used in mails and other situations.

dashboard object

See Dashboard

auth.publicAccess boolean

If you activate this flag, no authentication is needed and your app is accessible for everyone without a login.

This feature must be licensed.
Check with your Portrait reseller.

banner String

This will show a banner on top of the app. The user can hide the banner permanently by clicking on the “x”. If the announcement is changed, it will be reactivated.

Markdown formatting is accepted.

termsAndConditions String

This is your legal text, that each user that registers needs to accept.

theme object

See Theming

sectionsCaption String

First menu group name. e.g: “Sections”, “Documents”, …

pageSize int

Size of entries per page

matomoUrl url

Link to your matomo instance.
See Analytics

matomoSiteId int

Site Id in your matomo instance.
See Analytics

matrixDiagram bool

If you are using the diagram view, you can define if the entries are aligned in a matrix - instead the entries inside the organigram will be aligned horizontally.

csvDelimiter string

The delimiter, used in the CSV exports, is by default “;”. You can overwrite it according to your needs.

Some customers prefer a comma, since this is better accepted by Microsoft Excel.

polling int

Polling is by default turned off. By defining this value in seconds, you can activate a regular polling for new data.

Mapbox

If you want to use the Map view or use https://portrait.atlassian.net/wiki/spaces/PA/pages/122224641/Field+Processors#Geo-Coding, you need to have a Mapbox account and a token that is accessible for your portrait site URL. (e.g. https://portrait.customer.xyz)

mapbox:
  token: 'pk.xxxxxxxxxxxxxxxxxxx'
  url: 'https://api.mapbox.com/geocoding/v5/mapbox.places/'

Users

When Portrait is initialized, a user is created for administration. This user is defined here:

prepopulateUsers:
  enabled: false
  users:
    - email: admin@customer.com
      password: "s3cur3d"
      username: Administrator
      status: GRANTED
      role: ADMIN

Settings

Name

enabled boolean

We recommend keeping this feature set to false.

If set to true, each time you restart the server, the users will be recreated. This comes with a side effect, that all tokens are invalidated and you need to delete your auth-token manually.

users.email String

E-Mail address for login

users.password String

Preset password

users.username String

Given username

users.status String

GRANTED, UNCHECKED or REVOKED

users.role String

ADMIN or USER

You could use this configuration also for mass creation of users. We use this feature for internal tests, but we doubt there is a use case for this in the real world.

Properties

These settings are internal and usually you shouldn’t need to change them.

We document this example as a reference.

####################################
#      Application properties      #
####################################

endpoints:
  enabled: false
  sensitive: true
  jmx:
    enabled: false

jwt:
  header: Authorization
  secret: s3cur3d

elasticsearch:
  host: index
  port: 9300
  clusterName: docker-cluster

Custom Logging Configuration (Since 6.x)

Portait uses the Logback Library for Logging and comes with a default logging configuration.

This configuration can be overwritten with your own.

Configuration in application.yml:

####################################
#      Application properties      #
####################################

logging:
  config: config/logback.xml

(info) The path of the logfile needs to be accessable within the docker container. Therefore it should be in the config folder which is mapped as a volume inside the container.

Example logback.xml

<configuration>

    <property name="HOME_LOG" value="logs/portrait_backend.log"/>

    <appender name="FILE-ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${HOME_LOG}</file>

        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
            <fileNamePattern>logs/archived/portrait_backend.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
            <!-- each archived file, size max 10MB -->
            <maxFileSize>10MB</maxFileSize>
            <!-- total size of all archive files, if total size > 20GB, it will delete old archived file -->
            <totalSizeCap>20GB</totalSizeCap>
            <!-- 60 days to keep -->
            <maxHistory>60</maxHistory>
        </rollingPolicy>

        <encoder>

            <pattern>%d [%thread] %-5level %logger{36}:%method - %msg%n</pattern>
        </encoder>
    </appender>

    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
        <layout class="ch.qos.logback.classic.PatternLayout">
            <Pattern>
                %d [%thread] %highlight(%-5level) %cyan(%logger{36}):%green(%method) - %msg%n
            </Pattern>
        </layout>
    </appender>

    <logger name="at.treskon" level="WARN" additivity="false">
        <appender-ref ref="FILE-ROLLING"/>
        <appender-ref ref="CONSOLE"/>
    </logger>

    <root level="error">
        <appender-ref ref="FILE-ROLLING"/>
        <appender-ref ref="CONSOLE"/>
    </root>

</configuration>

(info) The Logfiles should be written to logs/. Then the files will be mapped on the host via docker-compose.

(info) Further Information is available on the official logback documentation

  • No labels