Skip to content
Snippets Groups Projects
Commit 6f936c36 authored by Atte Keinänen's avatar Atte Keinänen
Browse files

Merge branch 'master' of https://github.com/metabase/metabase into migrate-karma-to-jest

parents 25f75aad 8029bf90
No related branches found
No related tags found
No related merge requests found
Showing
with 101 additions and 91 deletions
......@@ -36,7 +36,6 @@ OSX/Resources/metabase.jar
OSX/build
/osx-artifacts
OSX/dsa_priv.pem
bin/config.json
bin/release/aws-eb/metabase-aws-eb.zip
*.sqlite
/reset-password-artifacts
......
......@@ -70,7 +70,6 @@ server {
set $day $3;
set $hour $4;
}
access_log /var/log/nginx/healthd/application.log.$year-$month-$day-$hour healthd;
access_log /var/log/nginx/access.log;
......@@ -122,7 +121,6 @@ server {
set $day $3;
set $hour $4;
}
access_log /var/log/nginx/healthd/application.log.$year-$month-$day-$hour healthd;
access_log /var/log/nginx/access.log;
......@@ -169,7 +167,7 @@ cp_default_server () {
log_x_real_ip () {
cp .ebextensions/metabase_config/nginx/log_x_real_ip.conf /etc/nginx/conf.d/log_x_real_ip.conf
cd /etc/nginx/sites-available
if ! grep -q access_log *-proxy.conf ; then
if ! grep -q access_log *-proxy.conf ; then
sed -i 's|location \/ {|location \/ {\n\n access_log \/var\/log\/nginx\/access.log log_x_real_ip;\n|' *-proxy.conf
fi
}
......
......@@ -155,6 +155,9 @@ trap summary EXIT
fail_fast() {
echo -e "========================================"
echo -e "Failing fast! Stopping other nodes..."
# Touch a file to differentiate between a local failure and a
# failure triggered by another node
touch '/tmp/local-fail'
# ssh to the other CircleCI nodes and send SIGUSR1 to tell them to exit early
for (( i = 0; i < $CIRCLE_NODE_TOTAL; i++ )); do
if [ $i != $CIRCLE_NODE_INDEX ]; then
......@@ -182,7 +185,12 @@ fi
export CIRCLE_COMMIT_MESSAGE="$(git log --format=oneline -n 1 $CIRCLE_SHA1)"
if [ -f "/tmp/fail" ]; then
# This local-fail check is to guard against two nodes failing at the
# same time. Both nodes ssh to each node and drop /tmp/fail. Those
# failing nodes then get here and see and the other node has told it
# to exit early. This results in both nodes exiting early, and thus
# not failing, causing the build to succeed
if [[ -f "/tmp/fail" && ! -f "/tmp/local-fail" ]]; then
exit_early
fi
......
{
"codesigningIdentity": "Developer ID Application: Metabase, Inc",
"slackWebhookURL": "",
"awsProfile": "metabase",
"awsBucket": ""
"awsBucket": "downloads.metabase.com"
}
#!/bin/bash
# if nobody manually set a host to list on then go with $HOSTNAME
# if nobody manually set a host to listen on then go with all available interfaces and host names
if [ -z "$MB_JETTY_HOST" ]; then
export MB_JETTY_HOST=$HOSTNAME
export MB_JETTY_HOST=0.0.0.0
fi
......
......@@ -8,11 +8,9 @@ use File::Copy 'copy';
use File::Copy::Recursive 'rcopy'; # CPAN
use File::Path 'remove_tree';
use File::stat 'stat';
use JSON 'encode_json', 'from_json'; # CPAN
use Readonly; # CPAN
use String::Util 'trim'; # CPAN
use Text::Caml; # CPAN
use WWW::Curl::Simple; # CPAN
use Metabase::Util;
......@@ -298,30 +296,6 @@ sub create_dmg {
# ------------------------------------------------------------ UPLOADING ------------------------------------------------------------
sub announce_on_slack {
Readonly my $slack_url => config('slackWebhookURL') or return;
Readonly my $version => version();
Readonly my $awsURL => 'https://s3.amazonaws.com/' . config('awsBucket') . '/' . upload_subdir() . '/Metabase.dmg';
my $text = "Metabase OS X $version 'Complexity-Embracing Toucan' Is Now Available!\n\n" .
"Get it here: $awsURL\n\n";
open(my $file, get_file_or_die($release_notes)) or die $!;
while (<$file>) {
m/^\s+<li>.*$/ && s|^\s+<li>(.*)</li>$|$1| && ($text .= '* ' . $_);
}
my $json = encode_json {
channel => '#general',
username => 'OS X Bot',
icon_emoji => ':bird:',
text => trim($text)
};
my $curl = WWW::Curl::Simple->new;
unless ((my $response = $curl->post($slack_url, $json))->code == 200) {
die 'Error posting to slack: ' . $response->code . ' ' . $response->content . "\n";
}
}
# Upload artifacts to AWS
# Make sure to run `aws configure --profile metabase` first to set up your ~/.aws/config file correctly
......@@ -352,8 +326,6 @@ sub upload {
's3', 'cp', $upload_dir,
"s3://$aws_bucket") == 0 or die "Upload failed: $!\n";
announce_on_slack;
announce "Upload finished."
}
......
......@@ -21,11 +21,13 @@ use constant UBERJAR_DEST => getcwd() . '/OSX/Resources/metabase.jar';
use constant RESET_PW_SRC => getcwd() . '/reset-password-artifacts/reset-password/reset-password.jar';
use constant RESET_PW_DEST => getcwd() . '/OSX/Resources/reset-password.jar';
use constant BUILD_SCRIPT => getcwd() . '/bin/build';
# Copy the JRE if needed
(rcopy(JRE_HOME, JRE_DEST) or die $!) unless -d JRE_DEST;
# Build jars if needed
(system('./bin/build') or die $!) unless -f UBERJAR_SRC;
(system(BUILD_SCRIPT) or die $!) unless -f UBERJAR_SRC;
(system('lein', 'with-profile', 'reset-password', 'jar') or die $!) unless -f RESET_PW_SRC;
# Copy jars over
......
#!/usr/bin/env bash
VERSION="v0.25.0-snapshot"
VERSION="v0.26.0-snapshot"
# dynamically pull more interesting stuff from latest git commit
HASH=$(git show-ref --head --hash=7 head) # first 7 letters of hash should be enough; that's what GitHub uses
......
## Single Sign-On with Google
## Authenticating with Google Sign-In or LDAP
Enabling single sign-on lets your team log in with a click instead of using email and password and can optionally let them sign up for Metabase accounts without an admin having to create them first.
Enabling Google Sign-In or LDAP lets your team log in with a click instead of using email and password, and can optionally let them sign up for Metabase accounts without an admin having to create them first. You can find these options in the Settings section of the Admin Panel, under Authentication.
Currently Metabase works with Google accounts for single sign-on. As time goes on we may add other auth providers. If you have a service you’d like to see work with Metabase please let us know by [filing an issue](http://github.com/metabase/metabase/issues/new).
![Authentication](./images/authentication.png)
### Enabling Sign in
As time goes on we may add other auth providers. If you have a service you’d like to see work with Metabase please let us know by [filing an issue](http://github.com/metabase/metabase/issues/new).
### Enabling Google Sign-In
To let your team start signing in with Google you’ll first need to create an application through Google’s [developer console](https://console.developers.google.com/projectselector/apis/library).
......@@ -16,14 +18,30 @@ Once you have your client_id, copy and paste it into the box on the Single Sign-
Now existing Metabase users signed into a Google account that matches their Metabase account email can sign in with just a click.
### Enabling Sign up
### Enabling account creation with Google Sign-In
If you’ve added your Google client ID to your Metabase settings you can also let users sign up on their own without creating accounts for them.
To enable this, go to the Google Sign-In configuration page, and specify the email domain you want to allow. For example, if you work at WidgetCo you could enter `widgetco.com` in the field to let anyone with a company email sign up on their own.
Note: Metabase accounts created with Google Sign-In do not have passwords and must use Google to sign in to Metabase.
### Enabling LDAP authentication
If your organization uses LDAP, and you want to allow your users to log in via their LDAP credentials, you can do so as follows.
Click the `Configure` button in the LDAP section of the Authentication page, and you'll see this form:
![Authentication](./images/ldap-form.png)
If you’ve added your Google client id to your Metabase settings you can also let users sign up on their own without creating accounts for them.
Click the toggle at the top of the form to enable LDAP, then fill in the form with the information about your LDAP server.
To enable this, check the box on the Single Sign-On Admin Settings page and specify the email domain you want to allow. For example if you work at WidgetCo you could enter widgetco.com in the field to let anyone with a company email sign up on their own.
Metabase will pull out three main attributes from your LDAP directory - email (defaulting to the `mail` attribute), first name (defaulting to the `givenName` attribute) and last name (defaulting to the `sn` attribute). If your LDAP setup uses other attributes for these, you can edit this under the "Attributes" portion of the form.
Note: Metabase accounts created with Single Sign-On do not have passwords and must use Google to sign in to Metabase.
![Attributes](./images/ldap-attributes.png)
If you have user groups in Metabase you are using to control access, it is often tedious to have to manually assign a user to a group after they're logged in via SSO. You can take advantage of the groups your LDAP directory uses by enabling Group Mappings, and specifying which LDAP group corresponds to which user group on your Metabase server.
---
......
docs/administration-guide/images/authentication.png

63 KiB

docs/administration-guide/images/ldap-attributes.png

147 KiB

docs/administration-guide/images/ldap-form.png

76.4 KiB

......@@ -13,7 +13,7 @@ Are you in charge of managing Metabase for your organization? Then you're in the
* [Creating segments and metrics](07-segments-and-metrics.md)
* [Configuring settings](08-configuration-settings.md)
* [Setting up Slack integration](09-setting-up-slack.md)
* [Enabling single sign-on with Google](10-single-sign-on.md)
* [Authenticating with Google Sign-In or LDAP](10-single-sign-on.md)
* [Creating a Getting Started Guide for your team](11-getting-started-guide.md)
* [Sharing dashboards and questions with public links](12-public-links.md)
* [Embedding Metabase in other Applications](13-embedding.md)
......
# Metabase OS X App
NOTE: These instructions are only for packaging a built Metabase uberjar into `Metabase.app`. They are not useful if your goal is to work on Metabase itself; for development, please see our [developers' guide](developers-guide.md).
NOTE: These instructions are only for packaging a built Metabase uberjar into `Metabase.app`. They are not useful if your goal is to work on Metabase itself; for development, please see our [developers' guide](developers-guide.md).
## Prereqs
1. Install XCode.
2. Run `./bin/build` to build the latest version of the uberjar.
1. Install XCode command-line tools. In `Xcode` > `Preferences` > `Locations` select your current Xcode version in the `Command Line Tools` drop-down.
3. Update Perl. I'm not sure these steps are actually needed, so feel free to try skipping it and come back to it if it fails:
```bash
# Upgrade Perl
brew install perl
# Add new version of perl to your $PATH
# (replace "5.24.0_1" below with whatever version you installed)
echo 'export PATH="/usr/local/Cellar/perl/5.24.0_1/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
# Double-check that we're using the newer version of CPAN
# (If this is your first time running CPAN, use the default config settings when prompted)
cpan --version # You should see a line like "running under Perl version 5.24.0."
```
1. Run `./bin/build` to build the latest version of the uberjar.
4. Next, you'll need to run the following commands before building the app:
1. Next, you'll need to run the following commands before building the app:
```bash
# Fetch and initialize git submodule
git submodule update --init
# Install libcurl (needed by WWW::Curl::Simple (I think))
brew install curl && brew link curl --force
# The new version of LLVM is snippy so have CPAN pass compiler flags to fix errors
# (Make sure this file exists first. If you didn't upgrade Perl in the step above,
# it might be in a different location; perhaps called "Config.pm".
# You may need to run "cpan" (no arguments) to generate an appropriate initial config.
# As above, you can go with the defaults).
sed -i '' -e "s/'make_arg' => q\[\]/'make_arg' => q\[CCFLAGS=\"-Wno-return-type\"\]/" ~/.cpan/CPAN/MyConfig.pm
# Install Perl modules used by ./bin/osx-setup and ./bin/osx-release
# You may have to run this as sudo if you didn't upgrade perl as described in step above
cpan install File::Copy::Recursive JSON Readonly String::Util Text::Caml WWW::Curl::Simple
sudo cpan install File::Copy::Recursive Readonly String::Util Text::Caml JSON
# Copy JRE and uberjar
./bin/osx-setup
```
......@@ -66,19 +41,27 @@ brew install awscli
# You just need the access key ID and secret key; use the defaults for locale and other options.
aws configure --profile metabase
# Copy & Edit Config file. Alternative ask Cam for a copy of his
cp bin/config.json.template bin/config.json
emacs bin/config.json
# Obtain a copy of the private key used for signing the app (ask Cam)
# and put a copy of it at ./dsa_priv.pem
cp /path/to/private/key.pem OSX/dsa_priv.pem
```
You'll probably also want an Apple Developer ID Application Certificate in your computer's keychain. You'll need to generate a Certificate Signing Request from Keychain Access, and have Sameer go to [the Apple Developer Site](https://developer.apple.com/account/mac/certificate/) and generate one for you, then load the file on your computer.
You'll need the `Apple Developer ID Application Certificate` in your computer's keychain.
You'll need to generate a Certificate Signing Request from Keychain Access, and have Sameer go to [the Apple Developer Site](https://developer.apple.com/account/mac/certificate/)
and generate one for you, then load the file on your computer.
Finally, you may need to open the project a single time in Xcode to make sure the appropriate "build schemes" are generated (these are not checked into CI).
Run `open OSX/Metabase.xcodeproj` to open the project, which will automatically generate the appropriate schemes. This only needs to be done once.
After that, you are good to go:
```bash
# Bundle entire app, and upload to s3
./bin/osx-release
```
## Debugging ./bin/osx-release
* You can run individual steps of the release script by passing in the appropriate step subroutines. e.g. `./bin/osx-release create_dmg upload`.
The entire sequence of different steps can be found at the bottom of `./bin/osx-release`.
* Generating the DMG seems to be somewhat finicky, so if it fails with a message like "Device busy" trying the step again a few times usually resolves the issue.
You can continue the build process from the DMG creation step by running `./bin/osx-release create_dmg upload`.
......@@ -156,10 +156,12 @@ By default, the tests only run against the `h2` driver. You can specify which dr
ENGINES=h2,postgres,mysql,mongo lein test
At the time of this writing, the valid engines are `h2`, `postgres`, `mysql`, `mongo`, `sqlserver`, `sqlite`, `druid`, `bigquery`, and `redshift`. Some of these engines require additional parameters
At the time of this writing, the valid engines are `h2`, `postgres`, `mysql`, `mongo`, `sqlserver`, `sqlite`, `druid`, `bigquery`, `oracle`, `vertica`, and `redshift`. Some of these engines require additional parameters
when testing since they are impossible to run locally (such as Redshift and Bigquery). The tests will fail on launch and let you know what parameters to supply if needed.
Run the linters:
Due to some issues with the way we've structured our test setup code, you currently always need to include `h2` in the `ENGINES` list. Thus to test something like `bigquery` you should specify `ENGINES=h2,bigquery`. Fortunately the H2 tests are fast so this should not make a noticeable difference.
##### Run the linters:
lein eastwood && lein bikeshed && lein docstring-checker && ./bin/reflection-linter
......
......@@ -58,7 +58,7 @@ git remote add heroku https://git.heroku.com/your-metabase-app.git
* If you are upgrading from a version that is lower than 0.25, add the Metabase buildpack to your Heroku app:
```
heroku buildpacks:add https://github.com/metabase/metabase-heroku
heroku buildpacks:add https://github.com/metabase/metabase-buildpack
```
* Force push the new version to Heroku:
......
......@@ -377,3 +377,14 @@ By default Metabase will include emoji characters in logs. You can disable this
export MB_EMOJI_IN_LOGS="false"
java -jar metabase.jar
# Configuring Logging Level
By default, Metabase logs quite a bit of information. Luckily, Metabase uses [Log4j](http://logging.apache.org/log4j) under the hood, meaning the logging is completely configurable.
Metabase's default logging configuration can be found [here](https://github.com/metabase/metabase/blob/master/resources/log4j.properties). You can override this properties file and tell
Metabase to use your own logging configuration file by passing a `-Dlog4j.configuration` argument when running Metabase:
java -Dlog4j.configuration=file:/path/to/custom/log4j.properties -jar metabase.jar
The easiest way to get started customizing logging would be to use a copy of default `log4j.properties` file linked to above and adjust that to meet your needs. Keep in mind that you'll need to restart Metabase for changes to the file to take effect.
## Troubleshooting Process
1.
1. Verify the Email Account Credentials
a. In the admin panel email settings, click "Send test email", and verify that the email is delivered to the test account
b.If the email is not sent or returns an error, try to use the same account credentials in another program and see if they work. If they do, it might be a bug, please report it at github.com/metabase/metabase/issues/new
2. Is the email being sent?
a. Check the server logs for any error messages
b. If there are any error messages, they are usually helpful :wink:
c. If you have access to your email delivery service's outbound queue or a dashboard, check that for errors.
d. Some email delivery services have very specific rules regarding valid "from" addresses, make sure you've whitelisted the "from" address you're using in Metabase
e. Some email delivery services have test modes or otherwise restricted delivery. Double check that your delivery service allows you to send email to the domain you're trying to get email sent to.
3. If the email is being sent, but you're not getting it, is anyone else getting theirs?
a. If so, check your spam folder, any forwarding rules, etc
b. If someone at another email provider is getting emails, this is probably due to deliverability rules, and you should look into signing your emails with DKIM, etc.
4. For user accounts specifically, did you previously create an account under this email and then delete it? This occasionally results in that email address being "claimed".
## Specific Problems:
......
......@@ -22,7 +22,7 @@ Lastly, clicking on the ID of an item in table gives you the option to go to a d
**Note that charts created with SQL don't currently have these action options.**
#### Exploring saved questions
In Metabase parlance, every chart on number on a dashboard is called a "question." Clicking on the title of a question on a dashboard will take you to a detail view of that question. You'll also end up at this detail view if you use one of the actions mentioned above. You can also browse all the questions your teammates have saved by clicking the `Questions` link in the main navigation.
In Metabase parlance, every chart or number on a dashboard is called a "question." Clicking on the title of a question on a dashboard will take you to a detail view of that question. You'll also end up at this detail view if you use one of the actions mentioned above. You can also browse all the questions your teammates have saved by clicking the `Questions` link in the main navigation.
When you're viewing the detail view of a question, you can use all the same actions mentioned above. You can also click on the headings of tables to see more options, like viewing the sum of the values in a column, or finding the minimum or maximum value in it.
......
......@@ -17,7 +17,7 @@ The first dropdown menu in the question builder is where you’ll choose the dat
If you've [saved some questions](06-sharing-answers.html), in the Data menu you'll see the option to use one of your saved questions as source data. What this means in practice is that you can do things like use complex SQL queries to create new tables that can be used in a question just like any other table in your database.
You can use any saved question as source data, provided you have [permission](../administration-guide/05-setting-permissions.html) to view that question. You can even use questions that were saved as a chart rather than a table. The only caveat is that you can't use a saved question which itself uses a saved question as source data. (That's more inception than Metabase can handle!)
You can use any saved question as source data, provided you have [permission](../administration-guide/05-setting-permissions.html) to view that question. You can even use questions that were saved as a chart rather than a table.
### Filters
---
......@@ -124,7 +124,7 @@ Say we had a table of baseball games, each row representing a single game, and w
The words in the quotes are the names of the fields in our table. If you start typing in this box, Metabase will show you fields in the current table that match what you’ve typed, and you can select from this list to autocomplete the field name.
Right now, you can only use the following math operators in your formulas: +, –, * (multiplication), and / (division). You can also use parentheses to clarify the order of operations.
Right now, you can only use the following math operators in your formulas: `+`, `–`, `*` (multiplication), and `/` (division). You can also use parentheses to clarify the order of operations.
Once you’ve written your formula and given your new field a name, select `Raw Data` for your view, and click the `Get Answer` button to see your new field appended to your current table. It’ll be on the far right of the table. **Note that this new field is NOT permanently added to this table.** It will only be kept if you save a question that uses it.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment