mirror of
				https://github.com/kevinveenbirkenbach/computer-playbook.git
				synced 2025-10-31 10:19:09 +00:00 
			
		
		
		
	Add custom hibernate.cfg.xml to XWiki role to use SELECT 1 as validation query (avoids PROCESS privilege requirement in MariaDB). See https://chatgpt.com/share/68c2c4dd-beec-800f-b44a-9c84494491f8
This commit is contained in:
		| @@ -16,6 +16,12 @@ | ||||
|     dest: "{{ XWIKI_HOST_PROPERTIES_PATH }}" | ||||
|   notify: docker compose up | ||||
|  | ||||
| - name: "Render hibernate.cfg.xml" | ||||
|   template: | ||||
|     src: "hibernate.cfg.xml.j2" | ||||
|     dest: "{{ XWIKI_HOST_HIBERNATE_PATH }}" | ||||
|   notify: docker compose up | ||||
|  | ||||
| - name: "flush docker compose for '{{ application_id }}'" | ||||
|   meta: flush_handlers | ||||
|  | ||||
|   | ||||
| @@ -11,6 +11,7 @@ | ||||
|     volumes: | ||||
|       - "{{ XWIKI_HOST_CONF_PATH }}:/usr/local/xwiki/xwiki.cfg" | ||||
|       - "{{ XWIKI_HOST_PROPERTIES_PATH }}:/usr/local/xwiki/xwiki.properties" | ||||
|       - "{{ XWIKI_HOST_HIBERNATE_PATH }}:/usr/local/xwiki/hibernate.cfg.xml" | ||||
|       - 'data:/usr/local/xwiki' | ||||
| {% include 'roles/docker-container/templates/healthcheck/curl.yml.j2' %} | ||||
| {% include 'roles/docker-container/templates/base.yml.j2' %} | ||||
|   | ||||
							
								
								
									
										20
									
								
								roles/web-app-xwiki/templates/hibernate.cfg.xml.j2
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								roles/web-app-xwiki/templates/hibernate.cfg.xml.j2
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" | ||||
|         "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> | ||||
| <hibernate-configuration> | ||||
|   <session-factory> | ||||
|     <!-- deine bestehenden DB-Props (Driver, URL, User, Pass) --> | ||||
|     <property name="hibernate.connection.driver_class">org.mariadb.jdbc.Driver</property> | ||||
|     <property name="hibernate.connection.url">jdbc:mariadb://{{ database_host }}:{{ database_port }}/{{ database_name }}?useUnicode=true&characterEncoding=UTF-8</property> | ||||
|     <property name="hibernate.connection.username">{{ database_username }}</property> | ||||
|     <property name="hibernate.connection.password">{{ database_password }}</property> | ||||
|  | ||||
|     <!-- DBCP: leichte Validierung statt Treiber-isValid / Diagnose --> | ||||
|     <property name="hibernate.dbcp.testOnBorrow">true</property> | ||||
|     <property name="hibernate.dbcp.testWhileIdle">true</property> | ||||
|     <property name="hibernate.dbcp.validationQuery">SELECT 1</property> | ||||
|     <property name="hibernate.dbcp.validationQueryTimeout">5</property> | ||||
|     <property name="hibernate.dbcp.timeBetweenEvictionRunsMillis">30000</property> | ||||
|     <property name="hibernate.dbcp.minEvictableIdleTimeMillis">60000</property> | ||||
|   </session-factory> | ||||
| </hibernate-configuration> | ||||
| @@ -14,6 +14,7 @@ XWIKI_HOSTNAME:                       "{{ container_hostname }}" | ||||
| ## Paths | ||||
| XWIKI_HOST_CONF_PATH:                 "{{ [docker_compose.directories.config, 'xwiki.cfg'] | path_join }}" | ||||
| XWIKI_HOST_PROPERTIES_PATH:           "{{ [docker_compose.directories.config, 'xwiki.properties'] | path_join }}" | ||||
| XWIKI_HOST_HIBERNATE_PATH:            "{{ [docker_compose.directories.config, 'hibernate.cfg.xml'] | path_join }}" | ||||
|  | ||||
| ## Docker | ||||
| XWIKI_IMAGE_CUSTOM:                   "xwiki_custom" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user