Commit Graph

53 Commits

Author SHA1 Message Date
Rémy Coutable c946ee1282
Enable the Layout/SpaceBeforeBlockBraces cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-09 11:52:22 +02:00
Markus Koller d27dec80ce
Support custom directory in gitlab:backup:create task 2017-07-27 13:24:19 +02:00
Achilleas Pipinellis e4d9be0e6b Fix rubocop 2017-05-23 11:17:25 +02:00
Achilleas Pipinellis 450e2cd879 Add missing regex to backup manager
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/10901/diffs
introduced a new naming scheme for backups, but the code which
cleans up old backups wasn't updated accordingly. In order to
maintain backward compatibility, we need to account for 3 naming
schemes.
2017-05-23 10:23:04 +02:00
Rémy Coutable b5526a2d13 Merge branch 'gl-version-backup-file' into 'master'
Add GitLab version to backup file name

See merge request !10901
2017-04-26 18:22:33 +00:00
Maxim Rydkin 6a541c7905 Decrease ABC threshold to 57.08 2017-04-26 10:54:11 +00:00
Achilleas Pipinellis 43f73107ca Expose GitLab version in backup file
Instead of doing hacks like http://stackoverflow.com/a/26082612/974710
2017-04-25 11:36:52 +02:00
Jon Keys 7a7ec1ac0f Add storage class configuration option for Amazon S3 remote backups 2017-02-28 16:30:58 -05:00
Douwe Maan 87c9df29ce Don’t exclude some file in lib from rubocop 2017-02-23 09:32:42 -06:00
Kamil Trzcinski 732a821d4f Fix specs 2017-01-31 22:50:40 +00:00
Adam Niedzielski 82692ea214 Restore backup correctly when "BACKUP" environment variable is passed 2017-01-09 18:38:53 +01:00
Sean McGivern 2fc1e643a7 Fix Backup::Manager#remove_old 2016-12-07 13:27:44 +00:00
David Gerő 0fbb5a86db Add Human Readable Timestamp to backup tar file 2016-11-30 11:41:53 +01:00
bogdanvlviv 96ebc8c4f7 Use `File::exist?` instead of `File::exists?`
Since version ruby-2.2.0, method `File::exists?` is deprecated.
2016-08-11 13:54:45 +03:00
Stan Hu f03df22815 Only create the backup directory if it is local
Closes #12710
2016-06-10 10:17:54 -07:00
Connor Shea 903946c78a
Replace colorize gem with rainbow.
Colorize is a gem licensed under the GPLv2, so we can’t use it in GitLab without relicensing GitLab under the terms of the GPL. Rainbow is licensed under the MIT license and does the exact same thing as Colorize, so Rainbow was added in place of Colorize.

The syntax is slightly different for Rainbow vs. Colorize, and was updated in accordance.

The gem is still a dependency of Spinach, so it’s included in the development/test environments, but won’t be packaged with the actual product, and therefore doesn’t require we relicense the product.

An attempt at relicensing Colorize was made, but didn’t succeed as the library owner never responded.

Rainbow library: https://github.com/sickill/rainbow
Relevant issue regarding licensing in GitLab's gems: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3775
2016-06-03 10:37:09 -06:00
Robert Speicher b826c9ff17 Create the specified remote directory during backup
This is idempotent, so there's no harm calling it if the directory
already exists.

