248 Commits

Author SHA1 Message Date
Zuul
c5b95b55fa Merge "Block access to Gitiles" 2022-03-03 22:22:09 +00:00
Ian Wienand
25f7403e2a hound: enable detect-ref
The dependent change enables the "detect-ref" option of hound, which
looks at the remote origin HEAD and indexes on that.  That should
allow indexing of our mixed repos that have a mix of "master" and
"main".

Add cirros to the test, which should exercise this path, and take some
screenshosts because this a js/react app and just a "curl" doesn't
help.

Change-Id: I1850577c63566b594f9730f5b8f0bc10b07ff7e4
Depends-On: https://review.opendev.org/c/opendev/jeepyb/+/830919
2022-02-25 17:27:35 +11:00
Jeremy Stanley
77972b0150 Block access to Gitiles
Once restarted onto the parent change, our Gerrit deployment will no
longer link to Gitiles representations of changes or the Git tree.
Explicitly deny access to the Gitiles URL base path in the Apache
vhost config, since we can't effectively remove the plugin itself.
This should help prevent search engines from finding its copies of
our projects rather than the ones we want people to use in Gitea.

Change-Id: I3c96221256662443f7a43344afd12194dce82b9d
2022-02-18 21:39:27 +00:00
James E. Blair
2a9553ef25 Add Zuul load balancer
This adds a load balancer for zuul-web and fingergw.

Change-Id: Id5aa01151f64f3c85e1532ad66999ef9471c5896
2022-02-10 13:24:42 -08:00
Zuul
a50aab2e3a Merge "lodgeit: switch pastes to be private by default" 2022-02-08 23:18:00 +00:00
Ian Wienand
de5011daf2 lodgeit: switch pastes to be private by default
Change-Id: I8d40c74d9dbb4899d705de05baca3b7a082c4dcc
Depends-On: https://review.opendev.org/c/opendev/lodgeit/+/828201
2022-02-08 11:45:26 +11:00
Zuul
83ae9c4663 Merge "Manage 10periodic and 20auto-upgrades together" 2022-02-02 16:27:46 +00:00
James E. Blair
14f4a20628 Remove gearman from Zuul
Zuul no longer uses gearman, so we can remove the infrastructure
around it.

Change-Id: I3613d812971add4733d3fe509ee22835e5814ec6
2022-02-01 13:52:47 -08:00
Clark Boylan
6d3a281a42 Manage 10periodic and 20auto-upgrades together
These two apt.conf.d config files are installed by different packages
but have overlap in the configuration they set. Unfortunately if the
wrong one sets the flag to disable periodic updates it wins based on apt
conf's priority rules.

To ensure that we continue to auto update and handle different packages
supplying different config files we manage the entirety of the periodic
config in both of these files at the same time using a common source
file.

Change-Id: I5e408fd7c343adb1de9ec564fe430a6f31ecc360
2022-01-27 09:17:26 -08:00
Clark Boylan
b88bc56c55 Manage apt.conf.d/20auto-upgrades
This file has been seen on a few servers with the Unattended-Upgrades
flag set to 0 disabling daily unattended upgrades. Most of our servers
have this set to 1 and are fine, but let's go ahead and manage this file
directly to ensure it is always 1 and auto upgrades are enabled.

Note that previously we had been setting this via apt.conf.d/10periodic
which seems to come from the update-notifier-common package on older
systems and is now no longer used. Since that file's prefix is smaller
than 20auto-upgrades the 20auto-ugprades file installed by
unattended-upgrades overrides this value. A future update would be to
coalesce both 10periodic and 20auto-upgrades together into one config
file.

Change-Id: Ic0bdaaf881780072fda7e60ff89b60b3a07b5804
2022-01-24 11:16:35 -08:00
Jeremy Stanley
b84bdffc08 Add mailman Web redirects for the moved staff list
While the staff mailing list is hidden and private in production,
that configuration is set after creation, so in our deployment tests
we can absolutely verify that HTTP and HTTPS redirects for listinfo
and archives work anyway. This paves the way for any further
rewrites and associated testing we may need to do for other mailing
lists which move between domains, as well as testing redirects we
may set up as part of the v2 to v3 migration.

Change-Id: I68078554a72e3b59d8192ac4339e8654a8351f52
2021-12-21 03:37:10 +00:00
Jeremy Stanley
81f8cdfb7b Add HTTPS vhosts to mailman servers
Add secondary vhosts for HTTPS to each mailman site, but don't
remove the plain HTTP ones for now. Before switching to Mailman 3
we'll replace the current HTTP vhosts with blanket redirects to
HTTPS.

Add tests to make sure this is working, and also add a command-line
test for the lists.openinfra.dev site now that it's got a first
non-default list of its own. Also collect Apache logs from the test
nodes so we can see for sure what might break.

Change-Id: I4d93d643381f17c9a968595587909f0ba3dd6f92
2021-12-20 20:35:14 +00:00
Jeremy Stanley
75c8739bf9 Forward messages for OpenInfra Foundation staff ML
Once the staff mailing list has been migrated to its new Mailman
site, merge this in order to forward posts destined for its old
address to the new one.

Add a test to make sure domain aliases are bein written as expected.

Change-Id: I5fea8e9ee6460417283c0ed7339d0dd447b2ff63
2021-12-16 19:22:16 +00:00
Jeremy Stanley
e2dbda1bec Block outbound SMTP connections from test jobs
Our deployment tests don't need to send E-mail messages. More to the
point, they may perform actions which would like to send E-mail
messages. Make sure, at the network level, they'll be prevented from
doing so. Also allow all connections to egress from the loopback
interface, so that services like mailman can connect to the Exim MTA
on localhost.

Add new rolevars for egress rules to support this, and also fix up
some missing related vars in the iptables role's documentation.

Change-Id: If4acd2d3d543933ed1e00156cc83fe3a270612bd
2021-12-09 18:46:38 +00:00
James E. Blair
f131ae98a8 Correct keycloak proxy config
Some extra steps are needed to use keycloak with a reverse proxy.
This adjusts the apache config to send the required headers and
the keycloak server config to use them.

Since the openid configuration json page is constructed entirely
from these headers (and not from static configuration), this is
a good test that the entire system is working.

Change-Id: I662dc85836d640cb732f12f39e9a61607767fcf3
2021-12-04 10:49:11 -08:00
Zuul
94bc7c1455 Merge "Add a keycloak server" 2021-12-04 16:50:26 +00:00
James E. Blair
e79dbbe6bb Add a keycloak server
This adds a keycloak server so we can start experimenting with it.

