_configuration.tpl 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. {{- define "diskover.configuration" -}}
  2. {{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) }}
  3. {{- $elasticsearch := printf "%s-elasticsearch" $fullname }}
  4. {{- $esPassword := randAlphaNum 32 }}
  5. secret:
  6. diskover-secret:
  7. enabled: true
  8. data:
  9. es-password: {{ $esPassword }}
  10. configmap:
  11. diskover-config:
  12. enabled: true
  13. data:
  14. .default_crawler.sh: |-
  15. #!/bin/sh
  16. while true; do
  17. # this condition wait for the script to copy into the container .
  18. if test -f "$1"; then
  19. # Empty folders don't generate indices . if folder is empty a default file is generated
  20. if ! [ "$(ls -A $2)" ]; then
  21. echo "Dummy file created as empty dirs are rejected" > $2/diskover_test.txt;
  22. fi
  23. python3 $1 $2/;
  24. break;
  25. fi
  26. sleep 5
  27. done
  28. Constants.php: |
  29. <?php
  30. namespace diskover;
  31. class Constants {
  32. const TIMEZONE = '{{ .Values.TZ }}';
  33. const ES_HOST = '{{ $elasticsearch }}';
  34. const ES_PORT = 9200;
  35. const ES_USER = 'elastic';
  36. const ES_PASS = '{{ $esPassword }}';
  37. // if your Elasticsearch cluster uses HTTP TLS/SSL, set ES_HTTPS to TRUE
  38. // override with env var ES_HTTPS
  39. const ES_HTTPS = FALSE;
  40. // login auth for diskover-web
  41. const LOGIN_REQUIRED = TRUE;
  42. // default username and password to login
  43. // the password is no longer used after first login, a hashed password gets stored in separate sqlite db
  44. const USER = '{{ .Values.diskoverConfig.username }}';
  45. const PASS = '{{ .Values.diskoverConfig.password }}';
  46. // default results per search page
  47. const SEARCH_RESULTS = 50;
  48. // default size field (size, size_du) to use for sizes on file tree and charts
  49. const SIZE_FIELD = 'size';
  50. // default file types, used by quick search (file type) and dashboard file type usage chart
  51. // additional extensions can be added/removed from each file types list
  52. const FILE_TYPES = [
  53. 'docs' => ['doc', 'docx', 'odt', 'pdf', 'tex', 'wpd', 'wks', 'txt', 'rtf', 'key', 'odp', 'pps', 'ppt', 'pptx', 'ods', 'xls', 'xlsm', 'xlsx'],
  54. 'images' => ['ai', 'bmp', 'gif', 'ico', 'jpeg', 'jpg', 'png', 'ps', 'psd', 'psp', 'svg', 'tif', 'tiff', 'exr', 'tga'],
  55. 'video' => ['3g2', '3gp', 'avi', 'flv', 'h264', 'm4v', 'mkv', 'qt', 'mov', 'mp4', 'mpg', 'mpeg', 'rm', 'swf', 'vob', 'wmv', 'ogg', 'ogv', 'webm'],
  56. 'audio' => ['au', 'aif', 'aiff', 'cda', 'mid', 'midi', 'mp3', 'm4a', 'mpa', 'ogg', 'wav', 'wma', 'wpl'],
  57. 'apps' => ['apk', 'exe', 'bat', 'bin', 'cgi', 'pl', 'gadget', 'com', 'jar', 'msi', 'py', 'wsf'],
  58. 'programming' => ['c', 'cgi', 'pl', 'class', 'cpp', 'cs', 'h', 'java', 'php', 'py', 'sh', 'swift', 'vb'],
  59. 'internet' => ['asp', 'aspx', 'cer', 'cfm', 'cgi', 'pl', 'css', 'htm', 'html', 'js', 'jsp', 'part', 'php', 'py', 'rss', 'xhtml'],
  60. 'system' => ['bak', 'cab', 'cfg', 'cpl', 'cur', 'dll', 'dmp', 'drv', 'icns', 'ico', 'ini', 'lnk', 'msi', 'sys', 'tmp', 'vdi', 'raw'],
  61. 'data' => ['csv', 'dat', 'db', 'dbf', 'log', 'mdb', 'sav', 'sql', 'tar', 'xml'],
  62. 'disc' => ['bin', 'dmg', 'iso', 'toast', 'vcd', 'img'],
  63. 'compressed' => ['7z', 'arj', 'deb', 'pkg', 'rar', 'rpm', 'tar', 'gz', 'z', 'zip'],
  64. 'trash' => ['old', 'trash', 'tmp', 'temp', 'junk', 'recycle', 'delete', 'deleteme', 'clean', 'remove']
  65. ];
  66. // extra fields for search results and view file/dir info pages
  67. // key is description for field and value is ES field name
  68. // Example:
  69. //const EXTRA_FIELDS = [
  70. // 'Date Changed' => 'ctime'
  71. //];
  72. const EXTRA_FIELDS = [];
  73. // Maximum number of indices to load by default, indices are loaded in order by creation date
  74. // setting this too high can cause slow logins and other timeout issues
  75. // This setting can bo overridden on indices page per user and stored in maxindex cookie
  76. // If MAX_INDEX is set higher than maxindex browser cookie, the cookie will be set to this value
  77. const MAX_INDEX = 250;
  78. // time in seconds for index info to be cached, clicking reload indices forces update
  79. const INDEXINFO_CACHETIME = 600;
  80. // time in seconds to check Elasticsearch for new index info
  81. const NEWINDEX_CHECKTIME = 10;
  82. // sqlite database file path
  83. const DATABASE = '../diskoverdb.sqlite3';
  84. }
  85. config.yaml: |
  86. # diskover default/sample config file
  87. #
  88. # default search paths for config
  89. # macOS: ~/.config/diskover and ~/Library/Application Support/diskover
  90. # Other Unix: ~/.config/diskover and /etc/diskover
  91. # Windows: %APPDATA%\diskover where the APPDATA environment variable falls back to %HOME%\AppData\Roaming if undefined
  92. #
  93. appName: diskover
  94. logLevel: INFO
  95. logToFile: False
  96. logDirectory: /tmp/
  97. diskover:
  98. # max number of crawl threads
  99. # a thread is created up to maxthreads for each directory at level 1 of tree dir arg
  100. # set to a number or leave blank to auto set based on number of cpus
  101. #maxthreads: 20
  102. maxthreads:
  103. # block size used for du size
  104. blocksize: 512
  105. excludes:
  106. # directory names and absolute paths you want to exclude from crawl
  107. # directory excludes uses python re.search for string search (regex)
  108. # directory excludes are case-sensitive
  109. # Examples: .* or .backup or .backup* or /dir/dirname
  110. # to exclude none use empty list []
  111. dirs: [".*", ".snapshot", ".Snapshot", "~snapshot", "~Snapshot", ".zfs"]
  112. #dirs: []
  113. # files you want to exclude from crawl
  114. # can include wildcards (.*, *.doc or NULLEXT for files with no extension)
  115. # file names are case-sensitive, extensions are not
  116. files: [".*", "Thumbs.db", ".DS_Store", "._.DS_Store", ".localized", "desktop.ini"]
  117. #files: []
  118. # exclude empty 0 byte files, set to True to exclude empty files or False to not exclude
  119. emptyfiles: True
  120. # exclude empty dirs, set to True to exclude empty dirs or False to not exclude
  121. emptydirs: True
  122. # exclude files smaller than min size in bytes
  123. minfilesize: 1
  124. #minfilesize: 512
  125. # exclude files modified less than x days ago
  126. minmtime: 0
  127. #minmtime: 30
  128. # exclude files modified more than x days ago
  129. maxmtime: 36500
  130. # exclude files changed less than x days ago
  131. minctime: 0
  132. # exclude files changed more than x days ago
  133. maxctime: 36500
  134. # exclude files accessed less than x days ago
  135. minatime: 0
  136. # exclude files accessed more than x days ago
  137. maxatime: 36500
  138. includes:
  139. # directory names and absolute paths you want to include (whitelist), case-sensitive,
  140. # to include none use empty list []
  141. #dirs: [".recycle"]
  142. dirs: []
  143. # files you want to include (whitelist), case-sensitive
  144. files: []
  145. ownersgroups:
  146. # control how owner (username) and group fields are stored for file and directory docs
  147. # store uid and gid's instead of trying to get owner and group names
  148. uidgidonly: False
  149. # owner/group names contain domain name set to True
  150. domain: False
  151. # character separator used on cifs/nfs mounts to separte user/group and domain name, usually \ or @
  152. domainsep: \
  153. # if domain name comes first before character separator, set this to True, otherwise False
  154. domainfirst: True
  155. # when indexing owner and group fields, keep the domain name
  156. keepdomain: False
  157. replacepaths:
  158. # translate path names set to True to enable or False to disable.
  159. # Set to True if crawling in Windows to replace drive letters and \ with /
  160. replace: False
  161. #from: /mnt/
  162. #to: /vols/
  163. from:
  164. to:
  165. plugins:
  166. # set to True to enable all plugins or False to disable all plugins
  167. enable: False
  168. # list of plugins (by name) to use for directories
  169. dirs: ['unixperms']
  170. # list of plugins (by name) to use for files
  171. files: ['unixperms']
  172. other:
  173. # restore atime/mtime for files and dirs during crawl
  174. # set to True or False, default False (useful for cifs which does not work with noatime mount option)
  175. # for nfs, it's preferable to use mount options ro,noatime,nodiratime
  176. restoretimes: False
  177. databases:
  178. elasticsearch:
  179. host: '{{ $elasticsearch }}'
  180. port: 9200
  181. user: 'elastic'
  182. password: '{{ $esPassword }}'
  183. # set https to True if using HTTP TLS/SSL or False if using http
  184. # for AWS ES, you will most likely want to set this to True
  185. # override with env var ES_HTTPS
  186. https: False
  187. # compress http data
  188. # for AWS ES, you will most likely want to set this to True
  189. httpcompress: False
  190. # timeout for connection to ES (default is 10)
  191. timeout: 30
  192. # number of connections kept open to ES when crawling (default is 10)
  193. maxsize: 20
  194. # max retries for ES operations (default is 0)
  195. maxretries: 10
  196. # wait for at least yellow status before bulk uploading (default is False), set to True if you want to wait
  197. wait: False
  198. # chunk size for ES bulk operations (default is 500)
  199. chunksize: 1000
  200. # the below settings are to optimize ES for crawling
  201. # index refresh interval (default is 1s), set to -1 to disable refresh during crawl (fastest performance but no index searches), after crawl is set back to 1s
  202. indexrefresh: 30s
  203. # transaction log flush threshold size (default 512mb)
  204. translogsize: 1gb
  205. # transaction log sync interval time (default 5s)
  206. translogsyncint: 30s
  207. # search scroll size (default 100 docs)
  208. scrollsize: 1000
  209. {{- end -}}