standalone.xml.j2 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. <?xml version="1.0" ?>
  2. <server xmlns="urn:jboss:domain:4.0">
  3. <extensions>
  4. <extension module="org.jboss.as.clustering.infinispan"/>
  5. <extension module="org.jboss.as.connector"/>
  6. <extension module="org.jboss.as.deployment-scanner"/>
  7. <extension module="org.jboss.as.ee"/>
  8. <extension module="org.jboss.as.ejb3"/>
  9. <extension module="org.jboss.as.jaxrs"/>
  10. <extension module="org.jboss.as.jdr"/>
  11. <extension module="org.jboss.as.jmx"/>
  12. <extension module="org.jboss.as.jpa"/>
  13. <extension module="org.jboss.as.jsf"/>
  14. <extension module="org.jboss.as.logging"/>
  15. <extension module="org.jboss.as.mail"/>
  16. <extension module="org.jboss.as.naming"/>
  17. <extension module="org.jboss.as.remoting"/>
  18. <extension module="org.jboss.as.security"/>
  19. <extension module="org.jboss.as.transactions"/>
  20. <extension module="org.keycloak.keycloak-server-subsystem"/>
  21. <extension module="org.wildfly.extension.bean-validation"/>
  22. <extension module="org.wildfly.extension.io"/>
  23. <extension module="org.wildfly.extension.request-controller"/>
  24. <extension module="org.wildfly.extension.security.manager"/>
  25. <extension module="org.wildfly.extension.undertow"/>
  26. </extensions>
  27. <management>
  28. <security-realms>
  29. <security-realm name="ManagementRealm">
  30. <authentication>
  31. <local default-user="$local" skip-group-loading="true"/>
  32. <properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>
  33. </authentication>
  34. <authorization map-groups-to-roles="false">
  35. <properties path="mgmt-groups.properties" relative-to="jboss.server.config.dir"/>
  36. </authorization>
  37. </security-realm>
  38. <security-realm name="ApplicationRealm">
  39. <authentication>
  40. <local default-user="$local" allowed-users="*" skip-group-loading="true"/>
  41. <properties path="application-users.properties" relative-to="jboss.server.config.dir"/>
  42. </authentication>
  43. <authorization>
  44. <properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>
  45. </authorization>
  46. </security-realm>
  47. </security-realms>
  48. <audit-log>
  49. <formatters>
  50. <json-formatter name="json-formatter"/>
  51. </formatters>
  52. <handlers>
  53. <file-handler name="file" formatter="json-formatter" relative-to="jboss.server.data.dir" path="audit-log.log"/>
  54. </handlers>
  55. <logger log-boot="true" log-read-only="false" enabled="false">
  56. <handlers>
  57. <handler name="file"/>
  58. </handlers>
  59. </logger>
  60. </audit-log>
  61. <management-interfaces>
  62. <http-interface security-realm="ManagementRealm" http-upgrade-enabled="true">
  63. <socket-binding http="management-http"/>
  64. </http-interface>
  65. </management-interfaces>
  66. <access-control provider="simple">
  67. <role-mapping>
  68. <role name="SuperUser">
  69. <include>
  70. <user name="$local"/>
  71. </include>
  72. </role>
  73. </role-mapping>
  74. </access-control>
  75. </management>
  76. <profile>
  77. <subsystem xmlns="urn:jboss:domain:logging:3.0">
  78. <console-handler name="CONSOLE">
  79. <level name="INFO"/>
  80. <formatter>
  81. <named-formatter name="COLOR-PATTERN"/>
  82. </formatter>
  83. </console-handler>
  84. <periodic-rotating-file-handler name="FILE" autoflush="true">
  85. <formatter>
  86. <named-formatter name="PATTERN"/>
  87. </formatter>
  88. <file relative-to="jboss.server.log.dir" path="server.log"/>
  89. <suffix value=".yyyy-MM-dd"/>
  90. <append value="true"/>
  91. </periodic-rotating-file-handler>
  92. <logger category="com.arjuna">
  93. <level name="WARN"/>
  94. </logger>
  95. <logger category="org.jboss.as.config">
  96. <level name="DEBUG"/>
  97. </logger>
  98. <logger category="sun.rmi">
  99. <level name="WARN"/>
  100. </logger>
  101. <root-logger>
  102. <level name="INFO"/>
  103. <handlers>
  104. <handler name="CONSOLE"/>
  105. <handler name="FILE"/>
  106. </handlers>
  107. </root-logger>
  108. <formatter name="PATTERN">
  109. <pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
  110. </formatter>
  111. <formatter name="COLOR-PATTERN">
  112. <pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
  113. </formatter>
  114. </subsystem>
  115. <subsystem xmlns="urn:jboss:domain:bean-validation:1.0"/>
  116. <subsystem xmlns="urn:jboss:domain:datasources:4.0">
  117. <datasources>
  118. <datasource jndi-name="java:jboss/datasources/KeycloakDS" pool-name="KeycloakDS" enabled="true" use-java-context="true">
  119. <connection-url>jdbc:postgresql://{{keycloak_pg_host}}:{{keycloak_pg_port}}/{{keycloak_pg_db}}</connection-url>
  120. <driver>postgresql</driver>
  121. <security>
  122. <user-name>{{postgres_user}}</user-name>
  123. <password>{{postgres_password}}</password>
  124. </security>
  125. <validation>
  126. <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker"/>
  127. <background-validation>true</background-validation>
  128. <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter"/>
  129. </validation>
  130. <pool>
  131. <flush-strategy>IdleConnections</flush-strategy>
  132. </pool>
  133. </datasource>
  134. <drivers>
  135. <driver name="postgresql" module="org.postgresql.jdbc">
  136. <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
  137. </driver>
  138. </drivers>
  139. </datasources>
  140. </subsystem>
  141. <subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
  142. <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}"/>
  143. </subsystem>
  144. <subsystem xmlns="urn:jboss:domain:ee:4.0">
  145. <spec-descriptor-property-replacement>false</spec-descriptor-property-replacement>
  146. <concurrent>
  147. <context-services>
  148. <context-service name="default" jndi-name="java:jboss/ee/concurrency/context/default" use-transaction-setup-provider="true"/>
  149. </context-services>
  150. <managed-thread-factories>
  151. <managed-thread-factory name="default" jndi-name="java:jboss/ee/concurrency/factory/default" context-service="default"/>
  152. </managed-thread-factories>
  153. <managed-executor-services>
  154. <managed-executor-service name="default" jndi-name="java:jboss/ee/concurrency/executor/default" context-service="default" hung-task-threshold="60000" keepalive-time="5000"/>
  155. </managed-executor-services>
  156. <managed-scheduled-executor-services>
  157. <managed-scheduled-executor-service name="default" jndi-name="java:jboss/ee/concurrency/scheduler/default" context-service="default" hung-task-threshold="60000" keepalive-time="3000"/>
  158. </managed-scheduled-executor-services>
  159. </concurrent>
  160. <default-bindings context-service="java:jboss/ee/concurrency/context/default" datasource="java:jboss/datasources/KeycloakDS" managed-executor-service="java:jboss/ee/concurrency/executor/default" managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default" managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>
  161. </subsystem>
  162. <subsystem xmlns="urn:jboss:domain:ejb3:4.0">
  163. <session-bean>
  164. <stateless>
  165. <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
  166. </stateless>
  167. <stateful default-access-timeout="5000" cache-ref="simple" passivation-disabled-cache-ref="simple"/>
  168. <singleton default-access-timeout="5000"/>
  169. </session-bean>
  170. <pools>
  171. <bean-instance-pools>
  172. <!-- Automatically configure pools. Alternatively, max-pool-size can be set to a specific value -->
  173. <strict-max-pool name="slsb-strict-max-pool" derive-size="from-worker-pools" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
  174. <strict-max-pool name="mdb-strict-max-pool" derive-size="from-cpu-count" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
  175. </bean-instance-pools>
  176. </pools>
  177. <caches>
  178. <cache name="simple"/>
  179. <cache name="distributable" passivation-store-ref="infinispan" aliases="passivating clustered"/>
  180. </caches>
  181. <passivation-stores>
  182. <passivation-store name="infinispan" cache-container="ejb" max-size="10000"/>
  183. </passivation-stores>
  184. <async thread-pool-name="default"/>
  185. <timer-service thread-pool-name="default" default-data-store="default-file-store">
  186. <data-stores>
  187. <file-data-store name="default-file-store" path="timer-service-data" relative-to="jboss.server.data.dir"/>
  188. </data-stores>
  189. </timer-service>
  190. <remote connector-ref="http-remoting-connector" thread-pool-name="default"/>
  191. <thread-pools>
  192. <thread-pool name="default">
  193. <max-threads count="10"/>
  194. <keepalive-time time="100" unit="milliseconds"/>
  195. </thread-pool>
  196. </thread-pools>
  197. <default-security-domain value="other"/>
  198. <default-missing-method-permissions-deny-access value="true"/>
  199. <log-system-exceptions value="true"/>
  200. </subsystem>
  201. <subsystem xmlns="urn:jboss:domain:io:1.1">
  202. <worker name="default"/>
  203. <buffer-pool name="default"/>
  204. </subsystem>
  205. <subsystem xmlns="urn:jboss:domain:infinispan:4.0">
  206. <cache-container name="keycloak" jndi-name="infinispan/Keycloak">
  207. <local-cache name="realms">
  208. <eviction max-entries="10000" strategy="LRU"/>
  209. </local-cache>
  210. <local-cache name="users">
  211. <eviction max-entries="10000" strategy="LRU"/>
  212. </local-cache>
  213. <local-cache name="sessions"/>
  214. <local-cache name="offlineSessions"/>
  215. <local-cache name="loginFailures"/>
  216. <local-cache name="work"/>
  217. <local-cache name="authorization">
  218. <eviction max-entries="100" strategy="LRU"/>
  219. </local-cache>
  220. <local-cache name="keys">
  221. <eviction max-entries="1000" strategy="LRU"/>
  222. <expiration max-idle="3600000"/>
  223. </local-cache>
  224. </cache-container>
  225. <cache-container name="server" default-cache="default" module="org.wildfly.clustering.server">
  226. <local-cache name="default">
  227. <transaction mode="BATCH"/>
  228. </local-cache>
  229. </cache-container>
  230. <cache-container name="web" default-cache="passivation" module="org.wildfly.clustering.web.infinispan">
  231. <local-cache name="passivation">
  232. <locking isolation="REPEATABLE_READ"/>
  233. <transaction mode="BATCH"/>
  234. <file-store passivation="true" purge="false"/>
  235. </local-cache>
  236. <local-cache name="persistent">
  237. <locking isolation="REPEATABLE_READ"/>
  238. <transaction mode="BATCH"/>
  239. <file-store passivation="false" purge="false"/>
  240. </local-cache>
  241. </cache-container>
  242. <cache-container name="ejb" aliases="sfsb" default-cache="passivation" module="org.wildfly.clustering.ejb.infinispan">
  243. <local-cache name="passivation">
  244. <locking isolation="REPEATABLE_READ"/>
  245. <transaction mode="BATCH"/>
  246. <file-store passivation="true" purge="false"/>
  247. </local-cache>
  248. <local-cache name="persistent">
  249. <locking isolation="REPEATABLE_READ"/>
  250. <transaction mode="BATCH"/>
  251. <file-store passivation="false" purge="false"/>
  252. </local-cache>
  253. </cache-container>
  254. <cache-container name="hibernate" default-cache="local-query" module="org.hibernate.infinispan">
  255. <local-cache name="entity">
  256. <transaction mode="NON_XA"/>
  257. <eviction strategy="LRU" max-entries="10000"/>
  258. <expiration max-idle="100000"/>
  259. </local-cache>
  260. <local-cache name="local-query">
  261. <eviction strategy="LRU" max-entries="10000"/>
  262. <expiration max-idle="100000"/>
  263. </local-cache>
  264. <local-cache name="timestamps"/>
  265. </cache-container>
  266. </subsystem>
  267. <subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
  268. <subsystem xmlns="urn:jboss:domain:jca:4.0">
  269. <archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
  270. <bean-validation enabled="true"/>
  271. <default-workmanager>
  272. <short-running-threads>
  273. <core-threads count="50"/>
  274. <queue-length count="50"/>
  275. <max-threads count="50"/>
  276. <keepalive-time time="10" unit="seconds"/>
  277. </short-running-threads>
  278. <long-running-threads>
  279. <core-threads count="50"/>
  280. <queue-length count="50"/>
  281. <max-threads count="50"/>
  282. <keepalive-time time="10" unit="seconds"/>
  283. </long-running-threads>
  284. </default-workmanager>
  285. <cached-connection-manager/>
  286. </subsystem>
  287. <subsystem xmlns="urn:jboss:domain:jdr:1.0"/>
  288. <subsystem xmlns="urn:jboss:domain:jmx:1.3">
  289. <expose-resolved-model/>
  290. <expose-expression-model/>
  291. <remoting-connector/>
  292. </subsystem>
  293. <subsystem xmlns="urn:jboss:domain:jpa:1.1">
  294. <jpa default-datasource="" default-extended-persistence-inheritance="DEEP"/>
  295. </subsystem>
  296. <subsystem xmlns="urn:jboss:domain:jsf:1.0"/>
  297. <subsystem xmlns="urn:jboss:domain:mail:2.0">
  298. <mail-session name="default" jndi-name="java:jboss/mail/Default">
  299. <smtp-server outbound-socket-binding-ref="mail-smtp"/>
  300. </mail-session>
  301. </subsystem>
  302. <subsystem xmlns="urn:jboss:domain:naming:2.0">
  303. <remote-naming/>
  304. </subsystem>
  305. <subsystem xmlns="urn:jboss:domain:remoting:3.0">
  306. <endpoint/>
  307. <http-connector name="http-remoting-connector" connector-ref="default" security-realm="ApplicationRealm"/>
  308. </subsystem>
  309. <subsystem xmlns="urn:jboss:domain:request-controller:1.0"/>
  310. <subsystem xmlns="urn:jboss:domain:security-manager:1.0">
  311. <deployment-permissions>
  312. <maximum-set>
  313. <permission class="java.security.AllPermission"/>
  314. </maximum-set>
  315. </deployment-permissions>
  316. </subsystem>
  317. <subsystem xmlns="urn:jboss:domain:security:1.2">
  318. <security-domains>
  319. <security-domain name="other" cache-type="default">
  320. <authentication>
  321. <login-module code="Remoting" flag="optional">
  322. <module-option name="password-stacking" value="useFirstPass"/>
  323. </login-module>
  324. <login-module code="RealmDirect" flag="required">
  325. <module-option name="password-stacking" value="useFirstPass"/>
  326. </login-module>
  327. </authentication>
  328. </security-domain>
  329. <security-domain name="jboss-web-policy" cache-type="default">
  330. <authorization>
  331. <policy-module code="Delegating" flag="required"/>
  332. </authorization>
  333. </security-domain>
  334. <security-domain name="jboss-ejb-policy" cache-type="default">
  335. <authorization>
  336. <policy-module code="Delegating" flag="required"/>
  337. </authorization>
  338. </security-domain>
  339. <security-domain name="jaspitest" cache-type="default">
  340. <authentication-jaspi>
  341. <login-module-stack name="dummy">
  342. <login-module code="Dummy" flag="optional"/>
  343. </login-module-stack>
  344. <auth-module code="Dummy"/>
  345. </authentication-jaspi>
  346. </security-domain>
  347. </security-domains>
  348. </subsystem>
  349. <subsystem xmlns="urn:jboss:domain:transactions:3.0">
  350. <core-environment>
  351. <process-id>
  352. <uuid/>
  353. </process-id>
  354. </core-environment>
  355. <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
  356. </subsystem>
  357. <subsystem xmlns="urn:jboss:domain:undertow:3.0">
  358. <buffer-cache name="default"/>
  359. <server name="default-server">
  360. <http-listener name="default" socket-binding="http" redirect-socket="https"/>
  361. <host name="default-host" alias="localhost">
  362. <location name="/" handler="welcome-content"/>
  363. <filter-ref name="server-header"/>
  364. <filter-ref name="x-powered-by-header"/>
  365. </host>
  366. </server>
  367. <servlet-container name="default">
  368. <jsp-config/>
  369. <websockets/>
  370. </servlet-container>
  371. <handlers>
  372. <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
  373. </handlers>
  374. <filters>
  375. <response-header name="server-header" header-name="Server" header-value="WildFly/10"/>
  376. <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
  377. </filters>
  378. </subsystem>
  379. <subsystem xmlns="urn:jboss:domain:keycloak-server:1.1">
  380. <web-context>auth</web-context>
  381. <providers>
  382. <provider>classpath:${jboss.home.dir}/providers/*</provider>
  383. </providers>
  384. <master-realm-name>master</master-realm-name>
  385. <scheduled-task-interval>900</scheduled-task-interval>
  386. <theme>
  387. <staticMaxAge>2592000</staticMaxAge>
  388. <cacheThemes>true</cacheThemes>
  389. <cacheTemplates>true</cacheTemplates>
  390. <dir>${jboss.home.dir}/themes</dir>
  391. </theme>
  392. <spi name="eventsStore">
  393. <provider name="jpa" enabled="true">
  394. <properties>
  395. <property name="exclude-events" value="[&quot;REFRESH_TOKEN&quot;]"/>
  396. </properties>
  397. </provider>
  398. </spi>
  399. <spi name="userCache">
  400. <provider name="default" enabled="true"/>
  401. </spi>
  402. <spi name="userSessionPersister">
  403. <default-provider>jpa</default-provider>
  404. </spi>
  405. <spi name="timer">
  406. <default-provider>basic</default-provider>
  407. </spi>
  408. <spi name="connectionsHttpClient">
  409. <provider name="default" enabled="true"/>
  410. </spi>
  411. <spi name="connectionsJpa">
  412. <provider name="default" enabled="true">
  413. <properties>
  414. <property name="dataSource" value="java:jboss/datasources/KeycloakDS"/>
  415. <property name="initializeEmpty" value="true"/>
  416. <property name="migrationStrategy" value="update"/>
  417. <property name="migrationExport" value="${jboss.home.dir}/keycloak-database-update.sql"/>
  418. </properties>
  419. </provider>
  420. </spi>
  421. <spi name="realmCache">
  422. <provider name="default" enabled="true"/>
  423. </spi>
  424. <spi name="connectionsInfinispan">
  425. <default-provider>default</default-provider>
  426. <provider name="default" enabled="true">
  427. <properties>
  428. <property name="cacheContainer" value="java:comp/env/infinispan/Keycloak"/>
  429. </properties>
  430. </provider>
  431. </spi>
  432. <spi name="jta-lookup">
  433. <default-provider>${keycloak.jta.lookup.provider:jboss}</default-provider>
  434. <provider name="jboss" enabled="true"/>
  435. </spi>
  436. <spi name="publicKeyStorage">
  437. <provider name="infinispan" enabled="true">
  438. <properties>
  439. <property name="minTimeBetweenRequests" value="10"/>
  440. </properties>
  441. </provider>
  442. </spi>
  443. </subsystem>
  444. </profile>
  445. <interfaces>
  446. <interface name="management">
  447. <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
  448. </interface>
  449. <interface name="public">
  450. <inet-address value="${jboss.bind.address:127.0.0.1}"/>
  451. </interface>
  452. </interfaces>
  453. <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
  454. <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
  455. <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
  456. <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
  457. <socket-binding name="http" port="${jboss.http.port:8080}"/>
  458. <socket-binding name="https" port="${jboss.https.port:8443}"/>
  459. <socket-binding name="txn-recovery-environment" port="4712"/>
  460. <socket-binding name="txn-status-manager" port="4713"/>
  461. <outbound-socket-binding name="mail-smtp">
  462. <remote-destination host="localhost" port="25"/>
  463. </outbound-socket-binding>
  464. </socket-binding-group>
  465. </server>