Skip to content

Commit

Permalink
forgejo,forgejo-lts: remove PAM support
Browse files Browse the repository at this point in the history
https://forgejo.org/docs/latest/user/authentication/#pam-pluggable-authentication-module

PAM support has to be enabled at compile time and upstream considers it
opt-in.

Official upstream binaries have it disabled.

We enabled it by default because we simply inherited most of it from
Gitea when the split in nixpkgs happened.

Reasons why it had been enabled in nixpkgs for Gitea are unknown.

See 9406f24.

There is reason to believe not a single Forgejo instance running on
NixOS uses this feature because it literally segfaults due to our
sandboxing.
  • Loading branch information
emilylange committed Aug 17, 2024
1 parent d8c8d5c commit 07641a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2411.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@
`services.forgejo.secrets` is a small wrapper over systemd's `LoadCredential=`. It has the same structure (sections/keys) as
`services.forgejo.settings` but takes file paths that will be read before service startup instead of some plaintext value.

- `forgejo` and `forgejo-lts` no longer support the opt-in feature [PAM (Pluggable Authentication Module)](https://forgejo.org/docs/latest/user/authentication/#pam-pluggable-authentication-module).

- `services.ddclient.use` has been deprecated: `ddclient` now supports separate IPv4 and IPv6 configuration. Use `services.ddclient.usev4` and `services.ddclient.usev6` instead.

- `teleport` has been upgraded from major version 15 to major version 16.
Expand Down
8 changes: 1 addition & 7 deletions pkgs/by-name/fo/forgejo/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
, nix-update-script
, nixosTests
, openssh
, pam
, pamSupport ? true
, sqliteSupport ? true
, xorg
, runCommand
Expand Down Expand Up @@ -68,8 +66,6 @@ buildGoModule rec {
makeWrapper
];

buildInputs = lib.optional pamSupport pam;

nativeCheckInputs = [
git
openssh
Expand All @@ -83,8 +79,7 @@ buildGoModule rec {
substituteInPlace modules/setting/server.go --subst-var data
'';

tags = lib.optional pamSupport "pam"
++ lib.optionals sqliteSupport [ "sqlite" "sqlite_unlock_notify" ];
tags = lib.optionals sqliteSupport [ "sqlite" "sqlite_unlock_notify" ];

ldflags = [
"-s"
Expand Down Expand Up @@ -115,7 +110,6 @@ buildGoModule rec {
skippedTests = [
"Test_SSHParsePublicKey/dsa-1024/SSHKeygen" # dsa-1024 is deprecated in openssh and requires opting-in at compile time
"Test_calcFingerprint/dsa-1024/SSHKeygen" # dsa-1024 is deprecated in openssh and requires opting-in at compile time
"TestPamAuth" # we don't have PAM set up in the build sandbox
"TestPassword" # requires network: api.pwnedpasswords.com
"TestCaptcha" # requires network: hcaptcha.com
"TestDNSUpdate" # requires network: release.forgejo.org
Expand Down

0 comments on commit 07641a9

Please sign in to comment.