Commit Graph

1162 Commits

Author SHA1 Message Date
Jordan Anderson 1ccf6b14cc Upgrade to OpenBSD 8.5 2024-04-11 13:17:44 +02:00
Haowen Liu cf39fb2a89 ubuntu/noble starts development 2024-04-11 13:10:59 +02:00
unwox 46e941eca9 images/guix: increase VM RAM to 3GB
Unfortunately 2GB is not enough anymore to build Guix.
2024-04-11 13:10:33 +02:00
Drew DeVault e4461297be images/*: bump disk size to 24G across the board 2024-04-09 10:37:26 +02:00
Drew DeVault ce191fdf47 Upgrade to Alpine 3.19 2024-03-20 14:37:34 +01:00
Simon Ser 813d720117 images/archlinux: drop pkill gpg-agent
This wasn't working properly: we weren't waiting for gpg-agent to
finish (just sending the signal). As a result, umount was still
failing.

The new PID namespace stuff supersedes this.
2024-03-16 16:53:27 +01:00
Simon Ser 9668eb0856 images/archlinux: run chroot in new PID namespace
gpg-agent remains after exit, and causes umount to fail.

Mirrors what was done in arch-chroot:
2be79c6259
2024-03-16 16:52:15 +01:00
Simon Ser 2b0d4e25cb images/archlinux: don't rm root in genimg cleanup
If we fail to umount, then this spams the logfile with numerous
errors, making it difficult to understand the cause of the issue.
This isn't a useful thing to do in the first place since this
directory is mounted.
2024-03-16 16:03:21 +01:00
Simon Ser 63ea8ae8c0 images/archlinux: fix mkinitcpio hook name
The hook got renamed, so it wasn't disabled anymore.
2024-03-16 16:03:14 +01:00
Simon Ser 568ec21c05 images/archlinux: allow mkinitcpio upgrades
This is a lightweight package, so shouldn't matter. Ignoring it
can lead to errors:

    error: missing dependency 'initramfs' for package 'linux'
    linux: ignoring package upgrade (6.7.6.arch1-1 => 6.7.8.arch1-1)
    mkinitcpio: ignoring package upgrade (37.3-1 => 38-4)
    Resolving dependencies...
    Checking package conflicts...
    :: uninstalling package 'mkinitcpio-37.3-1' due to conflict with 'cryptsetup-2.7.0-3'
2024-03-16 16:03:14 +01:00
Drew DeVault 0ee954e9ac .builds: drop debian, arch 2024-02-09 10:20:07 +01:00
Drew DeVault 892b2887fa images: drop 9front support
Just too much of a hassle to support this for the number of users we
have. Sorry.
2024-02-07 10:52:01 +01:00
Drew DeVault bb3c35344b worker: fix unknown secret regression
If the secret exists but is not owned by the user, GetSecret now returns
sql.ErrNoRows and the previous owner ID check is not useful. Unknown
secrets should not fail the build.
2024-02-07 10:47:34 +01:00
Drew DeVault 994883a04f images/*: update build worker deploy targets 2024-02-07 09:25:57 +01:00
Simon Ser 1020e00501 Drop unnecessary requires_payment() checks
The GraphQL server already checks for this.
2024-01-31 10:08:28 +01:00
Simon Ser 054233a7d2 Drop FreeBSD 12.x
FreeBSD 12.x is EOL, and doesn't build anymore:
https://builds.sr.ht/~sircmpwn/job/1126421
2024-01-24 09:45:18 +01:00
Conrad Hoffmann 224f51e8a9 Validate GraphQL response on build submission
The GraphQL API does a stricter validation of the manifest then the
Python code, specifically e.g. checking the `oauth:` directive. This can
lead to the API rejecting a manifest that passed the Python validation.
However, for this case, there is currently no error handling, causing
an exception. Such a case has been reported e.g. here: [1]

This commit adds such error handling by passing down the Validation
object all the way to the GraphQL call (which already accepts it). Only
caveat is that in this case, the `field` of the resulting error is not
set to "manifest" (or any other value). Hence, add an additional output
of the manifest summary to the template. This is added near the end of
the form, as we in fact do not know whether the error is from the
manifest, or something else.

[1] https://lists.sr.ht/~sircmpwn/sr.ht-discuss/%3Ce6709b1c-8181-4182-9926-595a38b7bc57%40app.fastmail.com%3E
2024-01-24 09:44:28 +01:00
Conrad Hoffmann 265224537a worker: add missing error handling 2024-01-21 20:49:18 +01:00
Conrad Hoffmann 29f79f49c3 worker: add some type safety to port handling
The "port" used for build jobs is an actual TCP port (used e.g. for SSH
access). It is already enforced to be in a specific port range when
initially selected. Enshrine this fact in the API by making it a uint16.
2024-01-21 20:23:58 +01:00
Luca Weiss dfa05f3399 images/alpine: install curl
The _apply_patch function for applying patches from lists.sr.ht requires
curl and since curl is not installed with the current set of packages
anymore, install it explicitly.
2024-01-21 11:28:03 +01:00
Simon Ser 85fc9c3ea0 Fix missing user in GraphQL user type request 2024-01-17 13:11:19 +01:00
Simon Ser 0046f91254 Use GraphQL API to fetch user type 2024-01-17 12:37:54 +01:00
Simon Ser c32e0052bf alpine: update symlinks 2023-12-22 10:59:42 +01:00
Willow Barraco 2a6317c4fa images/alpine: add 3.19
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-12-22 10:54:16 +01:00
Conrad Hoffmann b4e1b912ce Only allow resubmission of accessible jobs 2023-12-11 21:36:21 +01:00
Conrad Hoffmann c2bdab5b75 Un-break "View manifest" link in UI
This link was using the previously unauthenticated API endpoint for
manifests. However, that now requires authentication like any other
endpoint. Instead, provide a simple UI route which displays the
manifest.
2023-12-11 21:08:55 +01:00
Conrad Hoffmann 468badf423 api/job_by_id_manifest_GET: require oauth 2023-12-11 12:59:05 +01:00
Conrad Hoffmann 16a96a308c api/job_by_id_manifest_GET: fix logic grouping 2023-12-11 10:35:23 +01:00
Drew DeVault 431f7031bb api/job_by_id_manifest_GET: fix user/token 2023-12-09 19:23:30 +01:00
Drew DeVault 63cbb67271 builds.sr.ht: fix /api/.../manifest for logged out user 2023-12-09 10:37:10 +01:00
Conrad Hoffmann b48cc91c05 images/archlinux: add missing mkdir 2023-12-07 22:29:11 +01:00
Haowen Liu 1b21add920 ubuntu: upgrade packages during genimg 2023-12-07 22:07:43 +01:00
Conrad Hoffmann c87bcac7cd images/archlinux: avoid GnuPG's new keyboxd
GnuPG recently made "keyboxd", an alternative keyring storage, the
default for new installs [1]. For reasons I cannot explain yet, a gpg
command will hang indefinetly trying to talk to keyboxd, if all of the
following are true:

- keyboxd is already running for the user
- it is managed by the systemd-user session (!?)
- the gpg command is run inside fakeroot

This is easily reproducible on builds.sr.ht: when building and signing a
package with `makepkg`, it will just hang forever after outputting
"Entering fakeroot environment". One can see in the process tree that it
is executing a gpg command inside a fakeroot at that time, which never
finishes.

While I have not found the cause, this issue is not isolated to
builds.sr.ht. I have reproduced this on other Arch Linux systems.

I am trying to figure out what the exact issue is, and whom to talk to
about it, but until then I think just avoiding keyboxd makes sense.

Hence, this commit disables keyboxd system-wide by adding a
configuration put forth in [2]. I verified that this is indeed
sufficient to make GnuPG fall back to the old storage format, even for
new setups.

[1] https://github.com/gpg/gnupg/blob/master/README#L119
[2] https://marc.info/?l=gnupg-users&m=170193805722787&w=2
2023-12-07 11:57:55 +01:00
Conrad Hoffmann 4c4e6ad6de images/*: send failure emails to new list
For improved visibility, emails triggered by failures when building
build images will henceforth go to the new mailing list created for this
purpose: https://lists.sr.ht/~sircmpwn/sr.ht-image-failures
2023-12-04 15:50:58 +01:00
Simon Ser dccf0147ee images/archlinux: refresh pacman index before installing yay
Otherwise we get this:

    + chroot root sudo -u build -g build /bin/bash -c 'cd /home/build && cd yay && env GOCACHE=/tmp/cache makepkg -si --noconfirm --skippgpcheck'
    ==> Making package: yay 12.2.0-1 (Mon Dec  4 09:06:25 2023)
    ==> Checking runtime dependencies...
    warning: database file for 'multilib' does not exist (use '-Sy' to download)
    ==> Checking buildtime dependencies...
    warning: database file for 'multilib' does not exist (use '-Sy' to download)
    ==> Installing missing dependencies...
    warning: database file for 'multilib' does not exist (use '-Sy' to download)
    error: failed to prepare transaction (could not find database)
    ==> ERROR: 'pacman' failed to install missing dependencies.
    ==> Missing dependencies:
      -> go>=1.19
    ==> ERROR: Could not resolve all dependencies.
2023-12-04 12:37:01 +01:00
Simon Ser aab77d0f2f images/archlinux: use yay --provides=false instead of --noprovides
Fixes this warning:

    -> '--noprovides' is deprecated. Use '--provides=false' instead
2023-12-04 12:37:01 +01:00
Simon Ser 73f8323784 images/archlinux: upgrade archlinux-keyring before other packages
Currently the Arch image is broken because the keyring has been
updated but the package is too old:

    curl: signature from "Leonidas Spyropoulos <artafinde@archlinux.org>" is unknown trust
    :: deleting corrupted file '/var/cache/pacman/pkg/curl-8.4.0-2-x86_64.pkg.tar.zst' (invalid or corrupted package (PGP signature))
    syslinux: signature from "Leonidas Spyropoulos <artafinde@archlinux.org>" is unknown trust
    :: deleting corrupted file '/var/cache/pacman/pkg/syslinux-6.04.pre2.r11.gbf6db5b4-4-x86_64.pkg.tar.zst' (invalid or corrupted package (PGP signature))
2023-12-04 12:37:00 +01:00
Simon Ser 083dec43f2 contrib/crontab: add FreeBSD 14 2023-12-04 12:36:46 +01:00
Conrad Hoffmann 650e80c8e4 Revert "ubuntu/noble starts development"
This reverts commit 4130bfb968.

Does not build (on ubuntu/lts?):

https://builds.sr.ht/~bitfehler/job/1104224
2023-11-30 13:44:50 +01:00
Simon Ser 552be2f89e worker: drop go.mod
Let's just use the toplevel go.mod instead.

This upgrades core-go for the worker, so a small adjustment of
JobContext.oauth2Token is required.
2023-11-30 12:38:21 +01:00
Jordan Anderson aa6b9b1d23 Update OpenBSD symlinks 2023-11-30 12:38:11 +01:00
Jordan Anderson cc4a93e024 Add OpenBSD 7.4 2023-11-30 12:38:11 +01:00
Francesco Gazzetta a53aed3db2 images/nixos: add 23.11
* Do not point latest to 23.11 yet because it's still in beta
* Replace the 22.11 cronjob since that version is EoL
2023-11-30 12:38:11 +01:00
Simon Ser 3b397aa8c4 images/freebsd: add 14.0
FreeBSD 14.0 has been released today:
https://www.freebsd.org/releases/14.0R/announce/
2023-11-30 12:38:11 +01:00
Haowen Liu 4130bfb968 ubuntu/noble starts development 2023-11-30 12:38:11 +01:00
Conrad Hoffmann 4d5a076cd5 legacy api: check private job ownership everywhere 2023-11-30 12:38:11 +01:00
Simon Ser 6fe759ae2d Upgrade core-go 2023-11-30 11:53:09 +01:00
Simon Ser 8df0cd638f Upgrade core-go 2023-11-29 17:53:45 +01:00
Maxwell G 17b1e159d8 images: move fedora/latest alias to fedora/39
Fedora 39 was officially released on 7 November 2023.

Ref: https://fedoramagazine.org/announcing-fedora-linux-39/
2023-11-16 12:44:52 +01:00
Simon Ser 12bb3fd8a9 api/graph: validate OAuth grants when submitting build
An OAuth grants string can be supplied when submitting a build
manifest. Validate it to make sure it's well-formed.
2023-10-24 12:26:45 +02:00