centrifugo: 5.4.9 -> 6.1.0 (#396824)

This commit is contained in:
Ivan Trubach
2025-04-09 00:03:46 +03:00
committed by GitHub
4 changed files with 33 additions and 16 deletions
+2
View File
@@ -112,6 +112,8 @@
- `pkgs.nextcloud28` has been removed since it's out of support upstream.
- `centrifugo` was updated to v6, which uses a new config format. See [upstream documentation](https://centrifugal.dev/docs/getting-started/migration_v6) for migration.
- `teleport` has been upgraded from major version 16 to major version 17.
Refer to [upstream upgrade instructions](https://goteleport.com/docs/upgrading/overview/)
and [release notes for v17](https://goteleport.com/docs/changelog/#1701-11152024).
@@ -65,6 +65,14 @@ in
};
config = lib.mkIf cfg.enable {
assertions = [
{
assertion =
(lib.versionAtLeast cfg.package.version "6") -> (!(cfg.settings ? name) && !(cfg.settings ? port));
message = "`services.centrifugo.settings` is v5 config, must be compatible with centrifugo v6 config format";
}
];
systemd.services.centrifugo = {
description = "Centrifugo messaging server";
wantedBy = [ "multi-user.target" ];
+13 -9
View File
@@ -10,7 +10,10 @@ in
{ lib, ... }:
{
name = "centrifugo";
meta.maintainers = [ lib.maintainers.tie ];
meta.maintainers = [
lib.maintainers.tie
lib.maintainers.valodim
];
nodes = lib.listToAttrs (
lib.imap0 (index: name: {
@@ -21,12 +24,15 @@ in
services.centrifugo = {
enable = true;
settings = {
inherit name;
port = centrifugoPort;
# See https://centrifugal.dev/docs/server/engines#redis-sharding
engine = "redis";
# Connect to local Redis shard via Unix socket.
redis_address =
node = {
inherit name;
};
http_server.port = centrifugoPort;
http_api.insecure = true;
usage_stats.disabled = true;
engine.type = "redis";
engine.redis.address =
let
toRedisAddresses = map (name: "${name}:${toString redisPort}");
in
@@ -35,8 +41,6 @@ in
"unix://${config.services.redis.servers.centrifugo.unixSocket}"
]
++ toRedisAddresses (lib.drop (index + 1) nodes);
usage_stats_disable = true;
api_insecure = true;
};
extraGroups = [
config.services.redis.servers.centrifugo.user
+10 -7
View File
@@ -16,23 +16,23 @@ let
in
buildGoModule rec {
pname = "centrifugo";
version = "5.4.9";
version = "6.1.0";
src = fetchFromGitHub {
owner = "centrifugal";
repo = "centrifugo";
rev = "v${version}";
hash = "sha256-FDtAkoN1bdqVUEP0obbXBfQfVRpZN5YXbU1KT1yXWuI=";
hash = "sha256-7hh9wcM9cMfQ2W2PlDitTdJD9ftZt/KO/B+wV/c588U=";
};
vendorHash = "sha256-WfYN7bhtOPDp2UeB/WqtN3dD3+WO9lIxnXe2iTqn000=";
vendorHash = "sha256-hl1BznajnaOXMrlSqksqPdJih29yRDYW9IsyV9mSN20=";
ldflags = [
"-s"
"-w"
"-X=github.com/centrifugal/centrifugo/v5/internal/build.Version=${version}"
"-X=github.com/centrifugal/centrifugo/v5/internal/build.UsageStatsEndpoint=${statsEndpoint}"
"-X=github.com/centrifugal/centrifugo/v5/internal/build.UsageStatsToken=${statsToken}"
"-X=github.com/centrifugal/centrifugo/v6/internal/build.Version=${version}"
"-X=github.com/centrifugal/centrifugo/v6/internal/build.UsageStatsEndpoint=${statsEndpoint}"
"-X=github.com/centrifugal/centrifugo/v6/internal/build.UsageStatsToken=${statsToken}"
];
excludedPackages = [
@@ -56,7 +56,10 @@ buildGoModule rec {
homepage = "https://centrifugal.dev";
changelog = "https://github.com/centrifugal/centrifugo/releases/tag/v${version}";
license = lib.licenses.asl20;
maintainers = [ lib.maintainers.tie ];
maintainers = [
lib.maintainers.tie
lib.maintainers.valodim
];
mainProgram = "centrifugo";
};
}