gitit service: add github authentication

Changed files
+45 -2
nixos
modules
services
misc
+45 -2
nixos/modules/services/misc/gitit.nix
···
};
authenticationMethod = mkOption {
-
type = types.enum [ "form" "http" "generic"];
default = "form";
description = ''
'form' means that users will be logged in and registered using forms
···
through xss-sanitize. Set to no only if you trust all of your users.
'';
};
};
configFile = pkgs.writeText "gitit.conf" ''
···
pdf-export: ${toYesNo cfg.pdfExport}
pandoc-user-data: ${toString cfg.pandocUserData}
xss-sanitize: ${toYesNo cfg.xssSanitize}
'';
in
···
};
};
}
-
···
};
authenticationMethod = mkOption {
+
type = types.enum [ "form" "http" "generic" "github" ];
default = "form";
description = ''
'form' means that users will be logged in and registered using forms
···
through xss-sanitize. Set to no only if you trust all of your users.
'';
};
+
+
oauthClientId = mkOption {
+
type = with types; nullOr str;
+
default = null;
+
description = "OAuth client ID";
+
};
+
+
oauthClientSecret = mkOption {
+
type = with types; nullOr str;
+
default = null;
+
description = "OAuth client secret";
+
};
+
+
oauthCallback = mkOption {
+
type = with types; nullOr str;
+
default = null;
+
description = "OAuth callback URL";
+
};
+
+
oauthAuthorizeEndpoint = mkOption {
+
type = with types; nullOr str;
+
default = null;
+
description = "OAuth authorize endpoint";
+
};
+
+
oauthAccessTokenEndpoint = mkOption {
+
type = with types; nullOr str;
+
default = null;
+
description = "OAuth access token endpoint";
+
};
+
+
githubOrg = mkOption {
+
type = with types; nullOr str;
+
default = null;
+
description = "Github organization";
+
};
};
configFile = pkgs.writeText "gitit.conf" ''
···
pdf-export: ${toYesNo cfg.pdfExport}
pandoc-user-data: ${toString cfg.pandocUserData}
xss-sanitize: ${toYesNo cfg.xssSanitize}
+
+
[Github]
+
oauthclientid: ${cfg.oauthClientId}
+
oauthclientsecret: ${cfg.oauthClientSecret}
+
oauthcallback: ${cfg.oauthCallback}
+
oauthauthorizeendpoint: ${cfg.oauthAuthorizeEndpoint}
+
oauthaccesstokenendpoint: ${cfg.oauthAccessTokenEndpoint}
+
github-org: ${cfg.githubOrg}
'';
in
···
};
};
}