Unverified Commit 2207ac32 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

nixos/tests/nextcloud: fix notify_push test; nixos/nextcloud-notify_push: add...

 nixos/tests/nextcloud: fix notify_push test; nixos/nextcloud-notify_push: add nextcloudUrl option (#365442)
parents d67a8468 f6b7e8f6
Loading
Loading
Loading
Loading
+61 −58
Original line number Diff line number Diff line
@@ -40,6 +40,13 @@ in
        description = "Log level";
      };

      nextcloudUrl = lib.mkOption {
        type = lib.types.str;
        default = "http${lib.optionalString cfgN.https "s"}://${cfgN.hostName}";
        defaultText = lib.literalExpression ''"http''${lib.optionalString config.services.nextcloud.https "s"}://''${config.services.nextcloud.hostName}"'';
        description = "Configure the nextcloud URL notify_push tries to connect to.";
      };

      bendDomainToLocalhost = lib.mkOption {
        type = lib.types.bool;
        default = false;
@@ -71,11 +78,7 @@ in
    );

  config = lib.mkIf cfg.enable {
    systemd.services.nextcloud-notify_push =
      let
        nextcloudUrl = "http${lib.optionalString cfgN.https "s"}://${cfgN.hostName}";
      in
      {
    systemd.services.nextcloud-notify_push = {
      description = "Push daemon for Nextcloud clients";
      documentation = [ "https://github.com/nextcloud/notify_push" ];
      after = [
@@ -84,13 +87,13 @@ in
      ];
      wantedBy = [ "multi-user.target" ];
      environment = {
          NEXTCLOUD_URL = nextcloudUrl;
        NEXTCLOUD_URL = cfg.nextcloudUrl;
        SOCKET_PATH = cfg.socketPath;
        DATABASE_PREFIX = cfg.dbtableprefix;
        LOG = cfg.logLevel;
      };
      postStart = ''
          ${cfgN.occ}/bin/nextcloud-occ notify_push:setup ${nextcloudUrl}/push
        ${cfgN.occ}/bin/nextcloud-occ notify_push:setup ${cfg.nextcloudUrl}/push
      '';
      script =
        let
+1 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ runTest (
            config.dbtype = "pgsql";
            notify_push = {
              enable = true;
              bendDomainToLocalhost = true;
              logLevel = "debug";
            };
            extraAppsEnable = true;