From 1df6bd8e238e77a8ade15675defd84182797af9e Mon Sep 17 00:00:00 2001 From: Leo Maroni Date: Thu, 18 Jun 2020 07:41:59 +0200 Subject: [PATCH] Add config options for repository indexer --- README.md | 8 ++++++++ defaults/main.yml | 6 ++++++ templates/gitea.ini.j2 | 6 +++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1116f1c..c55e414 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,14 @@ As this will only deploy config files, fail2ban already has to be installed or o * `gitea_metrics_enabled`: Enable the metrics endpoint * `gitea_metrics_token`: Bearer token for the Prometheus scrape job +### Repository Indexer configuration + +* `gitea_repo_indexer_enabled`: Whether to enable the repository indexer (code search). Default: `false` +* `gitea_repo_indexer_include`: Glob patterns to include in the index (comma-separated list). Default: `""` (all files) +* `gitea_repo_indexer_exclude`: Glob patterns to exclude from the index (comma-separated list). Default: `""` (no files) +* `gitea_repo_exclude_vendored`: Exclude vendored files from the index. Default: `true` +* `gitea_repo_indexer_max_file_size`: Maximum size of files to be indexed (in bytes). Default: `1048576` (1 MB) + ## Contributing Don't hesitate to create a pull request, and when in doubt you can reach me on Twitter [@thomas_maurice](https://twitter.com/thomas_maurice). diff --git a/defaults/main.yml b/defaults/main.yml index dfa2884..e4ee065 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -71,3 +71,9 @@ gitea_metrics_token: ~ gitea_themes: gitea,arc-green gitea_theme_default: gitea + +gitea_repo_indexer_enabled: false +gitea_repo_indexer_include: "" +gitea_repo_indexer_exclude: "" +gitea_repo_exclude_vendored: true +gitea_repo_indexer_max_file_size: 1048576 diff --git a/templates/gitea.ini.j2 b/templates/gitea.ini.j2 index eee69d3..93f19ed 100644 --- a/templates/gitea.ini.j2 +++ b/templates/gitea.ini.j2 @@ -84,8 +84,12 @@ ISSUE_INDEXER_QUEUE_TYPE = levelqueue ISSUE_INDEXER_QUEUE_DIR = {{ gitea_home }}/indexers/issues.queue ; repo indexer by default disabled, since it uses a lot of disk space -REPO_INDEXER_ENABLED = false +REPO_INDEXER_ENABLED = {{ gitea_repo_indexer_enabled }} REPO_INDEXER_PATH = {{ gitea_home }}/indexers/repos.bleve +REPO_INDEXER_INCLUDE = {{ gitea_repo_indexer_include }} +REPO_INDEXER_EXCLUDE = {{ gitea_repo_indexer_exclude }} +REPO_INDEXER_EXCLUDE_VENDORED = {{ gitea_repo_exclude_vendored }} +MAX_FILE_SIZE = {{ gitea_repo_indexer_max_file_size }} [security] ; Whether the installer is disabled