Commit graph

137 commits

Author SHA1 Message Date
Yorhel
9c16eba485 cache-html: Fractional sleep & run after cron 2025-05-26 07:58:20 +02:00
Yorhel
bed455039e cache-html.pl: Now with transaction batching support
Because I'm trying to seed the cache from another machine and this
significantly reduces the effects of network latency.
2025-05-25 15:27:33 +02:00
Yorhel
d3bebc8888 Add support for caching HTML-rendered pages
Downside is that this consumes significant disk space, requires
recreating the entire cache when changing something to the way that
pages are rendered and removes flexibility to add dynamic
render-influencing settings in the future.

Alas, crawlers are getting more aggressive and I don't like the idea of
adding more invasive anti-bot tech.
This might not be enough in the long term, we also have a few slow SQL
queries that I'm not yet sure how to optimize. But this ought to give us
more time, at least.
2025-05-25 14:41:15 +02:00
Yorhel
a14f7b9bac Add OpenBSD 7.7 2025-05-02 15:00:16 +02:00
Yorhel
2aa5bea7b4 Add Ubuntu 25.04 2025-04-18 09:58:20 +02:00
Yorhel
adfeffd1d1 FreeBSD 13.5 2025-03-11 19:49:15 +01:00
Yorhel
1f8bd0ef9a *BSD repo updates 2025-01-09 13:24:00 +01:00
Yorhel
147911b750 CentOS 10 & Ubuntu mirror switch 2025-01-04 10:32:58 +01:00
Yorhel
ea99fc71f9 Alpine 3.21 2024-12-06 08:24:55 +01:00
Yorhel
57de5699e8 Repo updates + some /about page wording 2024-10-30 09:58:09 +01:00
Yorhel
0c1b140638 FreeBSD 14.1 2024-06-07 07:19:12 +02:00
Yorhel
bb5f1adc1f Alpine 3.20 2024-05-22 15:27:15 +02:00
Yorhel
1ee5c9c2df SQL: Add packages.c_hasman cache to speed up package listings
Going from average ~100ms to ~10ms or so. The previous query had a
tendency to be much slower sometimes, let's see if this cache also takes
care of those outliers.

Migration script:

  ALTER TABLE packages ADD COLUMN c_hasman boolean NOT NULL DEFAULT FALSE;

  DROP INDEX packages_system_name_key;
  CREATE UNIQUE INDEX packages_system_name_key ON packages (system, name) INCLUDE (id, c_hasman, dead);

  UPDATE packages SET c_hasman = NOT c_hasman
   WHERE c_hasman <> EXISTS(SELECT 1 FROM package_versions pv WHERE pv.package = packages.id AND EXISTS(SELECT 1 FROM files f WHERE f.pkgver = pv.id));
2024-04-29 21:15:40 +02:00
Yorhel
83ab6c3671 Get rid of package categories
Whether or not the package name itself or the (category,name) tuple
uniquely identified a package within a system has been a source of
confusion for a long time. Back in
03d278e4ff I ended up playing playing it
"safe" by going for (category,name), but in practice this doesn't make a
whole lot of sense. While it's *possible* for the same package name to
refer to completely different packages in different "categories", in
reality distributions can't sanely support this anyway.

For distributions where the category referred to a repository, the only
cases where the same package name was used in different repos was when
the package has moved from one repo to another. Those should certainly
not be treated as different packages.

For distributions where the category really referred to a category,
there's the Debian approach where the category is purely a tag and
doesn't help identify the package in any way, and then there's FreeBSD
where the category technically ought to be part of the name.  There were
a few cases where FreeBSD used categories to separate out different
versions of the same package (e.g. ipv6 vs non-ipv6), but none were
relevant for man pages so I ended up merging those as well.

Getting rid of the categories simplifies and shortens URLs, unclutters
the UI a little bit and merges the packages in listings that should've
been merged all along.

Migration script:

  -- Merge packages that are in multiple categories.
  -- All versions are moved to the package with the lowest ID.
  -- If the same version already exists in a lower ID, the higher-ID version is deleted.
  BEGIN;
  WITH migrate(old, new, second) AS (
    SELECT q.id, MIN(p.id), MAX(p.id)
      FROM packages p
      JOIN packages q ON q.id > p.id AND p.system = q.system AND p.name = q.name
     GROUP BY q.id
  ), ded(n) AS (
    UPDATE packages SET dead = false
      FROM migrate m
      JOIN packages q ON q.id = m.old
     WHERE packages.id = m.new AND packages.dead AND NOT q.dead
    RETURNING 1
  ), mov(n) AS (
    UPDATE package_versions SET package = m.new
      FROM migrate m
     WHERE package_versions.package = m.old
       AND NOT EXISTS(
          SELECT 1
            FROM package_versions v
           WHERE v.package IN(m.new, m.second)
             AND v.version = package_versions.version)
    RETURNING 1
  ), del(n) AS (
    DELETE FROM packages WHERE id IN(SELECT old FROM migrate)
    RETURNING 1
  ) SELECT (SELECT count(*) FROM migrate) AS migrate,
           (SELECT count(*) FROM ded) AS ded,
           (SELECT count(*) FROM mov) AS mov,
           (SELECT count(*) FROM del) AS del;

  ALTER TABLE packages DROP CONSTRAINT packages_system_name_category_key;
  CREATE UNIQUE INDEX packages_system_name_key ON packages (system, name);
  ALTER TABLE packages DROP COLUMN category;
  COMMIT;
