# ===================================================================
# 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.
#
# More information on profiles: https://jhipster.github.io/profiles/
# More information on configuration properties: https://jhipster.github.io/common-application-properties/
# ===================================================================

# ===================================================================
# 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

<%_ } _%>
<%_ if (applicationType === 'microservice') { _%>
# 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:
                physical-strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy
                implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
    <%_ } _%>
    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:
            client-id: xxx
            client-secret: xxx

        # see https://developers.facebook.com/docs/facebook-login/v2.2
        facebook:
            client-id: xxx
            client-secret: xxx

        # see https://apps.twitter.com/app/
        twitter:
            client-id: xxx
            client-secret: xxx

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

security:
    basic:
        enabled: false

server:
    session:
        cookie:
            http-only: true

# ===================================================================
# JHipster specific properties
#
# Full reference is available at: https://jhipster.github.io/common-application-properties/
# ===================================================================

jhipster:
    async:
        core-pool-size: 2
        max-pool-size: 50
        queue-capacity: 10000
    # By default CORS is disabled. Uncomment to enable.
    #cors:
        #allowed-origins: "*"
        #allowed-methods: GET, PUT, POST, DELETE, OPTIONS
        #allowed-headers: "*"
        #exposed-headers:
        #allow-credentials: true
        #max-age: 1800
    mail:
        from: <%= baseName %>@localhost
    swagger:
        default-include-pattern: /api/.*
        title: <%=baseName%> API
        description: <%=baseName%> API documentation
        version: 0.0.1
        terms-of-service-url:
        contact-name:
        contact-url:
        contact-email:
        license:
        license-url:
<%_ if (enableSocialSignIn) { _%>
    social:
        <%_ if (authenticationType == 'jwt') { _%>
        redirect-after-sign-in: "/#/social-auth"
        <%_ } else { _%>
        redirect-after-sign-in: "/#/home"
        <%_ } _%>
<%_ } _%>
    ribbon:
        display-on-active-profiles: dev

# ===================================================================
# Application specific properties
# Add your own application properties here, see the ApplicationProperties class
# to have type-safe configuration, like in the JHipsterProperties above
#
# More documentation is available at:
# https://jhipster.github.io/common-application-properties/
# ===================================================================

application:
