Commit Graph

62 Commits

Author SHA1 Message Date
Jarka Kadlecova 43ff738641 Support uploaders for personal snippets comments 2017-05-02 15:22:24 +02:00
blackst0ne ad27f20426 Periodically clean up temporary upload files to recover storage space 2017-04-10 08:48:44 +11:00
Robert Speicher 5c41338fa3 Handle relative and absolute Upload paths in the Uploaders 2017-03-06 14:41:10 -05:00
Robert Speicher 3a0be1c5fc Add `RecordsUploads` module to record Upload records via callbacks 2017-03-06 14:41:09 -05:00
Robert Speicher a8c62dfe5c Minor refactoring of Uploaders
- Moves a duplicate `file_storage?` definition into the common
  `GitlabUploader` ancestor.
- Get the `uploads` base directory from a class method rather than
  hard-coding it where it's needed. This will be used in a subsequent MR
  to store Uploads in the database.
- Improves the specs for uploaders.
2017-02-24 16:41:27 -05:00
Douwe Maan b7d8df503c Enable Style/MutableConstant 2017-02-23 09:31:56 -06:00
Robert Speicher dd944bf14f Merge branch 'svg-xss-fix' into 'security'
Fix for XSS vulnerability in SVG attachments

See https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2059
2017-02-15 10:42:13 -05:00
Jacob Vosmaer ec273b8d06 Copy, don't move uploaded avatar files 2017-01-03 15:37:32 +01:00
Jacob Vosmaer 6731ab5d76 Add Gitlab::Middleware::Multipart 2016-12-15 12:26:36 +01:00
Andre Guedes c6acc7ed43 Render SVG as images in notes 2016-12-08 00:29:43 -02:00
Yorick Peterse 5371da341e
Remove event caching code
Flushing the events cache worked by updating a recent number of rows in
the "events" table. This has the result that on PostgreSQL a lot of dead
tuples are produced on a regular basis. This in turn means that
PostgreSQL will spend considerable amounts of time vacuuming this table.
This in turn can lead to an increase of database load.

For GitLab.com we measured the impact of not using events caching and
found no measurable increase in response timings. Meanwhile not flushing
the events cache lead to the "events" table having no more dead tuples
as now rows are only inserted into this table.

As a result of this we are hereby removing events caching as it does not
appear to help and only increases database load.

For more information see the following comment:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6578#note_18864037
2016-11-23 14:17:07 +01:00
winniehell 58c562a951 Remove magic comments from Ruby files (!5456) 2016-07-24 07:08:45 +02:00
Rémy Coutable 6b7e9c7655
Remove VideoJS and clean the integration
Handle videos in:
- MD preview in notes: commit, issue/MR, MR diff
- New notes in: commit, issue/MR, MR diff
- Persisted notes in: commit, issue/MR, MR diff

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-07-20 11:36:42 +02:00
Rémy Coutable 29ea8d09e0 Remove duplication, useless rescue, and avoid using ActionView
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-07-19 18:51:09 +02:00
Rémy Coutable 356b2d2bd7 Get rid of `is_image` in FileUploader
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-07-19 18:51:09 +02:00
Eric Hayes c266c7fa18 First support of videos in issues, MRs and notes
* Registered video MIME types
* Currently supporting browser-supported formats with extensions that match the mime type
2016-07-19 18:51:09 +02:00
James Lopez 76771c2946 squashed - added avatar saver/restorer and specs
added spec for avatar saver

avatar saver!

added avatar restorer spec

fix spec

added avatar restorer class

fix export service

fix warnings, added changelog

fix spec

some refactoring based on feedback

fixed a few issues after testing i/e avatar
2016-07-19 13:06:06 +02:00
Grzegorz Bizon 28bafd5354 Enable Style/SpaceAfterComma Rubocop cop 2016-06-29 15:23:44 +02:00
Grzegorz Bizon b9f5719285 Remove reduntant `move_to_store` override 2016-03-30 12:50:19 +02:00
Grzegorz Bizon 99ee822857 Add method that returns markdown in file uploader 2016-03-30 10:56:25 +02:00
Grzegorz Bizon 0b8cefd3b2 Get FileUploader into test harness using factory
This attempts to get CarrierWave's uploader - `FileUploader` into test
harness using a factory. that makes it easier to build an instance of
it.