2024-04-28 10:37:04 +02:00
Yorhel
9d650b00ec Add Ubuntu 24.04 2024-04-25 17:46:45 +02:00
Yorhel
97b88a989f Add Fedora 40 2024-04-23 17:26:35 +02:00
Yorhel
d8f452e47e Add OpenBSD 2024-04-23 13:40:10 +02:00
Yorhel
a99b8aec89 Add FreeBSD 13.3 2024-04-14 12:22:11 +02:00
Yorhel
ab721c97b9 NetBSD: Remove 2.0.3; use HTTP
I forgot I had firewalled port 443 on prod system, heh.
Remaining NetBSD versions have now been indexed.
2024-04-14 12:14:21 +02:00
Yorhel
c9eef9e10a Index NetBSD 2024-04-14 11:35:04 +02:00
Yorhel
f33081df11 Fix indexing of Debian architecture-independent packages + Alpine 3.19 2024-01-03 10:25:48 +01:00
Yorhel
c2a1dd6416 Some fixes and repo updates 2023-11-26 10:33:30 +01:00
Yorhel
580fa89520 Also update Ubuntu 2023-05-27 21:17:04 +02:00
Yorhel
e77775246c Repo updates 2023-05-27 06:48:19 +02:00
Yorhel
81c9ec53ff Bunch of repo updates 2022-12-17 13:06:42 +01:00
Yorhel
47d86c06fd Add FreeBSD 12.3 & 13.1 2022-07-26 21:23:06 +02:00
Yorhel
775eabfb7e Some repo updates
Haven't done this in a while, was lagging behind quite a bit.
FreeBSD also has two new versions that need to be indexed, will add
those later.
2022-07-26 07:25:38 +02:00
Yorhel
fa8e084879 Bunch of fixes 2022-01-10 20:05:09 +01:00
Yorhel
f376f1f137 Large-ish SQL schema revamp/optimizations
Primarily aimed at reducing the size of the old 'man' (now: files)
table, using smaller integers to refer to man contents and text fields,
and storing a shorthash as an integer for quick lookups. This better
normalization also removes the need to keep a separate 'man_index' cache
for the search function.

The old schema wasn't necessarily bad, but I was in the mood for some
optimizations. And a little cleanup.

Prolly introduces a bunch of new bugs, I haven't tested this too well.
2021-12-14 15:08:54 +01:00
Yorhel
b531f71ab0 Index available Alpine Linux repositories 2021-12-11 18:08:46 +01:00
Yorhel
b8dca570a0 Add CentOS 8.5
It's still supported? I thought they dropped it early in favor of CentOS
Stream or something.
2021-12-11 11:49:36 +01:00
Yorhel
f6a8d5c134 Add Ubuntu 21.10 2021-10-17 09:56:28 +02:00
Yorhel
e69850d100 CentOS 8.4 2021-09-15 10:39:49 +02:00
Yorhel
67b703636b Some repo updates + Debian bookworm 2021-08-17 11:29:41 +02:00
Yorhel
d0896806c1 Add Debian testing + prefer that instead of Ubuntu 2021-06-10 09:33:32 +02:00
Yorhel
1572f6cedf Add Fedora 34 2021-04-29 07:06:27 +02:00
Yorhel
61965f23f6 Add Ubuntu 21.04 + stop syncing a few old distros 2021-04-23 11:48:59 +02:00
Yorhel
12f88c0b6f Add FreeBSD 12.2 & 13.0 2021-04-17 19:52:04 +02:00
Yorhel
7b791561aa Add CentOS 7.9 & 8.3
Just lazy maintenance. I need to figure out what to do with CentOS now
that they've switched to a different release model.
2021-04-17 11:13:25 +02:00
Yorhel
fb3f1f8af4 Add Fedora 33
Had to switch to a different mirror as the previous one hadn't synced
yet.
2020-10-28 07:42:22 +01:00
Yorhel
648dbe025f Add Ubuntu 20.10 2020-10-23 11:15:37 +02:00
Yorhel
2ee9a5b6b0 Add FreeBSD 11.4 2020-10-14 15:38:08 +02:00
Yorhel
81874c5d3f Add Fedora 32 2020-10-14 15:33:08 +02:00
Yorhel
777dd37e1b Add CentOS 8.2 2020-10-14 15:22:46 +02:00
Yorhel
faa1cd6e55 Add CentOS 7.7 2020-10-14 15:10:54 +02:00
Yorhel
cf52cd2825 Add Ubuntu 20.04 2020-04-23 15:44:36 +02:00
Yorhel
1260cdf766 Add FreeBSD 12.1 2020-03-15 14:13:19 +01:00
Yorhel
18f792b443 Add Fedora 31 2020-03-14 10:57:20 +01:00
Yorhel
1d8490dde9 Add CentOS 8.1 2020-03-14 10:34:21 +01:00
Yorhel
cf5c16241f Add CentOS 8.0 2019-10-22 21:10:44 +02:00