postfixadmin: remove, doesn't support php >8.1
In newer versions it does, but there's zero effort to package it by the maintainer and it's not the job of the PHP team to pick that up.
This commit is contained in:
@@ -127,7 +127,7 @@ In addition to numerous new and upgraded packages, this release has the followin
|
||||
|
||||
- [sx](https://github.com/earnestly/sx), a simple alternative to both xinit and startx for starting a Xorg server. Available as [services.xserver.displayManager.sx](#opt-services.xserver.displayManager.sx.enable)
|
||||
|
||||
- [postfixadmin](https://postfixadmin.sourceforge.io/), a web based virtual user administration interface for Postfix mail servers. Available as [postfixadmin](#opt-services.postfixadmin.enable).
|
||||
- [postfixadmin](https://postfixadmin.sourceforge.io/), a web based virtual user administration interface for Postfix mail servers.
|
||||
|
||||
- [prowlarr](https://wiki.servarr.com/prowlarr), an indexer manager/proxy built on the popular arr .net/reactjs base stack [services.prowlarr](#opt-services.prowlarr.enable).
|
||||
|
||||
|
||||
@@ -752,7 +752,6 @@
|
||||
./services/mail/pfix-srsd.nix
|
||||
./services/mail/postfix-tlspol.nix
|
||||
./services/mail/postfix.nix
|
||||
./services/mail/postfixadmin.nix
|
||||
./services/mail/postgrey.nix
|
||||
./services/mail/postsrsd.nix
|
||||
./services/mail/protonmail-bridge.nix
|
||||
|
||||
@@ -398,6 +398,10 @@ in
|
||||
services.invoiceplane has been removed since the service only supported PHP 8.1 which is EOL
|
||||
and removed from nixpkgs.
|
||||
'')
|
||||
(mkRemovedOptionModule [ "services" "postfixadmin" ] ''
|
||||
services.postfixadmin has been removed since it was unmaintained in nixpkgs and the version
|
||||
available only supported PHP 8.1 which is EOL.
|
||||
'')
|
||||
# Do NOT add any option renames here, see top of the file
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,215 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.services.postfixadmin;
|
||||
fpm = config.services.phpfpm.pools.postfixadmin;
|
||||
localDB = cfg.database.host == "localhost";
|
||||
pgsql = config.services.postgresql;
|
||||
user = if localDB then cfg.database.username else "nginx";
|
||||
in
|
||||
{
|
||||
options.services.postfixadmin = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to enable postfixadmin.
|
||||
|
||||
Also enables nginx virtual host management.
|
||||
Further nginx configuration can be done by adapting `services.nginx.virtualHosts.<name>`.
|
||||
See [](#opt-services.nginx.virtualHosts) for further information.
|
||||
'';
|
||||
};
|
||||
|
||||
hostName = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
example = "postfixadmin.example.com";
|
||||
description = "Hostname to use for the nginx vhost";
|
||||
};
|
||||
|
||||
adminEmail = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
example = "postmaster@example.com";
|
||||
description = ''
|
||||
Defines the Site Admin's email address.
|
||||
This will be used to send emails from to create mailboxes and
|
||||
from Send Email / Broadcast message pages.
|
||||
'';
|
||||
};
|
||||
|
||||
setupPasswordFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
description = ''
|
||||
Password file for the admin.
|
||||
Generate with `php -r "echo password_hash('some password here', PASSWORD_DEFAULT);"`
|
||||
'';
|
||||
};
|
||||
|
||||
database = {
|
||||
username = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "postfixadmin";
|
||||
description = ''
|
||||
Username for the postgresql connection.
|
||||
If `database.host` is set to `localhost`, a unix user and group of the same name will be created as well.
|
||||
'';
|
||||
};
|
||||
|
||||
host = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "localhost";
|
||||
description = ''
|
||||
Host of the postgresql server. If this is not set to
|
||||
`localhost`, you have to create the
|
||||
postgresql user and database yourself, with appropriate
|
||||
permissions.
|
||||
'';
|
||||
};
|
||||
|
||||
passwordFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
description = "Password file for the postgresql connection. Must be readable by user `nginx`.";
|
||||
};
|
||||
|
||||
dbname = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "postfixadmin";
|
||||
description = "Name of the postgresql database";
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = lib.mkOption {
|
||||
type = lib.types.lines;
|
||||
default = "";
|
||||
description = "Extra configuration for the postfixadmin instance, see postfixadmin's config.inc.php for available options.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.etc."postfixadmin/config.local.php".text = ''
|
||||
<?php
|
||||
|
||||
$CONF['setup_password'] = file_get_contents('${cfg.setupPasswordFile}');
|
||||
|
||||
$CONF['database_type'] = 'pgsql';
|
||||
$CONF['database_host'] = ${if localDB then "null" else "'${cfg.database.host}'"};
|
||||
${lib.optionalString localDB "$CONF['database_user'] = '${cfg.database.username}';"}
|
||||
$CONF['database_password'] = ${
|
||||
if localDB then "'dummy'" else "file_get_contents('${cfg.database.passwordFile}')"
|
||||
};
|
||||
$CONF['database_name'] = '${cfg.database.dbname}';
|
||||
$CONF['configured'] = true;
|
||||
|
||||
${cfg.extraConfig}
|
||||
'';
|
||||
|
||||
systemd.tmpfiles.settings."10-postfixadmin"."/var/cache/postfixadmin/templates_c".d = {
|
||||
inherit user;
|
||||
group = user;
|
||||
mode = "700";
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts = {
|
||||
${cfg.hostName} = {
|
||||
forceSSL = lib.mkDefault true;
|
||||
enableACME = lib.mkDefault true;
|
||||
locations."/" = {
|
||||
root = "${pkgs.postfixadmin}/public";
|
||||
index = "index.php";
|
||||
extraConfig = ''
|
||||
location ~* \.php$ {
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_pass unix:${fpm.socket};
|
||||
include ${config.services.nginx.package}/conf/fastcgi_params;
|
||||
include ${pkgs.nginx}/conf/fastcgi.conf;
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.postgresql = lib.mkIf localDB {
|
||||
enable = true;
|
||||
ensureUsers = [
|
||||
{
|
||||
name = cfg.database.username;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# The postgresql module doesn't currently support concepts like
|
||||
# objects owners and extensions; for now we tack on what's needed
|
||||
# here.
|
||||
systemd.services.postfixadmin-postgres = lib.mkIf localDB {
|
||||
after = [ "postgresql.target" ];
|
||||
bindsTo = [ "postgresql.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
path = [
|
||||
pgsql.package
|
||||
pkgs.util-linux
|
||||
];
|
||||
script = ''
|
||||
set -euo pipefail
|
||||
|
||||
PSQL() {
|
||||
psql --port=${toString pgsql.settings.port} "$@"
|
||||
}
|
||||
|
||||
PSQL -tAc "SELECT 1 FROM pg_database WHERE datname = '${cfg.database.dbname}'" | grep -q 1 || PSQL -tAc 'CREATE DATABASE "${cfg.database.dbname}" OWNER "${cfg.database.username}"'
|
||||
current_owner=$(PSQL -tAc "SELECT pg_catalog.pg_get_userbyid(datdba) FROM pg_catalog.pg_database WHERE datname = '${cfg.database.dbname}'")
|
||||
if [[ "$current_owner" != "${cfg.database.username}" ]]; then
|
||||
PSQL -tAc 'ALTER DATABASE "${cfg.database.dbname}" OWNER TO "${cfg.database.username}"'
|
||||
if [[ -e "${pgsql.dataDir}/.reassigning_${cfg.database.dbname}" ]]; then
|
||||
echo "Reassigning ownership of database ${cfg.database.dbname} to user ${cfg.database.username} failed on last boot. Failing..."
|
||||
exit 1
|
||||
fi
|
||||
touch "${pgsql.dataDir}/.reassigning_${cfg.database.dbname}"
|
||||
PSQL "${cfg.database.dbname}" -tAc "REASSIGN OWNED BY \"$current_owner\" TO \"${cfg.database.username}\""
|
||||
rm "${pgsql.dataDir}/.reassigning_${cfg.database.dbname}"
|
||||
fi
|
||||
'';
|
||||
|
||||
serviceConfig = {
|
||||
User = pgsql.superUser;
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
};
|
||||
};
|
||||
|
||||
users.users.${user} = lib.mkIf localDB {
|
||||
group = user;
|
||||
isSystemUser = true;
|
||||
createHome = false;
|
||||
};
|
||||
|
||||
users.groups.${user} = lib.mkIf localDB { };
|
||||
|
||||
services.phpfpm.pools.postfixadmin = {
|
||||
user = user;
|
||||
phpPackage = pkgs.php81;
|
||||
phpOptions = ''
|
||||
error_log = 'stderr'
|
||||
log_errors = on
|
||||
'';
|
||||
settings = lib.mapAttrs (_: lib.mkDefault) {
|
||||
"listen.owner" = "nginx";
|
||||
"listen.group" = "nginx";
|
||||
"listen.mode" = "0660";
|
||||
"pm" = "dynamic";
|
||||
"pm.max_children" = 75;
|
||||
"pm.start_servers" = 2;
|
||||
"pm.min_spare_servers" = 1;
|
||||
"pm.max_spare_servers" = 20;
|
||||
"pm.max_requests" = 500;
|
||||
"catch_workers_output" = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1216,7 +1216,6 @@ in
|
||||
handleTest ./postfix-raise-smtpd-tls-security-level.nix
|
||||
{ };
|
||||
postfix-tlspol = runTest ./postfix-tlspol.nix;
|
||||
postfixadmin = runTest ./postfixadmin.nix;
|
||||
postgres-websockets = runTest ./postgres-websockets.nix;
|
||||
postgresql = handleTest ./postgresql { };
|
||||
postgrest = runTest ./postgrest.nix;
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
name = "postfixadmin";
|
||||
meta = with pkgs.lib.maintainers; {
|
||||
maintainers = [ globin ];
|
||||
};
|
||||
|
||||
nodes = {
|
||||
postfixadmin =
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
services.postfixadmin = {
|
||||
enable = true;
|
||||
hostName = "postfixadmin";
|
||||
setupPasswordFile = pkgs.writeText "insecure-test-setup-pw-file" "$2y$10$r0p63YCjd9rb9nHrV9UtVuFgGTmPDLKu.0UIJoQTkWCZZze2iuB1m";
|
||||
};
|
||||
services.nginx.virtualHosts.postfixadmin = {
|
||||
forceSSL = false;
|
||||
enableACME = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
postfixadmin.start
|
||||
postfixadmin.wait_for_unit("postgresql.target")
|
||||
postfixadmin.wait_for_unit("phpfpm-postfixadmin.service")
|
||||
postfixadmin.wait_for_unit("nginx.service")
|
||||
postfixadmin.succeed(
|
||||
"curl -sSfL http://postfixadmin/setup.php -X POST -F 'setup_password=not production'"
|
||||
)
|
||||
postfixadmin.succeed("curl -sSfL http://postfixadmin/ | grep 'Mail admins login here'")
|
||||
'';
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
{
|
||||
fetchFromGitHub,
|
||||
stdenv,
|
||||
lib,
|
||||
nixosTests,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "postfixadmin";
|
||||
version = "3.3.16";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "postfixadmin";
|
||||
repo = "postfixadmin";
|
||||
tag = "postfixadmin-${version}";
|
||||
hash = "sha256-sSn5XHxnpP2Axv9BD9IvzSmu8MthcylEPk1kU51p/3k=";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir $out
|
||||
cp -r * $out/
|
||||
ln -sf /etc/postfixadmin/config.local.php $out/
|
||||
ln -sf /var/cache/postfixadmin/templates_c $out/
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.tests = { inherit (nixosTests) postfixadmin; };
|
||||
|
||||
meta = {
|
||||
changelog = "https://github.com/postfixadmin/postfixadmin/releases/tag/${src.tag}";
|
||||
description = "Web based virtual user administration interface for Postfix mail servers";
|
||||
homepage = "https://postfixadmin.sourceforge.io/";
|
||||
maintainers = with lib.maintainers; [ globin ];
|
||||
license = lib.licenses.gpl2Plus;
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
}
|
||||
@@ -2074,6 +2074,7 @@ mapAliases {
|
||||
poretools = throw "poretools has been removed from nixpkgs, as it was broken and unmaintained"; # Added 2024-06-03
|
||||
posix_man_pages = throw "'posix_man_pages' has been renamed to/replaced by 'man-pages-posix'"; # Converted to throw 2024-10-17
|
||||
powerdns = pdns; # Added 2022-03-28
|
||||
postfixadmin = throw "'postfixadmin' has been removed due to lack of maintenance and missing support for PHP >8.1"; # Added 2025-10-03
|
||||
presage = throw "presage has been removed, as it has been unmaintained since 2018"; # Added 2024-03-24
|
||||
preserves-nim = throw "'preserves-nim' has been removed due to a hostile upstream moving tags and breaking src FODs"; # Added 2025-09-01
|
||||
projectm = throw "Since version 4, 'projectm' has been split into 'libprojectm' (the library) and 'projectm-sdl-cpp' (the SDL2 frontend). ProjectM 3 has been moved to 'projectm_3'"; # Added 2024-11-10
|
||||
|
||||
Reference in New Issue
Block a user