Commit Graph

227 Commits (9856c61b2630239ac75cc4dd6bbcb0bf0eb066d4)

Author SHA1 Message Date
Jade McGough 46b62c2569 add links to retentionpolicy swagger 2017-03-20 11:52:49 -07:00
Jade McGough 12b2d4908a add links to database swagger object 2017-03-20 11:48:25 -07:00
Chris Goller 79b1e9ae5e Fix reporting stats to update uptime 2017-03-17 09:59:52 -05:00
Jade McGough 862802710e add example for retention policy 2017-03-14 16:53:41 -07:00
Jade McGough b72e03cf23 fix swagger errors, add tags 2017-03-14 16:44:44 -07:00
Jade McGough 5f2e3b5d15 db rp server endpoint objects 2017-03-14 16:05:13 -07:00
Jade McGough 59b45388a6 first whack at db rp server endpoints 2017-03-14 15:31:57 -07:00
Jade McGough 64d5e822e4 db rp documentation WIP 2017-03-14 14:01:28 -07:00
Andrew Watkins e61b8f73e8 Make name not required 2017-03-13 15:15:01 -07:00
Chris Goller a25a362360 Add ping and detection of influxdb source types 2017-03-13 16:45:05 -05:00
Chris Goller 43a12023f6 Update user's roles validation 2017-03-10 18:06:06 -06:00
Chris Goller 07ec40c94b Update roles to check if role already exists 2017-03-10 17:24:52 -06:00
Chris Goller b93cf4ca94 Add ability to update roles on a user resource 2017-03-10 16:52:24 -06:00
Chris Goller 6158502e45 Fix updating of OSS user permissions 2017-03-10 14:53:30 -06:00
Chris Goller e8da54a6c3 Update user/role responses to return empty arrays 2017-03-10 13:24:48 -06:00
Chris Goller 49d8ece940 Add structured logging to underlying http server 2017-03-06 15:16:45 -06:00
Chris Goller 9ac300cf19 Update to fix go linter issues 2017-03-06 10:11:52 -06:00
Chris Goller 03b6d4ce60 Update swagger documentation for roles and users examples 2017-03-01 19:39:03 -06:00
Chris Goller 51c65f9111 Update InfluxEnterprise users to return their roles 2017-03-01 19:13:44 -06:00
Chris Goller 3947d5181f Update schema for /permissions endpoint to have scopes 2017-02-27 13:31:38 -06:00
Chris Goller e1764a7c02 Update source timeseries client to change if meta server is set 2017-02-24 14:48:42 -06:00
Chris Goller 1f9be2e4aa Merge branch 'master' into feature/#54-tr-enterprise-client
Conflicts:
	bolt/internal/internal.pb.go
2017-02-24 13:02:32 -06:00
Chris Goller 701a041a88 Merge branch 'master' into feature/connection-info#825
Conflicts:
	CHANGELOG.md
2017-02-24 11:29:43 -06:00
Chris Goller 1f878aa6d9 Fix enterprise create user to add permissions 2017-02-24 01:16:28 -06:00
Chris Goller b8fa581248 Enhance server logging for connection errors 2017-02-24 00:34:50 -06:00
Chris Goller f60a358751 Merge branch 'master' into feature/#54-tr-enterprise-client
Conflicts:
	Makefile
	chronograf.go
	server/routes.go
	server/users.go
2017-02-23 23:26:09 -06:00
Chris Goller 6581dc7ec2 Add roles endpoint and switching between OSS and enterprise 2017-02-23 21:54:20 -06:00
Chris Goller b29846da68 Merge pull request #922 from influxdata/feature/oauth-google
Support Multiple OAuth2 Providers - Add Heroku and Google
2017-02-23 17:34:01 -06:00
Tim Raymond 6a9e61c740 Merge branch 'master' into feature/oauth-google
Conflicts:
	server/dashboards.go
	server/server.go
	ui/.eslintrc
	ui/src/index.js
