Commit Graph

100 Commits (98198dbf5b33b8ddfbe7e3d6ce91db0789d7e81c)

Author SHA1 Message Date
Chris Goller 98198dbf5b Update kapacitor alert rule to have detail field 2017-02-07 17:09:14 -06:00
Chris Goller cfc3bf357f Add BASE_PATH env var to -basepath cli option 2017-01-28 10:47:30 -06:00
Chris Goller 456b02a7b3 Update dashboard swagger definition to use LayoutQuery instead of a string 2017-01-27 19:08:40 -06:00
Tim Raymond ee8b9345e9 Fix typo
Spelling is hard.
2017-01-27 19:31:57 -05:00
Tim Raymond 594c1fc587 Merge branch 'master' into feature/tr-host-under-path
Conflicts:
  - CHANGELOG.md
2017-01-27 19:30:43 -05:00
Tim Raymond 3752affedf Remove extraneous lines
One of these was from experimental work during working on this feature.
The other is just... well, extra.
2017-01-27 19:27:59 -05:00
Tim Raymond 31621b460d Make URLPrefixer use the chronograf.Logger
We have a unified structured logging package in Chronograf, and this
should use it.
2017-01-27 19:24:51 -05:00
Tim Raymond a0ba920046 Move Basepath prop to better match style
Since this is a flag that is being accepted by the application, it makes
sense to group it with the other flags. Also, the `json` struct tag was
a remnant from an earlier attempt at implementing this feature, and is
no longer necessary.
2017-01-27 19:15:56 -05:00
Tim Raymond e3186479cd Move URLPrefixer setup to mux, add default
URLPrefixer had nothing to do with assets, so it actually belongs up in
the mux, where we're assembling handlers together across the
application.

Also, the setup was painful to look at, and others will probably use the
same `Attrs`, so a `NewDefaultURLPrefixer` was added to spawn a prefixer
with only a prefix and a next handler.
2017-01-27 19:14:21 -05:00
Jade McGough e85fed1ddd Merge pull request #808 from influxdata/feature/614-dashboard-view
Feature/614 dashboard view
2017-01-27 15:49:14 -08:00
Tim Raymond 609b7a1d1a Setup front-end to work with a basepath
React-router and also the client that we use in the frontend need to be
informed on how to access the Chronograf backend when it's being hosted
on a route other than /. To accomplish this, a data attribute is written
into the `<div>` which serves as our React root. We then make the React
router aware of this if it's set and also pass the prefix to axios (our
front end HTTP client) by way of window.

Originally, it was desired to have the basepath accessible via an API,
but this proved to be impossible because to access that API, the front
end would already need to know the basepath. The technique we went with
was arrived at independently, but is also used by Jupityr notebooks
which encountered the same problem.
2017-01-27 17:00:08 -05:00
Tim Raymond cf243794af Improve docs on URL Prefixer
These were a little too brief. Hopefully these make it clearer to others
2017-01-27 17:00:08 -05:00
Tim Raymond e6a4635266 Make basepath configureable
/chronograf was hard-coded for developing this feature. This adds a
--basepath flag that lets users configure what the basepath will
actually be
2017-01-27 17:00:08 -05:00
Tim Raymond 9d2e9111ef Make prefixer support multiple tags, chunked enc
The prefixer needs to not only replace `src="` attributes as it
currently does because that is not the only place a relative URL can
appear. It needs to also prefix URLs found in CSS which can also come
from the downstream http.ResponseWriter.

This adds support for an arbitrary list of patterns that will cause the
prefixer to insert its configured prefix. This is currently set to look
for `src`, `href`, and `url()` attributes.

