Giter Club home page Giter Club logo

blazer-docker's Introduction

Blazer Docker

A Docker image for Blazer

Getting Started

Pull the image:

docker pull ankane/blazer

Create database tables:

docker run -ti -e DATABASE_URL=postgres://user:password@hostname:5432/dbname ankane/blazer rails db:migrate

Run the web server:

docker run -ti -e DATABASE_URL=postgres://user:password@hostname:5432/dbname -p 8080:8080 ankane/blazer

Use URL-encoding for any special characters in the username or password. For databases on the host machine, use host.docker.internal as the hostname (on Linux, this requires Docker 20.04+ and --add-host=host.docker.internal:host-gateway).

Then visit http://localhost:8080.

Authentication

Add basic authentication with:

-e BLAZER_USERNAME=admin -e BLAZER_PASSWORD=secret

Or use a reverse proxy like OAuth2 Proxy.

Checks

TODO: SMTP instructions

Schedule checks to run (with cron, Heroku Scheduler, etc). The default options are every 5 minutes, 1 hour, or 1 day, which you can customize. For each of these options, set up a task to run.

docker run ... rake blazer:run_checks SCHEDULE="5 minutes"
docker run ... rake blazer:run_checks SCHEDULE="1 hour"
docker run ... rake blazer:run_checks SCHEDULE="1 day"

You can also set up failing checks to be sent once a day (or whatever you prefer).

docker run ... rake blazer:send_failing_checks

For Slack notifications, create an incoming webhook and set:

-e BLAZER_SLACK_WEBHOOK_URL=https://hooks.slack.com/...

Name the webhook “Blazer” and add a cool icon.

Customization

Create a blazer.yml file with:

# see https://github.com/ankane/blazer for more info

data_sources:
  main:
    url: <%= ENV["DATABASE_URL"] %>

    # statement timeout, in seconds
    # none by default
    # timeout: 15

    # caching settings
    # can greatly improve speed
    # off by default
    # cache:
    #   mode: slow # or all
    #   expires_in: 60 # min
    #   slow_threshold: 15 # sec, only used in slow mode

    # wrap queries in a transaction for safety
    # not necessary if you use a read-only user
    # true by default
    # use_transaction: false

    smart_variables:
      # zone_id: "SELECT id, name FROM zones ORDER BY name ASC"
      # period: ["day", "week", "month"]
      # status: {0: "Active", 1: "Archived"}

    linked_columns:
      # user_id: "/admin/users/{value}"

    smart_columns:
      # user_id: "SELECT id, name FROM users WHERE id IN {value}"

# create audits
audit: true

# change the time zone
# time_zone: "Pacific Time (US & Canada)"

# email to send checks from
# from_email: [email protected]

# webhook for Slack
# slack_webhook_url: <%= ENV["BLAZER_SLACK_WEBHOOK_URL"] %>

check_schedules:
  - "1 day"
  - "1 hour"
  - "5 minutes"

# enable anomaly detection
# note: with trend, time series are sent to https://trendapi.org
# anomaly_checks: prophet / trend / anomaly_detection

# enable forecasting
# note: with trend, time series are sent to https://trendapi.org
# forecasting: prophet / trend

# enable map
# mapbox_access_token: <%= ENV["MAPBOX_ACCESS_TOKEN"] %>

# enable uploads
# uploads:
#   url: <%= ENV["BLAZER_UPLOADS_URL"] %>
#   schema: uploads
#   data_source: main

Create a Dockerfile with:

FROM ankane/blazer

COPY blazer.yml /app/config/blazer.yml

And build your image:

docker build -t my-blazer .

Deployment

Health Checks

Use the /health endpoint for health checks. Status code 200 indicates healthy.

History

View the changelog

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

To get started with development:

git clone https://github.com/ankane/blazer-docker.git
cd blazer-docker
docker build -t ankane/blazer:latest .

blazer-docker's People

Contributors

ankane avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

blazer-docker's Issues

Mongo not working

Hi,
I can not connect Blazer with MongoDB. When I run
docker run -ti -e DATABASE_URL=mongodb://127.0.0.1:27017/movecrop ankane/blazer rails db:migrate
I see an error:
Could not load the 'mongodb' Active Record adapter. Ensure that the adapter is spelled correctly in config/database.yml and that you've added the necessary adapter gem to your Gemfile.
Please check my issue.

System info:
MacOS: 10.15
Docker
Version: 2.3.0.3
Engine: 19.03.8

