diff options
author | Thomas Hunger <tehunger@gmail.com> | 2014-10-25 17:22:49 +0100 |
---|---|---|
committer | Jaka Hudoklin <jakahudoklin@gmail.com> | 2014-12-12 18:01:29 +0100 |
commit | 59995e168cf3f682ca8086a58015edc9781a847b (patch) | |
tree | 5736415c0f023eb00cf744c3b89725e549da929b /pkgs/applications/version-management/gitlab/remove-hardcoded-locations.patch | |
parent | b7eba773dc636fc0892753b11c941dae85ddf390 (diff) | |
download | nixpkgs-59995e168cf3f682ca8086a58015edc9781a847b.tar nixpkgs-59995e168cf3f682ca8086a58015edc9781a847b.tar.gz nixpkgs-59995e168cf3f682ca8086a58015edc9781a847b.tar.bz2 nixpkgs-59995e168cf3f682ca8086a58015edc9781a847b.tar.lz nixpkgs-59995e168cf3f682ca8086a58015edc9781a847b.tar.xz nixpkgs-59995e168cf3f682ca8086a58015edc9781a847b.tar.zst nixpkgs-59995e168cf3f682ca8086a58015edc9781a847b.zip |
nixos: Add gitlab and gitlab-shell
I had to make several adjustments to make it work with nixos: * Replace relative config file lookups with ENV variable. * Modify gitlab-shell to not clear then environment when running pre-receive. * Modify gitlab-shell to write some environment variables into the .authorized_keys file to make sure gitlab-shell reads the correct config file. * Log unicorn output to syslog. I tried various ways of adding a syslog package but the bundler would not pick them up. Please fix in a better way if possible. * Gitlab-runner program wrapper. This is useful to run e.g. backups etc. with the correct environment set up.
Diffstat (limited to 'pkgs/applications/version-management/gitlab/remove-hardcoded-locations.patch')
-rw-r--r-- | pkgs/applications/version-management/gitlab/remove-hardcoded-locations.patch | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/pkgs/applications/version-management/gitlab/remove-hardcoded-locations.patch b/pkgs/applications/version-management/gitlab/remove-hardcoded-locations.patch new file mode 100644 index 00000000000..f5532bbd67c --- /dev/null +++ b/pkgs/applications/version-management/gitlab/remove-hardcoded-locations.patch @@ -0,0 +1,109 @@ +diff --git a/config/environments/production.rb b/config/environments/production.rb +index 78bf543..9b37122 100644 +--- a/config/environments/production.rb ++++ b/config/environments/production.rb +@@ -66,10 +66,10 @@ Gitlab::Application.configure do + + config.action_mailer.delivery_method = :sendmail + # Defaults to: +- # # config.action_mailer.sendmail_settings = { +- # # location: '/usr/sbin/sendmail', +- # # arguments: '-i -t' +- # # } ++ config.action_mailer.sendmail_settings = { ++ location: '/var/setuid-wrappers/sendmail', ++ arguments: '-i -t' ++ } + config.action_mailer.perform_deliveries = true + config.action_mailer.raise_delivery_errors = true + +diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example +index e7a8d08..834ecaf 100644 +--- a/config/gitlab.yml.example ++++ b/config/gitlab.yml.example +@@ -17,8 +17,8 @@ production: &base + ## GitLab settings + gitlab: + ## Web server settings (note: host is the FQDN, do not include http://) +- host: localhost +- port: 80 # Set to 443 if using HTTPS, see installation.md#using-https for additional HTTPS configuration details ++ host: <%= ENV['GITLAB_HOST'] || 'localhost' %> ++ port: <%= ENV['GITLAB_PORT'] || 80 %> + https: false # Set to true if using HTTPS, see installation.md#using-https for additional HTTPS configuration details + + # Uncommment this line below if your ssh host is different from HTTP/HTTPS one +@@ -31,11 +31,11 @@ production: &base + # relative_url_root: /gitlab + + # Uncomment and customize if you can't use the default user to run GitLab (default: 'git') +- # user: git ++ user: gitlab + + ## Email settings + # Email address used in the "From" field in mails sent by GitLab +- email_from: example@example.com ++ email_from: <%= ENV['GITLAB_EMAIL_FROM'] %> + + # Email server smtp settings are in [a separate file](initializers/smtp_settings.rb.sample). + +@@ -230,12 +230,12 @@ production: &base + # GitLab Satellites + satellites: + # Relative paths are relative to Rails.root (default: tmp/repo_satellites/) +- path: /home/git/gitlab-satellites/ ++ path: <%= ENV['GITLAB_SATELLITES_PATH'] %> + timeout: 30 + + ## Backup settings + backup: +- path: "tmp/backups" # Relative paths are relative to Rails.root (default: tmp/backups/) ++ path: <%= ENV['GITLAB_BACKUP_PATH'] %> + # keep_time: 604800 # default: 0 (forever) (in seconds) + # upload: + # # Fog storage connection settings, see http://fog.io/storage/ . +@@ -249,11 +249,11 @@ production: &base + + ## GitLab Shell settings + gitlab_shell: +- path: /home/git/gitlab-shell/ ++ path: <%= ENV['GITLAB_SHELL_PATH'] %> + + # REPOS_PATH MUST NOT BE A SYMLINK!!! +- repos_path: /home/git/repositories/ +- hooks_path: /home/git/gitlab-shell/hooks/ ++ repos_path: <%= ENV['GITLAB_REPOSITORIES_PATH'] %> ++ hooks_path: <%= ENV['GITLAB_SHELL_HOOKS_PATH'] %> + + # Git over HTTP + upload_pack: true +@@ -266,7 +266,7 @@ production: &base + # CAUTION! + # Use the default values unless you really know what you are doing + git: +- bin_path: /usr/bin/git ++ bin_path: git + # The next value is the maximum memory size grit can use + # Given in number of bytes per git object (e.g. a commit) + # This value can be increased if you have very large commits +@@ -299,7 +299,7 @@ test: + gravatar: + enabled: true + gitlab: +- host: localhost ++ host: <%= ENV['GITLAB_HOST'] %> + port: 80 + + # When you run tests we clone and setup gitlab-shell +diff --git a/lib/gitlab/app_logger.rb b/lib/gitlab/app_logger.rb +index 8e4717b..abfe2e4 100644 +--- a/lib/gitlab/app_logger.rb ++++ b/lib/gitlab/app_logger.rb +@@ -1,7 +1,7 @@ + module Gitlab + class AppLogger < Gitlab::Logger + def self.file_name +- 'application.log' ++ ENV["GITLAB_APPLICATION_LOG_PATH"] + end + + def format_message(severity, timestamp, progname, msg) |