1
1
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_gitea.git synced 2024-08-16 11:39:50 +02:00

cleanup README

This commit is contained in:
L3D 2021-03-22 00:35:16 +01:00
parent 7d8ff11f5e
commit 42f6a4e594
Signed by: l3d
GPG key ID: CD08445BFF4313D1
2 changed files with 33 additions and 99 deletions

103
README.md
View file

@ -62,6 +62,8 @@ Here is a deeper insight into the variables of this gitea role. For the exact fu
| `gitea_dl_url` | *(see [defaults/main.yml](defaults/main.yml#L5))* | The path from where this role downloads the gitea binary | | `gitea_dl_url` | *(see [defaults/main.yml](defaults/main.yml#L5))* | The path from where this role downloads the gitea binary |
| `gitea_gpg_key` | `7C9E68152594688862D62AF62D9AE806EC1592E2` | the gpg key the gitea binary is signed with | | `gitea_gpg_key` | `7C9E68152594688862D62AF62D9AE806EC1592E2` | the gpg key the gitea binary is signed with |
| `gitea_gpg_server` | `hkp://keyserver.ubuntu.com:80` | A gpg key server where this role can download the gpg key | | `gitea_gpg_server` | `hkp://keyserver.ubuntu.com:80` | A gpg key server where this role can download the gpg key |
| `gitea_backup_on_upgrade` | `false` | Optionally a backup can be created with every update of gitea. |
| `gitea_backup_location` | `{{ gitea_home }}/backups/` | Where to store the gitea backup if one is created with this role. |
### gitea in the linux world ### gitea in the linux world
| variable name | default value | description | | variable name | default value | description |
@ -69,6 +71,7 @@ Here is a deeper insight into the variables of this gitea role. For the exact fu
| `gitea_group` | `gitea` | UNIX group used by Gitea | | `gitea_group` | `gitea` | UNIX group used by Gitea |
| `gitea_home` | `/var/lib/gitea` | Base directory to work | | `gitea_home` | `/var/lib/gitea` | Base directory to work |
| `gitea_shell` | `/bin/false` | UNIX shell used by gitea. Set it to `/bin/bash` if you don't use the gitea built-in ssh server. | | `gitea_shell` | `/bin/false` | UNIX shell used by gitea. Set it to `/bin/bash` if you don't use the gitea built-in ssh server. |
| `gitea_systemd_cap_net_bind_service` | `false` | Adds `AmbientCapabilities=CAP_NET_BIND_SERVICE` to systemd service file |
### Overall ([DEFAULT](https://docs.gitea.io/en-us/config-cheat-sheet/#overall-default)) ### Overall ([DEFAULT](https://docs.gitea.io/en-us/config-cheat-sheet/#overall-default))
| variable name | default value | description | | variable name | default value | description |
@ -198,38 +201,23 @@ Here is a deeper insight into the variables of this gitea role. For the exact fu
| `gitea_log_level` | `Warn` | General log level. `[Trace, Debug, Info, Warn, Error, Critical, Fatal, None]` | | `gitea_log_level` | `Warn` | General log level. `[Trace, Debug, Info, Warn, Error, Critical, Fatal, None]` |
| `gitea_log_extra_config` | `''` | you can use this variable to pass additional config parameters in the `[log]` section of the config. | | `gitea_log_extra_config` | `''` | you can use this variable to pass additional config parameters in the `[log]` section of the config. |
### Metrics ([metrics](https://docs.gitea.io/en-us/config-cheat-sheet/#metrics-metrics))
| `gitea_enable_notify_mail`: Whether e-mail should be send to watchers of a repository when something happens. Default: `false`
### LFS configuration
### Look and feel
| variable name | default value | description | | variable name | default value | description |
| ------------- | ------------- | ----------- | | ------------- | ------------- | ----------- |
| `gitea_metrics_enabled`| `false` | Enable the metrics endpoint |
| `gitea_metrics_token`| `''` | Bearer token for the Prometheus scrape job |
### OAuth2 ([oauth2](https://docs.gitea.io/en-us/config-cheat-sheet/#oauth2-oauth2))
### Security
| variable name | default value | description | | variable name | default value | description |
| ------------- | ------------- | ----------- | | ------------- | ------------- | ----------- |
| `gitea_oauth2_enabled` | `true` | Enable the Oauth2 provider (true/false) |
| `gitea_oauth2_jwt_secret` | `''` | Oauth2 JWT secret. Can be generated with ``gitea generate secret JWT_SECRET``. Will be autogenerated if not defined. | | `gitea_oauth2_jwt_secret` | `''` | Oauth2 JWT secret. Can be generated with ``gitea generate secret JWT_SECRET``. Will be autogenerated if not defined. |
| `gitea_oauth2_extra_config` | `''` | you can use this variable to pass additional config parameters in the `[oauth2]` section of the config. |
### additional gitea config
### HTTP configuration | variable name | default value | description |
| ------------- | ------------- | ----------- |
| `gitea_extra_config` | `''` | Additional gitea configuration. Have a look at the [config-cheat-sheet](https://docs.gitea.io/en-us/config-cheat-sheet/) before using it! |
### SSH configuration
### Database configuration
### Mailer configuration
### Log configuration
### Fail2Ban configuration ### Fail2Ban configuration
@ -237,31 +225,14 @@ If enabled, this will deploy a fail2ban filter and jail config for Gitea as desc
As this will only deploy config files, fail2ban already has to be installed or otherwise the role will fail. As this will only deploy config files, fail2ban already has to be installed or otherwise the role will fail.
* `gitea_fail2ban_enabled`: Whether to deploy the fail2ban config or not | variable name | default value | description |
* `gitea_fail2ban_jail_maxretry`: fail2ban jail `maxretry` setting. Default: `10` | ------------- | ------------- | ----------- |
* `gitea_fail2ban_jail_findtime`: fail2ban jail `findtime` setting. Default: `3600` | `gitea_fail2ban_enabled` | `false` | Whether to deploy the fail2ban config or not |
* `gitea_fail2ban_jail_bantime`: fail2ban jail `bantime` setting. Default: `900` | `gitea_fail2ban_jail_maxretry` | `10` | fail2ban jail `maxretry` setting. |
* `gitea_fail2ban_jail_action`: fail2ban jail `action` setting. Default: `iptables-allports` | `gitea_fail2ban_jail_findtime` | `3600` | fail2ban jail `findtime` setting. |
| `gitea_fail2ban_jail_bantime` | `900` | fail2ban jail `bantime` setting. |
| `gitea_fail2ban_jail_action` | `iptables-allports` | fail2ban jail `action` setting. |
### Oauth2 provider configuration
* `gitea_oauth2_enabled`: Enable the Oauth2 provider (true/false)
### Metrics endpoint configuration
* `gitea_metrics_enabled`: Enable the metrics endpoint
* `gitea_metrics_token`: Bearer token for the Prometheus scrape job
### Repository Indexer configuration
### backup on upgrade
* `gitea_backup_on_upgrade`: Optionally a backup can be created with every update of gitea. Default: `false`
* `gitea_backup_location`: Where to store the gitea backup if one is created with this role. Default: `{{ gitea_home }}/backups/`
* `gitea_systemd_cap_net_bind_service`: Adds `AmbientCapabilities=CAP_NET_BIND_SERVICE` to systemd service file
* `gitea_extra_config`: Additional configuration
## Contributing ## Contributing
Don't hesitate to create a pull request, and when in doubt you can reach me on Don't hesitate to create a pull request, and when in doubt you can reach me on
Mastodon [@l3d@chaos.social](https://chaos.social/@l3d). Mastodon [@l3d@chaos.social](https://chaos.social/@l3d).
@ -269,35 +240,5 @@ Mastodon [@l3d@chaos.social](https://chaos.social/@l3d).
I'm happy to fix any issue that's been opened, or even better, review your pull requests :) I'm happy to fix any issue that's been opened, or even better, review your pull requests :)
## Testing ## Testing
Testing uses [molecule](https://molecule.readthedocs.io/en/stable-1.22/usage.html). To start the There is a test that is using [molecule](https://molecule.readthedocs.io/en/stable-1.22/usage.html). And som linting tests with github actions.
tests, install the dependencies first. I would recommend you use [a virtual env](https://virtualenv.pypa.io/en/latest/) for that but who am I to tell you what to do. *For locale molecule testing docker is required.*
```
pip install pew # install pew to manage the venvs
pew new ansible # create the venv
pip install -r requirements-travis.txt # install the requirements
molecule test # Run the actual tests
```
Note: you need Docker installed
### Known testing limitations
Currently it's mainly validating that the playbook runs, the lint is ok, and that kind of things.
Since it runs in Docker, we currently have no way to check if the service is actually launched by systemd
and so on. This has to be worked on.
## License
```
Copyright (c) 2019 - today L3D <l3d@c3woc.de>
Copyright (c) 2019 - 2021 Thomas Maurice
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```

View file

@ -5,11 +5,14 @@ gitea_version_check: true
gitea_dl_url: "https://github.com/go-gitea/gitea/releases/download/v{{ gitea_version }}/gitea-{{ gitea_version }}-linux-{{ gitea_arch }}" gitea_dl_url: "https://github.com/go-gitea/gitea/releases/download/v{{ gitea_version }}/gitea-{{ gitea_version }}-linux-{{ gitea_arch }}"
gitea_gpg_key: '7C9E68152594688862D62AF62D9AE806EC1592E2' gitea_gpg_key: '7C9E68152594688862D62AF62D9AE806EC1592E2'
gitea_gpg_server: 'hkp://keyserver.ubuntu.com:80' gitea_gpg_server: 'hkp://keyserver.ubuntu.com:80'
gitea_backup_on_upgrade: false
gitea_backup_location: "{{ gitea_home }}/backups/"
# gitea in the linux world # gitea in the linux world
gitea_group: 'gitea' gitea_group: 'gitea'
gitea_home: '/var/lib/gitea' gitea_home: '/var/lib/gitea'
gitea_shell: '/bin/false' gitea_shell: '/bin/false'
gitea_systemd_cap_net_bind_service: false
# Overall (DEFAULT) # Overall (DEFAULT)
# -> https://docs.gitea.io/en-us/config-cheat-sheet/#overall-default # -> https://docs.gitea.io/en-us/config-cheat-sheet/#overall-default
@ -48,6 +51,7 @@ gitea_ssh_listen: '0.0.0.0'
gitea_offline_mode: true gitea_offline_mode: true
gitea_lfs_server_enabled: false gitea_lfs_server_enabled: false
gitea_lfs_content_path: "{{ gitea_home }}/data/lfs" gitea_lfs_content_path: "{{ gitea_home }}/data/lfs"
gitea_lfs_jwt_secret: ''
gitea_server_extra_config: '' gitea_server_extra_config: ''
# Database (database) # Database (database)
@ -131,23 +135,12 @@ gitea_oauth2_enabled: true
gitea_oauth2_jwt_secret: '' gitea_oauth2_jwt_secret: ''
gitea_oauth2_extra_config: '' gitea_oauth2_extra_config: ''
# additional gitea config
# security
gitea_lfs_jwt_secret: ''
gitea_systemd_cap_net_bind_service: false
gitea_fail2ban_enabled: false
gitea_fail2ban_jail_maxretry: 10
gitea_fail2ban_jail_findtime: 3600
gitea_fail2ban_jail_bantime: 900
gitea_fail2ban_jail_action: iptables-allports
gitea_extra_config: "" gitea_extra_config: ""
gitea_backup_on_upgrade: false # fail2ban
gitea_backup_location: "{{ gitea_home }}/backups/" gitea_fail2ban_enabled: false
gitea_fail2ban_jail_maxretry: '10'
gitea_fail2ban_jail_findtime: '3600'
gitea_fail2ban_jail_bantime: '900'
gitea_fail2ban_jail_action: 'iptables-allports'