Screen Shot 2020-06-20 at 8 01 59 PM

Puma error when trying to run docker image

/app/config/puma.rb:6:in `_load_from': uninitialized constant #<Class:#<Puma::DSL:0x0000004005e54b48>>::DefaultRackup (NameError)
        from /usr/local/bundle/gems/puma-6.1.1/lib/puma/dsl.rb:132:in `instance_eval'
        from /usr/local/bundle/gems/puma-6.1.1/lib/puma/dsl.rb:132:in `_load_from'
        from /usr/local/bundle/gems/puma-6.1.1/lib/puma/configuration.rb:236:in `block in load'
        from /usr/local/bundle/gems/puma-6.1.1/lib/puma/configuration.rb:236:in `each'
        from /usr/local/bundle/gems/puma-6.1.1/lib/puma/configuration.rb:236:in `load'
        from /usr/local/bundle/gems/puma-6.1.1/lib/puma/launcher.rb:54:in `initialize'
        from /usr/local/bundle/gems/puma-6.1.1/lib/puma/cli.rb:66:in `new'
        from /usr/local/bundle/gems/puma-6.1.1/lib/puma/cli.rb:66:in `initialize'
        from /usr/local/bundle/gems/puma-6.1.1/bin/puma:8:in `new'
        from /usr/local/bundle/gems/puma-6.1.1/bin/puma:8:in `<top (required)>'
        from /usr/local/bundle/bin/puma:25:in `load'
        from /usr/local/bundle/bin/puma:25:in `<main>'

This after having successfully run the db:migrate and then going to run the command for running the web.

multiple authentication

please guide how to provide multiple authentication using reverse proxy like [oauth2-proxy] ,how can i authenticate specific users via oauth2 to use my blazer application

user authentiation

how to add multiple authentication from ankane/blazer docker pull? I cannot add new user authentiation apart from blazer_username and blazer_password

Form submission redirects to localhost:8080

I'm running Blazer using the Docker image on EC2 and accessing it via the Internet. Everything works great except form submission redirects to localhost:8080 (the default host Blazer is running on) instead of the URL in the browser.

I'm running Blazer behind nginx using the default command suggested in the README:

docker run -e DATABASE_URL=... -e BLAZER_USERNAME=... -e BLAZER_PASSWORD=... ankane/blazer:latest

I probably need to set the host somewhere, but it's not obvious from looking at the Blazer repo or this one where that config could be.

specific Database access

hi,please help lets say im authentication 2 useres via Oauth2 and i want each user to access only specific database and not all of them,how can i achieve this?

Adding oracle support fails rake task

Hello,

i'm building blazer with oracle support. As stated on blazer repo i changed Gemfile adding this:

gem 'activerecord-oracle_enhanced-adapter'
gem "ruby-oci8" # for oracle

and switched docker base image to redhat registry.access.redhat.com/ubi8/ruby-27:latest which has ruby 2.7 and allows installation of oracle instantclient packages (on default alpine image instantclient 21 was not working).

This is the dockerfile

FROM registry.access.redhat.com/ubi8/ruby-27:latest

MAINTAINER Andrew Kane <[email protected]>
USER root

RUN gem install bundler

ENV INSTALL_PATH /app

RUN mkdir -p $INSTALL_PATH

WORKDIR $INSTALL_PATH

COPY Gemfile Gemfile.lock ./

COPY oracle-instantclient-basic-21.1.0.0.0-1.x86_64.rpm /tmp
COPY oracle-instantclient-devel-21.1.0.0.0-1.x86_64.rpm /tmp
COPY oracle-instantclient-sqlplus-21.1.0.0.0-1.x86_64.rpm /tmp
RUN  dnf localinstall -y /tmp/oracle*

RUN bundle install --binstubs

COPY . .

RUN bundle exec rake RAILS_ENV=production DATABASE_URL=postgresql://user:[email protected]/dbname SECRET_TOKEN=dummytoken assets:precompile

ENV PORT 8080

EXPOSE 8080

CMD puma -C /app/config/puma.rb

Everything goes ok until the last run, which fails due to:

Step 15/18 : RUN bundle exec rake RAILS_ENV=production DATABASE_URL=postgresql://user:[email protected]/dbname SECRET_TOKEN=dummytoken assets:precompile
 ---> Running in ff82ea04c298
Warning: NLS_LANG is not set. fallback to US7ASCII.
rake aborted!
NameError: uninitialized constant ActiveRecord::ConnectionAdapters::ConnectionSpecification
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/database_configurations/url_config.rb:63:in `build_url_hash'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/database_configurations/url_config.rb:68:in `build_config'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/database_configurations/url_config.rb:36:in `initialize'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/database_configurations.rb:191:in `new'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/database_configurations.rb:191:in `environment_url_config'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/database_configurations.rb:133:in `build_configs'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/database_configurations.rb:18:in `initialize'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/core.rb:51:in `new'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/core.rb:51:in `configurations='
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/core.rb:53:in `block in <module:Core>'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concern.rb:122:in `class_eval'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concern.rb:122:in `append_features'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/base.rb:293:in `include'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/base.rb:293:in `<class:Base>'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/base.rb:277:in `<module:ActiveRecord>'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/base.rb:27:in `<top (required)>'
/usr/share/gems/gems/activerecord-oracle_enhanced-adapter-6.0.6/lib/active_record/connection_adapters/oracle_enhanced/database_tasks.rb:3:in `<top (required)>'
/usr/share/gems/gems/activerecord-oracle_enhanced-adapter-6.0.6/lib/activerecord-oracle_enhanced-adapter.rb:8:in `block in <class:OracleEnhancedRailtie>'
/usr/share/gems/gems/railties-6.0.3.7/lib/rails/railtie.rb:245:in `instance_exec'
/usr/share/gems/gems/railties-6.0.3.7/lib/rails/railtie.rb:245:in `block in run_tasks_blocks'
/usr/share/gems/gems/railties-6.0.3.7/lib/rails/railtie.rb:253:in `each'
/usr/share/gems/gems/railties-6.0.3.7/lib/rails/railtie.rb:253:in `each_registered_block'
/usr/share/gems/gems/railties-6.0.3.7/lib/rails/railtie.rb:245:in `run_tasks_blocks'
/usr/share/gems/gems/railties-6.0.3.7/lib/rails/application.rb:517:in `block in run_tasks_blocks'
/usr/share/gems/gems/railties-6.0.3.7/lib/rails/engine/railties.rb:15:in `each'
/usr/share/gems/gems/railties-6.0.3.7/lib/rails/engine/railties.rb:15:in `each'
/usr/share/gems/gems/railties-6.0.3.7/lib/rails/application.rb:517:in `run_tasks_blocks'
/usr/share/gems/gems/railties-6.0.3.7/lib/rails/engine.rb:459:in `load_tasks'
/app/Rakefile:6:in `<top (required)>'
/usr/share/gems/gems/rake-13.0.3/exe/rake:27:in `<top (required)>'
/usr/local/share/gems/gems/bundler-2.2.20/lib/bundler/cli/exec.rb:63:in `load'
/usr/local/share/gems/gems/bundler-2.2.20/lib/bundler/cli/exec.rb:63:in `kernel_load'
/usr/local/share/gems/gems/bundler-2.2.20/lib/bundler/cli/exec.rb:28:in `run'
/usr/local/share/gems/gems/bundler-2.2.20/lib/bundler/cli.rb:474:in `exec'
/usr/local/share/gems/gems/bundler-2.2.20/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/share/gems/gems/bundler-2.2.20/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/share/gems/gems/bundler-2.2.20/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/usr/local/share/gems/gems/bundler-2.2.20/lib/bundler/cli.rb:30:in `dispatch'
/usr/local/share/gems/gems/bundler-2.2.20/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/usr/local/share/gems/gems/bundler-2.2.20/lib/bundler/cli.rb:24:in `start'
/usr/local/share/gems/gems/bundler-2.2.20/exe/bundle:49:in `block in <top (required)>'
/usr/local/share/gems/gems/bundler-2.2.20/lib/bundler/friendly_errors.rb:128:in `with_friendly_errors'
/usr/local/share/gems/gems/bundler-2.2.20/exe/bundle:37:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
(See full trace by running task with --trace)

I tried building without the changes on gemfile and same dockerfile and goes ok. If i add ruby-oci8 works, but if i add activerecord-oracle_enhanced-adapter, everything breaks.

Any suggestion? I don't know if i have to select another activerecord package instead of the one stated in the documentation.

Luca

Problem building the docker image locally.

First, congrats on such a useful open-source project! I wanted to use with a SQL-Server connection so I had to make changes to the Gemfile and build the image locally. But, when I used the following command, it returned an error:

docker build -t ankane/blazer:latest .

This is the output that I got:

Sending build context to Docker daemon 41.98kB
Step 1/14 : FROM ruby:2.7.2-alpine3.11
---> 850bf24f9cfe
Step 2/14 : MAINTAINER Andrew Kane [email protected]
---> Using cache
---> a37e3c7c4cd9
Step 3/14 : RUN apk add --update ruby-dev build-base libxml2-dev libxslt-dev pcre-dev libffi-dev postgresql-dev mysql-dev sqlite-dev git unixodbc-dev freetds-dev
---> Using cache
---> ecd394300519
Step 4/14 : RUN gem install bundler
---> Using cache
---> e3e935067b81
Step 5/14 : ENV INSTALL_PATH /app
---> Using cache
---> e1f9900a8e23
Step 6/14 : RUN mkdir -p $INSTALL_PATH
---> Using cache
---> e648810e12de
Step 7/14 : WORKDIR $INSTALL_PATH
---> Using cache
---> 4854f854a303
Step 8/14 : COPY Gemfile Gemfile.lock ./
---> Using cache
---> a00570e86808
Step 9/14 : RUN bundle install --binstubs
---> Running in 2cf5d756d6ae
[DEPRECATED] The --binstubs option will be removed in favor of bundle binstubs --all
Fetching gem metadata from https://rubygems.org/
Fetching gem metadata from https://rubygems.org/.........
Your bundle is locked to mimemagic (0.3.5) from rubygems repository
https://rubygems.org/ or installed locally, but that version can no longer be
found in that source. That means the author of mimemagic (0.3.5) has removed it.
You'll need to update your bundle to a version other than mimemagic (0.3.5) that
hasn't been removed in order to install.

