From bb50b7fcd0161a7b9f0f87cb395e355a87a9dd17 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Mon, 6 Jul 2015 18:43:17 +0200 Subject: Allow custom backup archive permissions This change helps system administrators who want to replicate GitLab backup files without needing root permissions. --- config/gitlab.yml.example | 1 + config/initializers/1_settings.rb | 1 + 2 files changed, 2 insertions(+) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index c32ac2042d0..542106e86dd 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -247,6 +247,7 @@ production: &base ## Backup settings backup: path: "tmp/backups" # Relative paths are relative to Rails.root (default: tmp/backups/) + # archive_permissions: 0640 # Permissions for the resulting backup.tar file (default: 0600) # keep_time: 604800 # default: 0 (forever) (in seconds) # upload: # # Fog storage connection settings, see http://fog.io/storage/ . diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 7b5d488f59e..bd76c918485 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -170,6 +170,7 @@ Settings.gitlab_shell['ssh_path_prefix'] ||= Settings.send(:build_gitlab_shell_s Settings['backup'] ||= Settingslogic.new({}) Settings.backup['keep_time'] ||= 0 Settings.backup['path'] = File.expand_path(Settings.backup['path'] || "tmp/backups/", Rails.root) +Settings.backup['archive_permissions'] ||= 0600 Settings.backup['upload'] ||= Settingslogic.new({ 'remote_directory' => nil, 'connection' => nil }) # Convert upload connection settings to use symbol keys, to make Fog happy if Settings.backup['upload']['connection'] -- cgit v1.2.1