Commit c5aae307 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Set internal backup directory modes on create

This sidesteps problems with running 'chmod' on some CIFS mounts.
parent 5efb58b0
......@@ -7,7 +7,7 @@ module Backup
def initialize
@config = YAML.load_file(File.join(Rails.root,'config','database.yml'))[Rails.env]
@db_dir = File.join(Gitlab.config.backup.path, 'db')
FileUtils.mkdir_p(@db_dir) unless Dir.exists?(@db_dir)
FileUtils.mkdir_p(@db_dir, mode: 0700)unless Dir.exists?(@db_dir)
end
def dump
......
......@@ -16,8 +16,6 @@ module Backup
file << s.to_yaml.gsub(/^---\n/,'')
end
FileUtils.chmod(0700, folders_to_backup)
# create archive
$progress.print "Creating backup archive: #{tar_file} ... "
orig_umask = File.umask(0077)
......
......@@ -130,7 +130,7 @@ module Backup
def prepare
FileUtils.rm_rf(backup_repos_path)
FileUtils.mkdir_p(backup_repos_path)
FileUtils.mkdir_p(backup_repos_path, mode: 0700)
end
def silent
......
......@@ -10,7 +10,7 @@ module Backup
# Copy uploads from public/uploads to backup/uploads
def dump
FileUtils.mkdir_p(backup_uploads_dir)
FileUtils.mkdir_p(backup_uploads_dir, mode: 0700)
FileUtils.cp_r(app_uploads_dir, backup_dir)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment