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

nixcloud.email: evaluation error when using nginx simultaniously #17

Closed
erictapen opened this issue Mar 10, 2018 · 3 comments
Closed

nixcloud.email: evaluation error when using nginx simultaniously #17

erictapen opened this issue Mar 10, 2018 · 3 comments

Comments

@erictapen
Copy link
Contributor

erictapen commented Mar 10, 2018

When using the example config, I'm getting

error: cannot coerce null to a string, at /home/justin/git/nixcloud-webservices/modules/services/reverse-proxy/default.nix:224:7
(use ‘--show-trace’ to show detailed location information)

This is a test case, reproducing the issue:

import <nixpkgs/nixos/tests/make-test.nix> ({ pkgs, ...}:

{
  name = "nixcloud-email";

  nodes = {

    server =
      { config, pkgs, lib, ... }:

      let
        ipAddress = "8.19.10.3";
        ipv6Address = "201:48:11:403::1:1";
      in {
        imports = [
          <nixcloud-webservices/modules>
        ];
        nixcloud.email= {
          enable = true;
          domains = [ "lastlog.de" "dune2.de" ];
          ipAddress = ipAddress;
          ip6Address = ipv6Address;
          hostname = "mail.lastlog.de";
          users = [
            # see https://wiki.dovecot.org/Authentication/PasswordSchemes
            { name = "js"; domain = "lastlog.de"; password = "{SHA256-CRYPT}$<<<removed by qknight>>>"; }
            { name = "foo1"; domain = "dune2.de"; password = "{PLAIN}asdfasdfasdfasdf"; }
          ];
        };
        services.nginx = {
          enable = true;
          virtualHosts = {
            "example.com" = {
              locations."/" = {
                root = "/webroot/";
              };
              forceSSL = true;
              enableACME = true;
            };
          };
        };

      };
  };

  testScript = ''
    startAll;

  '';
})

Put it in test-email.nix and call it with

nix-build test-email.nix -I nixcloud-webservices=/path/to/your/nixcloud-webservices/ -I nixpkgs=https://d3g5gsiof5omrk.cloudfront.net/nixos/17.09/nixos-17.09.3154.b47b4f3dd3c/nixexprs.tar.xz

where nixpkgs is current nixos-17.09 and nixcloud-webservices current master.

@qknight
Copy link
Member

qknight commented Mar 10, 2018

thanks for that bug report, needs to be fixed!

note on services.nginx usage

if you want to use services.nginx then you need to disable ACME in nixcloud.email, see:

https://nixdoc.io/nixcloud-webservices/index.html#enableacme+nixcloud

use nixcloud.webservices instead of services.nginx, see:

https://github.com/nixcloud/nixcloud-webservices/blob/master/documentation/nixcloud.webservices.md#static-file-serving-no-cgi

documentation

i'll update the documentation about how to use services.nginx with nixcloud.reverse-proxy in parallel soon.

@qknight
Copy link
Member

qknight commented Mar 14, 2018

qknight added a commit that referenced this issue Mar 14, 2018
@qknight
Copy link
Member

qknight commented Mar 14, 2018

@erictapen fixed in 7a510de and the cause for the problem is fixed in nixpkgs by NixOS/nixpkgs@edeacd0#diff-3ac514cd8063d3114597ce7aa42b27cf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants