application.conf 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. # https://www.playframework.com/documentation/latest/Configuration
  2. # This is the main configuration file for the application.
  3. # https://www.playframework.com/documentation/latest/ConfigFile
  4. # ~~~~~
  5. # Play uses HOCON as its configuration file format. HOCON has a number
  6. # of advantages over other config formats, but there are two things that
  7. # can be used when modifying settings.
  8. #
  9. # You can include other configuration files in this main application.conf file:
  10. #include "extra-config.conf"
  11. #
  12. # You can declare variables and substitute for them:
  13. #mykey = ${some.value}
  14. #
  15. # And if an environment variable exists when there is no other subsitution, then
  16. # HOCON will fall back to substituting environment variable:
  17. #mykey = ${JAVA_HOME}
  18. ## Akka
  19. # https://www.playframework.com/documentation/latest/ScalaAkka#Configuration
  20. # https://www.playframework.com/documentation/latest/JavaAkka#Configuration
  21. # ~~~~~
  22. # Play uses Akka internally and exposes Akka Streams and actors in Websockets and
  23. # other streaming HTTP responses.
  24. akka {
  25. # "akka.log-config-on-start" is extraordinarly useful because it log the complete
  26. # configuration at INFO level, including defaults and overrides, so it s worth
  27. # putting at the very top.
  28. #
  29. # Put the following in your conf/logback.xml file:
  30. #
  31. # <logger name="akka.actor" level="INFO" />
  32. #
  33. # And then uncomment this line to debug the configuration.
  34. #
  35. #log-config-on-start = true
  36. }
  37. ## Secret key
  38. # http://www.playframework.com/documentation/latest/ApplicationSecret
  39. # ~~~~~
  40. # The secret key is used to sign Play's session cookie.
  41. # This must be changed for production, but we don't recommend you change it in this file.
  42. play.http.secret.key = "changeme"
  43. ## Modules
  44. # https://www.playframework.com/documentation/latest/Modules
  45. # ~~~~~
  46. # Control which modules are loaded when Play starts. Note that modules are
  47. # the replacement for "GlobalSettings", which are deprecated in 2.5.x.
  48. # Please see https://www.playframework.com/documentation/latest/GlobalSettings
  49. # for more information.
  50. #
  51. # You can also extend Play functionality by using one of the publically available
  52. # Play modules: https://playframework.com/documentation/latest/ModuleDirectory
  53. play.modules {
  54. # By default, Play will load any class called Module that is defined
  55. # in the root package (the "app" directory), or you can define them
  56. # explicitly below.
  57. # If there are any built-in modules that you want to disable, you can list them here.
  58. #enabled += my.application.Module
  59. # If there are any built-in modules that you want to disable, you can list them here.
  60. #disabled += ""
  61. }
  62. ## IDE
  63. # https://www.playframework.com/documentation/latest/IDE
  64. # ~~~~~
  65. # Depending on your IDE, you can add a hyperlink for errors that will jump you
  66. # directly to the code location in the IDE in dev mode. The following line makes
  67. # use of the IntelliJ IDEA REST interface:
  68. #play.editor="http://localhost:63342/api/file/?file=%s&line=%s"
  69. ## Internationalisation
  70. # https://www.playframework.com/documentation/latest/JavaI18N
  71. # https://www.playframework.com/documentation/latest/ScalaI18N
  72. # ~~~~~
  73. # Play comes with its own i18n settings, which allow the user's preferred language
  74. # to map through to internal messages, or allow the language to be stored in a cookie.
  75. play.i18n {
  76. # The application languages
  77. langs = [ "en" ]
  78. # Whether the language cookie should be secure or not
  79. #langCookieSecure = true
  80. # Whether the HTTP only attribute of the cookie should be set to true
  81. #langCookieHttpOnly = true
  82. }
  83. ## Play HTTP settings
  84. # ~~~~~
  85. play.http {
  86. ## Router
  87. # https://www.playframework.com/documentation/latest/JavaRouting
  88. # https://www.playframework.com/documentation/latest/ScalaRouting
  89. # ~~~~~
  90. # Define the Router object to use for this application.
  91. # This router will be looked up first when the application is starting up,
  92. # so make sure this is the entry point.
  93. # Furthermore, it's assumed your route file is named properly.
  94. # So for an application router like `my.application.Router`,
  95. # you may need to define a router file `conf/my.application.routes`.
  96. # Default to Routes in the root package (aka "apps" folder) (and conf/routes)
  97. #router = my.application.Router
  98. ## Action Creator
  99. # https://www.playframework.com/documentation/latest/JavaActionCreator
  100. # ~~~~~
  101. #actionCreator = null
  102. ## ErrorHandler
  103. # https://www.playframework.com/documentation/latest/JavaRouting
  104. # https://www.playframework.com/documentation/latest/ScalaRouting
  105. # ~~~~~
  106. # If null, will attempt to load a class called ErrorHandler in the root package,
  107. #errorHandler = null
  108. ## Filters
  109. # https://www.playframework.com/documentation/latest/ScalaHttpFilters
  110. # https://www.playframework.com/documentation/latest/JavaHttpFilters
  111. # ~~~~~
  112. # Filters run code on every request. They can be used to perform
  113. # common logic for all your actions, e.g. adding common headers.
  114. # Defaults to "Filters" in the root package (aka "apps" folder)
  115. # Alternatively you can explicitly register a class here.
  116. #filters = my.application.Filters
  117. ## Session & Flash
  118. # https://www.playframework.com/documentation/latest/JavaSessionFlash
  119. # https://www.playframework.com/documentation/latest/ScalaSessionFlash
  120. # ~~~~~
  121. session {
  122. # Sets the cookie to be sent only over HTTPS.
  123. #secure = true
  124. # Sets the cookie to be accessed only by the server.
  125. #httpOnly = true
  126. # Sets the max-age field of the cookie to 5 minutes.
  127. # NOTE: this only sets when the browser will discard the cookie. Play will consider any
  128. # cookie value with a valid signature to be a valid session forever. To implement a server side session timeout,
  129. # you need to put a timestamp in the session and check it at regular intervals to possibly expire it.
  130. #maxAge = 300
  131. # Sets the domain on the session cookie.
  132. #domain = "example.com"
  133. }
  134. flash {
  135. # Sets the cookie to be sent only over HTTPS.
  136. #secure = true
  137. # Sets the cookie to be accessed only by the server.
  138. #httpOnly = true
  139. }
  140. }
  141. ## Netty Provider
  142. # https://www.playframework.com/documentation/latest/SettingsNetty
  143. # ~~~~~
  144. play.server.netty {
  145. # Whether the Netty wire should be logged
  146. #log.wire = true
  147. # If you run Play on Linux, you can use Netty's native socket transport
  148. # for higher performance with less garbage.
  149. #transport = "native"
  150. }
  151. ## WS (HTTP Client)
  152. # https://www.playframework.com/documentation/latest/ScalaWS#Configuring-WS
  153. # ~~~~~
  154. # The HTTP client primarily used for REST APIs. The default client can be
  155. # configured directly, but you can also create different client instances
  156. # with customized settings. You must enable this by adding to build.sbt:
  157. #
  158. # libraryDependencies += ws // or javaWs if using java
  159. #
  160. play.ws {
  161. # Sets HTTP requests not to follow 302 requests
  162. #followRedirects = false
  163. # Sets the maximum number of open HTTP connections for the client.
  164. #ahc.maxConnectionsTotal = 50
  165. ## WS SSL
  166. # https://www.playframework.com/documentation/latest/WsSSL
  167. # ~~~~~
  168. ssl {
  169. # Configuring HTTPS with Play WS does not require programming. You can
  170. # set up both trustManager and keyManager for mutual authentication, and
  171. # turn on JSSE debugging in development with a reload.
  172. #debug.handshake = true
  173. #trustManager = {
  174. # stores = [
  175. # { type = "JKS", path = "exampletrust.jks" }
  176. # ]
  177. #}
  178. }
  179. }
  180. ## Cache
  181. # https://www.playframework.com/documentation/latest/JavaCache
  182. # https://www.playframework.com/documentation/latest/ScalaCache
  183. # ~~~~~
  184. # Play comes with an integrated cache API that can reduce the operational
  185. # overhead of repeated requests. You must enable this by adding to build.sbt:
  186. #
  187. # libraryDependencies += cache
  188. #
  189. play.cache {
  190. # If you want to bind several caches, you can bind the individually
  191. #bindCaches = ["db-cache", "user-cache", "session-cache"]
  192. }
  193. ## Filters
  194. # https://www.playframework.com/documentation/latest/Filters
  195. # ~~~~~
  196. # There are a number of built-in filters that can be enabled and configured
  197. # to give Play greater security. You must enable this by adding to build.sbt:
  198. #
  199. # libraryDependencies += filters
  200. #
  201. play.filters {
  202. ## CORS filter configuration
  203. # https://www.playframework.com/documentation/latest/CorsFilter
  204. # ~~~~~
  205. # CORS is a protocol that allows web applications to make requests from the browser
  206. # across different domains.
  207. # NOTE: You MUST apply the CORS configuration before the CSRF filter, as CSRF has
  208. # dependencies on CORS settings.
  209. cors {
  210. # Filter paths by a whitelist of path prefixes
  211. #pathPrefixes = ["/"]
  212. # The allowed origins. If null, all origins are allowed.
  213. allowedOrigins = null #["https://api.nal.usda.gov"]
  214. # The allowed HTTP methods. If null, all methods are allowed
  215. #allowedHttpMethods = null #["GET", "POST"]
  216. }
  217. ## CSRF Filter
  218. # https://www.playframework.com/documentation/latest/ScalaCsrf#Applying-a-global-CSRF-filter
  219. # https://www.playframework.com/documentation/latest/JavaCsrf#Applying-a-global-CSRF-filter
  220. # ~~~~~
  221. # Play supports multiple methods for verifying that a request is not a CSRF request.
  222. # The primary mechanism is a CSRF token. This token gets placed either in the query string
  223. # or body of every form submitted, and also gets placed in the users session.
  224. # Play then verifies that both tokens are present and match.
  225. csrf {
  226. # Sets the cookie to be sent only over HTTPS
  227. #cookie.secure = true
  228. # Defaults to CSRFErrorHandler in the root package.
  229. #errorHandler = MyCSRFErrorHandler
  230. }
  231. ## Security headers filter configuration
  232. # https://www.playframework.com/documentation/latest/SecurityHeaders
  233. # ~~~~~
  234. # Defines security headers that prevent XSS attacks.
  235. # If enabled, then all options are set to the below configuration by default:
  236. headers {
  237. # The X-Frame-Options header. If null, the header is not set.
  238. #frameOptions = "DENY"
  239. # The X-XSS-Protection header. If null, the header is not set.
  240. #xssProtection = "1; mode=block"
  241. # The X-Content-Type-Options header. If null, the header is not set.
  242. #contentTypeOptions = "nosniff"
  243. # The X-Permitted-Cross-Domain-Policies header. If null, the header is not set.
  244. #permittedCrossDomainPolicies = "master-only"
  245. # The Content-Security-Policy header. If null, the header is not set.
  246. contentSecurityPolicy = "default-src 'self' api.nal.usda.gov; script-src 'self' 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline';"# img-src 'self'
  247. }
  248. ## Allowed hosts filter configuration
  249. # https://www.playframework.com/documentation/latest/AllowedHostsFilter
  250. # ~~~~~
  251. # Play provides a filter that lets you configure which hosts can access your application.
  252. # This is useful to prevent cache poisoning attacks.
  253. hosts {
  254. # Allow requests to example.com, its subdomains, and localhost:9000.
  255. #allowed = [".example.com", "localhost:9000"]
  256. }
  257. }
  258. ## Evolutions
  259. # https://www.playframework.com/documentation/latest/Evolutions
  260. # ~~~~~
  261. # Evolutions allows database scripts to be automatically run on startup in dev mode
  262. # for database migrations. You must enable this by adding to build.sbt:
  263. #
  264. # libraryDependencies += evolutions
  265. #
  266. play.evolutions {
  267. # You can disable evolutions for a specific datasource if necessary
  268. #db.default.enabled = false
  269. }
  270. ## Database Connection Pool
  271. # https://www.playframework.com/documentation/latest/SettingsJDBC
  272. # ~~~~~
  273. # Play doesn't require a JDBC database to run, but you can easily enable one.
  274. #
  275. # libraryDependencies += jdbc
  276. #
  277. play.db {
  278. # The combination of these two settings results in "db.default" as the
  279. # default JDBC pool:
  280. #config = "db"
  281. #default = "default"
  282. # Play uses HikariCP as the default connection pool. You can override
  283. # settings by changing the prototype:
  284. prototype {
  285. # Sets a fixed JDBC connection pool size of 50
  286. #hikaricp.minimumIdle = 50
  287. #hikaricp.maximumPoolSize = 50
  288. }
  289. }
  290. ## JDBC Datasource
  291. # https://www.playframework.com/documentation/latest/JavaDatabase
  292. # https://www.playframework.com/documentation/latest/ScalaDatabase
  293. # ~~~~~
  294. # Once JDBC datasource is set up, you can work with several different
  295. # database options:
  296. #
  297. # Slick (Scala preferred option): https://www.playframework.com/documentation/latest/PlaySlick
  298. # JPA (Java preferred option): https://playframework.com/documentation/latest/JavaJPA
  299. # EBean: https://playframework.com/documentation/latest/JavaEbean
  300. # Anorm: https://www.playframework.com/documentation/latest/ScalaAnorm
  301. #
  302. db {
  303. # You can declare as many datasources as you want.
  304. # By convention, the default datasource is named `default`
  305. # https://www.playframework.com/documentation/latest/Developing-with-the-H2-Database
  306. default.driver = org.h2.Driver
  307. default.url = "jdbc:h2:mem:default"
  308. default.jndiName = DefaultDS
  309. test.driver = org.h2.Driver
  310. test.url = "jdbc:h2:mem:testing"
  311. test.jndiName = TestDS
  312. # You can turn on SQL logging for any datasource
  313. # https://www.playframework.com/documentation/latest/Highlights25#Logging-SQL-statements
  314. #default.logSql=true
  315. }
  316. jpa.default=defaultPersistenceUnit