Permalink
Browse files

add local development files

  • Loading branch information...
peh committed Sep 14, 2018
1 parent d1353ba commit a06575b21d871c9c472545c44ecdb63eb31e0b49
Showing with 112 additions and 2 deletions.
  1. +1 −1 .gitignore
  2. +28 −0 local/docker-compose.yml
  3. +82 −0 local/errbuddy-config.groovy
  4. +1 −1 src/main/groovy/CorsFilter.groovy
@@ -31,7 +31,7 @@ log/
target/

# helpers
/local/
/local/.data
/data/
.slcache
.data/
@@ -0,0 +1,28 @@
version: '2'
services:
redis:
image: redis
expose:
- 6379
ports:
- 127.0.0.1:6379:6379
elasticsearch:
image: elasticsearch:1.7.5
volumes:
- .data/elasticsearch:/usr/share/elasticsearch/data
expose:
- 9300
- 9200
ports:
- 127.0.0.1:9200:9200
- 127.0.0.1:9300:9300
command: "--cluster.name=elasticsearch"
mariadb:
image: mariadb
environment:
- MYSQL_ROOT_PASSWORD=123456
- MYSQL_USER=errbuddy
- MYSQL_PASSWORD=123456
- MYSQL_DATABASE=errbuddy
ports:
- 127.0.0.1:3306:3306
@@ -0,0 +1,82 @@
dataSource {
dbCreate = "none" // sql-migration plugin will do that for us!
driverClassName = "com.mysql.jdbc.Driver"
url = "jdbc:mysql://127.0.0.1/errbuddy?generateSimpleParameterMetadata=true&zeroDateTimeBehavior=convertToNull"
username = "errbuddy"
password = "123456"
properties {
maxActive = 100
minEvictableIdleTimeMillis = 1800000
timeBetweenEvictionRunsMillis = 1800000
numTestsPerEvictionRun = 3
testOnBorrow = true
testWhileIdle = true
testOnReturn = true
validationQuery = "SELECT 1"
}
}

springsession {
redis {
connectionFactory {
host = redisHost
timeout = 2000
usePool = true
}
}
}

grails {
serverURL = System.getProperty('errbuddy.serverUrl')
redis {
host = redisHost
poolConfig {
// jedis pool specific tweaks here, see jedis docs & src
testWhileIdle = true
maxTotal = 500
}
timeout = 2000 //default in milliseconds
}
}

errbuddy {
defaultMax = 20
maximumMax = 100
supportedLanguages = ['en']
defaultLanguage = 'en'
retentionDays = 21
}

grails {
jesque {
enabled = true
schedulerThreadActive = false
delayedJobThreadActive = true
}
plugin {
errbuddy {
enabled = true // whether the plugin is enabled and the LogAppender is registered with the root logger
exceptionsOnly = false // whether to send more then just exceptions
threshold = "WARN" // if exceptionsOnly is false, this is the threshold
hostname {
resolve = false
name = 'localhost'
}
}
}
}

elasticSearch {
client {
mode = 'transport'
hosts = [
[
host: "127.0.0.1",
port: 9300
]
]
}
datastoreImpl = 'hibernateDatastore'
cluster.name = 'elasticsearch'
bulkIndexOnStartup = false
}
@@ -17,7 +17,7 @@ class CorsFilter extends OncePerRequestFilter {

String origin = req.getHeader("Origin")

boolean options = "OPTIONS".equals(req.getMethod())
boolean options = req.method.equalsIgnoreCase("OPTIONS")
if (options) {
if (origin == null) return
resp.addHeader("Access-Control-Allow-Headers", "key, origin, authorization, accept, content-type, x-requested-with")

0 comments on commit a06575b

Please sign in to comment.