From 672f7c906e97363b220562498366099e25ac7922 Mon Sep 17 00:00:00 2001 From: L3D Date: Thu, 26 Jan 2023 02:53:50 +0100 Subject: [PATCH] configutre lfs and other options --- README.md | 23 +++++++++++++++++++++++ defaults/main.yml | 20 ++++++++++++++++++++ templates/gitea.ini.j2 | 32 +++++++++++++++++++++++++++++++- 3 files changed, 74 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index aae51fa..3543ad9 100644 --- a/README.md +++ b/README.md @@ -267,6 +267,29 @@ Either you define exactly which release you install. Or you use the option ``lat | `gitea_federation_share_user_stats` | `false` | Enable/Disable user statistics for nodeinfo if federation is enabled | | `gitea_federation_extra` | | you can use this variable to pass additional config parameters in the `[federation]` section of the config. | +### Packages ([packages](https://docs.gitea.io/en-us/config-cheat-sheet/#packages-packages)) +| variable name | default value | description | +| ------------- | ------------- | ----------- | +| `gitea_packages_enabled` | `true` | Enable/Disable package registry capabilities | +| `gitea_packages_extra` | |you can use this variable to pass additional config parameters in the `[packages]` section of the config. | + +### LFS ([lfs](https://docs.gitea.io/en-us/config-cheat-sheet/#lfs-lfs)) +| variable name | default value | description | +| ------------- | ------------- | ----------- | +| `gitea_lfs_storage_type` | `local` | Storage type for lfs | +| `gitea_lfs_serve_direct` | `false` | Allows the storage driver to redirect to authenticated URLs to serve files directly. *(only Minio/S3)* | +| `gitea_lfs_content_path` | `{{ gitea_home }}/data/lfs` | Where to store LFS files | +| `gitea_lfs_extra` ||you can use this variable to pass additional config parameters in the `[lfs]` section of the config. | + +### Other ([other](https://docs.gitea.io/en-us/config-cheat-sheet/#other-other)) +| variable name | default value | description | +| ------------- | ------------- | ----------- | +| `gitea_other_show_footer_branding` | `false` | Show Gitea branding in the footer. | +| `gitea_other_show_footer_version` | `true` | Show Gitea and Go version information in the footer. | +| `gitea_other_show_footer_template_load_time` | `true` | Show time of template execution in the footer. | +| `gitea_other_enable_sitemap` | `true` | Generate sitemap. | +| `gitea_other_enable_feed` | `true` | Enable/Disable RSS/Atom feed. | + ### additional gitea config | variable name | default value | description | | ------------- | ------------- | ----------- | diff --git a/defaults/main.yml b/defaults/main.yml index 087e799..cc25b72 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -210,6 +210,26 @@ gitea_federation_enabled: false gitea_federation_share_user_stats: false gitea_federation_extra: '' +# Packages (packages) +# -> https://docs.gitea.io/en-us/config-cheat-sheet/#packages-packages +gitea_packages_enabled: true +gitea_packages_extra: '' + +# LFS (lfs) +# -> https://docs.gitea.io/en-us/config-cheat-sheet/#lfs-lfs +gitea_lfs_storage_type: 'local' +gitea_lfs_serve_direct: false +gitea_lfs_content_path: "{{ gitea_home }}/data/lfs" +gitea_lfs_extra: '' + +# Other (other) +# -> https://docs.gitea.io/en-us/config-cheat-sheet/#other-other +gitea_other_show_footer_branding: false +gitea_other_show_footer_version: true +gitea_other_show_footer_template_load_time: true +gitea_other_enable_sitemap: true +gitea_other_enable_feed: true + # additional gitea config gitea_extra_config: "" diff --git a/templates/gitea.ini.j2 b/templates/gitea.ini.j2 index 74581d5..7ca195c 100644 --- a/templates/gitea.ini.j2 +++ b/templates/gitea.ini.j2 @@ -230,7 +230,7 @@ TOKEN = {{ gitea_metrics_token }} {% if gitea_metrics_extra != '' %}{{ gitea_metrics_extra }}{% else %};{% endif %} ; ; -; https://docs.gitea.io/en-us/config-cheat-sheet/#oauth2-oauth2 +; -> https://docs.gitea.io/en-us/config-cheat-sheet/#oauth2-oauth2 [oauth2] ENABLE = {{ gitea_oauth2_enabled | ternary('true', 'false') }} JWT_SECRET = {{ gitea_oauth2_jwt_secret }} @@ -244,6 +244,36 @@ SHARE_USER_STATISTICS = {{ gitea_federation_share_user_stats | ternary('true', ' {% if gitea_federation_extra != '' %}{{ gitea_federation_extra }}{% else %};{% endif %} ; ; +; Packages (packages) +; -> https://docs.gitea.io/en-us/config-cheat-sheet/#packages-packages +[packages] +ENABLED = {{ gitea_packages_enabled | ternary('true', 'false') }} +{%- if gitea_packages_enabled | bool %} +CHUNKED_UPLOAD_PATH = {{ gitea_home }}/data/tmp/package-upload +{% if gitea_packages_extra != '' %}{{ gitea_packages_extra }}{% else %};{% endif %} +;{% endif %} +; +; +{%- if gitea_lfs_server_enabled | bool %} +; -> https://docs.gitea.io/en-us/config-cheat-sheet/#lfs-lfs +[lfs] +STORAGE_TYPE = {{ gitea_lfs_storage_type }} +SERVE_DIRECT = {{ gitea_lfs_serve_direct | ternary('true', 'false') }} +PATH = {{ gitea_lfs_content_path }} +{% if gitea_lfs_extra != '' %}{{ gitea_lfs_extra }}{% else %};{% endif %} +{%- endif %} +; +; +; Other (other) +; -> https://docs.gitea.io/en-us/config-cheat-sheet/#other-other +[other] +SHOW_FOOTER_BRANDING = {{ gitea_other_show_footer_branding | ternary('true', 'false') }} +SHOW_FOOTER_VERSION = {{ gitea_other_show_footer_version | ternary('true', 'false') }} +SHOW_FOOTER_TEMPLATE_LOAD_TIME = {{ gitea_other_show_footer_template_load_time | ternary('true', 'false') }} +ENABLE_SITEMAP = {{ gitea_other_enable_sitemap | ternary('true', 'false') }} +ENABLE_FEED = {{ gitea_other_enable_feed | ternary('true', 'false') }} +; +; ; ; Optional additional config {{ gitea_extra_config }}