# ===================================================================
# Spring Boot configuration.
#
# This configuration will be overriden by the Spring profile you use,
# for example application-dev.yml if you use the "dev" profile.
# ===================================================================

# ===================================================================
# Standard Spring Boot properties.
# Full reference is available at:
# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
# ===================================================================

<%_ if (serviceDiscoveryType == 'eureka') { _%>
eureka:
    instance:
        appname: <%= baseName %>
        instanceId: <%= baseName %>:${spring.application.instance_id:${random.value}}
        statusPageUrlPath: ${management.context-path}/info
        healthCheckUrlPath: ${management.context-path}/health
ribbon:
    eureka:
        enabled: true
<%_ } _%>
<%_ if (applicationType == 'gateway') { _%>
zuul:
    host:
        connect-timeout-millis: 5000
        socket-timeout-millis: 10000
    <%_ if (serviceDiscoveryType == 'consul') { _%>
    ignoredServices: 'consul,<%= baseName %>' # Prevent Consul and the "<%= baseName %>" app itself from having a Zuul route automatically created for them
    <%_ } _%>

# See https://github.com/Netflix/Hystrix/wiki/Configuration
hystrix:
    command:
        default:
            execution:
                isolation:
                    thread:
                        timeoutInMilliseconds: 10000

<%_ } _%>
management:
    context-path: /management
    health:
        mail:
            enabled: false # When using the MailService, configure an SMTP server and set this to true
<%_ if (messageBroker == 'kafka') { _%>
        binders:
            enabled: true
<%_ } _%>
spring:
    application:
        name: <%= baseName %>
    <%_ if (serviceDiscoveryType == 'consul') { _%>
    cloud:
        consul:
            discovery:
                healthCheckPath: /management/health
                instanceId: ${spring.application.name}:${spring.application.instance_id:${random.value}}
    <%_ } _%>
    <%_ if (applicationType === 'monolith') { _%>
    profiles:
        # The commented value for `active` can be replaced with valid spring profiles to load.
        # Otherwise, it will be filled in by <%= buildTool %> when building the WAR file
        # Either way, it can be overridden by `--spring.profiles.active` value passed in the commandline or `-Dspring.profiles.active` set in `JAVA_OPTS`
        active: #spring.profiles.active#
    <%_ } _%>
    jackson:
        serialization.write_dates_as_timestamps: false
    <%_ if (databaseType == 'sql') { _%>
    jpa:
        open-in-view: false
        hibernate:
            ddl-auto: none
            naming:
                strategy: org.springframework.boot.orm.jpa.hibernate.SpringNamingStrategy
    <%_ } _%>
    messages:
        basename: i18n/messages
    mvc:
        favicon:
            enabled: false
    thymeleaf:
        mode: XHTML
<%_ if (enableSocialSignIn) { _%>
    social:
        # see https://developers.google.com/+/web/signin/server-side-flow#step_1_create_a_client_id_and_client_secret
        google:
            clientId: xxx
            clientSecret: xxx

        # see https://developers.facebook.com/docs/facebook-login/v2.2
        facebook:
            clientId: xxx
            clientSecret: xxx

        # see https://apps.twitter.com/app/
        twitter:
            clientId: xxx
            clientSecret: xxx

        # jhipster-needle-add-social-configuration
<%_ } _%>

security:
    basic:
        enabled: false

# ===================================================================
# JHipster specific properties
# ===================================================================

jhipster:
    async:
        corePoolSize: 2
        maxPoolSize: 50
        queueCapacity: 10000
    #cors: #By default CORS are not enabled. Uncomment to enable.
        #allowed-origins: "*"
        #allowed-methods: GET, PUT, POST, DELETE, OPTIONS
        #allowed-headers: "*"
        #exposed-headers:
        #allow-credentials: true
        #max-age: 1800
    mail:
        from: <%= baseName %>@localhost
    swagger:
        title: <%=baseName%> API
        description: <%=baseName%> API documentation
        version: 0.0.1
        termsOfServiceUrl:
        contactName:
        contactUrl:
        contactEmail:
        license:
        licenseUrl:
<%_ if (enableSocialSignIn) { _%>
    social:
        <%_ if (authenticationType == 'jwt') { _%>
        redirectAfterSignIn: "/#/social-auth"
        <%_ } else { _%>
        redirectAfterSignIn: "/#/home"
        <%_ } _%>
<%_ } _%>
    ribbon:
        # comma seperated list of profiles to show a ribbon on the GUI
        displayOnActiveProfiles: dev
