GitHub PullRequestReviewCommentEvent at 2014-11-03 12:53:20
Repository: nixpkgs
Actor: offlinehacker
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/comments/19730834","id":19730834,"diff_hunk":"@@ -0,0 +1,227 @@\n+{ config, lib, pkgs, ... }:\n+\n+# TODO: support non-postgresql\n+\n+with lib;\n+\n+let\n+  cfg = config.services.gitlab;\n+\n+  ruby = pkgs.ruby;\n+  rubyLibs = pkgs.rubyLibs;\n+\n+  databaseYml = ''\n+    production:\n+      adapter: postgresql\n+      database: ${cfg.databaseName}\n+      host: ${cfg.databaseHost}\n+      password: ${cfg.databasePassword}\n+      username: ${cfg.databaseUsername}\n+      encoding: utf8\n+  '';\n+  gitlabShellYml = ''\n+    user: gitlab\n+    gitlab_url: \"http://localhost:8080/\"\n+    http_settings:\n+      self_signed_cert: false\n+    repos_path: \"${cfg.stateDir}/repositories\"\n+    log_file: \"${cfg.stateDir}/log/gitlab-shell.log\"\n+    redis:\n+      bin: ${pkgs.redis}/bin/redis-cli\n+      host: 127.0.0.1\n+      port: 6379\n+      database: 0\n+      namespace: resque:gitlab\n+  '';\n+\n+  unicornConfig = builtins.readFile ./defaultUnicornConfig.rb;\n+\n+in {\n+\n+  options = {\n+    services.gitlab = {\n+      enable = mkOption {\n+        type = types.bool;\n+        default = false;\n+        description = ''\n+          Enable the gitlab service.\n+        '';\n+      };\n+\n+      satelliteDir = mkOption {\n+        type = types.str;\n+        default = \"/var/gitlab/git-satellites\";\n+        description = \"Directory to store checked out git trees requires for operation.\";\n+      };\n+\n+      stateDir = mkOption {\n+        type = types.str;\n+        default = \"/var/gitlab/state\";\n+        description = \"The state directory, logs are stored here.\";\n+      };\n+\n+      databaseHost = mkOption {\n+        type = types.str;\n+        default = \"127.0.0.1\";\n+        description = \"Database hostname\";\n+      };\n+\n+      databasePassword = mkOption {\n+        type = types.str;\n+        default = \"\";\n+        description = \"Database user password\";\n+      };\n+\n+      databaseName = mkOption {\n+        type = types.str;\n+        default = \"gitlab\";\n+        description = \"Database name\";\n+      };\n+\n+      databaseUsername = mkOption {\n+        type = types.str;\n+        default = \"gitlab\";\n+        description = \"Database user\";\n+      };\n+\n+      emailFrom = mkOption {\n+        type = types.str;\n+        default = \"example@example.org\";\n+        description = \"The source address for emails sent by gitlab.\";\n+      };\n+    };\n+  };\n+\n+  config = mkIf cfg.enable {\n+\n+    assertions = [\n+      { assertion = cfg.databasePassword != \"\";","path":"nixos/modules/services/misc/gitlab.nix","position":98,"original_position":98,"commit_id":"81c2eb8b6c12cdba03cb529c149650b3f24aee82","original_commit_id":"81c2eb8b6c12cdba03cb529c149650b3f24aee82","user":{"login":"offlinehacker","id":585547,"avatar_url":"https://avatars.githubusercontent.com/u/585547?v=2","gravatar_id":"","url":"https://api.github.com/users/offlinehacker","html_url":"https://github.com/offlinehacker","followers_url":"https://api.github.com/users/offlinehacker/followers","following_url":"https://api.github.com/users/offlinehacker/following{/other_user}","gists_url":"https://api.github.com/users/offlinehacker/gists{/gist_id}","starred_url":"https://api.github.com/users/offlinehacker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/offlinehacker/subscriptions","organizations_url":"https://api.github.com/users/offlinehacker/orgs","repos_url":"https://api.github.com/users/offlinehacker/repos","events_url":"https://api.github.com/users/offlinehacker/events{/privacy}","received_events_url":"https://api.github.com/users/offlinehacker/received_events","type":"User","site_admin":false},"body":"You could enable database by default using `services.postgresql.enable = mkDefault true;`. Users can still disable by setting it to false.","created_at":"2014-11-03T12:53:20Z","updated_at":"2014-11-03T12:53:20Z","html_url":"https://github.com/NixOS/nixpkgs/pull/4796#discussion_r19730834","pull_request_url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/4796","_links":{"self":{"href":"https://api.github.com/repos/NixOS/nixpkgs/pulls/comments/19730834"},"html":{"href":"https://github.com/NixOS/nixpkgs/pull/4796#discussion_r19730834"},"pull_request":{"href":"https://api.github.com/repos/NixOS/nixpkgs/pulls/4796"}}},"pull_request":{"url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/4796","id":23738337,"html_url":"https://github.com/NixOS/nixpkgs/pull/4796","diff_url":"https://github.com/NixOS/nixpkgs/pull/4796.diff","patch_url":"https://github.com/NixOS/nixpkgs/pull/4796.patch","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/4796","number":4796,"state":"open","locked":false,"title":"Add gitlab and gitlab-shell.","user":{"login":"teh","id":139251,"avatar_url":"https://avatars.githubusercontent.com/u/139251?v=2","gravatar_id":"","url":"https://api.github.com/users/teh","html_url":"https://github.com/teh","followers_url":"https://api.github.com/users/teh/followers","following_url":"https://api.github.com/users/teh/following{/other_user}","gists_url":"https://api.github.com/users/teh/gists{/gist_id}","starred_url":"https://api.github.com/users/teh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teh/subscriptions","organizations_url":"https://api.github.com/users/teh/orgs","repos_url":"https://api.github.com/users/teh/repos","events_url":"https://api.github.com/users/teh/events{/privacy}","received_events_url":"https://api.github.com/users/teh/received_events","type":"User","site_admin":false},"body":"I had to make several adjustments to make it work with nixos:\r\n\r\n* Replace relative config file lookups with ENV variable.\r\n* Modify gitlab-shell to not clear then environment when running\r\n  pre-receive.\r\n* Modify gitlab-shell to write some environment variables into\r\n  the .authorized_keys file to make sure gitlab-shell reads the\r\n  correct config file.\r\n\r\nThe current version requires the user to install the gitlab-shell\r\npackage into the systemPackages environment because\r\n/run/current-system/sw/bin/gitlab-shell is hard-coded in the\r\n.authorized_keys file.","created_at":"2014-11-02T23:33:32Z","updated_at":"2014-11-03T12:53:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e07828fa3fed490c41be07a76708d9db68789133","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/4796/commits","review_comments_url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/4796/comments","review_comment_url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/comments/{number}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/4796/comments","statuses_url":"https://api.github.com/repos/NixOS/nixpkgs/statuses/81c2eb8b6c12cdba03cb529c149650b3f24aee82","head":{"label":"teh:gitlab","ref":"gitlab","sha":"81c2eb8b6c12cdba03cb529c149650b3f24aee82","user":{"login":"teh","id":139251,"avatar_url":"https://avatars.githubusercontent.com/u/139251?v=2","gravatar_id":"","url":"https://api.github.com/users/teh","html_url":"https://github.com/teh","followers_url":"https://api.github.com/users/teh/followers","following_url":"https://api.github.com/users/teh/following{/other_user}","gists_url":"https://api.github.com/users/teh/gists{/gist_id}","starred_url":"https://api.github.com/users/teh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teh/subscriptions","organizations_url":"https://api.github.com/users/teh/orgs","repos_url":"https://api.github.com/users/teh/repos","events_url":"https://api.github.com/users/teh/events{/privacy}","received_events_url":"https://api.github.com/users/teh/received_events","type":"User","site_admin":false},"repo":{"id":25733884,"name":"nixpkgs","full_name":"teh/nixpkgs","owner":{"login":"teh","id":139251,"avatar_url":"https://avatars.githubusercontent.com/u/139251?v=2","gravatar_id":"","url":"https://api.github.com/users/teh","html_url":"https://github.com/teh","followers_url":"https://api.github.com/users/teh/followers","following_url":"https://api.github.com/users/teh/following{/other_user}","gists_url":"https://api.github.com/users/teh/gists{/gist_id}","starred_url":"https://api.github.com/users/teh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teh/subscriptions","organizations_url":"https://api.github.com/users/teh/orgs","repos_url":"https://api.github.com/users/teh/repos","events_url":"https://api.github.com/users/teh/events{/privacy}","received_events_url":"https://api.github.com/users/teh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/teh/nixpkgs","description":"Nix Packages collection","fork":true,"url":"https://api.github.com/repos/teh/nixpkgs","forks_url":"https://api.github.com/repos/teh/nixpkgs/forks","keys_url":"https://api.github.com/repos/teh/nixpkgs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/teh/nixpkgs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/teh/nixpkgs/teams","hooks_url":"https://api.github.com/repos/teh/nixpkgs/hooks","issue_events_url":"https://api.github.com/repos/teh/nixpkgs/issues/events{/number}","events_url":"https://api.github.com/repos/teh/nixpkgs/events","assignees_url":"https://api.github.com/repos/teh/nixpkgs/assignees{/user}","branches_url":"https://api.github.com/repos/teh/nixpkgs/branches{/branch}","tags_url":"https://api.github.com/repos/teh/nixpkgs/tags","blobs_url":"https://api.github.com/repos/teh/nixpkgs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/teh/nixpkgs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/teh/nixpkgs/git/refs{/sha}","trees_url":"https://api.github.com/repos/teh/nixpkgs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/teh/nixpkgs/statuses/{sha}","languages_url":"https://api.github.com/repos/teh/nixpkgs/languages","stargazers_url":"https://api.github.com/repos/teh/nixpkgs/stargazers","contributors_url":"https://api.github.com/repos/teh/nixpkgs/contributors","subscribers_url":"https://api.github.com/repos/teh/nixpkgs/subscribers","subscription_url":"https://api.github.com/repos/teh/nixpkgs/subscription","commits_url":"https://api.github.com/repos/teh/nixpkgs/commits{/sha}","git_commits_url":"https://api.github.com/repos/teh/nixpkgs/git/commits{/sha}","comments_url":"https://api.github.com/repos/teh/nixpkgs/comments{/number}","issue_comment_url":"https://api.github.com/repos/teh/nixpkgs/issues/comments/{number}","contents_url":"https://api.github.com/repos/teh/nixpkgs/contents/{+path}","compare_url":"https://api.github.com/repos/teh/nixpkgs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/teh/nixpkgs/merges","archive_url":"https://api.github.com/repos/teh/nixpkgs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/teh/nixpkgs/downloads","issues_url":"https://api.github.com/repos/teh/nixpkgs/issues{/number}","pulls_url":"https://api.github.com/repos/teh/nixpkgs/pulls{/number}","milestones_url":"https://api.github.com/repos/teh/nixpkgs/milestones{/number}","notifications_url":"https://api.github.com/repos/teh/nixpkgs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/teh/nixpkgs/labels{/name}","releases_url":"https://api.github.com/repos/teh/nixpkgs/releases{/id}","created_at":"2014-10-25T14:22:01Z","updated_at":"2014-10-25T07:50:48Z","pushed_at":"2014-11-02T23:31:34Z","git_url":"git://github.com/teh/nixpkgs.git","ssh_url":"git@github.com:teh/nixpkgs.git","clone_url":"https://github.com/teh/nixpkgs.git","svn_url":"https://github.com/teh/nixpkgs","homepage":null,"size":112451,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"NixOS:master","ref":"master","sha":"fae9e793b44e0b9c2e5a212a0d76df33e31a4289","user":{"login":"NixOS","id":487568,"avatar_url":"https://avatars.githubusercontent.com/u/487568?v=2","gravatar_id":"","url":"https://api.github.com/users/NixOS","html_url":"https://github.com/NixOS","followers_url":"https://api.github.com/users/NixOS/followers","following_url":"https://api.github.com/users/NixOS/following{/other_user}","gists_url":"https://api.github.com/users/NixOS/gists{/gist_id}","starred_url":"https://api.github.com/users/NixOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NixOS/subscriptions","organizations_url":"https://api.github.com/users/NixOS/orgs","repos_url":"https://api.github.com/users/NixOS/repos","events_url":"https://api.github.com/users/NixOS/events{/privacy}","received_events_url":"https://api.github.com/users/NixOS/received_events","type":"Organization","site_admin":false},"repo":{"id":4542716,"name":"nixpkgs","full_name":"NixOS/nixpkgs","owner":{"login":"NixOS","id":487568,"avatar_url":"https://avatars.githubusercontent.com/u/487568?v=2","gravatar_id":"","url":"https://api.github.com/users/NixOS","html_url":"https://github.com/NixOS","followers_url":"https://api.github.com/users/NixOS/followers","following_url":"https://api.github.com/users/NixOS/following{/other_user}","gists_url":"https://api.github.com/users/NixOS/gists{/gist_id}","starred_url":"https://api.github.com/users/NixOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NixOS/subscriptions","organizations_url":"https://api.github.com/users/NixOS/orgs","repos_url":"https://api.github.com/users/NixOS/repos","events_url":"https://api.github.com/users/NixOS/events{/privacy}","received_events_url":"https://api.github.com/users/NixOS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NixOS/nixpkgs","description":"Nix Packages collection","fork":false,"url":"https://api.github.com/repos/NixOS/nixpkgs","forks_url":"https://api.github.com/repos/NixOS/nixpkgs/forks","keys_url":"https://api.github.com/repos/NixOS/nixpkgs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NixOS/nixpkgs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NixOS/nixpkgs/teams","hooks_url":"https://api.github.com/repos/NixOS/nixpkgs/hooks","issue_events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/events{/number}","events_url":"https://api.github.com/repos/NixOS/nixpkgs/events","assignees_url":"https://api.github.com/repos/NixOS/nixpkgs/assignees{/user}","branches_url":"https://api.github.com/repos/NixOS/nixpkgs/branches{/branch}","tags_url":"https://api.github.com/repos/NixOS/nixpkgs/tags","blobs_url":"https://api.github.com/repos/NixOS/nixpkgs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NixOS/nixpkgs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NixOS/nixpkgs/git/refs{/sha}","trees_url":"https://api.github.com/repos/NixOS/nixpkgs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NixOS/nixpkgs/statuses/{sha}","languages_url":"https://api.github.com/repos/NixOS/nixpkgs/languages","stargazers_url":"https://api.github.com/repos/NixOS/nixpkgs/stargazers","contributors_url":"https://api.github.com/repos/NixOS/nixpkgs/contributors","subscribers_url":"https://api.github.com/repos/NixOS/nixpkgs/subscribers","subscription_url":"https://api.github.com/repos/NixOS/nixpkgs/subscription","commits_url":"https://api.github.com/repos/NixOS/nixpkgs/commits{/sha}","git_commits_url":"https://api.github.com/repos/NixOS/nixpkgs/git/commits{/sha}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/comments{/number}","issue_comment_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/{number}","contents_url":"https://api.github.com/repos/NixOS/nixpkgs/contents/{+path}","compare_url":"https://api.github.com/repos/NixOS/nixpkgs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NixOS/nixpkgs/merges","archive_url":"https://api.github.com/repos/NixOS/nixpkgs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NixOS/nixpkgs/downloads","issues_url":"https://api.github.com/repos/NixOS/nixpkgs/issues{/number}","pulls_url":"https://api.github.com/repos/NixOS/nixpkgs/pulls{/number}","milestones_url":"https://api.github.com/repos/NixOS/nixpkgs/milestones{/number}","notifications_url":"https://api.github.com/repos/NixOS/nixpkgs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/labels{/name}","releases_url":"https://api.github.com/repos/NixOS/nixpkgs/releases{/id}","created_at":"2012-06-04T02:49:46Z","updated_at":"2014-11-02T14:40:11Z","pushed_at":"2014-11-03T12:43:53Z","git_url":"git://github.com/NixOS/nixpkgs.git","ssh_url":"git@github.com:NixOS/nixpkgs.git","clone_url":"https://github.com/NixOS/nixpkgs.git","svn_url":"https://github.com/NixOS/nixpkgs","homepage":null,"size":282145,"stargazers_count":401,"watchers_count":401,"language":"Nix","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":493,"mirror_url":null,"open_issues_count":420,"forks":493,"open_issues":420,"watchers":401,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NixOS/nixpkgs/pulls/4796"},"html":{"href":"https://github.com/NixOS/nixpkgs/pull/4796"},"issue":{"href":"https://api.github.com/repos/NixOS/nixpkgs/issues/4796"},"comments":{"href":"https://api.github.com/repos/NixOS/nixpkgs/issues/4796/comments"},"review_comments":{"href":"https://api.github.com/repos/NixOS/nixpkgs/pulls/4796/comments"},"review_comment":{"href":"https://api.github.com/repos/NixOS/nixpkgs/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/NixOS/nixpkgs/pulls/4796/commits"},"statuses":{"href":"https://api.github.com/repos/NixOS/nixpkgs/statuses/81c2eb8b6c12cdba03cb529c149650b3f24aee82"}}}}