The command '/bin/sh -c bundle install --binstubs' returned a non-zero code: 7

SQL Error on Docker Run

@ankane Thanks for quickly putting this together! I'm happy to test and give feedback.

After running docker run -ti -e DATABASE_URL=postgres://user:password@hostname:5432/dbname -p 8080:8080 blazer with the actual target database info, I get an error:

[1] Puma starting in cluster mode...
[1] * Version 4.3.1 (ruby 2.6.5-p114), codename: Mysterious Traveller
[1] * Min threads: 1, max threads: 16
[1] * Environment: production
[1] * Process workers: 3
[1] * Preloading application
[1] * Listening on tcp://0.0.0.0:8080
[1] ! WARNING: Detected 1 Thread(s) started in app boot:
[1] ! #<Thread:0x0000559908b797a0@/usr/local/bundle/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:336 sleep> - /usr/local/bundle/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:339:in `sleep'
[1] Use Ctrl-C to stop
[1] - Worker 0 (pid: 8) booted, phase: 0
[1] - Worker 2 (pid: 15) booted, phase: 0
[1] - Worker 1 (pid: 10) booted, phase: 0
Started GET "/" for 172.17.0.1 at 2020-02-05 22:09:16 +0000
Processing by Blazer::QueriesController#home as HTML
Completed 500 Internal Server Error in 1147ms (ActiveRecord: 444.0ms | Allocations: 3772)
  
ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR:  relation "blazer_queries" does not exist
LINE 8:  WHERE a.attrelid = '"blazer_queries"'::regclass
                            ^
):
  
