Commit Graph

491 Commits

Author SHA1 Message Date
Kevin Fenzi
1b938e0c7a Revert "koji: re-block some koji endpoints due to scrapers"
This reverts commit ffbcb36d91.

We no longer need this after the blocking of that abusive ASN.
2026-01-25 10:46:37 -08:00
Kevin Fenzi
ffbcb36d91 koji: re-block some koji endpoints due to scrapers
They are hitting these endpoints really hard.
Might be able to lift it later...

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2026-01-25 10:24:17 -08:00
Adam Williamson
2a8f208ce6 Fix qa redirect (remove trailing slash)
The qa.fp.o redirect is to a wiki page, it should not have a
trailing slash.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2026-01-22 14:16:53 -08:00
Adam Williamson
d76afa032b Move the qa-landingpage reverse proxy config removal
...we already have a better place to do this, it turns out.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2026-01-21 15:44:01 -08:00
Adam Williamson
521897ede9 sigh, tags
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2026-01-21 15:05:23 -08:00
Adam Williamson
b67fe0f32f Remove qa-landingpage proxypassreverse config
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2026-01-21 14:58:44 -08:00
Kevin Fenzi
e5f736c308 riscv-kojipkgs: add a custom reversepassproxy config
This will help not expose things we should not.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2026-01-15 12:36:40 -08:00
Michal Konecny
66ea3d1769 [httpd] Re-enable history endpoint on src.fp.o
See https://pagure.io/fedora-infrastructure/issue/13011 for more info.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2026-01-07 09:01:48 +00:00
Adam Williamson
fc36e437c0 reverseproxy: whoops, drop stray duplicate endif
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2026-01-06 10:17:49 -08:00
Adam Williamson
0547a22e86 Forgejo attachment redirects: set up for prod
This tweaks the Forgejo redirect-to-pagure-for-attachments stuff
to work for prod as well as staging, since we proved it out in
staging and we do want it to actually work for prod migrations.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2026-01-06 08:59:39 -08:00
Adam Williamson
16ddce81e8 Forgejo attachment proxy: special-case testdays-web
This is a bit ugly, but can't think of a better way right now.
Since @kparal is using this migration of testdays-web from prod
pagure to staging forgejo as a test case for prod migrations in
general, let's make sure it works properly by proxying attachment
requests to prod pague instead of staging.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2025-12-18 17:46:36 -08:00
Adam Williamson
08f04c6d36 Whoops, fix a missing stg. in forgejo attachment proxying
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2025-12-18 17:44:54 -08:00
Adam Williamson
cacc7710ad proxies/forge: fix attachment proxying for images
This turned out to be a bit complicated, see
https://codeberg.org/forgejo/forgejo/issues/6360#issuecomment-9010932 . Pagure
images in comments use root-relative Markdown links, like this:

![image.png](/group/repo/issue/raw/files/image.png)

but Forgejo renders those relative to *the repo*, not the server root, so
they get rendered as something like:

<img src="/forgejoorg/forgejorepo/group/repo/issue/raw/files/image.png">

However, it does *not* do this for *non-image* root-relative links, so those
aren't 'broken'. This means we need to handle *both* cases in the proxying,
and we also need to keep in mind that Pagure allows repos without a group.
So we can wind up with one, two, three or four folders before /issue.

I did some testing and I *think* this should cover all cases. I've tested
this does fix images, I haven't tested on a non-image attachment yet (need
to find one).

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2025-12-18 17:39:26 +00:00
Adam Williamson
219ffbf416 proxies/forge: fix SSL failures with attachment reverse proxy
The attachment reverse proxy was failing for several reasons, one
of which is that SSL options weren't set up correctly so the SSL
connection to pagure.io failed. This adds a Proxy section for
stg.pagure.io with the appropriate settings to make it work.

There are still several other issues, but this at least fixes the
SSL problem.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2025-12-18 17:39:26 +00:00
Akashdeep Dhar
1a58c8ff14 Restrict the changes to the staging environment temporarily
Signed-off-by: Akashdeep Dhar <akashdeep.dhar@gmail.com>
2025-12-08 22:00:38 +00:00
Akashdeep Dhar
ed1103649c proxies/forge: proxy attachment requests from Forge to Pagure
redirect attachment file requests from Fedora Forge to Pagure for migrated
projects, allowing attachments to remain on this existing instance without
needing to be migrated.

Signed-off-by: Akashdeep Dhar <akashdeep.dhar@gmail.com>
2025-12-08 22:00:38 +00:00
Kevin Fenzi
ea1a9a5b6b proxies: block /history/ and /blame/ on the web interface of src.
Scrapers are crawling these endpoints and pkgs01 takes a while to call
git on the backend and return data to them. This causes latency to
increase a bunch because it's got all those blame and history requests
it's processing so it can't process more important things.

So, lets just block these for now. Any users who need them can easily
git clone locally and run history/blame just fine.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-12-06 10:10:35 -08:00
Kevin Fenzi
2f76d23a6b proxies: block another fork for now
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-11-23 17:39:50 -08:00
Kevin Fenzi
e8c5b9309f proxies / src: add another fork block
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-11-22 16:40:32 -08:00
Kevin Fenzi
4150f58a00 proxies / src: organize and document fork blocks
I am not sure these are even ai scrapers. If they are, they are broken
and unfit for scraping. They just hit these forks (and nothing else)
over and over via a Distributed pile of ips. They pass anubis
challenges, so probibly residential users who they don't care about.

Anyhow, on high load on pkgs01, see if more blocks need to be added
here.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-11-22 09:26:14 -08:00
Kevin Fenzi
d5e1fa08f2 proxies: drop some requests that use referrer of some forks
there's about... 7million hits a day from sites passing a referrer
of forks/kernel or forks/firefox where they are fetching static content
over and over and over. This may be because before they were blocked
from the forks themselves they were also downloading the js and static
content, and now they are just too dumb to see the 403 and still
want to fetch the old static content. Fortunately, they send a
referrer we can match on.

So, this should cut load another chunk.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-10-15 13:53:28 -07:00
Kevin Fenzi
58c8447d1a proxies / src: block all kernel forks for now
Some scraper(s) were very very agressively crawling kernel fork repos
and causing all kinds of problems for koji and src.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-10-15 07:58:11 -07:00
Kevin Fenzi
3565e5634c httpd / websites: do not enable anubis in internal proxies
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-10-13 10:37:01 -07:00
Kevin Fenzi
775d046d8f proxies / download: switch to new 2025 wildcard fedoraproject.org cert
Switch from the 2024 one that expires in a bit to a new shiny one that
doesn't expire until next year.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-09-25 14:50:49 -07:00
Kevin Fenzi
708d4e64fc httpd / website: adjust apache headers so logging works
We need to tell apache to use the X-Real-Ip we set at the first proxy
level for remoteipheader. This will get it to log the correct remote ip
in logs.

We can also then re-enable the fix for lists/duplicate headers with no
problems.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-09-18 17:37:55 -07:00
Kevin Fenzi
1051fb0bb6 https / website: enable ProxyAddHeaders for anubis proxying for now
All the sites except list are fine with multiple hosts in the
x-forwarder-for. Lists breaks. This gets list working, but then
all the log entries are localhost instead of the real ip.

So, lets disable this for now and revisit a solution for lists
before enabling it.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-09-18 17:05:56 -07:00
James Antill
1666b9614d Wiki: Update robots.txt to do what mediawiki says.
Signed-off-by: James Antill <james@and.org>
2025-09-17 18:08:26 +00:00
Kevin Fenzi
f5484874b5 httpd / website: Don't add proxy headers to requests post anubis
Do not add proxy headers here as they were already added when we
first got the request and sent it to anubis. This fixes some applications
(like mailman/django) that don't deal well with duplicate x-forwarded-for
entries and keeps the non anubis behavior.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-09-15 11:43:24 -07:00
Kevin Fenzi
734b560f2c websites: anubis config: proxies via ipv4
Use 127.0.0.1 here, not ipv6.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-09-10 13:38:46 -07:00
Kevin Fenzi
65f69ce847 httpd / websites: drop blank link that would change prod
We are in freeze and don't want to change production, so
drop this blank line that was added outside a staging
conditional.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-09-08 13:27:43 -07:00
Kevin Fenzi
3c34a93af0 anubis: test on koji.stg
This just reuses the existing copr anubis role and adds it into our
proxy setup (in staging only).

