Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-19.09] port new Mailman & Postorius & Hyperkitty NixOS module from master #68500

Merged
merged 7 commits into from Sep 14, 2019

Conversation

peti
Copy link
Member

@peti peti commented Sep 11, 2019

Merged to master in #67951.

A simple Apache configuration for running Postorious and Hyperkitty looks as follows:

httpd = let webRoot = config.services.mailman.webRoot; in {
  enable = true;
  adminAddr = "postmaster@example.org";
  hostName = "lists.example.org";
  logPerVirtualHost = true;
  extraModules = [ { name = "wsgi"; path = "${pkgs.apacheHttpdPackages.mod_wsgi3}/modules/mod_wsgi.so"; } ];
  extraConfig = ''                                                                                                                                                                                                  
    WSGISocketPrefix /run/httpd/wsgi                                                                                                                                                                                
    WSGIDaemonProcess mailman threads=25 home=/var/lib/mailman-web python-path=${webRoot}:${
      lib.makeSearchPath pkgs.python3.sitePackages
        pkgs.python3Packages.mailman-web.requiredPythonModules
    }                                                                       
  '';
  virtualHosts = [
    { hostName = "lists.example.org";
      documentRoot = config.security.acme.certs."lists.example.org".webroot;
      extraConfig = ''                                                                                                                                                                                              
        <Directory "${config.security.acme.certs."lists.example.org".webroot}">                                                                                                                                     
          Options -Indexes                                                                                                                                                                                          
        </Directory>                                                                                                                                                                                                
        RedirectMatch permanent ^(?!/\.well-known/acme-challenge/).* https://lists.example.org$0                                                                                                                    
                                                                                                                                                                                                                    
      '';
    }
    { hostName = "lists.example.org";
      enableSSL = true;
      sslServerCert = "/var/lib/acme/lists.example.org/fullchain.pem";
      sslServerKey = "/var/lib/acme/lists.example.org/key.pem";
      servedDirs = [ { dir = "/var/lib/mailman-web/static"; urlPath = "/static"; } ];
      extraConfig = ''                                                                                                                                                                                              
        <Directory "${webRoot}">                                                                                                                                                                                    
          <Files wsgi.py>                                                                                                                                                                                           
            Require all granted                                                                                                                                                                                     
          </Files>                                                                                                                                                                                                  
          WSGIProcessGroup mailman                                                                                                                                                                                  
        </Directory>                                                                                                                                                                                                
        WSGIScriptAlias / ${webRoot}/wsgi.py                                                                                                                                                                        
      '';
    }
    { hostName = "localhost";
      servedDirs = [ { dir = "/var/lib/postorius/static"; urlPath = "/static"; } ];
      extraConfig = ''                                                                                                                                                                                              
        <Directory "${webRoot}">                                                                                                                                                                                    
          <Files wsgi.py>                                                                                                                                                                                           
            Require ip 127.0.0.1                                                                                                                                                                                    
            Require all granted                                                                                                                                                                                     
          </Files>                                                                                                                                                                                                  
          WSGIProcessGroup mailman                                                                                                                                                                                  
        </Directory>                                                                                                                                                                                                
        WSGIScriptAlias / ${webRoot}/wsgi.py                                                                                                                                                                        
      '';
    }
  ];
};

…-shift Python library

Suggested in NixOS#67951 (comment).

(cherry picked from commit 86f8895)
When mailman-web restarts, it removes the generated "static" directory. This
breaks a currently running httpd process, which needs a re-start, too, to
obtain a new handle for the newly generated path.

(cherry picked from commit 0cc37b3)
@peti peti requested a review from FRidh as a code owner September 11, 2019 13:43
@peti peti changed the title Port new Mailman & Postorius & Hyperkitty NixOS module from master. [release-19.09] port new Mailman & Postorius & Hyperkitty NixOS module from master Sep 11, 2019
@peti peti added this to the 19.09 milestone Sep 11, 2019
@peti peti merged commit 4b342f6 into NixOS:release-19.09 Sep 14, 2019
@peti peti deleted the t/mailman branch December 16, 2019 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants