Configuration

Heromyth edited this page Feb 12, 2019 · 18 revisions

Get Config item value

// get hunt.upload.maxSize value use Config() function
long uploadMaxSize = Config().upload.maxSize;

Hunt application config file

config/application.conf

hunt.application.name = MYSITE
hunt.application.baseUrl = http://localhost:8080/
hunt.application.defaultLanguage = zh-CN
hunt.application.languages = zh-CN,en-US
hunt.application.secret = ASDF0123456789
hunt.application.encoding = UTF-8
hunt.application.staticFileCacheMinutes = 30

# hunt.route.groups = admin:directory:admincp, api:domain:api.example.com

hunt.session.storage = file
hunt.session.path = ./storage/sessions/
hunt.session.prefix = huntsession_
hunt.session.expire = 3600
hunt.session.args =

hunt.cookie.domain = .huntframework.com
hunt.cookie.path = /
hunt.cookie.expires = 3600
hunt.cookie.httpOnly = false
hunt.cookie.secure = false

hunt.cache.storage = memory
hunt.cache.prefix = huntcache_
hunt.cache.expire = 3600
hunt.cache.args =
hunt.cache.enableL2 = 

hunt.memcache.enabled = true
hunt.memcache.servers = 127.0.0.1:11211

hunt.redis.enabled = true
hunt.redis.host = 127.0.0.1
hunt.redis.port = 6379
hunt.redis.database = 0
hunt.redis.password = ""
hunt.redis.timeout = 0

hunt.http.address=0.0.0.0
hunt.http.port=8080
hunt.http.path=wwwroot/
hunt.http.workerThreads=4
hunt.http.cacheControl=0
hunt.http.ioThreads = 
hunt.http.keepAliveTimeOut=

hunt.https.enabled=false
#hunt.https.privateKey=privkey.pem
#hunt.https.certKey=cert.pem
hunt.https.protocol = "TLS";
hunt.https.keyStore=keystore.p12
hunt.https.keyStoreType=PKCS12
hunt.https.keyStorePassword=secret


hunt.logging.level=DEBUG
hunt.logging.path=
hunt.logging.file=
hunt.logging.maxSize = 8M
hunt.logging.maxNum=10

hunt.upload.path=attachments/
hunt.upload.maxSize=4096000

hunt.cron.noon=0 0 12 * * ?

hunt.date.format=yyyy-mm-dd
hunt.date.timeZone=Asia/Shanghai

hunt.database.default.driver=postgresql
hunt.database.default.host=127.0.0.1
hunt.database.default.port=2345
hunt.database.default.database=test
hunt.database.default.username=root
hunt.database.default.password=
hunt.database.default.charset=utf8
hunt.database.default.prefix=
hunt.database.default.enabled=false

hunt.database.pool.name=
hunt.database.pool.minIdle=5
hunt.database.pool.idleTimeout=30000
hunt.database.pool.maxConnection=20
hunt.database.pool.minConnection=5
hunt.database.pool.maxPoolSize=20
hunt.database.pool.minPoolSize=20
hunt.database.pool.maxLifetime=2000000
hunt.database.pool.connectionTimeout=30000

hunt.mail.smtp.host = smtp.gmail.com
hunt.mail.smtp.channel =
hunt.mail.smtp.port=2500
hunt.mail.smtp.protocol=smtps
hunt.mail.smtp.user =
hunt.mail.smtp.password =

hunt.view.path = ./views/
hunt.view.ext = .html

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.