git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #9778 from statusfailed/service-gitit-github-auth

added more configuration options to gitit to allow github authentication

commitd5505ae75732b3313015804b915aca30746767cd authorArseniy Seroka <jagajaga@users.noreply.github.com> dateFri 11 Sep 2015, 14:13 (11 years ago) parent9681e04d2ca8b4
1 file changed+45−2
nixos/modules/services/misc/gitit.nix+45−2
nixos/modules/services/misc/gitit.nix+45−2
@@ -99,7 +99,7 @@ let
9999 };
100100
101101 authenticationMethod = mkOption {
102− type = types.enum [ "form" "http" "generic"];
102+ type = types.enum [ "form" "http" "generic" "github" ];
103103 default = "form";
104104 description = ''
105105 'form' means that users will be logged in and registered using forms
@@ -537,6 +537,42 @@ video/x-ms-wmx wmx
537537 through xss-sanitize. Set to no only if you trust all of your users.
538538 '';
539539 };
540+
541+ oauthClientId = mkOption {
542+ type = with types; nullOr str;
543+ default = null;
544+ description = "OAuth client ID";
545+ };
546+
547+ oauthClientSecret = mkOption {
548+ type = with types; nullOr str;
549+ default = null;
550+ description = "OAuth client secret";
551+ };
552+
553+ oauthCallback = mkOption {
554+ type = with types; nullOr str;
555+ default = null;
556+ description = "OAuth callback URL";
557+ };
558+
559+ oauthAuthorizeEndpoint = mkOption {
560+ type = with types; nullOr str;
561+ default = null;
562+ description = "OAuth authorize endpoint";
563+ };
564+
565+ oauthAccessTokenEndpoint = mkOption {
566+ type = with types; nullOr str;
567+ default = null;
568+ description = "OAuth access token endpoint";
569+ };
570+
571+ githubOrg = mkOption {
572+ type = with types; nullOr str;
573+ default = null;
574+ description = "Github organization";
575+ };
540576 };
541577
542578 configFile = pkgs.writeText "gitit.conf" ''
@@ -587,6 +623,14 @@ video/x-ms-wmx wmx
587623 pdf-export: ${toYesNo cfg.pdfExport}
588624 pandoc-user-data: ${toString cfg.pandocUserData}
589625 xss-sanitize: ${toYesNo cfg.xssSanitize}
626+
627+ [Github]
628+ oauthclientid: ${toString cfg.oauthClientId}
629+ oauthclientsecret: ${toString cfg.oauthClientSecret}
630+ oauthcallback: ${toString cfg.oauthCallback}
631+ oauthauthorizeendpoint: ${toString cfg.oauthAuthorizeEndpoint}
632+ oauthaccesstokenendpoint: ${toString cfg.oauthAccessTokenEndpoint}
633+ github-org: ${toString cfg.githubOrg}
590634 '';
591635
592636in
@@ -681,4 +725,3 @@ NAMED
681725 };
682726 };
683727}
684−