Commit graph

292 commits

Author SHA1 Message Date
Yorhel
ccecb28835 Drop grog(1) in favor of 'groff -mandoc' + two regexes
This provides an almost 2x speedup in man page rendering time and
removes some heuristics to work around bad guesses by grog(1).

Funnily enough, this also fixes rendering of obscure man pages that
happen to use 'grap' macros; grog detected those correctly but my groff
installation doesn't actually support rendering that.

No doubt I broke rendering of other pages, will have to see.
2024-04-28 15:08:00 +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
bc26633fc7 UI: Replace "locations" tab with separate page
Removing the JS requirement and (hopefully) providing a more useful
view into the same data.

This view now also lists other man pages that happen to have the same
contents.
2024-04-27 12:56:10 +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
30a8353089 www: Fix link to schema.sql 2024-04-14 12:54:07 +02:00
Yorhel
bb28e17bbd www: Keep links to other man pages within the same system
The sidebar links should actually stay within the same system as well,
it's quite confusing this way. Meh.
2024-04-14 12:35:54 +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
f92639d22c Cleanup SQL files 2024-04-14 11:35:39 +02:00
Yorhel
c9eef9e10a Index NetBSD 2024-04-14 11:35:04 +02:00
Yorhel
4356620d1f Fix URL to NetBSD man pages 2024-02-02 19:55:22 +01: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
f5b35efdc3 www: Prefer <name>.<section> pages over <name> 2023-05-26 12:22:47 +02:00
Yorhel
7302a6408a indexer: Skip some more non-manpage files 2023-05-26 12:16:22 +02:00
Yorhel
962ded97f5 Fix a shorthash encoding confusion 2023-04-30 09:01:38 +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
ea1531fcc3 Fix recognizing the default (empty) locale as English
This fixes selecting the right man page for 'mount', which would
otherwise grab a version from an old distro that happened to have it
with an explicit 'en' locale.
2022-07-26 15:06:06 +02:00
Yorhel
33efd07715 Fix the "prefer lower sections" man page selection rule 2022-07-26 14:58:29 +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
997dd8728c www: Add some new flexible URL formats
New canonical permalink format is now:

  /man.<hash>/<system>/<name>.<section>

Including the system name makes for more predictable navigation between
man pages of the same system.

This new URL format also fixes a problem with not being able to browse
from a package's page to the correct page when the package has multiple
versions of the same man.

This is also yak shaving for some new navigation and formatting features
I have planned.
2021-12-19 17:38:14 +01:00
Yorhel
46b4a5f7e0 Change contact email
contact@manned.org works fine, too, except I don't have outgoing mail
setup to go through an smtp proxy so I can't reply to Outlook and gmail
(and a few others). Seriously, fuck providers who can't see the
difference between spam messages and human replies to legitimate mails.
2021-12-17 10:17:09 +01:00
Yorhel
b39d038811 html: Apply appropriate "lang" attributes
Primarily so that browsers can choose the correct font for CJK pages.
2021-12-16 16:26:00 +01:00
Yorhel
f57c474932 Fixup: remove experimental shorthash URL format 2021-12-16 13:51:10 +01:00
Yorhel
d19c56f285 Correctly handle a few more mis-identified locales 2021-12-16 13:44:39 +01:00
Yorhel
c6f53fb0fb Add system selector to man pages + other stuff
The /man/* URLs now directly open man pages rather than redirecting to
the permalink format, so that the extra source information can be used
to provide a better UI for switching between systems and packages
(currently only between systems).

Step one in getting rid of the JS location/version selection thingies.
Still quite a bit more to do, but I haven't worked it all out yet.
2021-12-16 13:12:14 +01:00
Yorhel
5194ed95cf A few more about page tweaks 2021-12-15 09:52:07 +01:00
Yorhel
2d1dca24e5 Update about page with new license 2021-12-14 15:56:33 +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
6f7f59c6df Fix homepage reflow while images are loading
Apparently setting the image sizes in CSS wasn't enough, it was still
reflowing in Firefox.
2021-12-14 11:40:14 +01:00
Yorhel
7648603685 Recognize .zst-compressed man pages + fix SQL basename_from_filename() to recognize .xz
Also greatly simplified basename_from_filename() because apparently I
couldn't write regexes back then.

(And the removed REFERENCES line is to sync schema.sql with the actual
state of the DB, which doesn't have that constraint for some reason.
I'll prolly fix that later)
2021-12-13 18:16:16 +01:00
Yorhel
d8b60a251a Switch to AGPL license
Not that I have anything against the MIT license nowadays, nor do I mind
of companies use my software without paying and all that stuff, but this
switch is because I *do* like the AGPL license more for networked
software like this, especially when getting-everyone-and-their-pet to
run the code is not really a goal.

Of course, previous commits are still available under MIT.
2021-12-13 17:56:29 +01:00
Yorhel
b27d55215a Arch: Mark deleted packages as dead and hide them from listings
We've got a lot of packages in the DB that have long been removed from
the Arch repos. These are still indexed, but won't clutter the package
listing anymore.

Also fixed an issue with packages.id numbers getting rather large
because the indexer allocates a new ID for every package on every
update.
2021-12-13 08:18:17 +01:00
Yorhel
f3323de5e4 churn: Remove systems.relorder column + misc cleanup 2021-12-13 06:56:22 +01:00
Yorhel
3db1283a16 Change to more minimalistic website design + few HTML modernizations
I didn't touch the actual man page pages yet, but they seem to have
mostly survived my CSS changes. There's a LOT of general UI improvements
to be done, while this commit is really just a different style of paint.
2021-12-12 17:29:26 +01:00
Yorhel
b531f71ab0 Index available Alpine Linux repositories 2021-12-11 18:08:46 +01:00
Yorhel
82a626b7d4 indexer+www: Support Alpine Linux repos 2021-12-11 16:18:07 +01:00
Yorhel
c9e81a8922 indexer: More crate updates + warning fixes + 2018 edition 2021-12-11 14:56:22 +01:00
Yorhel
c48feedc85 indexer: Switch to ureq + debloat stuff a bit
And stop using the "url" crate directly, its API is too unstable for it
to be worth using.

...that applies to several other crates as well, but meh.
2021-12-11 12:26:57 +01:00
Yorhel
4588e67b64 Make the Rust garbage compile again 2021-12-11 11:53:26 +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
29a6f784f5 wwww: Fix escape_like() to also escape backslash 2021-10-12 13:53:01 +02:00
Yorhel
e69850d100 CentOS 8.4 2021-09-15 10:39:49 +02:00