Improves how we handle symlinks in plugin management.
(cherry picked from commit 04df634ef5)
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
* Plugins: Use a Grafana specific SDK logger implementation for core plugins (#51229)
Upgrade grafana-aws-sdk to v0.10.6
(cherry picked from commit a8eb29f1d7)
* fix go.mod go.sum
* Extend template and generate
* Generate and fix up alertmanager endpoints
* Prometheus routes
* fix up Testing endpoints
* touch up ruler API
* Update provisioning and fix 500
* Drop dead code
* Remove more dead code
* Resolve merge conflicts
(cherry picked from commit 0d9389e1f4)
* Alerting: Don't stop the migration when alert rule tags are invalid
As we migrate we expect the `alertRuleTags` on a dashboard alert to be a JSON object. However, it seems this is not really validated by Grafana and an user can change the format to something else that the JSON parser is not able to marshal into a `map[string]string`.
Let's do a bit better by "attempting" to parse the tags and if we can't we'll simple return an empty map. The data is still there so if the user wishes they can go back, fix the data and attemp the migration again.
(cherry picked from commit 90646e7f41)
* Chore: Remove global bus variable (#50765)
* Chore: Remove global bus variable
* fix bus in tests
(cherry picked from commit 0b55c41d05)
* fix the imports
* Algorithm to fix up receivers
* Extract for tests
* Add tests, fix bug
* Add test which demonstrates how it fixes up broken groups
* Fix package prefix
(cherry picked from commit 9bbfeedadf)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
* use etag header for previews
* use unix millis rather than tz-dependant string
(cherry picked from commit 644503f5e6)
Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com>
* Bug: Fix delete dashboard snapshot for deleted dashboards
* Fix lint and make it work for all the errors
* Fix lint
(cherry picked from commit 8ab8ce609b)
Co-authored-by: idafurjes <36131195+idafurjes@users.noreply.github.com>
* Pass on request body
* Fix GETs and add tests
* Fix err handling
* Add comments
* Close response body
* Fix lint maybe
* Fix test
(cherry picked from commit 07be95a001)
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
Earlier we only allowed symlinks in plugins starting with grafana- in zip archives when
installing plugins using the grafana-cli. This changes so that symlinks in zip archives
containing relative links to files in the zip archive are always allowed when installing
plugins. The reasoning behind this is that Grafana per default doesn't load a plugin
that has an invalid plugin signature meaning that any symlink must be included in
the plugin signature manifest.
Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
(cherry picked from commit b47ec36d0d)
* backend/api: refactor PlaylistId to PlaylistUid
* Add org_id to Get and Update playlist functions
Fix migration - no longer pad the uid; fix mysql syntax
The relevant tests are passing using postgres, mysql and the default sqllite backends, but there are a number of other failing tests when using postgres and myself so I'm not entirely confident with those results.
* fix bad query in GetPlaylistItem and add a test that would have caught the mistake in the first place. Reverted the playlist_uid column addition in playlist_item; it became unnecessary after this PR.
Added default value to the new UID column based on PR feedback.
* break this PRs migration into its own function
* Playlists: Update UI to use the updated API
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
(cherry picked from commit a33a023629)
Co-authored-by: Kristin Laemmert <mildwonkey@users.noreply.github.com>
* OAuth: Redirect to login if no oauth module is found or if module is not
configured
* OAuth: Update test to check for location header
(cherry picked from commit 95a4c4a4d6)
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
* Make inheritance permission migration more robust
* Better fix
* Add more tests to the migration
* Add removed test case
* Add test case for empty role in empty org
* Handling the role.ID 0 case with a log
Co-authored-by: Jguer <joao.guerreiro@grafana.com>
Co-authored-by: Jguer <joao.guerreiro@grafana.com>
(cherry picked from commit 307a0d4538)
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
* pass on all headers except for accept headers
* touch up and testing
* add custom header values to resource queries
* remove my picture. oops
* handle gzip responses as well
* fix linting issues
* add my space
* no lint
* removed cookies from being proxied
* clean up and handle errors from io.reader.Close() calls
(cherry picked from commit 49dc9da9c1)
Co-authored-by: Stephanie Closson <srclosson@gmail.com>