# ===================================================================
# 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 (applicationType == 'microservice' || applicationType == 'gateway' || applicationType == 'uaa') { _%>
eureka:
    instance:
        appname: <%= baseName %>
        instanceId: <%= baseName %>:${spring.application.instance_id:${random.value}}

ribbon:
    eureka:
        enabled: true

<%_ } _%>
<%_ if (applicationType == 'gateway') { _%>
zuul:

<%_ } _%>
management:
    context-path: /management
    health:
        mail:
            enabled: false # When using the MailService, configure an SMTP server and set this to true

spring:
    application:
        name: <%= baseName %>
    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

        # jh-genesis-needle-add-social-configuration
<%_ } _%>

security:
    basic:
        enabled: false

# ===================================================================
# JHGenesis specific properties
# ===================================================================

jh-genesis:
    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