It's based on the docker-compose file Matthieu made for Zuul
(see https://review.opendev.org/819745 )

We should be able to configure a realm and federate with openstackid
and other providers as described in the opendev auth spec.  However,
I am unable to test federation with openstackid due its inability to
configure an oauth app at "localhost".  Therefore, we will need an
actual deployed system to test it.  This should allow us to do so.

It will also allow use to connect realms to the newly available
Zuul admin api on opendev.

It should be possible to configure the realm the way we want, then
export its configuration into a JSON file and then have our playbooks
or the docker-compose file import it.  That would allow us to drive
change to the configuration of the system through code review.  Because
of the above limitation with openstackid, I think we should regard the
current implementation as experimental.  Once we have a realm
configuration that we like (which we will create using the GUI), we
can chose to either continue to maintain the config with the GUI and
appropriate file backups, or switch to a gitops model based on an
export.

My understanding is that all the data (realms configuration and session)
are kept in an H2 database.  This is probably sufficient for now and even
production use with Zuul, but we should probably switch to mariadb before
any heavy (eg gerrit, etc) production use.

This is a partial implementation of https://docs.opendev.org/opendev/infra-specs/latest/specs/central-auth.html

We can re-deploy with a new domain when it exists.

Change-Id: I2e069b1b220dbd3e0a5754ac094c2b296c141753
Co-Authored-By: Matthieu Huin <mhuin@redhat.com>
2021-12-03 14:17:23 -08:00
Jeremy Stanley
0613cfda31 Cache Ansible Galaxy on CI mirror servers
Ansible Galaxy indexes tarballs of Ansible roles and collections at
a central site, which in turn points to a dedicated Amazon S3
subdomain. The tools which consume it support overriding the default
Galaxy URL with any arbitrary one, so should be able to take
advantage of this in CI jobs.

Change-Id: Ib5664e5588f7237a19a2cdb6eec3109452e8a107
2021-11-22 18:49:58 +00:00
Ian Wienand
855efc9010 Enable mirroring of 9-stream
This is a re-implementation of
I195ebee548071b0b89bd5bf64b251595271178ca that puts 9-stream in a
separate AFS volume

(Note the automated volume name "mirror.centos-stream" comes just
short of the limit)

Change-Id: I483c2982a6931e7d6fc97ab82f7750b72d2ef265
2021-11-15 17:54:54 +11:00
Zuul
890d59cd5f Merge "Switch IPv4 rejects from host-prohibit to admin" 2021-11-09 20:36:01 +00:00
Zuul
e2fdcc73fd Merge "More yaml.safe_load() in testinfra/conftest.py" 2021-10-13 23:46:14 +00:00
Jeremy Stanley
d76fb17fba More yaml.safe_load() in testinfra/conftest.py
Previous change If91f79a4648920999de8e6bf6e0c9fec82fde233 replaced
one of the instances of yaml.load() in this file with safe_load() in
order to silence what were then warnings. Now they're errors with
current PyYAML, so go ahead and update the other one.

Change-Id: If9f839f60cd71be8be141423ef2b93884d8aeba7
2021-10-13 21:58:41 +00:00
Clark Boylan
63f5674e6f Switch test gerrit hostname to review99.opendev.org
Previously we had set up the test gerrit instance to use the same
hostname as production: review02.opendev.org. This causes some confusion
as we have to override settings specifically for testing like a reduced
heap size, but then also copy settings from the prod host vars as we
override the host vars entirely. Using a new hostname allows us to use a
different set of host vars with unique values reducing confusion.

Change-Id: I4b95bbe1bde29228164a66f2d3b648062423e294
2021-10-12 09:48:53 -07:00
Zuul
5f96f2abe3 Merge "Update ICLA to reference OpenInfra" 2021-10-08 01:14:34 +00:00
Wes Wilson
bdb6e7b8f8 Update ICLA to reference OpenInfra
Change-Id: Ifc9feaefcd64bb2e6ca060b5bd3aac5ed6345f9c
2021-10-07 13:17:12 -07:00
Ian Wienand
67c08d52ad ptgbot: rename site to ptg.opendev.org
To remain consistent with "ptg.openstack.org", we are dropping the
"bot"

Depends-On: https://review.opendev.org/c/opendev/zone-opendev.org/+/812757
Change-Id: I5f06ee08241a286178fcb1be5c19fee6b6086d6f
2021-10-07 09:43:39 +11:00
Ian Wienand
86b7f75b25 ptgbot: setup web interface
The dependent change exports the ptgbot website on port 8000 in the
container.  Proxy this through apache.

Depends-On: https://review.opendev.org/c/openstack/ptgbot/+/812417
Change-Id: Idf9e9f5ffad981427d24a3476c0c1f244721d917
2021-10-06 15:39:25 +11:00
Clark Boylan
7df09ecef5 Properly copy gerrit static files
Dockerfile's COPY directive only copies the contents of a directory when
src is a directory. It does not copy the directory itself. This meant
the copy we were using to copy static files put them in /var/gerrit and
not /var/gerrit/static where we need them to be.

Update the Dockerfile to copy to /var/gerrit/static/ to fix this and add
some resource fetching tests to ensure they are served correctly.

Change-Id: I3bb4c06f3d7a57dcfccbbdb27cb8405586949949
2021-09-27 15:04:15 -07:00
Jeremy Stanley
1a227489e2 Use Apache to serve a local OpenDev logo on paste
In order to avoid unnecessary browser requests to other sites,
install a copy of the OpenDev logo on the Lodgeit server and serve
it from there rather than pointing at one served from Gitea.

Change-Id: I4c3678a1de8ca4a41cd0c64aab71b2e0e25373af
2021-09-21 20:28:29 +00:00
Jeremy Stanley
7308220484 Switch IPv4 rejects from host-prohibit to admin
When generically rejecting connections, we'd prefer to signal to
users clearly that it's the firewall rejecting them. For IPv4 we
previously emitted generic ICMP "no route to host" responses, but
this tends to make it look incorrectly like a routing failure.
Switch to flagging our error responses as "administratively
prohibited" which is more accurate and less confusing. We're also
already using icmp6-adm-prohibited for the v6 rules, so this makes
our v4 ruleset more consistent.

Note that the iptables-extensions(8) manpage indicates "Using
icmp-admin-prohibited with kernels that do not support it will
result in a plain DROP instead of REJECT" but all our kernels should
have support for it these days so this isn't a concern.

Change-Id: Id423f3ec03d0c3c4e40ddef34c38f97167b173f6
2021-09-21 18:19:06 +00:00
Clark Boylan
6c115cf29e Add support for Ubuntu Focal to our mailman ansible
This switch testing of lists.openstack.org to Focal and we make a CGI
env var update to accomodate newer mailman.

Specifically newer mailman's CGI scripts filter env vars that it will
pass through. We were setting MAILMAN_SITE_DIR to vhost our mailman
installs with apache2, but that doesn't pass the filter and is removed.
HOST is passed through so we update our scripts, apache vhost configs,
exim, and init scripts to use the HOST env var instead.

Change-Id: I5c8c70c219669e37b7b75a61001a2b7f7bb0bb6c
2021-09-13 09:10:00 -07:00
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
Jeremy Stanley
e2649a1aba Stop redirecting for the paste site
The pastebinit command-line tool hard-codes an allowed list of
pastebin URLs, one of which is "http://paste.openstack.org" so
redirecting to HTTPS and to other hostnames seems to break it.

It has a specific user-agent, so allow plain HTTP access for this
tool, but redirect others.

Change-Id: Ia7c983986e6e9c08299ded5282a83761448b35bb
2021-08-19 15:21:03 +10:00
James E. Blair
8d76a7cd99 Test port 9001 on eavesdrop
We merged change I9459e47ecfd19b27b7adcaee9ce91f80d51c124d which
should have opened this port but did not.  Add testing for it.

Remove eavesdrop from webservers group

This was overridding the custom iptables ports that were being set
in the eavesdrop group vars file.  There appears to be no other use
for the webservers group.

Change-Id: I7109f1472176ff39482f9bdfc8462e5f525f791c
2021-08-11 14:20:41 -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
James E. Blair
efd6ed5be8 Add DNSSEC configuration for gating.dev
Change-Id: I4d62968456ac72d4f84a63104932cc28d27feccb
2021-07-22 09:36:17 -07:00
Zuul
f1b559bb7a Merge "review02: move out of staging group" 2021-07-19 04:49:37 +00:00
Ian Wienand
8607ff7d81 review02: move out of staging group
This moves review02 out of the review-staging group and into the main
review group.  At this point, review01.openstack.org is inactive so we
can remove all references to openstack.org from the groups.  We update
the system-config job to run against a focal production server, and
remove the unneeded rsync setup used to move data.

This additionally enables replication; this should be a no-op when
applied as part of the transition process is to manually apply this,
so that DNS setup can pull zone changes from opendev.org.

It also switches to the mysql connector, as noted inline we found some
issues with mariadb.

Note backups follow in a separate step to avoid doing too much at
once, hence dropping the backup group from the testing list.

Change-Id: I7ee3e3051ea8f3237fd5f6bf1dcc3e5996c16d10
2021-07-18 19:45:35 -07:00
Zuul
dea42eb61f Merge "Enable openEuler mirroring" 2021-07-16 04:26:02 +00:00
Xinliang Liu
e54cc45bb8 Enable openEuler mirroring
Mirror latest LTS release openEuler-20.03-LTS-SP2.

Change-Id: I134b0c8b119d4662fc56f139a7ff4b0c7d6a4980
2021-07-15 07:12:22 +00:00
Ian Wienand
e3ab346f89 lodgeit: add robots.txt
Add robots.txt same as the old server.  While we're here and before
the db is setup, put everything under /var/lib/lodgeit/ for general
consistency.

Change-Id: Ib40cba5bb9e1f9f98769c00e2e9fe09e8fb2582f
2021-07-13 17:11:15 +10:00
Ian Wienand
916c1d3dc8 Add paste service
The paste service needs an upgrade; since others have created a
lodgeit container it seems worth us keeping the service going if only
to maintain the historical corpus of pastes.

This adds the ansible to deploy lodgeit and a sibling mariadb
container.  I have imported a dump of the old data as a test.  The
dump is ~4gb and imported it takes up about double that; certainly
nothing we need to be too concerned over.  The server will be more
than capable of running the db container alongside the lodgeit
instance.

This should have no effect on production until we decide to switch
DNS.

Change-Id: I284864217aa49d664ddc3ebdc800383b2d7e00e3
2021-07-07 15:12:04 +10:00
Zuul
b9d885ff2d Merge "Run statusbot from eavesdrop01.opendev.org" 2021-06-11 07:45:55 +00:00
Ian Wienand
23fac31c92 Run statusbot from eavesdrop01.opendev.org
This installs statusbot on eavesdrop01.opendev.org.

Otherwise it's just config translation and bringing up the daemon.

Change-Id: I246b2723372594e65bcd1ba90215d6831d4c0c72
2021-06-11 07:52:51 +10:00
Zuul
1077849a52 Merge "Move gerritbot/accessbot to new eavesdrop server" 2021-06-08 04:23:45 +00:00
Ian Wienand
fec8018581 Move gerritbot/accessbot to new eavesdrop server
This moves these services to eavesdrop01.opendev.org, a new
Focal-based server to host IRC services.

We have stopped running puppet on eavesdrop01.openstack.org so there
is nothing left for it to do (note the server is still running
meetbot/ptgbot).  Remove the commented out puppet run, and remove the
server from puppet groups.  Update the host in the Zuul jobs to the
new node.

Change-Id: I809f9af3e78f566362142790f6c79654ef5b8959
2021-06-08 08:16:56 +10:00