Skip to content

Commit

Permalink
add local development files
Browse files Browse the repository at this point in the history
  • Loading branch information
peh committed Sep 14, 2018
1 parent d1353ba commit a06575b
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ log/
target/

# helpers
/local/
/local/.data
/data/
.slcache
.data/
Expand Down
28 changes: 28 additions & 0 deletions local/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
82 changes: 82 additions & 0 deletions local/errbuddy-config.groovy
Original file line number Diff line number Diff line change
@@ -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
}
2 changes: 1 addition & 1 deletion src/main/groovy/CorsFilter.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit a06575b

Please sign in to comment.