git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #155039 from andir/prosody-security
commitb47203b28f5cf1efc4e3476ca8f333db3a2c3223 authorNinjatrappeur <NinjaTrappeur@users.noreply.github.com> dateSat 15 Jan 2022, 10:13 (5 years ago) parentdf74acf4369beb
3 files changed+4−97
nixos/tests/all-tests.nix−1 nixos/tests/xmpp/prosody-mysql.nix−92 pkgs/servers/xmpp/prosody/default.nix+4−4
nixos/tests/all-tests.nix−1
@@ -397,7 +397,6 @@ in
397397 prometheus = handleTest ./prometheus.nix {};
398398 prometheus-exporters = handleTest ./prometheus-exporters.nix {};
399399 prosody = handleTest ./xmpp/prosody.nix {};
400− prosodyMysql = handleTest ./xmpp/prosody-mysql.nix {};
401400 proxy = handleTest ./proxy.nix {};
402401 prowlarr = handleTest ./prowlarr.nix {};
403402 pt2-clone = handleTest ./pt2-clone.nix {};
nixos/tests/xmpp/prosody-mysql.nixdeleted−92
@@ -1,92 +0,0 @@
1−import ../make-test-python.nix {
2− name = "prosody-mysql";
3−
4− nodes = {
5− client = { nodes, pkgs, ... }: {
6− environment.systemPackages = [
7− (pkgs.callPackage ./xmpp-sendmessage.nix { connectTo = nodes.server.config.networking.primaryIPAddress; })
8− ];
9− networking.extraHosts = ''
10− ${nodes.server.config.networking.primaryIPAddress} example.com
11− ${nodes.server.config.networking.primaryIPAddress} conference.example.com
12− ${nodes.server.config.networking.primaryIPAddress} uploads.example.com
13− '';
14− };
15− server = { config, pkgs, ... }: {
16− nixpkgs.overlays = [
17− (self: super: {
18− prosody = super.prosody.override {
19− withDBI = true;
20− withExtraLibs = [ pkgs.luaPackages.luadbi-mysql ];
21− };
22− })
23− ];
24− networking.extraHosts = ''
25− ${config.networking.primaryIPAddress} example.com
26− ${config.networking.primaryIPAddress} conference.example.com
27− ${config.networking.primaryIPAddress} uploads.example.com
28− '';
29− networking.firewall.enable = false;
30− services.prosody = {
31− enable = true;
32− # TODO: use a self-signed certificate
33− c2sRequireEncryption = false;
34− extraConfig = ''
35− storage = "sql"
36− sql = {
37− driver = "MySQL";
38− database = "prosody";
39− host = "mysql";
40− port = 3306;
41− username = "prosody";
42− password = "password123";
43− };
44− '';
45− virtualHosts.test = {
46− domain = "example.com";
47− enabled = true;
48− };
49− muc = [
50− {
51− domain = "conference.example.com";
52− }
53− ];
54− uploadHttp = {
55− domain = "uploads.example.com";
56− };
57− };
58− };
59− mysql = { config, pkgs, ... }: {
60− networking.firewall.enable = false;
61− services.mysql = {
62− enable = true;
63− initialScript = pkgs.writeText "mysql_init.sql" ''
64− CREATE DATABASE prosody;
65− CREATE USER 'prosody'@'server' IDENTIFIED BY 'password123';
66− GRANT ALL PRIVILEGES ON prosody.* TO 'prosody'@'server';
67− FLUSH PRIVILEGES;
68− '';
69− package = pkgs.mariadb;
70− };
71− };
72− };
73−
74− testScript = { nodes, ... }: ''
75− mysql.wait_for_unit("mysql.service")
76− server.wait_for_unit("prosody.service")
77− server.succeed('prosodyctl status | grep "Prosody is running"')
78−
79− # set password to 'nothunter2' (it's asked twice)
80− server.succeed("yes nothunter2 | prosodyctl adduser cthon98@example.com")
81− # set password to 'y'
82− server.succeed("yes | prosodyctl adduser azurediamond@example.com")
83− # correct password to 'hunter2'
84− server.succeed("yes hunter2 | prosodyctl passwd azurediamond@example.com")
85−
86− client.succeed("send-message")
87−
88− server.succeed("prosodyctl deluser cthon98@example.com")
89− server.succeed("prosodyctl deluser azurediamond@example.com")
90− '';
91−}
92−
pkgs/servers/xmpp/prosody/default.nix+4−4
@@ -20,7 +20,7 @@ let
2020 );
2121in
2222stdenv.mkDerivation rec {
23− version = "0.11.10"; # also update communityModules
23+ version = "0.11.12"; # also update communityModules
2424 pname = "prosody";
2525 # The following community modules are necessary for the nixos module
2626 # prosody module to comply with XEP-0423 and provide a working
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
3434 ];
3535 src = fetchurl {
3636 url = "https://prosody.im/downloads/source/${pname}-${version}.tar.gz";
37− sha256 = "1q84s9cq7cgzd295qxa2iy0r3vd3v3chbck62bdx3pd6skk19my6";
37+ sha256 = "03an206bl3h2lqcgv1wfvc2bqjq6m9vjb2idw0vyvczm43c55kan";
3838 };
3939
4040 # A note to all those merging automated updates: Please also update this
@@ -42,8 +42,8 @@ stdenv.mkDerivation rec {
4242 # version.
4343 communityModules = fetchhg {
4444 url = "https://hg.prosody.im/prosody-modules";
45− rev = "64fafbeba14d";
46− sha256 = "02gj1b8sdmdvymsdmjpq47zrl7sg578jcdxbbq18s44f3njmc9q1";
45+ rev = "bd0a1f917d98";
46+ sha256 = "0figx0b0y5zfk5anf16h20y4crjmpb6bkg30vl7p0m594qnyqjcx";
4747 };
4848
4949 nativeBuildInputs = [ makeWrapper ];