16 Commits

Author SHA1 Message Date
Ian Wienand
9ba398dee9 testinfra: refactor screenshot taking
Reduce the screenshots to a single utility function to avoid copying a
lot of boilerplate.

Change-Id: Iad1c7afa4e9ea9a4ddaca5e62751795e60bc2980
2021-09-07 12:54:26 +10:00
Ian Wienand
1dde7628e8 gitea: add some screenshots to testing
Change-Id: Id13fdd8ffbca1b0cd19858419d68f012e33f3ba8
2021-09-07 08:59:46 +10:00
James E. Blair
30a96d8cb8 Switch robots.txt test on gitea to proxy port
Instead of having testinfra check that gitead serves robots.txt,
let's have it check that apache serves or proxies it (since that's
what the load balancer will see).

Change-Id: I809fe9c5d5b43e73a216b61d72eea95546b9619c
2021-08-20 22:06:08 -07:00
James E. Blair
2a697f8ecd Serve matrix well-known files from apache
So that we can set the CORS header

Change-Id: I49eab2bda9a6b636a30384f7590c765079d31b20
2021-08-20 22:03:45 -07:00
Clark Boylan
65cb02a016 Improve repo rename functional testing
This tests that we can rename both the project and the org the project
lives in. Should just add a bit more robustness to our testing.

Change-Id: I0914e864c787b1dba175e0fabf6ab2648a554d16
2021-08-02 14:12:57 -07:00
Clark Boylan
d504604b0c Test the rename_repos playbook
It would be useful to test our rename playbook against gitea and gerrit
when we make changes to these related playbooks, roles, and docker
images. To do this we need to converge our test and production setups
for gerrit a bit more. We create an openstack-project-creator account in
the test gerrit to match prod and we have rename_repos.yaml talk to
localhost for gerrit ssh commands.

With that done we can run the rename_repos.yaml playbook from
test-gitea.yaml and test-gerrit.yaml to help ensure the playbook
functions as expected against these services.

Co-Authored-By: Ian Wienand <iwienand@redhat.com>
Change-Id: I49ffaf86828e87705da303f40ad4a86be030c709
2021-07-28 08:33:55 -07:00
Ian Wienand
694241ad77 docker: install rsyslog to capture container output
This started with me wondering why gerritbot was putting all its
output into /var/log/syslog -- it turns out Xenial docker is
configured to use journalctl (which forwards to syslog) and Bionic
onwards uses json-file.

Both are sub-optimial; but particularly the json-file because we lose
the logs when the container dies.  This proposes moving to a more
standard model of having the containers log to syslog and redirecting
that to files on disk.

Install a rsyslog configuration to capture "docker-*" program names
and put them into logfiles in /var/log/containers.  Also install
rotation for these files.

In an initial group of docker-compose files, setup logging to syslog
which should then be captured into these files.  Add some basic
testing.

If this works OK, I think we can standardise our docker-compose files
like this to caputure the logs the same everywhere.

Change-Id: I940a5b05057e832e2efad79d9a2ed5325020ed0c
2020-10-19 16:06:03 +11:00
Ian Wienand
8d0d6155ed gitea: crawler UA reject rules
As described inline, this crawler is causing us problems as it hits
the backends indiscriminately.  Block it via the known UA strings,
which luckily are old so should not cause real client issues.

Change-Id: I0d78a8b625b69f600e00e8b3ea64576e0fdb84d9
2020-07-01 16:15:59 +10:00
Ian Wienand
870f664648 gitea: Add reverse proxy option
This adds an option to have an Apache based reverse proxy on port 3081
forwarding to 3000.  The idea is that we can use some of the Apache
filtering rules to reject certain traffic if/when required.

It is off by default, but tested in the gate.

Change-Id: Ie34772878d9fb239a5f69f2d7b993cc1f2142930
2020-07-01 15:33:05 +10:00
Ian Wienand
eb3e58da91 gitea-image: add a robots.txt
This looks like a very sane default robots.txt.  We can modify it as
required.

Change-Id: I8b9d3aa63538388e319f0216535f7a1d977f4885
2020-07-01 06:38:18 +10:00
Clark Boylan
8eb981b47f Install docker-compose from pypi
We want to use stop_grace_period to manage gerrit service stops. This
feature was added in docker-compose 1.10 but the distro provides 1.5.
Work around this by installing docker-compose from pypi.

This seems like a useful feature and we want to manage docker-compose
the same way globally so move docker-compose installation into the
install-docker role.

New docker-compose has slightly different output that we must check for
in the gitea start/stop machinery. We also need to check for different
container name formatting in our test cases. We should pause here and
consider if this has any upgrade implications for our existing services.

Change-Id: Ia8249a2b84a2ef167ee4ffd66d7a7e7cff8e21fb
2020-04-16 12:08:00 -07:00
Clark Boylan
05e0ffdebc Collect gitea sshd logs
Currently we don't have any logs from our gitea sshd processes because
sshd logs to syslog by default and /dev/log isn't in our containers. You
can ask sshd nicely to log to stderr instead with the -e flag which
docker will pick up and store for us.

Update the sshd command to include -e then use testinfra to check we
collect logs and they are accssible from docker.

Change-Id: Ib7d6d405554c3c30be410bc08c6fee7d4363b096
2019-08-06 13:42:25 -07:00
Jeremy Stanley
5587c299ea Re-add gitea01 replacement to inventory
Add new IP addresses to inventory for the rebuild, but don't
reactivate it in the haproxy pools yet.

Note this switches the gitea testing to use a host called gitea99 so
that it doesn't conflict with our changes of the production hosts.

Change-Id: I9779e16cca423bcf514dd3a8d9f14e91d43f1ca3
2019-07-23 16:17:41 -07:00
James E. Blair
a845815520 Double stack size on gitea
Git can segfault and cause a gitea error due to the size of the
openstack/openstack repo.  Give it more stack space.

The hard limit is a workaround for
https://github.com/moby/moby/issues/39125

Change-Id: Ibce79d8ab27af3070bf9c5f584d0d78f2b266388
2019-04-22 17:00:00 -07:00
James E. Blair
480c7ebe37 Use host networking for gitea
Change-Id: If706c6f85022919add93e46eeb6eae1b6d948d75
2019-02-21 15:27:44 -08:00
James E. Blair
67cda2c7df Deploy gitea with docker-compose
This deploys a shared-nothing gitea server using docker-compose.
It includes a mariadb server.

Change-Id: I58aff016c7108c69dfc5f2ebd46667c4117ba5da
2019-02-18 08:46:40 -08:00