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

59 commits

Author SHA1 Message Date
L3D
129674be94
starting gitea if backup failed
Resolving https://github.com/roles-ansible/ansible_role_gitea/issues/78
2022-05-04 20:42:23 +02:00
Jens Timmerman
fba0abac30
alternative fix for #74
specify full gitea path
2022-05-03 12:15:24 +02:00
L3D
c179060741
resolve linting errors 2022-03-27 05:19:36 +02:00
L3D
2f95efdf9c
Fix Typo directorys/directories
RESOLVE https://github.com/roles-ansible/ansible_role_gitea/issues/69
2022-02-14 11:08:49 +01:00
L3D
9f55d0eefd
use variable gitea_user and remove trailing spaces
since it is possible to run gitea with an other user defined in the ``{{ gitea_user }}`` variable, I built it in this command.
2022-01-23 18:03:07 +01:00
jogrie
7b0180b1f0
fixed backup failure 2022-01-23 14:08:46 +01:00
L3D
06eab17b71
update linting rules 2022-01-16 18:00:52 +01:00
L3D
3509f6bd66
user gitea is now part of gitea group 2021-10-18 14:24:07 +02:00
Jens Timmerman
ad24ff74f2
gitea secrets aren't necessarily strings
fixes errors like 	fatal: [gitea]: FAILED! => {"msg": "The conditional check 'gitea_secret_key | length == 0' failed. The error was: Unexpected templating type error occurred on ({% if gitea_secret_key | length == 0 %} True {% else %} False {% endif %}): object of type 'AnsibleVaultEncryptedUnicode' has no len()
when using an encrypted string in vault for secrets
2021-09-24 11:50:31 +02:00
L3D
aabcf8beb8
Fixing yamllinting errors 2021-07-19 00:55:37 +02:00
Robert Pufky
39e76e2359 Add 'latest' version to automatically download the latest gitea release.
* Versioning logic moved into separate file; versioning is determined in that
  file and appropriate facts are set.
* Removed 'gitea_dl_url' from defaults/main.yml. This is now a generated fact
  from tasks/set_version.yml.
* Remote gitea version is only checked if 'latest' is set, otherwise no logic
  change.
* 'gitea_version' used in tasks is now 'gitea_version_target'. This is the
  target install version after versioning logic is applied. No change to end
  user usage of 'gitea_version' in defaults/main.yml.
* Updated documentation with usage and removal of 'gitea_dl_url'.
2021-07-16 10:16:54 -07:00
L3D
b898edfd48
allow optional public files 2021-06-03 22:51:28 +02:00
L3D
265bca3eeb
Add custom footer support 2021-06-03 21:06:04 +02:00
L3D
e27ef27706
implement custom logos 2021-06-03 17:59:14 +02:00
L3D
094c0038d4
update ansible version requirement 2021-05-10 22:49:14 +02:00
L3D
4d3289a796
import gpg key with the same user
import gpg key with the same user that will verify the gpg key.

RESOLVE #29
2021-05-06 15:16:31 +02:00
L3D
2ca88c2711
add message to warn the user
+ Added a message that will warn the user that fail2ban is not installed.
+ Increased the version integer for the simple versionscheck.
2021-04-12 16:56:48 +02:00
firesoft-de
391447a345
removed trailing spaces 2021-04-12 16:01:24 +02:00
firesoft-de
664c894e17
Fixed missing quotes 2021-04-12 12:39:11 +02:00
firesoft-de
18bb3f9c44
Added condition to only configure fail2ban if it is installed 2021-04-12 12:30:52 +02:00
firesoft-de
552747dda9
Added package_facts to determine if fail2ban is installed 2021-04-12 12:29:42 +02:00
firesoft-de
4555638297 Fix login shell 2021-04-05 22:02:31 +02:00
L3D
d9ff631e62
add gitea_filename variable 2021-03-22 21:47:28 +01:00
L3D
0e0a319773
Add new ansible naming scheme 2021-03-22 21:28:51 +01:00
L3D
d3c26ac0f8
use new ansible name scheme at more tasks 2021-03-22 21:21:25 +01:00
L3D
6096767d26
simplify directory handling and start using new ansible name scheme 2021-03-22 21:08:40 +01:00
L3D
791ae23361
add optional versionscheck
a simple version check that can prevent you from accidentally running an older version of this role.
2021-03-22 02:22:22 +01:00
L3D
1a8164b5ac
resolve linting error 2021-03-21 02:29:29 +01:00
L3D
6ec2f8ed04
change secret mechanism and continue with README clenaup 2021-03-21 02:22:36 +01:00
L3D
1127d83778
make the backup on update optional
Documentation and introduction of the variable `gitea_backup_on_upgrade: false`
2021-02-13 05:41:32 +01:00
L3D
0ffd14ccf0
create backup direcotry
create a backup folder and move the gitea backup to backup.yml
2021-02-13 05:32:27 +01:00
Finwë
56375819a7
Improve ARM Support (#74)
* Gitea user should be a system user

* Improve installation system

* Download archive instead of binary
* Add checksum validation
* Add GPG check
* Add backup process before upgrading

* Improve ARM support

* Improve support for Vault Encrypted JWT tokens

* Fix spacing in gitea configuration template

When Gitea rewrite the configuration file (e.g.: the JWT token is not
set or doesn't fit their criteria), it'll align space on a per-section
basis in the .ini file.
If the template is not properly spaced, at the next Ansible run, you'll
have an enormous diff, hidding what the real changes are.

* add proper redhat/debian deps for molecule testing

* Gitea group should be a system group

* fix linting for CI

* Update CI and meta information for up-to-date tests and distros

* molecule: fix typo for redhat packages

* fix typo

* bump gitea version to 1.13.1

* Use Ubuntu keyservers to play nicely with everyone

* Update minimum required ansible version to 2.9.8

This is required for Ubuntu Focal, which comes with systemd >= 245
The Get Facts modules doesn't work well with it before the bugfix
introduced in 2.9.8

* Replace yes by True to please the linting

* Truthy values needs to be lower-case

* bump gitea version to 1.13.2

* perform gitea dump as gitea user

* need to set become to yes

* autogenerate JWT_SECRETS (#77)

* autogenerate JWT_SECRETS

Based on https://docs.gitea.io/en-us/command-line/#generate we will now autogenerate JWT_SECRETS if they are not defined.
In my opinion a much better idea than writing a value in the default config.

The check if the variables for the secrets are now 43 characters long i took out. Gitea generates itself suitable secrets, if the user given ones do not fit.

* drop ansible.builtin. syntax

* Update file permissions for "{{ gitea_home }}" (#75)

The file permissions for {{ gitea_home }} especially in conjunction with the recurse: true flag are on closer inspection very open to all and also have a +x set on files.

This should be done better. And I have done here now.

By the way: To improve the -x on normal files in his gitea installation this shell command was useful for me
```
find . -type f -exec chmod a-x {} \+;
find . -type f -exec chmod u=rwX {} \+;
```

* Bump cryptography from 3.2 to 3.3.2 (#79)

Bumps [cryptography](https://github.com/pyca/cryptography) from 3.2 to 3.3.2.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.2...3.3.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Gitea user should be a system user

* Improve installation system

* Download archive instead of binary
* Add checksum validation
* Add GPG check
* Add backup process before upgrading

* Improve ARM support

* Fix spacing in gitea configuration template

When Gitea rewrite the configuration file (e.g.: the JWT token is not
set or doesn't fit their criteria), it'll align space on a per-section
basis in the .ini file.
If the template is not properly spaced, at the next Ansible run, you'll
have an enormous diff, hidding what the real changes are.

* add proper redhat/debian deps for molecule testing

* Gitea group should be a system group

* fix linting for CI

* Update CI and meta information for up-to-date tests and distros

* molecule: fix typo for redhat packages

* fix typo

* bump gitea version to 1.13.1

* Use Ubuntu keyservers to play nicely with everyone

* Update minimum required ansible version to 2.9.8

This is required for Ubuntu Focal, which comes with systemd >= 245
The Get Facts modules doesn't work well with it before the bugfix
introduced in 2.9.8

* Replace yes by True to please the linting

* Truthy values needs to be lower-case

* bump gitea version to 1.13.2

* perform gitea dump as gitea user

* need to set become to yes

* check-variables.yml doesn't exists anymore

Co-authored-by: L3D <l3d@c3woc.de>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-12 17:56:31 +00:00
L3D
7d91337447
Update file permissions for "{{ gitea_home }}" (#75)
The file permissions for {{ gitea_home }} especially in conjunction with the recurse: true flag are on closer inspection very open to all and also have a +x set on files.

This should be done better. And I have done here now.

By the way: To improve the -x on normal files in his gitea installation this shell command was useful for me
```
find . -type f -exec chmod a-x {} \+;
find . -type f -exec chmod u=rwX {} \+;
```
2021-02-10 19:05:04 +00:00
L3D
9cd664d91f
autogenerate JWT_SECRETS (#77)
* autogenerate JWT_SECRETS

Based on https://docs.gitea.io/en-us/command-line/#generate we will now autogenerate JWT_SECRETS if they are not defined.
In my opinion a much better idea than writing a value in the default config.

The check if the variables for the secrets are now 43 characters long i took out. Gitea generates itself suitable secrets, if the user given ones do not fit.

* drop ansible.builtin. syntax
2021-02-10 19:04:13 +00:00
L3D
67afb71160
add default "gitea_group: gitea" (#71)
* delete trailing whitespace

* Add gitea_group

This will add the `gitea_group: gitea` and will probably
RESOLVE https://github.com/thomas-maurice/ansible-role-gitea/issues/70

* update variable length

update variable length to make this role idempotent

* vars should not include special character
2021-01-27 14:13:02 +00:00
L3D
2500047d22 improve all easy to fix yaml warnings 2021-01-22 11:06:55 +00:00
L3D
fb45c4dfc5 add linting check and fix warning
There is this linting message:
```
[208] File permissions unset or incorrect
tasks/main.yml:27
Task/Handler: Create config and data directory
```

I fixed it in this commit and added a github action
to run the official™ ansible linting check!
2021-01-22 11:06:55 +00:00
genofire
883b6d958e fix logging path 2020-09-24 17:21:36 +01:00
Jens Timmerman
667c375a9d Update install_systemd.yml 2020-09-24 16:00:51 +01:00
Jens Timmerman
4976d531ba Update install_systemd.yml
reload systemd should be triggered via handler
2020-09-24 16:00:51 +01:00
Jens Timmerman
d517cd1e64 also create inders and logs directory as gitea
Recursively set the gitea user as owner of all it's directories (and create /indexers and /logs directories.
This is needed if one tried to start gitea as root before.
2020-08-21 23:16:35 +01:00
Jens Timmerman
56d9e08c64 make sure git is installed
gitea service fails to start if the git binary is not present on the system
2020-08-21 23:15:44 +01:00
Sergej
77d593a4b9 Bugfix: set -o pipefail fails silently.
This is due the fact that Ansible often takes another default shell
to execute its commands, e.g., /bin/sh.
Solution is to require /bin/bash for the particular command.
2020-06-17 14:08:26 +01:00
Simeon Keske
16707f4a38 Allow to set a custom Download-URL for gitea 2020-05-19 14:21:12 +01:00
L. Alberto Giménez
7e7626ed2a Fix check mode for binary download task
In check_mode, the binary download task depends on the execution of the
previous one, which uses the module shell to fill in a variable. In the
download binary task we use a field on that variable that does not exist
in check_mode, so the task fails.

Signed-off-by: L. Alberto Giménez <agimenez@sysvalve.es>
2020-05-15 09:47:24 +01:00
Thomas Maurice
cdfb5bd354 Fix linting 2020-04-20 15:38:03 +01:00
dhs
d65ac0f919 Update main.yml
remove debugging remnant
2020-04-20 15:09:35 +01:00
dhs
7e59a636cb improved testing 2020-04-20 15:09:35 +01:00
dhach
15a5f64e8a check that jwt token is < 32 chars to prevent gitea from crashing 2020-04-20 15:02:41 +01:00
L3D
5e971278c3 Fixing deprecation warning
ANsible comes with the error:
```bash
[DEPRECATION WARNING]: evaluating gitea_fail2ban_enabled as a bare variable, this behaviour will go away and you might need to add |bool to the expression in the future. Also see CONDITIONAL_BARE_VARS configuration toggle.. This
feature will be removed in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
```

appending ``|bool`` after a boolean variable will resolve the issue.
2019-05-23 21:19:21 +01:00