Closes #12710
2016-05-31 13:29:37 -04:00
Kamil Trzcinski 718fe268c4 Improve after review 2016-05-24 22:52:31 -05:00
Kamil Trzcinski 12bd781031 Fix backups if registry is disabled 2016-05-23 14:18:39 -05:00
Kamil Trzcinski 143cd58c39 Added backup of container registry 2016-05-16 17:25:38 -05:00
Jeroen Nijhof 897f18032a Make sure there is a connection before using ActiveRecord 2016-02-08 17:31:24 +01:00
Marin Jankovski 3cc2b48a82 Backup LFS objects same as any upload. 2015-11-19 10:43:45 +01:00
Marin Jankovski bf3c0aafaa USe reject. 2015-11-18 18:14:13 +01:00
Marin Jankovski f5e3d93c28 Check which folders and archives should be packed before passing to tar command. 2015-11-18 13:01:35 +01:00
Kamil Trzcinski d0e3e823a2 Implement Build Artifacts
- Offloads uploading to GitLab Workhorse
- Use /authorize request for fast uploading
- Added backup recipes for artifacts
- Support download acceleration using X-Sendfile
2015-11-10 12:51:50 +01:00
Jacob Vosmaer e789644783 Keep old path: db/database.sql.gz
Documentation elsewhere refers to this internal path, let's keep
it.
2015-10-06 15:21:15 +02:00
Jacob Vosmaer 90ddf140b9 Reduce disk IO during SQL backup
By using light gzip compression we can save a lot of disk IO during
the backup.
2015-10-06 15:06:15 +02:00
Jacob Vosmaer d3734fbd89 Use tar for intermediate backup storage
During the backup we create an intermediate copy of two directories:
builds and uploads. Instead of creating many small files with 'cp
-r', we now use tar (and fast gzip) to create single intermediate
files. This saves on disk IO and disk space while creating a backup.
2015-10-06 14:43:19 +02:00
Paul Beattie 253d2320ab Add support for AWS S3 Server-Side Encryption support
This adds support for AWS S3 SSE with S3 managed keys, this means the
data is encrypted at rest and the encryption is handled transparently to
the end user as well as in the AWS Console. This is optional and not
required to make S3 uploads work.
2015-09-25 17:06:31 +01:00
Kamil Trzcinski 2f2b9f67c2 Fix backup tests 2015-09-16 00:06:41 +02:00
Dmitriy Zaporozhets b118f648cb Merge branch 'master' of github.com:gitlabhq/gitlabhq 2015-08-03 11:04:04 +02:00
Jacob Vosmaer c5aae30773 Set internal backup directory modes on create
This sidesteps problems with running 'chmod' on some CIFS mounts.
2015-07-29 11:18:55 +02:00
Jacob Vosmaer bb50b7fcd0 Allow custom backup archive permissions
This change helps system administrators who want to replicate
GitLab backup files without needing root permissions.
2015-07-06 18:43:17 +02:00
Jeroen Nijhof a7047569db use gitlab not gitlabci 2015-06-09 18:30:38 +02:00
Jeroen Nijhof bf7315cb13 update fog to 1.25.0 and add multipart upload support 2015-06-09 17:56:37 +02:00
Valery Sizov 67c83489ca ability to skip some items in backup 2015-04-02 15:37:50 +03:00
Vinnie Okada 0f78d92e4c Don't use chmod_R for backup tars
When creating backup tar files, only change permissions on the `db`,
`uploads`, and `repositories` directories, not their contents.
2015-03-28 08:38:48 -06:00
Vinnie Okada 083027fc84 Change directory when removing old backups 2015-03-24 20:47:11 -06:00
Vinnie Okada 06aafb7364 Call chdir() with a block 2015-03-19 20:30:19 -06:00
Vinnie Okada 61c06c5e1a Change permissions on backup files
Use more restrictive permissions for backup tar files and for the db,
uploads, and repositories directories inside the tar files.
2015-03-17 19:04:21 -06:00
Dmitriy Zaporozhets 3a324d9c6d Revert "Merge branch 'backup-permissions' into 'master'"
This reverts commit c42262b43b, reversing
changes made to c6586b1283.
2015-03-16 23:51:46 -07:00
Vinnie Okada 8587a29370 Change permissions on backup files
Use more restrictive permissions for backup tar files and for the db,
uploads, and repositories directories inside the tar files.
2015-03-15 13:14:30 -06:00
Dmitriy Zaporozhets 8184a65644 Revert "Fix broken access control and refactor avatar upload"
This reverts commit 7d5f86f6cb.
2015-02-19 08:57:35 -08:00
Hannes Rosenögger 7d5f86f6cb Fix broken access control and refactor avatar upload
This commit moves the note folder from
/public/uploads/note
to
/uploads/note
and changes the uploader accordingly.
Now it's no longer possible to avoid the access control by modifing the url.
The Avatar upload has been refactored to use an own uploader as well
to cleanly seperate the two upload types.
2015-02-16 20:10:15 +01:00
Jacob Vosmaer 7c54c63ac1 Add CRON=1 backup setting for quiet backups 2014-11-20 15:46:04 +01:00
Jacob Vosmaer 02bf992f37 Fail harder in the backup script
This change also shows the output of failed Git commands during the
backup.
2014-10-01 15:43:27 +02:00
Jacob Vosmaer e1f6fa6f18 Add backup upload support to the rake task 2014-09-29 15:03:08 +02:00
Jacob Vosmaer da347d1bb4 Apply the locale encoding to `tar --version`
Fixes a bug with non-UTF8 locales introduced by
2b816075dc.
2014-05-08 18:23:44 +02:00
Jacob Vosmaer 2b816075dc Replace backticks with Gitlab::Popen 2014-03-03 08:40:29 +01:00
Jacob Vosmaer 75f274b750 Use Gitlab::VERSION to version backups
Previous to this commit, backups were tied to the git revision (SHA1) of
the app at the time the backup:create command was invoked. If the SHA1
at the time of restore was different, the script would refuse to restore
the backup.  This commit loosens this tie so that the backup script only
complains if the value of the Gitlab::VERSION constant is different
between the time of backup and the time of restore.
2014-02-27 14:30:41 +01:00