_persistence.tpl 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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. tmp:
  111. enabled: true
  112. type: emptyDir
  113. targetSelector:
  114. nextcloud:
  115. nextcloud:
  116. mountPath: /tmp
  117. {{- range $idx, $storage := .Values.ncStorage.additionalStorages }}
  118. {{ printf "nc-%v:" (int $idx) }}
  119. enabled: true
  120. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  121. targetSelector:
  122. nextcloud:
  123. nextcloud:
  124. mountPath: {{ $storage.mountPath }}
  125. nextcloud-cron:
  126. nextcloud-cron:
  127. mountPath: {{ $storage.mountPath }}
  128. {{- end }}
  129. {{- if .Values.ncNetwork.certificateID }}
  130. nginx-cert:
  131. enabled: true
  132. type: secret
  133. objectName: nextcloud-cert
  134. defaultMode: "0600"
  135. items:
  136. - key: tls.key
  137. path: private.key
  138. - key: tls.crt
  139. path: public.crt
  140. targetSelector:
  141. nginx:
  142. nginx:
  143. mountPath: /etc/nginx-certs
  144. readOnly: true
  145. nginx-conf:
  146. enabled: true
  147. type: configmap
  148. objectName: nginx
  149. defaultMode: "0600"
  150. items:
  151. - key: nginx.conf
  152. path: nginx.conf
  153. targetSelector:
  154. nginx:
  155. nginx:
  156. mountPath: /etc/nginx
  157. readOnly: true
  158. {{- end -}}
  159. {{- include "ix.v1.common.app.postgresPersistence"
  160. (dict "pgData" .Values.ncStorage.pgData
  161. "pgBackup" .Values.ncStorage.pgBackup
  162. ) | nindent 2 }}
  163. {{- end -}}
  164. {{- define "isOldIxVol" -}}
  165. {{- $oldDatasetName := "ix-nextcloud_data" -}}
  166. {{- $isOld := "false" -}}
  167. {{- $storage := .storage -}}
  168. {{- if eq $storage.type "ixVolume" -}}
  169. {{- if eq $storage.ixVolumeConfig.datasetName $oldDatasetName -}}
  170. {{- $isOld = "true" -}}
  171. {{- end -}}
  172. {{- end -}}
  173. {{- $isOld }}
  174. {{- end -}}