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

Nextcloud: fix ldap integration #101553

Merged
merged 2 commits into from Nov 1, 2020
Merged

Nextcloud: fix ldap integration #101553

merged 2 commits into from Nov 1, 2020

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented Oct 24, 2020

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@Mic92 Mic92 requested a review from Ma27 October 24, 2020 13:45
@@ -551,7 +551,7 @@ in {
priority = 900;
extraConfig = if major < 20
then "rewrite ^ /index.php;"
else "try_files $uri $uri/ /index.php$request_uri;";
else "try_files $uri/ /index.php$request_uri;";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This broke autoloading.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajs124
Copy link
Member

ajs124 commented Oct 24, 2020

Does this also work on the older, still supported, releases?

@Ma27
Copy link
Member

Ma27 commented Oct 24, 2020

@Mic92 I'm not sure if I'm missing something, but it doesn't seem to properly fix the original LDAP issue. I built a VM from your branch (rev c403ed445dbd3cf7f23d86ba0b8b35e8b9f10442) with the following config:

# cat vm.nix
{
  snens = { lib, pkgs, config, ... }: {
    networking.firewall.allowedTCPPorts = [ 80 ];
    services.nextcloud = {
      enable = true;
      hostName = "localhost";
      config = {
        adminpass = "root";
      };
    };
  };
}

And started it like this:

$ nixos-build-vms -I nixpkgs=$(pwd) vm.nix
$ QEMU_NET_OPTS=hostfwd=tcp::8080-:80 ./result/bin/nixos-run-vms

When I try to configure LDAP auth in the VM, I still get the following error:

snens # [  102.003163] nginx[739]: 2020/10/24 16:58:03 [error] 739#739: *92 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Class 'OC_JSON' not found in /nix/store/5ybb1r22wxqv92ix92igqp7ysvlyy1wx-nextcloud-20.0.1/apps/user_ldap/ajax/getConfiguration.php:30
snens # [  102.008149] nginx[739]: Stack trace:
snens # [  102.009502] nginx[739]: #0 {main}
snens # [  102.010688] nginx[739]:   thrown in /nix/store/5ybb1r22wxqv92ix92igqp7ysvlyy1wx-nextcloud-20.0.1/apps/user_ldap/ajax/getConfiguration.php on line 30" while reading response header from upstream, client: 10.0.2.2, server: localhost, request: "POST /apps/user_ldap/ajax/getConfiguration.php HTTP/1.1", upstream: "fastcgi://unix:/run/phpfpm/nextcloud.sock:", host: "localhost:8080"

@Mic92
Copy link
Member Author

Mic92 commented Oct 26, 2020

Does this also work on the older, still supported, releases?

It does not change anything for older releases.

@Mic92
Copy link
Member Author

Mic92 commented Oct 26, 2020

I applied now suggestions from nextcloud/documentation#2197 (comment) which is basically a revert of the changes before. Also I think ldap worked with the other hack.

@Ma27
Copy link
Member

Ma27 commented Oct 30, 2020

Also I think ldap worked with the other hack.

@Mic92 which other hack?

@Mic92
Copy link
Member Author

Mic92 commented Nov 1, 2020

Also I think ldap worked with the other hack.

@Mic92 which other hack?

The one you tested in a VM also worked on my server.

@Ma27
Copy link
Member

Ma27 commented Nov 1, 2020

Oops sorry, I didn't realize that you pushed new changes after my last commit... LGTM, will merge/backport :)

@Ma27 Ma27 merged commit 4f3f06d into NixOS:master Nov 1, 2020
@Ma27
Copy link
Member

Ma27 commented Nov 1, 2020

Thanks! Ported to 20.09 as bae0cce, 1c50dc4.

@Ma27 Ma27 added the 8.has: port to stable A PR already has a backport to the stable release. label Nov 1, 2020
@Mic92 Mic92 deleted the nextcloud branch November 1, 2020 15:35
@ajs124
Copy link
Member

ajs124 commented Dec 12, 2020

Just a note: This leaves behind the major function unused.

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

3 participants