#only used when not configured in run configuration, dev profile always recommended to save in IDE
spring.profiles.active=test

server.port=${PORT:8080}

#enable to force https for development
#server.ssl.key-store-type=PKCS12
#server.ssl.key-store=alovoa.p12
#server.ssl.key-store-password=alovoa
#server.ssl.key-alias=alovoa

spring.main.allow-bean-definition-overriding=true

server.http2.enabled=true

spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
spring.datasource.url=jdbc:mariadb://localhost:3306/alovoa?createDatabaseIfNotExist=true&serverTimezone=UTC&useLegacyDatetimeCode=false
#spring.datasource.hikari.maximum-pool-size=10
#spring.datasource.hikari.connectionTimeout=30000
#spring.datasource.hikari.idleTimeout=600000
#spring.datasource.hikari.maxLifetime=1800000

#Insert your oauth2 ids and secrets here
#spring.security.oauth2.client.registration.google.client-id=<your client id>
#spring.security.oauth2.client.registration.google.client-secret=<your client secret>
#spring.security.oauth2.client.registration.facebook.client-id=<your client id>
#spring.security.oauth2.client.registration.facebook.client-secret=<your client secret>

#we keep the default /login/oauth2/code/{registrationId} scheme

spring.web.locale=en_EN

spring.cache.jcache.config=classpath:ehcache.xml

spring.servlet.multipart.maxFileSize=10MB
spring.servlet.multipart.maxRequestSize=10MB

spring.security.oauth2.client.registration.google.scope[0]=email
spring.security.oauth2.client.registration.google.scope[1]=profile
spring.security.oauth2.client.registration.facebook.scope[0]=email
spring.security.oauth2.client.registration.facebook.scope[1]=public_profile

server.servlet.session.timeout=1h
server.servlet.session.cookie.max-age=1h
server.servlet.session.cookie.same-site=LAX
server.compression.enabled=true
server.compression.mime-types=text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json,application/xml
server.compression.min-response-size=10240

spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MariaDBDialect
spring.jpa.database-platform=org.hibernate.dialect.MariaDB103Dialect
spring.jpa.show-sql=false
spring.jpa.generate-ddl=true
spring.jpa.properties.hibernate.id.db_structure_naming_strategy=legacy
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.jdbc.time_zone=UTC
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
spring.jpa.properties.hibernate.plan_cache_max_size=16
spring.jpa.properties.hibernate.plan_parameter_metadata_max_size=16
spring.jpa.properties.hibernate.query.in_clause_parameter_padding=true

### KEYS AND CREDENTIALS ###
#spring.datasource.password=lekker4life
#spring.datasource.username=itslivesex_badoo
#keys for transparent database encryption
#app.text.key= #key must be 16, 24 or 32 bytes long
#app.text.salt= #salt must be 16 bytes long
#app.admin.email=petjeplex@gmail.com
#app.admin.key=
#spring.mail.password=<login password to smtp server>
spring.mail.host=mail.gmx.net
spring.mail.port=587
spring.mail.username=nonononoki@gmx.de
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
spring.mail.test-connection=true
spring.mail.properties.mail.smtp.ssl.checkserveridentity=false

# logging
logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} %-5level %logger{36} - %msg%n
logging.level.org.springframework.web=INFO
logging.level.org.hibernate.SQL=ERROR
logging.level.org.hibernate=ERROR
logging.file.name=./logs/spring.log

#bucket4j
bucket4j.enabled=true
bucket4j.filters[0].cache-name=bucket4j
bucket4j.filters[0].url=.*
bucket4j.filters[0].rate-limits[0].cache-key=getRemoteAddr()
bucket4j.filters[0].rate-limits[0].bandwidths[0].capacity=200
bucket4j.filters[0].rate-limits[0].bandwidths[0].time=6
bucket4j.filters[0].rate-limits[0].bandwidths[0].unit=seconds

bucket4j.filters[1].cache-name=bucket4j
bucket4j.filters[1].url=/login
bucket4j.filters[1].rate-limits[0].cache-key=getRemoteAddr()
bucket4j.filters[1].rate-limits[0].bandwidths[0].capacity=20
bucket4j.filters[1].rate-limits[0].bandwidths[0].time=60
bucket4j.filters[1].rate-limits[0].bandwidths[0].unit=seconds

bucket4j.filters[2].cache-name=bucket4j
bucket4j.filters[2].url=/delete-account-confirm
bucket4j.filters[2].rate-limits[0].cache-key=getRemoteAddr()
bucket4j.filters[2].rate-limits[0].bandwidths[0].capacity=5
bucket4j.filters[2].rate-limits[0].bandwidths[0].time=60
bucket4j.filters[2].rate-limits[0].bandwidths[0].unit=seconds

bucket4j.filters[3].cache-name=bucket4j
bucket4j.filters[3].url=/password/reset
bucket4j.filters[3].rate-limits[0].cache-key=getRemoteAddr()
bucket4j.filters[3].rate-limits[0].bandwidths[0].capacity=5
bucket4j.filters[3].rate-limits[0].bandwidths[0].time=60
bucket4j.filters[3].rate-limits[0].bandwidths[0].unit=seconds

bucket4j.filters[4].cache-name=bucket4j
bucket4j.filters[4].url=/password/change
bucket4j.filters[4].rate-limits[0].cache-key=getRemoteAddr()
bucket4j.filters[4].rate-limits[0].bandwidths[0].capacity=5
bucket4j.filters[4].rate-limits[0].bandwidths[0].time=60
bucket4j.filters[4].rate-limits[0].bandwidths[0].unit=seconds

bucket4j.filters[5].cache-name=bucket4j
bucket4j.filters[5].url=/user/like/*
bucket4j.filters[5].rate-limits[0].cache-key=getRemoteAddr()
bucket4j.filters[5].rate-limits[0].bandwidths[0].capacity=10
bucket4j.filters[5].rate-limits[0].bandwidths[0].time=60
bucket4j.filters[5].rate-limits[0].bandwidths[0].unit=seconds

bucket4j.filters[6].cache-name=bucket4j
bucket4j.filters[6].url=/search/users/*
bucket4j.filters[6].rate-limits[0].cache-key=getRemoteAddr()
bucket4j.filters[6].rate-limits[0].bandwidths[0].capacity=5
bucket4j.filters[6].rate-limits[0].bandwidths[0].time=60
bucket4j.filters[6].rate-limits[0].bandwidths[0].unit=seconds

bucket4j.filters[7].cache-name=bucket4j
bucket4j.filters[7].url=/register
bucket4j.filters[7].rate-limits[0].cache-key=getRemoteAddr()
bucket4j.filters[7].rate-limits[0].bandwidths[0].capacity=5
bucket4j.filters[7].rate-limits[0].bandwidths[0].time=60
bucket4j.filters[7].rate-limits[0].bandwidths[0].unit=seconds

bucket4j.filters[8].cache-name=bucket4j
bucket4j.filters[8].url=/user/delete-account-confirm
bucket4j.filters[8].rate-limits[0].cache-key=getRemoteAddr()
bucket4j.filters[8].rate-limits[0].bandwidths[0].capacity=5
bucket4j.filters[8].rate-limits[0].bandwidths[0].time=60
bucket4j.filters[8].rate-limits[0].bandwidths[0].unit=seconds

bucket4j.filters[9].cache-name=bucket4j
bucket4j.filters[9].url=/user/update/profile-picture
bucket4j.filters[9].rate-limits[0].cache-key=getRemoteAddr()
bucket4j.filters[9].rate-limits[0].bandwidths[0].capacity=5
bucket4j.filters[9].rate-limits[0].bandwidths[0].time=60
bucket4j.filters[9].rate-limits[0].bandwidths[0].unit=seconds

bucket4j.filters[10].cache-name=bucket4j
bucket4j.filters[10].url=/user/update/audio*
bucket4j.filters[10].rate-limits[0].cache-key=getRemoteAddr()
bucket4j.filters[10].rate-limits[0].bandwidths[0].capacity=5
bucket4j.filters[10].rate-limits[0].bandwidths[0].time=60
bucket4j.filters[10].rate-limits[0].bandwidths[0].unit=seconds

bucket4j.filters[11].cache-name=bucket4j
bucket4j.filters[11].url=/user/image/add
bucket4j.filters[11].rate-limits[0].cache-key=getRemoteAddr()
bucket4j.filters[11].rate-limits[0].bandwidths[0].capacity=5
bucket4j.filters[11].rate-limits[0].bandwidths[0].time=60
bucket4j.filters[11].rate-limits[0].bandwidths[0].unit=seconds

bucket4j.filters[12].cache-name=bucket4j
bucket4j.filters[12].url=/user/report
bucket4j.filters[12].rate-limits[0].cache-key=getRemoteAddr()
bucket4j.filters[12].rate-limits[0].bandwidths[0].capacity=5
bucket4j.filters[12].rate-limits[0].bandwidths[0].time=60
bucket4j.filters[12].rate-limits[0].bandwidths[0].unit=seconds

bucket4j.filters[13].cache-name=bucket4j
bucket4j.filters[13].url=/profile/view/*
bucket4j.filters[13].rate-limits[0].cache-key=getRemoteAddr()
bucket4j.filters[13].rate-limits[0].bandwidths[0].capacity=5
bucket4j.filters[13].rate-limits[0].bandwidths[0].time=60
bucket4j.filters[13].rate-limits[0].bandwidths[0].unit=seconds

bucket4j.filters[14].cache-name=bucket4j
bucket4j.filters[14].url=/captcha/generate
bucket4j.filters[14].rate-limits[0].cache-key=getRemoteAddr()
bucket4j.filters[14].rate-limits[0].bandwidths[0].capacity=5
bucket4j.filters[14].rate-limits[0].bandwidths[0].time=60
bucket4j.filters[14].rate-limits[0].bandwidths[0].unit=seconds

bucket4j.filters[15].cache-name=bucket4j
bucket4j.filters[15].url=/info
bucket4j.filters[15].rate-limits[0].cache-key=getRemoteAddr()
bucket4j.filters[15].rate-limits[0].bandwidths[0].capacity=2
bucket4j.filters[15].rate-limits[0].bandwidths[0].time=20
bucket4j.filters[15].rate-limits[0].bandwidths[0].unit=seconds

bucket4j.filters[16].cache-name=bucket4j
bucket4j.filters[16].url=/user/*
bucket4j.filters[16].rate-limits[0].cache-key=getRemoteAddr()
bucket4j.filters[16].rate-limits[0].bandwidths[0].capacity=10
bucket4j.filters[16].rate-limits[0].bandwidths[0].time=20
bucket4j.filters[16].rate-limits[0].bandwidths[0].unit=seconds

bucket4j.filters[17].cache-name=bucket4j
bucket4j.filters[17].url=/user/userdata/*
bucket4j.filters[17].rate-limits[0].cache-key=getRemoteAddr()
bucket4j.filters[17].rate-limits[0].bandwidths[0].capacity=5
bucket4j.filters[17].rate-limits[0].bandwidths[0].time=1200
bucket4j.filters[17].rate-limits[0].bandwidths[0].unit=seconds

bucket4j.filters[18].cache-name=bucket4j
bucket4j.filters[18].url=/profile/*
bucket4j.filters[18].rate-limits[0].cache-key=getRemoteAddr()
bucket4j.filters[18].rate-limits[0].bandwidths[0].capacity=10
bucket4j.filters[18].rate-limits[0].bandwidths[0].time=10
bucket4j.filters[18].rate-limits[0].bandwidths[0].unit=seconds

bucket4j.filters[19].cache-name=bucket4j
bucket4j.filters[19].url=/user/delete-account-confirm
bucket4j.filters[19].rate-limits[0].cache-key=getRemoteAddr()
bucket4j.filters[19].rate-limits[0].bandwidths[0].capacity=5
bucket4j.filters[19].rate-limits[0].bandwidths[0].time=1200
bucket4j.filters[19].rate-limits[0].bandwidths[0].unit=seconds

bucket4j.filters[20].cache-name=bucket4j
bucket4j.filters[20].url=/imprint/delete-account-request
bucket4j.filters[20].rate-limits[0].cache-key=getRemoteAddr()
bucket4j.filters[20].rate-limits[0].bandwidths[0].capacity=10
bucket4j.filters[20].rate-limits[0].bandwidths[0].time=1200
bucket4j.filters[20].rate-limits[0].bandwidths[0].unit=seconds


# custom values
app.company.name=Alovoa
app.privacy.update-date=2021-06-16
app.tos.update-date=2021-09-22
app.name=Alovoa
app.domain=http://localhost:8080
app.scheduling.enabled=true

#secret in url to verify that the transaction is legit, change in production!
app.donate.kofi.key=kofi123
app.donate.bmac.key=bmac123

app.mail.plus-addressing=false
app.first-name.length-min=2
app.first-name.length-max=10
app.audio.max-time=10
app.audio.max-size=10000000
app.image.max-size=5000000
app.captcha.length=4
app.password-token.length=32
app.age.min=16
app.age.max=99
app.age.range=10
#7 days
app.donation.popup.time=604800000
app.token.length=30
app.profile.image.length=600
app.profile.image.max=4
app.profile.description.size=255
app.search.max=20
app.search.max.distance=160
app.search.estimate.max=200
app.search.ignore-intention=true
app.message.size=255
app.conversation.messages-max=50
app.donate.users.max=100
app.referral.max=20
app.like.message.length=120

#test values only, use proper keys for production!
app.login.remember.key=CWjuiidCW23KnRWUnzVpcpE4pVFcVCC7pi5X9htZVxDPp5ztWDrj2ePahFXQQeTx

app.intention.delay=86400000
app.interest.max=10
app.interest.min-chars=3
app.interest.max-chars=30
app.interest.autocomplete.max=5
app.prompt.max=6
app.prompt.length.max=120
app.donation.modulus=10
app.url.auth.success=/
app.url.auth.failure=/?auth-error
app.url.front-end=http://localhost:8081

#24 hours
app.user.delete.duration.valid=86400000
#5 minutes
app.user.password-reset.duration.valid=300000

#schedules
app.schedule.enabled=true
#30 seconds
app.schedule.short=30000
#1 hour
app.schedule.long=3600000
#5 minutes
app.schedule.delay.captcha=300000
#90 days
app.schedule.delay.hide=9720000000
#14 days
app.schedule.delay.user.cleanup=1209600000
