From 0b2382655392be1a3520d8e38e72913747ecdd04 Mon Sep 17 00:00:00 2001 From: L3D Date: Sun, 21 Mar 2021 17:56:16 +0100 Subject: [PATCH] reorder gitea indexer config --- README.md | 18 ++++++++++-------- defaults/main.yml | 13 ++++++++----- templates/gitea.ini.j2 | 13 ++++++------- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 9fd6092..32b0a81 100644 --- a/README.md +++ b/README.md @@ -124,10 +124,17 @@ Here is a deeper insight into the variables of this gitea role. For the exact fu | `gitea_db_password` | `lel` | Database password. **PLEASE CHANGE** | | `gitea_db_ssl` | `disable` | Configure SSL only if your database type supports it. Have a look into the [config-cheat-sheet](https://docs.gitea.io/en-us/config-cheat-sheet/#database-database) for more detailed information | | `gitea_db_path` | `{{ gitea_home }}/data/gitea.db` | DB path, if you use `sqlite3`. | -| `gitea_database_extra_config` | `''` | you can use this variable to pass additional config parameters in the `[ui]` section of the config. | - - +| `gitea_database_extra_config` | `''` | you can use this variable to pass additional config parameters in the `[database]` section of the config. | +### Indexer ([indexer](https://docs.gitea.io/en-us/config-cheat-sheet/#indexer-indexer)) +| variable name | default value | description | +| ------------- | ------------- | ----------- | +| `gitea_repo_indexer_enabled` | `false` | Enables code search *(uses a lot of disk space, about 6 times more than the repository size).* | +| `gitea_repo_indexer_include` | `''` |Glob patterns to include in the index *(comma-separated list)*. An empty list means include all files. | +| `gitea_repo_indexer_exclude` | `''` | Glob patterns to exclude from the index (comma-separated list). | +| `gitea_repo_exclude_vendored` | `true` | Exclude vendored files from index. | +| `gitea_repo_indexer_max_file_size` | `1048576` | Maximum size in bytes of files to be indexed. | +| `gitea_indexer_extra_config` | `''` | you can use this variable to pass additional config parameters in the `[indexer]` section of the config. | ### Look and feel @@ -204,11 +211,6 @@ As this will only deploy config files, fail2ban already has to be installed or o ### 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) ### backup on upgrade * `gitea_backup_on_upgrade`: Optionally a backup can be created with every update of gitea. Default: `false` diff --git a/defaults/main.yml b/defaults/main.yml index d38d701..12d0a89 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -60,6 +60,14 @@ gitea_db_password: 'lel' gitea_db_ssl: 'disable' gitea_db_path: "{{ gitea_home }}/data/gitea.db" +# Indexer (indexer) +# -> https://docs.gitea.io/en-us/config-cheat-sheet/#indexer-indexer +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' +gitea_indexer_extra_config: '' # look and feel gitea_disable_gravatar: true @@ -111,11 +119,6 @@ gitea_metrics_enabled: false gitea_metrics_token: ~ -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 gitea_log_level: Info diff --git a/templates/gitea.ini.j2 b/templates/gitea.ini.j2 index 77a9b0f..c0603fa 100644 --- a/templates/gitea.ini.j2 +++ b/templates/gitea.ini.j2 @@ -75,20 +75,19 @@ LOG_SQL = false ; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#indexer-indexer [indexer] -; Issue indexer storage path, available when ISSUE_INDEXER_TYPE is bleve ISSUE_INDEXER_PATH = {{ gitea_home }}/indexers/issues.bleve -; Issue indexer queue, currently support: channel or levelqueue, default is levelqueue -ISSUE_INDEXER_QUEUE_TYPE = levelqueue -; When ISSUE_INDEXER_QUEUE_TYPE is levelqueue, this will be the queue will be saved path, -; default is indexers/issues.queue 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 = {{ gitea_repo_indexer_enabled }} +REPO_INDEXER_ENABLED = {{ gitea_repo_indexer_enabled | ternary('true', 'false') }} 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 }} +{{ gitea_indexer_extra_config }} +; +; +; + [security] ; Whether the installer is disabled