A new variable 'anubis' is set globally to false, but can be enabled on
a per site / app basis in the httpd/website role call.
I have set it for koji.stg.

The proxy playbook now should install anubis on staging proxies and then
only use it for the one site thats enabled in configuration.

Before moving to prod:
- testing in staging
- testing with some more staging apps
- perhaps moving the copr anubis role to a base role?
- adding some more bot policy

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-09-08 11:18:05 -07:00
Kevin Fenzi
9a22870dd7 candidate-registry: set network to 10.16 instead of the old iad2 10.3
This apache config is needed in order to allow auth to upload to the
candidate registry. Without it, skopeo just gives a perm denied.
Anytime the datacenter networks change this will also need updated.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-07-29 15:28:51 -07:00
Kevin Fenzi
f32e35dc41 koji: restore some web endpoints now, uncomment if load becomes too bad
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-07-11 11:16:09 -07:00
Nils Philippsen
6c85fda0c9 Mass remove/replace iad2 -> rdu3, 10.3. -> 10.16.
Signed-off-by: Nils Philippsen <nils@redhat.com>
2025-07-03 20:05:02 +02:00
Kevin Fenzi
ac0abd5853 proxies: switch openqa stg to use rdu3 and add a tag for easily setting it up
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-06-30 17:40:44 -07:00
Kevin Fenzi
fc396674c9 proxies: ipa web ui, missed a iad2
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-06-30 10:15:19 -07:00
Kevin Fenzi
4edce82deb proxies: send ipa web ui to rdu3
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-06-30 10:11:28 -07:00
Kevin Fenzi
7b0eeff7e6 proxies / kojipkgs / nagios: enable in rdu3
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-06-26 15:39:59 -07:00
Kevin Fenzi
126e66c736 proxies: also enable proxy for src.stg/src in rdu3
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-06-26 14:36:15 -07:00
Kevin Fenzi
e670096cd4 proxies / reverspassproxy: setup rdu3 non openshift to work (for riscv koji)
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-06-26 13:30:35 -07:00
Kevin Fenzi
8c64f2ee8a koschei: also drop bots on koschei
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-06-18 13:53:35 -07:00
Kevin Fenzi
4ccfef4a5b bodhi: move bot section to the right place
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-06-18 13:24:43 -07:00
Kevin Fenzi
6880ca537b proxies: bodhi: try and block all the bots going to bodhi
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-06-18 12:45:14 -07:00
Kevin Fenzi
a6c096617b proxies: openshift rdu3
So, we renamed the cluster with the ocp-rdu3 name, so drop all this
special handling. All the proxies should be able to reach it by that
name and via the vpn endpoints it has.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-06-16 11:10:08 -07:00
Kevin Fenzi
880e83dd43 proxies / rdu3: fix ca filename
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-06-14 14:51:21 -07:00
Kevin Fenzi
e7e6db8d8d proxies: rename ocp4-rdu3 to ocp4_rdu3 to hopefully get jinja2 to leave it alone
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-06-14 14:30:00 -07:00
Kevin Fenzi
e1132667d3 proxies: add a ocp-rdu3 site/endpoint to get to the new rdu3 prod openshift
We can't use easily the existing hostname/site, as that goes to the
current iad2 cluster, so setup a -rdu3 version for now.
After we switch we can drop this and repoint the main one to the new
cluster.

Hopefully this all works and does the right thing.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-06-14 12:35:20 -07:00
Kevin Fenzi
b1c844e6d3 proxies / koji: block buildroot and rpminfo for now as scrapers are beating things up on them
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-06-02 07:42:37 -07:00
Kevin Fenzi
d42014c740 httpd: set a few conf files as optional for initial installs
Due to ordering, these config files don't get copied over before the
first time httpd gets restarted. Setting them as optional should allow
initial runs to work better.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-05-28 19:49:32 -07:00
Kevin Fenzi
91e9a5627d httpd / botblocking: fix syntax on bot rewrite
These have to be in "s in order to do a string comparison, since
they were not, they were never matching anything. ;(

Fix them all up, and also block a few more repos on pagure that are
getting heavily crawled.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-05-13 11:39:25 -07:00