activerecord (6.0.2.1) lib/active_record/connection_adapters/postgresql/database_statements.rb:65:in `exec'
activerecord (6.0.2.1) lib/active_record/connection_adapters/postgresql/database_statements.rb:65:in `block (2 levels) in query'
activesupport (6.0.2.1) lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
activesupport (6.0.2.1) lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
activesupport (6.0.2.1) lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
activerecord (6.0.2.1) lib/active_record/connection_adapters/postgresql/database_statements.rb:64:in `block in query'
activerecord (6.0.2.1) lib/active_record/connection_adapters/abstract_adapter.rb:718:in `block (2 levels) in log'
/usr/local/lib/ruby/2.6.0/monitor.rb:235:in `mon_synchronize'
activerecord (6.0.2.1) lib/active_record/connection_adapters/abstract_adapter.rb:717:in `block in log'
activesupport (6.0.2.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activerecord (6.0.2.1) lib/active_record/connection_adapters/abstract_adapter.rb:708:in `log'
activerecord (6.0.2.1) lib/active_record/connection_adapters/postgresql/database_statements.rb:63:in `query'
activerecord (6.0.2.1) lib/active_record/connection_adapters/postgresql_adapter.rb:817:in `column_definitions'
activerecord (6.0.2.1) lib/active_record/connection_adapters/abstract/schema_statements.rb:114:in `columns'
activerecord (6.0.2.1) lib/active_record/connection_adapters/schema_cache.rb:76:in `columns'
activerecord (6.0.2.1) lib/active_record/connection_adapters/schema_cache.rb:82:in `columns_hash'
activerecord (6.0.2.1) lib/active_record/model_schema.rb:490:in `load_schema!'
activerecord (6.0.2.1) lib/active_record/attributes.rb:247:in `load_schema!'
activerecord (6.0.2.1) lib/active_record/attribute_decorators.rb:51:in `load_schema!'
activerecord (6.0.2.1) lib/active_record/model_schema.rb:480:in `block in load_schema'
/usr/local/lib/ruby/2.6.0/monitor.rb:235:in `mon_synchronize'
activerecord (6.0.2.1) lib/active_record/model_schema.rb:477:in `load_schema'
activerecord (6.0.2.1) lib/active_record/model_schema.rb:352:in `columns_hash'
activerecord (6.0.2.1) lib/active_record/relation/query_methods.rb:1216:in `arel_column'
activerecord (6.0.2.1) lib/active_record/relation/query_methods.rb:1326:in `order_column'
activerecord (6.0.2.1) lib/active_record/relation/query_methods.rb:1309:in `block in preprocess_order_args'
activerecord (6.0.2.1) lib/active_record/relation/query_methods.rb:1306:in `map!'
activerecord (6.0.2.1) lib/active_record/relation/query_methods.rb:1306:in `preprocess_order_args'
activerecord (6.0.2.1) lib/active_record/relation/query_methods.rb:364:in `order!'
activerecord (6.0.2.1) lib/active_record/relation/query_methods.rb:359:in `order'
blazer (2.2.1) app/controllers/blazer/queries_controller.rb:280:in `set_queries'
blazer (2.2.1) app/controllers/blazer/queries_controller.rb:7:in `home'
actionpack (6.0.2.1) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (6.0.2.1) lib/abstract_controller/base.rb:196:in `process_action'
actionpack (6.0.2.1) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (6.0.2.1) lib/abstract_controller/callbacks.rb:42:in `block in process_action'
activesupport (6.0.2.1) lib/active_support/callbacks.rb:135:in `run_callbacks'
actionpack (6.0.2.1) lib/abstract_controller/callbacks.rb:41:in `process_action'
actionpack (6.0.2.1) lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack (6.0.2.1) lib/action_controller/metal/instrumentation.rb:33:in `block in process_action'
activesupport (6.0.2.1) lib/active_support/notifications.rb:180:in `block in instrument'
activesupport (6.0.2.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.0.2.1) lib/active_support/notifications.rb:180:in `instrument'
actionpack (6.0.2.1) lib/action_controller/metal/instrumentation.rb:32:in `process_action'
actionpack (6.0.2.1) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
activerecord (6.0.2.1) lib/active_record/railties/controller_runtime.rb:27:in `process_action'
actionpack (6.0.2.1) lib/abstract_controller/base.rb:136:in `process'
actionview (6.0.2.1) lib/action_view/rendering.rb:39:in `process'
actionpack (6.0.2.1) lib/action_controller/metal.rb:191:in `dispatch'
actionpack (6.0.2.1) lib/action_controller/metal.rb:252:in `dispatch'
actionpack (6.0.2.1) lib/action_dispatch/routing/route_set.rb:51:in `dispatch'
actionpack (6.0.2.1) lib/action_dispatch/routing/route_set.rb:33:in `serve'
actionpack (6.0.2.1) lib/action_dispatch/journey/router.rb:49:in `block in serve'
actionpack (6.0.2.1) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (6.0.2.1) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (6.0.2.1) lib/action_dispatch/routing/route_set.rb:837:in `call'
railties (6.0.2.1) lib/rails/engine.rb:526:in `call'
railties (6.0.2.1) lib/rails/railtie.rb:190:in `public_send'
railties (6.0.2.1) lib/rails/railtie.rb:190:in `method_missing'
actionpack (6.0.2.1) lib/action_dispatch/routing/mapper.rb:19:in `block in <class:Constraints>'
actionpack (6.0.2.1) lib/action_dispatch/routing/mapper.rb:48:in `serve'
actionpack (6.0.2.1) lib/action_dispatch/journey/router.rb:49:in `block in serve'
actionpack (6.0.2.1) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (6.0.2.1) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (6.0.2.1) lib/action_dispatch/routing/route_set.rb:837:in `call'
rack (2.1.2) lib/rack/tempfile_reaper.rb:17:in `call'
rack (2.1.2) lib/rack/etag.rb:27:in `call'
rack (2.1.2) lib/rack/conditional_get.rb:27:in `call'
rack (2.1.2) lib/rack/head.rb:14:in `call'
actionpack (6.0.2.1) lib/action_dispatch/http/content_security_policy.rb:18:in `call'
rack (2.1.2) lib/rack/session/abstract/id.rb:269:in `context'
rack (2.1.2) lib/rack/session/abstract/id.rb:263:in `call'
actionpack (6.0.2.1) lib/action_dispatch/middleware/cookies.rb:648:in `call'
actionpack (6.0.2.1) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport (6.0.2.1) lib/active_support/callbacks.rb:101:in `run_callbacks'
actionpack (6.0.2.1) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (6.0.2.1) lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'
actionpack (6.0.2.1) lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call'
actionpack (6.0.2.1) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (6.0.2.1) lib/rails/rack/logger.rb:38:in `call_app'
railties (6.0.2.1) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (6.0.2.1) lib/active_support/tagged_logging.rb:80:in `block in tagged'
activesupport (6.0.2.1) lib/active_support/tagged_logging.rb:28:in `tagged'
activesupport (6.0.2.1) lib/active_support/tagged_logging.rb:80:in `tagged'
railties (6.0.2.1) lib/rails/rack/logger.rb:26:in `call'
actionpack (6.0.2.1) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
actionpack (6.0.2.1) lib/action_dispatch/middleware/request_id.rb:27:in `call'
rack (2.1.2) lib/rack/method_override.rb:24:in `call'
rack (2.1.2) lib/rack/runtime.rb:24:in `call'
activesupport (6.0.2.1) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
actionpack (6.0.2.1) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.0.2.1) lib/action_dispatch/middleware/static.rb:126:in `call'
rack (2.1.2) lib/rack/sendfile.rb:113:in `call'
actionpack (6.0.2.1) lib/action_dispatch/middleware/host_authorization.rb:77:in `call'
railties (6.0.2.1) lib/rails/engine.rb:526:in `call'
rack (2.1.2) lib/rack/urlmap.rb:77:in `block in call'
rack (2.1.2) lib/rack/urlmap.rb:61:in `each'
rack (2.1.2) lib/rack/urlmap.rb:61:in `call'
puma (4.3.1) lib/puma/configuration.rb:228:in `call'
puma (4.3.1) lib/puma/server.rb:681:in `handle_request'
puma (4.3.1) lib/puma/server.rb:472:in `process_client'
puma (4.3.1) lib/puma/server.rb:328:in `block in run'
puma (4.3.1) lib/puma/thread_pool.rb:134:in `block in spawn_thread'

smart_variables do not work

Hi,

I've added a few variables to a smart_variables section but they don't seem to pick up in the queries. I'm not familiar with Ruby so could you please help me with the troubleshooting steps? I'm using the latest official docker image (docker.io/ankane/blazer@sha256:f127d2ee00fbf43fa4985d9b22568bbacb50862a88b3d2883da9cdb2c29f883f).

My blazer.yaml:

data_sources:
  imapp:
    url: # redacted

    smart_variables:
      payment_system: {0: "Reserved", 1: "AppStore", 2: "GooglePlay"}

Simple query for testing:
image
Notice that the payment_system is not recognized as a smart variable.

Thanks!

Can't run using local database

Good day, I just pulled this image from a hub and tried to run it, however when I open localhost:8080 I don't see anything except for an empty page and bunch of 500 server errors in network tab.
Steps to reproduce

  1. docker pull ankane/blazer
  2. docker run -ti -e DATABASE_URL=postgres://user:[email protected]:5432/dbname -p 8080:8080 ankane/blazer
    I assume it's trying to connect to my host machine's Postgres . I don't see anything in logs too
rack (2.2.3) lib/rack/urlmap.rb:58:in `each'
rack (2.2.3) lib/rack/urlmap.rb:58:in `call'
puma (5.5.2) lib/puma/configuration.rb:249:in `call'
puma (5.5.2) lib/puma/request.rb:77:in `block in handle_request'
puma (5.5.2) lib/puma/thread_pool.rb:340:in `with_force_shutdown'
puma (5.5.2) lib/puma/request.rb:76:in `handle_request'
puma (5.5.2) lib/puma/server.rb:447:in `process_client'
puma (5.5.2) lib/puma/thread_pool.rb:147:in `block in spawn_thread'

What could be the problem ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.