2017-02-23 18:13:39 -05:00
Jared Scheib 6c67dcf402 Merge 'master' into 751-stack_graph, resolve conflicts 2017-02-23 14:33:07 -08:00
Tim Raymond 1b5b568d2a Move OAuth configuration into server/server.go
This uses a provide() function in server/server.go, to push the
necessary oauth2.Provider and oauth2.Mux into the scope of the
server.Mux. This allows the server.Mux to configure its routes without
caring which Providers are enabled, which switches/ENVs are set etc. It
configures its routes optimistically and leaves the higher-order logic
to decide whether to actually invoke the logic used by the mux to
configure routes for that provider.
2017-02-23 17:17:28 -05:00
Jared Scheib b7f4909685 Add stacked and stepplot graph display options as new types to canned Docker graphs and swagger def 2017-02-23 14:08:45 -08:00
Chris Goller 08271f25ef Add roles to chronograf 2017-02-23 16:02:53 -06:00
Chris Goller 10b0e1f623 Add examples for most swagger JSON schemas 2017-02-22 12:52:55 -06:00
Chris Goller fbba020f64 Update swagger to include users and permissions endpoints 2017-02-22 11:35:19 -06:00
Chris Goller 9220cc2e56 Add dashboards PATCH for incremental update of name or cells 2017-02-22 11:08:50 -06:00
Chris Goller a25da605e3 Update dashboards to have a minimum width/height of 4 2017-02-22 11:05:20 -06:00
Chris Goller b5ebadaf45 Add tests to sources/users endpoints 2017-02-21 23:54:24 -06:00
Chris Goller de7d01fe06 Add tests for /me endpoint 2017-02-21 21:36:23 -06:00
Chris Goller 83887a8cea Update comments for go vet 2017-02-21 21:35:24 -06:00
Tim Raymond 22a556e964 Add organization restriction on Heroku provider
This allows operators to permit access to Chronograf only to users belonging
to a set of specific Heroku organizations. This is controlled using the
HEROKU_ORGS env or the --heroku-organizations switch.
2017-02-21 13:09:42 -05:00
Chris Goller 9f86ce209f Fix server tests with additional links 2017-02-19 14:37:45 -06:00
Chris Goller a7fabd4ecb Add permissions endpoint to get all possible permission strings 2017-02-19 14:00:34 -06:00
Chris Goller 74522fd030 Refactor Influx OSS users 2017-02-19 00:54:52 -06:00
Chris Goller b33a32d69d Add routes for users 2017-02-17 20:47:23 -06:00
Chris Goller 0828b47e45 Add permissions to users 2017-02-17 16:03:49 -06:00
Chris Goller b304ac256e Add get of all users for a data source 2017-02-17 15:13:51 -06:00
Chris Goller 3fac8f2707 Add GET/POST handlers for source users 2017-02-17 14:33:10 -06:00
Chris Goller 72d9f19e6f Refactor proxy into influx 2017-02-17 14:02:02 -06:00
Chris Goller 3ef3d171d4 Update users to be go 1.7 compatible 2017-02-17 13:52:21 -06:00
Chris Goller 2a2e188560 Refactor users and add client usersstore 2017-02-17 13:37:00 -06:00
Tim Raymond f48487771c Rename JWTMux to CookieMux
JWTMux was a disingenuous name because while JWTs are a very good choice
for a cookie encoding, they were not strictly required for use with this
mux. To better indicate the responsibilities of this mux, it's been
renamed "CookieMux," since its responsibilities end with persisting the
oauth2.Authenticator's encoded state in the browser. It is up to the
oauth2.Authenticator to choose the encoding.
2017-02-17 12:57:08 -05:00
Tim Raymond 9a0b4d6251 Configure Mux to use Heroku OAuth2 provider
If a --token-secret, --heroku-client-id, and --heroku-secret are
provided to Chronograf, it will add Heroku as an OAuth2 provider. These
tokens can be obtained (as of this writing) by visiting your "manage
account" page, navigating to "Applications," and then clicking "Register
New API Client" under the "API Clients" section.
2017-02-16 12:56:59 -05:00
Chris Goller fa36ac6149 Add unified OAuth2 logout route redirecting to provider logout
Signed-off-by: Tim Raymond <tim@timraymond.com>
2017-02-15 16:29:13 -06:00
Chris Goller 4039bfea0c Add routes for oauth providers 2017-02-15 14:07:33 -06:00
Hunter Trujillo 1e4c7a4d5a Add frontend support for OAuth changes. 2017-02-15 11:57:52 -07:00
Chris Goller 2d691bb694 Add --public-url CLI option to support google oauth redirect uri 2017-02-14 23:34:15 -06:00
Chris Goller ae5e4edacf Add google oauth provider. Need redirect_uri 2017-02-14 23:11:11 -06:00
Chris Goller 9c3ffed99e Remove unneeded authenticator from github 2017-02-14 23:09:34 -06:00
Tim Raymond 09e8063131 Reorganize OAuth2 Logic
Created an oauth2 package which encapsulates all oauth2 providers,
utility functions, types, and interfaces. Previously some methods of the
Github provider were used as http.HandlerFuncs. These have now been
pulled into a concrete type called a JWTMux to implement other Oauth2
providers.

