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

nixos/nginx: fix gitweb submodule #38527

Merged
merged 1 commit into from Apr 7, 2018
Merged

nixos/nginx: fix gitweb submodule #38527

merged 1 commit into from Apr 7, 2018

Conversation

ghost
Copy link

@ghost ghost commented Apr 6, 2018

Motivation for this change

Correct issues

  • don't use systemd socket, as CGI::Fast used by gitweb can create socket by its own
  • add flag to use FCGI::ProcManager, otherwise gitweb will stop functioning under burst loads in case of error conditions
  • make nginx to properly pass gitweb static content

cc @wmertens

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

};

services.nginx = {
virtualHosts.default = {
locations."/gitweb" = {
root = "${pkgs.git}/share/gitweb";
locations."/gitweb/" = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should you also add a redirect from /gitweb to /gitweb/?

extraConfig = ''
include ${pkgs.nginx}/conf/fastcgi_params;
fastcgi_param GITWEB_CONFIG ${cfg.gitwebConfigFile};
fastcgi_pass unix:/run/gitweb.sock;
fastcgi_pass unix:/run/gitweb/gitweb.sock;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't really understand this change, so gitweb was trying to create its own socket?
Also, the previous socket was owned by nginx, and this one?

Copy link
Author

Choose a reason for hiding this comment

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

@wmertens Before this PR systemd does socket magic, after this PR gitweb does it itself (I didn't know its able to do that - its not part of gitweb docs but part of CGI::Fast library docs which gitweb uses for fastcgi mode).
Socket is still owned by nginx, since gitweb is run under nginx user. And with RuntimeDirectory systemd creates /run/gitweb folder with nginx owner, so gitweb is allowed to write socket there.

@wmertens
Copy link
Contributor

wmertens commented Apr 7, 2018

👍 Good stuff!

@wmertens wmertens merged commit d55e830 into NixOS:master Apr 7, 2018
@ghost
Copy link
Author

ghost commented Apr 7, 2018

@wmertens Thank you!

@ghost ghost deleted the gitweb branch April 7, 2018 18:39
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