Commit Graph

23 Commits

Author SHA1 Message Date
Kyle Brandt
49f0f0e89e
config: fix connstr for remote_cache (#17675)
fixes #17643 and adds test to check for commented out lines (but will only catch `;`, not `#`).
2019-06-20 10:15:21 -04:00
Mario Trangoni
ab4e1526b3 Codestyle: Fix some goconst issues (#17530)
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2019-06-12 07:27:47 +02:00
Hofls
b3bfbc6f77 Config: Show user-friendly error message instead of stack trace (#16564)
Fixes #16283
2019-04-25 08:29:07 +02:00
Oleg Gaidarenko
db584b3d28
Chore: remove session storage references (#16445)
* Chore: remove session storage references

* Small refactoring of the settings module

* Update docs - remove references for the session storage

* Update config files (sample and default configs)

* Add tests for warning during the config load on defined storage cache

* Remove all references to session storage

* Remove macaron session dependency

* Remove leftovers

* Fix: address review comments

* Fix: remove old deps

* Fix: add skipStaticRootValidation = true to tests

* Fix: improve the docs and warning message

As per discussion in here - https://github.com/grafana/grafana/pull/16445/files#r273026255

* Chore: make linter happy

Fixes #16148
Ref #16114
2019-04-22 18:58:24 +03:00
Torkel Ödegaard
d5d8d7efa6 minor setting refactorings 2018-10-12 07:55:36 +02:00
Nick Triller
f8ca55bb1f Fix setting test 2018-09-17 17:56:52 +02:00
bergquist
8e5000fb31 moves files from /tests to more appropriate folders
ref #11433
2018-09-17 10:10:20 +02:00
Anthony Woods
5c0fbbf7c8 improve remote image rendering (#13102)
* improve remote image rendering

- determine "domain" during Init() so we are not re-parsing settings
  on every request
- if using http-mode via a rednererUrl, then use the AppUrl for the
  page that the renderer loads.  When in http-mode the renderer is likely
  running on another server so trying to use the localhost or even the
  specific IP:PORT grafana is listening on wont work.
- apply the request timeout via a context rather then directly on the http client.
- use a global http client so we can take advantage of connection re-use
- log and handle errors better.

* ensure imagesDir exists

* allow users to define callback_url for remote rendering

- allow users to define the url that a remote rendering service
  should use for connecting back to the grafana instance.
  By default the "root_url" is used.

* improve remote image rendering

- determine "domain" during Init() so we are not re-parsing settings
  on every request
- if using http-mode via a rednererUrl, then use the AppUrl for the
  page that the renderer loads.  When in http-mode the renderer is likely
  running on another server so trying to use the localhost or even the
  specific IP:PORT grafana is listening on wont work.
- apply the request timeout via a context rather then directly on the http client.
- use a global http client so we can take advantage of connection re-use
- log and handle errors better.

* ensure imagesDir exists

* allow users to define callback_url for remote rendering

- allow users to define the url that a remote rendering service
  should use for connecting back to the grafana instance.
  By default the "root_url" is used.

* rendering: fixed issue with renderKey where userId and orgId was in mixed up, added test for RenderCallbackUrl reading logic
2018-09-04 13:42:55 +02:00
Torkel Ödegaard
fa7d7ed5df
Initial Baby Step to refactoring settings from global vars to instance (#11777)
* wip: start on refactoring settings

* settings: progress on settings refactor

* refactor: progress on settings refactoring

* fix: fixed failing test

* settings: moved smtp settings from global to instance
2018-04-30 16:21:04 +02:00
Daniel Lee
533f3a9e8c settings: fixes test
For some reason, the url parse does not fail anymore for curly
braces. Add a colon in the first segment to make sure the url
parse fails.
2018-04-03 19:09:49 +02:00
bergquist
2ccbf12d1c settings: return error instead of ignoring it
closes #11281
2018-03-28 22:32:58 +02:00
Daniel Lee
8973b48f96 setting: add tests for windows 2017-06-28 09:35:33 +02:00
Anton Yackushev
bab21c9069 misspell: Corrected some misspelled words 2017-06-05 15:20:34 +03:00
Soulou
aa064b18e8 Test environment override for secret and url with credentials 2016-06-29 13:49:41 +02:00
Torkel Ödegaard
6b2a4fe8e8 feat(instrumentation): work on settings model for internal metrics publishing, #4696 2016-06-02 14:32:17 +02:00
Torkel Ödegaard
8174b9f041 fix(tests): fixed failling backend test 2015-09-11 08:58:45 +02:00
Torkel Ödegaard
89418a155a More work on email and notification infra #1456 2015-06-05 11:08:19 +02:00
Torkel Ödegaard
6de584aafc Updated to config file finding, and added homepath command line option 2015-04-12 09:15:49 +02:00
Torkel Ödegaard
2020fedfdb Fixed issue with overriding default config values via command line 2015-04-10 10:58:32 +02:00
Torkel Ödegaard
d1767144a8 Reworking configuration loading and overriding 2015-04-09 12:16:59 +02:00
Jason Wilder
b6428b08d0 CLI: Fix config flag being ignored
Passing --config had no effect when passed.  It will now be applied as
the last config file and before any env var overrrides.
2015-02-15 15:06:02 -07:00
Torkel Ödegaard
79f798f67b Configuration file options can now be overriden using environment variables using GF_<SectionName>_<KeyName> syntax, if Section name contains dots in config they are replaced with underscores, and the section name and keyname needs to be all upper case, #1473 2015-02-12 13:31:41 +01:00
Torkel Ödegaard
2c16b0f0f3 added unit test for loading configuration file 2015-02-12 11:55:55 +01:00