_persistence.tpl 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. {{- define "nextcloud.persistence" -}}
  2. persistence:
  3. html:
  4. enabled: true
  5. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.ncStorage.html) | nindent 4 }}
  6. targetSelector:
  7. nextcloud:
  8. nextcloud:
  9. mountPath: /var/www/html
  10. {{- if .Values.ncStorage.isDataInTheSameVolume }}
  11. subPath: html
  12. {{- end }}
  13. nextcloud-cron:
  14. nextcloud-cron:
  15. mountPath: /var/www/html
  16. {{- if .Values.ncStorage.isDataInTheSameVolume }}
  17. subPath: html
  18. {{- end }}
  19. postgresbackup:
  20. postgresbackup:
  21. mountPath: /nc-config
  22. data:
  23. enabled: true
  24. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.ncStorage.data) | nindent 4 }}
  25. targetSelector:
  26. nextcloud:
  27. nextcloud:
  28. mountPath: {{ .Values.ncConfig.dataDir }}
  29. {{- if .Values.ncStorage.isDataInTheSameVolume }}
  30. subPath: data
  31. {{- end }}
  32. nextcloud-cron:
  33. nextcloud-cron:
  34. mountPath: {{ .Values.ncConfig.dataDir }}
  35. {{- if .Values.ncStorage.isDataInTheSameVolume }}
  36. subPath: data
  37. {{- end }}
  38. {{- if .Values.ncStorage.isDataInTheSameVolume }}
  39. config:
  40. enabled: true
  41. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.ncStorage.html) | nindent 4 }}
  42. targetSelector:
  43. nextcloud:
  44. nextcloud:
  45. mountPath: /var/www/html/config
  46. subPath: config
  47. nextcloud-cron:
  48. nextcloud-cron:
  49. mountPath: /var/www/html/config
  50. subPath: config
  51. customapps:
  52. enabled: true
  53. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.ncStorage.html) | nindent 4 }}
  54. targetSelector:
  55. nextcloud:
  56. nextcloud:
  57. mountPath: /var/www/html/custom_apps
  58. subPath: custom_apps
  59. nextcloud-cron:
  60. nextcloud-cron:
  61. mountPath: /var/www/html/custom_apps
  62. subPath: custom_apps
  63. themes:
  64. enabled: true
  65. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.ncStorage.html) | nindent 4 }}
  66. targetSelector:
  67. nextcloud:
  68. nextcloud:
  69. mountPath: /var/www/html/themes
  70. subPath: themes
  71. nextcloud-cron:
  72. nextcloud-cron:
  73. mountPath: /var/www/html/themes
  74. subPath: themes
  75. {{- end }}
  76. # Configuration files mounting
  77. nc-config-opcache:
  78. enabled: true
  79. type: configmap
  80. objectName: nextcloud-config
  81. defaultMode: "0755"
  82. targetSelector:
  83. nextcloud:
  84. nextcloud:
  85. # z-99 is used to ensure that this file is loaded last
  86. mountPath: /usr/local/etc/php/conf.d/opcache-z-99.ini
  87. subPath: opcache.ini
  88. nc-config-php:
  89. enabled: true
  90. type: configmap
  91. objectName: nextcloud-config
  92. defaultMode: "0755"
  93. targetSelector:
  94. nextcloud:
  95. nextcloud:
  96. # z-99 is used to ensure that this file is loaded last
  97. mountPath: /usr/local/etc/php/conf.d/nextcloud-z-99.ini
  98. subPath: php.ini
  99. nc-config-limreqbody:
  100. enabled: true
  101. type: configmap
  102. objectName: nextcloud-config
  103. defaultMode: "0755"
  104. targetSelector:
  105. nextcloud:
  106. nextcloud:
  107. # https://github.com/nextcloud/docker/issues/1796
  108. mountPath: /etc/apache2/conf-enabled/limitrequestbody.conf
  109. subPath: limitrequestbody.conf
  110. nc-occ:
  111. enabled: true
  112. type: configmap
  113. objectName: nextcloud-config
  114. defaultMode: "0755"
  115. targetSelector:
  116. nextcloud:
  117. nextcloud:
  118. mountPath: /usr/bin/occ
  119. subPath: occ
  120. tmp:
  121. enabled: true
  122. type: emptyDir
  123. targetSelector:
  124. nextcloud:
  125. nextcloud:
  126. mountPath: /tmp
  127. {{- range $idx, $storage := .Values.ncStorage.additionalStorages }}
  128. {{ printf "nc-%v:" (int $idx) }}
  129. enabled: true
  130. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  131. targetSelector:
  132. nextcloud:
  133. nextcloud:
  134. mountPath: {{ $storage.mountPath }}
  135. nextcloud-cron:
  136. nextcloud-cron:
  137. mountPath: {{ $storage.mountPath }}
  138. {{- end }}
  139. {{- if .Values.ncNetwork.certificateID }}
  140. nginx-cert:
  141. enabled: true
  142. type: secret
  143. objectName: nextcloud-cert
  144. defaultMode: "0600"
  145. items:
  146. - key: tls.key
  147. path: private.key
  148. - key: tls.crt
  149. path: public.crt
  150. targetSelector:
  151. nginx:
  152. nginx:
  153. mountPath: /etc/nginx-certs
  154. readOnly: true
  155. nginx-conf:
  156. enabled: true
  157. type: configmap
  158. objectName: nginx
  159. defaultMode: "0600"
  160. items:
  161. - key: nginx.conf
  162. path: nginx.conf
  163. targetSelector:
  164. nginx:
  165. nginx:
  166. mountPath: /etc/nginx
  167. readOnly: true
  168. {{- end -}}
  169. {{- include "ix.v1.common.app.postgresPersistence"
  170. (dict "pgData" .Values.ncStorage.pgData
  171. "pgBackup" .Values.ncStorage.pgBackup
  172. ) | nindent 2 }}
  173. {{- end -}}
  174. {{- define "isOldIxVol" -}}
  175. {{- $oldDatasetName := "ix-nextcloud_data" -}}
  176. {{- $isOld := "false" -}}
  177. {{- $storage := .storage -}}
  178. {{- if eq $storage.type "ixVolume" -}}
  179. {{- if eq $storage.ixVolumeConfig.datasetName $oldDatasetName -}}
  180. {{- $isOld = "true" -}}
  181. {{- end -}}
  182. {{- end -}}
  183. {{- $isOld }}
  184. {{- end -}}