Also, because we are modifying the stream, we need to suppress the
Content-Length generated by any downstream http.Handlers and instead
enable Transfer-Encoding: chunked so that we can stream the modified
response (we don't know apriori how many times we'll perform a
prefixing, so we can't calculate a final Content-Length). This is
accomplished by duplicating the Headers in the wrapResponseWriter that
is handed to the `Next` handler. We also handle the chunking and
Flushing that needs to happen as a result of using chunked transfer
encoding.
2017-01-27 17:00:08 -05:00
Tim Raymond 33256914b3 Add URL Prefixer
In order to support hosting chronograf under an arbitrary path[1], we
need to be able to rewrite all the URLs that are served in HTML and CSS.
Take, for example, the scenario where Chronograf is to be hosted under
`/chronograf` using Caddy and this example Caddyfile:

```
localhost:2020
gzip
proxy /chronograf localhost:8888 {
  without /chronograf
}
```

Chronograf will not load properly when visiting
`http://localhost:2020/chronograf` because the requests for CSS, and
fonts will go to `http://localhost:2020/app-somegianthash.js` when they
should go to `http://localhost:2020/chronograf/app-somegianthash.js`.
This is the essence of issue #721.

To solve this, we add a URLPrefixer http.Handler, that acts as a
middleware. It inserts itself between any upstream handlers, and the
handler that was passed to it as its `Next` parameter and searches for
`src="` attributes. Upon discovering one of these attributes, it writes
the detected attribute and then the configured prefix. It then continues
writing the stream to the upstream http.ResponseWriter until
encountering another attribute until EOF.
2017-01-27 17:00:08 -05:00
Jade McGough 154f6f312c fix dashboards routes 2017-01-27 04:59:13 -08:00
Jade McGough fdb6de3503 fix bugs 2017-01-27 04:51:31 -08:00
gunnaraasen 58a2a82d52 Add X-Chronograf-Version header 2017-01-23 23:29:12 -08:00
Chris Goller a8729df725 Fix kapacitor auth with basic auth in header
Proxying the basic auth via URL path was not working, so, this
places it directly into the header.
2017-01-10 18:51:25 -06:00
Chris Goller a8252b5cda Merge pull request #738 from influxdata/feature/go-orphan-kapacitor
Update source remove to also remove kapacitor and rules resources
2017-01-09 15:49:05 -06:00
Chris Goller 3dc578aa59 Merge pull request #733 from influxdata/feature/go-oauth-gh-orgs
Add Github organization restriction to authentication
2017-01-06 13:27:25 -06:00
Hunter Trujillo 10a0ea1c14 Clarifying operator values. 2017-01-06 10:45:54 -07:00
Chris Goller bc3a0e1b3d Add Github organization restriction to authentication 2017-01-06 11:39:20 -06:00
Chris Goller c852618342 Merge pull request #728 from influxdata/feature/go-insecure-tls
Add insecureSkipVerify option to source to accept all influxdb certs
2017-01-05 16:08:58 -06:00
Chris Goller 18b7dd1932 Fix formatting of swagger.json 2017-01-05 15:59:46 -06:00
Chris Goller 291bab7f16 Update removal of sources to include removing kapacitor and rules resources 2017-01-05 14:47:44 -06:00
Chris Goller bf415e5eea Update kapacitor alert rules to accept inside and outside range 2017-01-04 22:20:12 -06:00
Chris Goller 439a4d32e8 Add insecureSkipVerify option to source to accept all influxdb certs
The insecureSkipVerify defaults to false, but when true, instructs
the server to accept any certificate coming from the InfluxDB server.
2017-01-04 19:35:07 -06:00
Mark Rushakoff 84d28e3aad Miscellaneous lint cleanup 2016-12-20 12:59:56 -08:00
Chris Goller ad2374fbb7 Merge pull request #700 from influxdata/jz-add-uptime
Add server uptime reporting
2016-12-19 16:10:14 -06:00
Jack Zampolin 9994097ebc Address PR comments 2016-12-19 13:29:33 -08:00
Jack Zampolin 3ab2c13364 Add server uptime reporting 2016-12-19 12:09:59 -08:00
Jade McGough 1be3eef2e2 Merge pull request #691 from influxdata/feature/dashboards
Feature/dashboards
2016-12-15 13:54:23 -08:00
Jade McGough 32f1097a7d fix json decoding 2016-12-15 13:53:43 -08:00
Jade McGough ffe9943212 clean up pointer usage 2016-12-15 13:37:11 -08:00
Jade McGough 7d275b9551 add dashboard validation 2016-12-15 13:22:32 -08:00
Jade McGough 00f66e7593 fix bugs 2016-12-15 11:27:06 -08:00
Jade McGough d3e77fd253 wording 2016-12-15 00:41:42 -08:00
Jade McGough eda132df08 add update function for dashboards api 2016-12-15 00:31:53 -08:00
Jade McGough 52e845844f formatting 2016-12-14 12:55:21 -08:00
Jade McGough e8d1094be9 add dashboard creation to API 2016-12-14 12:54:58 -08:00
Jade McGough 8bc8ba151e formatting 2016-12-14 12:12:20 -08:00
Jade McGough 7986ecce3f add dashboard GET and DELETE handlers 2016-12-14 09:37:47 -08:00
Jade McGough 8f939f8fbf omg it compiled 2016-12-13 23:56:26 -08:00
Jade McGough ccf93b4781 fix errors 2016-12-13 22:57:52 -08:00
Jade McGough 4cd1037ce0 update internal.pb.go 2016-12-13 03:07:24 -08:00
Jade McGough 70e64b6baf WIP 2016-12-08 19:28:40 -08:00
Chris Goller 34b79fd0eb Fix Content-Type of the index.html page to be text/html 2016-12-08 21:03:11 -06:00
Chris Goller a073f26078 Merge pull request #673 from influxdata/remove_endpoint
removing unimplemented endpoint from swagger
2016-12-08 17:23:38 -06:00
Jade McGough 7393e4b321 removing unimplemented endpoint from swagger 2016-12-08 15:12:39 -08:00