Commit Graph

89 Commits (7edd10b541013222292947db4a22877c831e7863)

Author SHA1 Message Date
Jared Scheib 7e8018782e Merge branch 'master' into feature/persist_datasource_flag-1555 2017-07-07 14:45:00 -07:00
Tim Raymond d9bfa23660 Fix bad merge conflict resolution
Duplicate definitions of the same property were present because of
confusing placement of merge conflict markers.
2017-07-07 16:59:19 -04:00
Tim Raymond 6be0cafd3a Merge master into feature/tr-auth0-organizations
Conflicts were the addition of CLI flags from a concurrent branch.
2017-07-07 16:18:01 -04:00
Jared Scheib 965d72ea3f Correct comment 2017-07-06 15:04:04 -07:00
Jared Scheib a8c816085e Refactor process new sources into named func 2017-07-06 14:27:14 -07:00
Jared Scheib 1c72fd338b Move NewSources input prep to server
Signed-off-by: Tim Raymond <tim@timraymond.com>
2017-07-06 14:12:07 -07:00
Jared Scheib 8707659688 Allow server to run even if NewSources errors out 2017-07-06 12:05:05 -07:00
Jared Scheib 3d6048be2e Update error messages to use plural 2017-07-06 11:48:14 -07:00
Jared Scheib 1ca0315f67 Add sample usage
Make flag identifier plural since JSON array of objects
2017-07-06 11:44:42 -07:00
Jared Scheib eb762dda86 Successfully persist new source and kapa via server flag
Move this to after BoltDb connection is opened
2017-07-05 18:12:08 -07:00
Tim Raymond fc6e3f87ec Parse JSON for --new-source into struct
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-07-05 15:00:59 -07:00
Jared Scheib 6bc6324eb6 Add pseudocode outline for parsing and persisting source and server
Signed-off-by: Tim Raymond <tim@timraymond.com>
2017-06-29 15:33:22 -07:00
Jared Scheib 8fa81c9541 Group flags more semantically consistently 2017-06-29 14:27:30 -07:00
Jared Scheib 49eaccda81 Group flags more semantically consistently 2017-06-29 14:25:41 -07:00
Jared Scheib 079ca3c235 Improve description of custom link use, and give example (#1676) 2017-06-28 14:41:13 -07:00
Tim Raymond 734414c479 Support Organizations in Auth0
It's useful for operators to classify users into separate groups which
we have termed "organizations". For other OAuth providers, the notion of
an organization typically fell along company lines. For example,
MegaCorp might have a "MegaCorp" GitHub organiztion, and all email
addresses would have the domain "megacorp.com".

Auth0 is slightly different in that MegaCorp would likely run their own
Auth0 provider for their internal services, so "organizations" in Auth0
are no longer synonymous with "large organizations" (or companies).
Instead, Auth0 organizations could be used to restrict access to
Chronograf instances based on team membership within an organization.

To make use of Auth0 organizations, operators should modify users'
app_metadata to include the key "organization". Its value should be the
organization which that user belongs to. This can be done automatically
through arbitrary rules using Auth0 Rules.
2017-06-28 16:29:52 -04:00
Jared Scheib 21fab035c2 Error out server if CustomLinks invalid on run
Signed-off-by: Chris Goller <goller@gmail.com>
2017-06-27 13:31:35 -07:00
Jared Scheib 90aaa8104d Refactor CustomLinks transform into routes.go and new links.go
Rename generateCustomLinks to NewCustomLinks
Handle error from NewCustomLinks per app convention
2017-06-26 15:30:33 -05:00
Jared Scheib 7d6eaf925a Generate custom links from env var and multiple CLI flags
Signed-off-by: Chris Goller <goller@gmail.com>
2017-06-26 11:48:47 -07:00
Jared Scheib 613dcc64ac WIP Parse custom links from CLI 2017-06-23 15:12:02 -07:00
Tim Raymond 07a3dceb2f Add Auth0 to supported OAuth2 providers
Auth0 is an OpenID Connect compliant OAuth2 provider, so we're able to
re-use the generic OAuth2 provider to implement it. The routes required
by Auth0 have been hardcoded for user convenience.

Also, Auth0 requires users to register a subdomain of auth0.com when
signing up. This must be provided to chronograf through the
`--auth0-domain` parameter (or `AUTH0_DOMAIN` ENV). This is **distinct**
from the `PUBLIC_URL`. For example, for a Chronograf hosted at
`http://www.example.com`, and an Auth0 domain of
`http://oceanic-airlines.auth0.com`, a client-id of `notpennysboat` and a
client-secret of `4-8-15-16-23-42`, the command line options would look
like:

```
chronograf \
  --auth0-domain=http://oceanic-airlines.auth0.com \
  --auth0-client-id=notpennysboat \
  --auth0-secret=4-8-15-16-23-24
  --public-url=http://www.example.com
  -t `uuidgen`
```
2017-06-21 10:20:46 -04:00
Timothy J. Raymond 21c3f78fe3 Merge pull request #1619 from pragkent/generic-oauth-redirect-url
Add redirect url to generic oauth
2017-06-21 10:19:03 -04:00
Kent Wang fdcbd6badc Fix generic redirect URL 2017-06-21 12:19:21 +08:00
Kent Wang 55093d720d Replace string concat to path.Join 2017-06-18 10:47:02 +08:00
Kent Wang 25958a017e Don't pass RedirectURL if PublicURL not set 2017-06-18 10:40:07 +08:00
Jared Scheib 06dd8a7a3d Update default JSON feed URL to final, secure link 2017-06-16 14:23:46 -07:00
Kent Wang b4627983b9 Add redirect url to generic oauth 2017-06-16 17:35:57 +08:00
Jared Scheib 7e359239e5 Refactor statusFeedURL to be set in CLI 'default'
Reverts to a clean separation of concerns between mux.go vs AllRoutes
AllRoutes now expects a StatusFeed url directly
2017-06-15 13:51:22 -07:00
Jared Scheib 25bde527a6 Add status-feed-url build flag within new externalLinks prop in AllRoutes 2017-06-13 13:40:20 -07:00
Tim Raymond & Jared Scheib 337c7b16a5 Fix OAuth when using Basepath
Updated the logout link in the UI to use a link provided by the
/chronograf/v1/ endpoint. We also replaced many instances of string
concatenation of URL paths with path.Join, which better handles cases
where prefixed and suffixed "/" characters may be present in provided
basepaths. We also refactored how Basepath was being prefixed when using
Auth. Documentation was also updated to warn users that basepaths should
be applied to the OAuth callback link when configuring OAuth with their
provider.
2017-05-08 14:40:50 -07:00
Jared Scheib 9c7fb0904b Notify user about --prefix-routes when using --basepath 2017-05-08 14:40:50 -07:00
Chris Goller d643907a6e Merge branch 'master' into feature/reverse-kapa 2017-04-11 12:52:49 -05:00
Fred Cox 183a0e0f28 Fix env var name for Google client secret 2017-04-11 16:48:35 +03:00
Chris Goller 84f1263357 Add configurable scopes to generic oauth2 support 2017-04-07 14:58:35 -05:00
Chris Goller 4a56fdddfc Add generic oauth2 configuration options 2017-04-06 16:45:33 -05:00
Jared Scheib 9df1630cf8 Add new auth duration CLI option; add client heartbeat; fix logout (#1119)
* User can now set oauth cookie session duration via the CLI to any duration or to expire on browser close

* Refactor GET 'me' into heartbeat at constant interval

* Add ping route to all routes

* Add /chronograf/v1/ping endpoint for server status

* Refactor cookie generation to use an interface

* WIP adding refreshable tokens

* Add reminder to review index.js Login error handling

* Refactor Authenticator interface to accommodate cookie duration and logout delay

* Update make run-dev to be more TICKStack compliant

* Remove heartbeat/logout duration from authentication

* WIP Refactor tests to accommodate cookie and auth refactor

* Update oauth2 tests to newly refactored design

* Update oauth provider tests

* Remove unused oauth2/consts.go

* Move authentication middleware to server package

* Fix authentication comment

* Update authenication documentation to mention AUTH_DURATION

* Update /chronograf/v1/ping to simply return 204

* Fix Makefile run-dev target

* Remove spurious ping route

* Update auth docs to clarify authentication duration

* Revert "Refactor GET 'me' into heartbeat at constant interval"

This reverts commit 298a8c47e1.

Conflicts:
ui/src/index.js

* Add auth test for JWT signing method

* Add comments for why coverage isn't written for some areas of jwt code

* Update auth docs to explicitly mention how to require re-auth for all users on server restart

* Add Duration to Validation interface for Tokens

* Make auth duration of zero yield a everlasting token

* Revert "Revert "Refactor GET 'me' into heartbeat at constant interval""

This reverts commit b4773c15af.

* Rename http status constants and add FORBIDDEN

* Heartbeat only when logged in, notify user if heartbeat fails

* Update changelog

* Fix minor word semantics

* Update oauth2 tests to be in the oauth2_test package

* Add check at compile time that JWT implements Tokenizer

* Rename CookieMux to AuthMux for consistency with earlier refactor

* Fix logout middleware

* Fix logout button not showing due to obsolete data shape expectations

* Update changelog

* Fix proptypes for logout button data shape in SideNav
2017-04-06 11:40:57 -07:00
Chris Goller 21c1c90ca3 Merge branch 'master' into feature/reverse-kapa 2017-04-05 20:05:25 -05:00
Chris Goller e83d95b937 Update kapacitors rule's to use AST and kapacitor directly 2017-04-05 20:04:42 -05:00
Tim Raymond d75ee187e6 Add parameter to control mounting behavior
Some load balancers will strip prefixes on their way to the chronograf
backend, others won't. The "--prefix-routes" parameter forces all
requests to the backend to have the prefix specified in "--basepath".
Omitting it will only cause routes to be rewritten in rendered
templates and assumes that the load balancer will remove the prefix.

Use with Caddy
==============

An easy way to test this out is using the free Caddy http server at
http://caddyserver.com.

This Caddyfile will work with the options `--basepath /chronograf
--prefix-routes` set:

```
localhost:2020 {
  proxy /chronograf localhost:8888
  log stdout
}
```

This Caddyfile will work with only the option `--basepath /chronograf`
set:

```
localhost:2020 {
  proxy /chronograf localhost:8888 {
    except /chronograf
  }
  log stdout
}
```
2017-04-04 10:28:46 -04:00
Tim Raymond f35de37257 Use MountableRouter when Basepath is set
This breaks compatibility with the old behavior of --basepath, so this
requires that proxies be configured to not modify routes forwarded to
backends. The old behavior will be supported in a subsequent commit.
2017-04-03 17:09:05 -04:00
lukevmorris ae77767c9c Allow InfluxDB and Kapacitor configuration via ENV vars or CLI options (#1129)
* Introduce Kapacitor and InfluxDB as command line options

If omitted, their values will be null at runtime. If supplied, e.g.:
  chronograf
    --kapacitor https://path.to.my:1/kapacitor/instance
    --influxdb  https://path.to.my:1/influxdb/instance
Their values will be accessible via
  Server.Kapacitor
  Server.InfluxDB

* MultiSourcesStore will hold Bolt and config’d sources

* Delegate to db.SourcesStore for now

* Add Username/Password tags for InfluxDB and Kapacitor

* Builders for MultiSourceStore and MultiLayoutStore

* Store Kapacitor and InfluxDB configs in memory

* Typo

* Update CHANGELOG

* Move StoreBuilders to server/builders.go

* Correct these assertions by reversing them

* Kapacitor -> KapacitorURL; InfluxDB -> InfluxDBURL
2017-03-30 09:48:04 -07:00
Andrew Watkins 01ec21b483 Merge pull request #1029 from influxdata/feature/db-manager
Feature/db manager
2017-03-24 10:57:12 -07:00
Jared Scheib 959b387f61 Introduce ability to edit a dashboard cell
* Correct documentation for dashboards

* Exclude .git and use 'make run-dev' in 'make continuous'

* Fix dashboard deletion bug where id serialization was wrong

* Commence creation of overlay technology, add autoRefresh props to DashboardPage

* Enhance overlay magnitude of overlay technology

* Add confirm buttons to overlay technology

* Refactor ResizeContainer to accommodate arbitrary containers

* Refactor ResizeContainer to require explicit ResizeTop and ResizeBottom for clarity

* Add markup and styles for OverlayControls

* CellEditorOverlay needs a larger minimum bottom height to accommodate more things

* Revert Visualization to not use ResizeTop or flex-box

* Remove TODO and move to issue

* Refactor CellEditorOverlay to allow selection of graph type

* Style Overlay controls, move confirm buttons to own stylesheet

* Fix toggle buttons in overlay so active is actually active

* Block user-select on a few UI items

* Update cell query shape to support Visualization and LayoutRenderer

* Code cleanup

* Repair fixture schema; update props for affected components

* Wired up selectedGraphType and activeQueryID in CellEditorOverlay

* Wire up chooseMeasurements in QueryBuilder

Pass queryActions into QueryBuilder so that DataExplorer can provide
actionCreators and CellEditorOverlay can provide functions that
modify its component state

* semicolon cleanup

* Bind all queryModifier actions to component state with a stateReducer

* Overlay Technologies™ can add and delete a query from a cell

* Semicolon cleanup

* Add conversion of InfluxQL to QueryConfig for dashboards

* Update go deps to add influxdb at af72d9b0e4ebe95be30e89b160f43eabaf0529ed

* Updated docs for dashboard query config

* Update CHANGELOG to mention InfluxQL to QueryConfig

* Make reducer’s name more specific for clarity

* Remove 'table' as graphType

* Make graph renaming prettier

* Remove duplicate DashboardQuery in swagger.json

* Fix swagger to include name and links for Cell

* Refactor CellEditorOverlay to enable graph type selection

* Add link.self to all Dashboard cells; add bolt migrations

* Make dash graph names only hover on contents

* Consolidate timeRange format patterns, clean up

* Add cell endpoints to dashboards

* Include Line + Stat in Visualization Type list

* Add cell link to dashboards

* Enable step plot and stacked graph in Visualization

* Overlay Technologies are summonable and dismissable

* OverlayTechnologies saves changes to a cell

* Convert NameableGraph to createClass for state

This was converted from a pure function to encapsulate the state of the
buttons. An attempt was made previously to store this state in Redux,
but it proved too convoluted with the current state of the reducers for
cells and dashboards. Another effort must take place to separate a cell
reducer to manage the state of an individual cell in Redux in order for
this state to be sanely kept in Redux as well.

For the time being, this state is being kept in the component for the
sake of expeditiousness, since this is needed for Dashboards to be
released. A refactor of this will occur later.

* Cells should contain a links key in server response

* Clean up console logs

* Use live data instead of a cellQuery fixture

* Update docs for dashboard creation

* DB and RP are already present in the Command field

* Fix LayoutRenderer’s understanding of query schema

* Return a new object, rather that mutate in place

* Visualization doesn’t use activeQueryID

* Selected is an object, not a string

* QueryBuilder refactored to use query index instead of query id

* CellEditorOverlay refactored to use query index instead of query id

* ConfirmButtons doesn’t need to act on an item

* Rename functions to follow convention

* Queries are no longer guaranteed to have ids

* Omit WHERE and GROUP BY clauses when saving query

* Select new query on add in OverlayTechnologies

* Add click outside to dash graph menu, style menu also

* Change context menu from ... to a caret

More consistent with the rest of the UI, better affordance

* Hide graph context menu in presentation mode

Don’t want people editing a dashboard from presentation mode

* Move graph refreshing spinner so it does not overlap with context menu

* Wire up Cell Menu to Overlay Technologies

* Correct empty dashboard type

* Refactor dashboard spec fixtures

* Test syncDashboardCell reducer

* Remove Delete button from graph dropdown menu (for now)

* Update changelog
2017-03-23 17:12:33 -07:00
Jade McGough 6a4c4122bb it's working! 2017-03-22 13:27:36 -07:00
Chris Goller 02c85cd2a0 Fix reporting stats to update uptime 2017-03-17 09:59:52 -05:00
Chris Goller b60901e766 Add structured logging to underlying http server 2017-03-06 15:16:45 -06:00
Chris Goller 8dc012aeac Update to fix go linter issues 2017-03-06 10:11:52 -06:00
Chris Goller 46b1a08aa5 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 a4a5b53bf5 Add roles endpoint and switching between OSS and enterprise 2017-02-23 21:54:20 -06:00
Tim Raymond 38c9abc1c9 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