JWTMux has all of the functionality required to take a token from any
provider and store it as a JWT in a browser, and that is the extent of
its responsibilities. It implements the oauth2.Mux interface which would
potentially allow other strategies of oauth2 credential storage.
2017-02-14 16:18:41 -05:00
Chris Goller f5ec601e77 WIP 2017-02-13 18:02:43 -06:00
Chris Goller c8474ca66b WIP 2017-02-13 08:45:37 -06:00
Chris Goller 3d8de02463 Fix go vet commiting of NewListener 2017-02-12 21:48:12 -06:00
Chris Goller df65557412 Add TLS w/ env vars TLS_CERTIFICATE/TLS_PRIVATE_KEY 2017-02-12 21:33:27 -06:00
Chris Goller 996b46d015 Add HSTS handler to add headers for upcoming TLS support 2017-02-12 18:21:49 -06:00
Chris Goller 97a2206869 Update chronograf sources response 2017-02-12 16:38:05 -06:00
Chris Goller 6d495b1d1d Fix swagger JSON formatting 2017-02-10 13:57:12 -06:00
Chris Goller a0352b1e7d Add disable and enable to kapacitor alerts 2017-02-10 13:48:42 -06:00
Chris Goller ffd743a1b0 Merge pull request #859 from influxdata/feature/server-gzip
Add gzip compression to all of our server responses and caching for assets
2017-02-10 10:27:21 -06:00
Jade McGough a7742fb9c1 add metaURL to source 2017-02-09 23:14:04 -06:00
Jade McGough 621fc03975 add metaUrl to swagger 2017-02-09 23:11:51 -06:00
Chris Goller ce5e104a59 Fix url_prefixer to write asset headers 2017-02-09 17:13:34 -06:00
Chris Goller d1114ee76d Add gzip compression to all of our server respones 2017-02-09 14:35:38 -06:00
Chris Goller 4d37da2d0a Update swagger spec to include alertNodes for kapacitor 2017-02-09 00:50:59 -06:00
Chris Goller 926dfae5c8 Add kapacitor alert node structs 2017-02-08 22:18:23 -06:00
Chris Goller a4aa900bf8 Merge pull request #852 from influxdata/feature/kapacitor-detail-field
Update kapacitor alert rule to have detail field
2017-02-08 20:50:48 -06:00
Chris Goller 7d0b7781d4 Update kapacitor alert rule to have detail field 2017-02-07 17:09:14 -06:00
Chris Goller 75cd6cebff Remove explorations from backend server 2017-02-01 15:09:02 -06:00
Chris Goller 2290d5b6de Add BASE_PATH env var to -basepath cli option 2017-01-28 10:47:30 -06:00
Chris Goller 97ee53f49d Update dashboard swagger definition to use LayoutQuery instead of a string 2017-01-27 19:08:40 -06:00
Tim Raymond c7f31a5074 Fix typo
Spelling is hard.
2017-01-27 19:31:57 -05:00
Tim Raymond 2102b779f4 Merge branch 'master' into feature/tr-host-under-path
Conflicts:
  - CHANGELOG.md
2017-01-27 19:30:43 -05:00
Tim Raymond 99bd4f369a 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 0c02aeedc0 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 2fed6f92be 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 2b6a05cf6f 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 f6fe95827d Merge pull request #808 from influxdata/feature/614-dashboard-view
Feature/614 dashboard view
2017-01-27 15:49:14 -08:00
Tim Raymond 8425d2c3ed 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 2dfc52069e 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 17ca110a11 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 14437af28d 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 4064817ac8 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 203088830c fix dashboards routes 2017-01-27 04:59:13 -08:00
Jade McGough 626ee4081e fix bugs 2017-01-27 04:51:31 -08:00
gunnaraasen 4bef66aff7 Add X-Chronograf-Version header 2017-01-23 23:29:12 -08:00
Chris Goller c287f9d244 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 587c87fd9d 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 ed4498b07e 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 935fc66cab Clarifying operator values. 2017-01-06 10:45:54 -07:00
Chris Goller 636ebedf22 Add Github organization restriction to authentication 2017-01-06 11:39:20 -06:00