Along with !3435 it may be easier to use uploaders in tests
2016-03-30 10:44:18 +02:00
Grzegorz Bizon cff3497f2c Add markdown pattern for uploads to file uploader 2016-03-30 10:44:18 +02:00
Rémy Coutable 1714883107 Revert "Merge branch 'avatar-cropping' into 'master' "
This reverts commit 01160fc061, reversing
changes made to 4bff9daf8b.
2016-03-15 14:55:40 +01:00
Johann Pardanaud 0701b70c9c Minor changes on avatar cropping internals
- Avoid multiple calls to `validates` for the avatar attributes.
- In a cropping process, don't check if the model inherits `User`, check if it responds to `:avatar_crop_size`.
2016-02-18 13:12:39 +01:00
Johann Pardanaud bf6aa15512 Improve avatar cropping internals, based on suggestions made by @rspeicher on !2773 2016-02-17 18:35:16 +01:00
Johann Pardanaud 78588cfca1 Improve user experience for avatar cropping
- Avoid incomprehensible errors on non-integer cropping values
- Set the default cropping area to 80%
2016-02-16 19:50:23 +01:00
Johann Pardanaud 3ca16ec2ec Fix failing tests introduced in commit 6d58088 2016-02-10 13:09:13 +01:00
Johann Pardanaud 6d5808801f Fix #7959: Fix avatar stretching by providing a cropping feature 2016-02-09 22:26:50 +01:00
Kamil Trzcinski ac652d82f1 Let the CI runner know about builds that this build depends on
This allows us to implement artifacts passing: runner will download artifacts from all prior builds
2016-01-14 19:45:55 +01:00
Douwe Maan 0614793b38 DRY up upload and download services 2016-01-08 17:38:53 +01:00
Grzegorz Bizon 504696453b Add hotfix that allows to access build artifacts created before 8.3
This is a temporary hotfix that allows to access build artifacts created
before 8.3. See #5257.

This needs to be changed after migrating CI build files.

Note that `ArtifactUploader` uses `artifacts_path` to create a storage
directory before and after parsisting `Ci::Build` instance, before and
after moving a file to store (save and fetch a file).
2015-12-29 09:51:19 +01:00
Kamil Trzcinski 11728b50f9 Expose artifacts path 2015-11-23 13:05:22 +01:00
Dmitriy Zaporozhets 1328e4b504 Merge branch 'refactor-duplication' into 'master'
Remove some code duplication

* remove duplicate code in uploaders
* remove duplicate code in NotificationHelper
* remove duplicate code in Repository


Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

See merge request !1800
2015-11-16 13:05:49 +00:00
Dmitriy Zaporozhets 796bb65170 Remove duplicate methods in uploaders
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-16 13:01:34 +01:00
Marin Jankovski 14032d8eb1 Add support for git lfs. 2015-11-16 12:39:13 +01:00
Kamil Trzcinski 445cdb7579 Move tmp artifacts to shared/artifacts/tmp/. Check for GitLab-Workhorse now 2015-11-10 12:51:51 +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
Valery Sizov 8f584d5f2c Fix: Images cannot show when projects' path was changed 2015-10-14 18:50:35 +03:00
Douwe Maan 7f1adc3d9c Fix URL to uploaded file. 2015-02-20 16:01:37 +01:00
Douwe Maan 218283b368 Merge branch 'extend_markdown_upload' into generic-uploads
# Conflicts:
#	app/controllers/files_controller.rb
#	app/controllers/projects/uploads_controller.rb
#	app/uploaders/attachment_uploader.rb
2015-02-20 15:37:37 +01:00
Douwe Maan 4ef6ffaad3 Split up AttachmentUploader. 2015-02-20 15:19:50 +01: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
Douwe Maan ab65be7a2f Use longer upload secret. 2015-02-17 22:23:31 +01:00
Douwe Maan d2ebdf664b Refactor. 2015-02-17 22:23:31 +01:00
Hannes Rosenögger 9729cc584f implement Project::UploadsController 2015-02-17 22:21:13 +01:00
Hannes Rosenögger 9bf8480b4a Generalize the image upload in markdown
This commit generalizes the image upload via drag and drop so it supports all files.
It also adds access control for these files.
2015-02-17 22:20:44 +01: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
Marin Jankovski db585009be Revert "Merge pull request #7349 from srna/patch-1"
This reverts commit b37b71d887, reversing
changes made to 42a1d8083c.
2014-12-05 15:33:22 +01:00
Tomas Srna 733012cb65 Removed + '' + 2014-10-29 10:52:54 +01:00
Tomas Srna 1072c95180 Attachment URL with non-/ relative root
The attachment URL was not working with relative_url_root not equal to '/'. I suggest this fix.
2014-07-22 13:29:41 +02:00