Commit Graph

13 Commits (22dbc3ebc1b2524baf59d5aeaba57cc14dfd0976)

Author SHA1 Message Date
Dustin 3511176c31 r/gitea: Configure SMTP mailer
Gitea needs SMTP configuration in order to send e-mail notifications
about e.g. pull requests.  The `gitea_smtp` variable can be defined to
enable this feature.
2024-08-25 08:46:37 -05:00
Dustin 1ab0dd3457 r/gitea: Set WORK_DIR in config
Gitea complains if the `WORK_DIR` setting is not set.  It tries to set
it itself, but fails because the configuration is read-only.  The value
it uses is incorrect anyway (`/usr/local/bin`, since that's where the
`gitea` executable is).
2024-08-25 08:45:29 -05:00
Dustin 710a8686fe r/gitea: Update LFS config syntax 2024-08-25 08:45:23 -05:00
Dustin 5c297df6b9 r/gitea: use sshd_config.d
Recent(-ish) versions of Fedora have a drop-in configuration directory
for `sshd`.  This allows applications, etc. to define certain settings
for the SSH server, without having to manage the entire server
configuration.  For Gitea specifically, we only need to set a few
settings for the *gitea* user, leaving the remaining settings alone.

This commit does not include any migration to undo the settings that
were originally set,  but that should be as simple as `mv
/etc/ssh/sshd_config.rpmnew /etc/ssh/sshd_config && systemctl reload
sshd`.
2023-11-13 17:45:21 -06:00
Dustin b45e647382 r/gitea: Update to v1.20.5 2023-10-27 17:41:43 -05:00
Dustin 772f669ab2 r/gitea: Handle encoded / characters in HTTP paths
Gitea package names (e.g. OCI images, etc.) can contain `/` charactres.
These are encoded as %2F in request paths.  Apache needs to forward
these sequences to the Gitea server without decoding them.
Unfortunately, the `AllowEncodedSlashes` setting, which controls this
behavior, is a per-virtualhost setting that is *not* inherited from the
main server configuration, and therefore must be explicitly set inside
the `VirtualHost` block.  This means Gitea needs its own virtual host
definition, and cannot rely on the default virtual host.
2022-11-27 17:21:03 -06:00
Dustin 0e97d5e39f r/gitea: Update to 1.17.0
The only major change that affects the configuration policy is the
introduction of the `webhook.ALLOWED_HOST_LIST` setting.  For some dumb
reason, the default value of this setting *denies* access to machines on
the local network.  This makes no sense; why do they expect you to host
your CI or whatever on a *public* network?  Of course, the only reason
given is "for security reasons."
2022-09-01 17:29:34 -05:00
Dustin 6df0d7bea4 r/gitea: Enable Prometheus metrics
Gitea provides a Prometheus-compatible metrics endpoint at `/metrics`,
but it is disabled by default.
2021-10-18 10:11:44 -05:00
Dustin f8b7f28469 roles/gitea: Install from upstream binary
I seem to have forgotten how I got the RPM for Gitea.  I think I built
it, but I cannot find the spec file, nor the RPM package.  Since this is
clearly not reproducible, I decided to switch to using the binary
provided by upstream for now, until either I or Fedora get around to
making a better RPM.

Installing Gitea from the upstream binary is simple: just download it
and copy it to `/usr/local/bin`.  Of course, the OS user and systemd
unit have to be managed by configuration policy when it's installed this
way.
2020-02-22 16:43:46 -06:00
Dustin f368938550 roles/gitea: Add Oauth2 JWT Secret
Newer versions of Gitea need a JWT secret for Oauth2.  Gitea will
attempt to generate one at startup if it is not already specified in the
configuration file, but this will fail since the file is not writable by
the user running the service.  As such, it must be set via configuration
policy.
2019-04-24 16:18:19 -05:00
Dustin 6a83a6dfa3 roles/gitea: Allow configuring clone URLs
The `gitea_ssh_domain` and `gitea_http_domain` variables can be used to
configure the host portion of the URLs for cloning Git repositories over
SSH and HTTPS, respectively. By default, both values are the FQDN of the
machine hosting Gitea.
2018-06-04 20:03:55 -05:00
Dustin a7ebe3b2ae roles/gitea: Add HTTP -> HTTPS redirect 2018-06-04 20:03:55 -05:00
Dustin adaf3c6789 roles/gitea: Deploy Gitea server
The *gitea* role installs Gitea using the system package manager and
configures Apache as a reverse proxy for it.

The configuration file requires a number of "secret" values that need to
be unique. These must be specified as Ansible variables:

* `gitea_internal_token`
* `gitea_secret_key`
* `gitea_lfs_jwt_secret`

The `gitea generate` command can be used to create these values.

Normally, Gitea expects to run its own setup tool to generate the
configuration file and create the administrative user. Since the
configuration file is generated from the template instead, no
administrative user is created automatically. Luckily, the `gitea`
command includes a tool to create users, so the administrator can be
created manually, e.g.:

    sudo -u gitea gitea admin create-user -c /etc/gitea/app.ini \
        --admin
        --name giteadmin \
        --password giteadmin \
        --email giteadmin@example.org
2018-06-04 20:03:55 -05:00