hanami / webconsole Goto Github PK
View Code? Open in Web Editor NEWHanami web console for development
License: MIT License
Hanami web console for development
License: MIT License
/Users/jodosha/.gem/ruby/3.2.2/gems/hanami-webconsole-2.1.0.beta1/lib/hanami/webconsole/middleware.rb: in initialize
def initialize(app)...
/Users/jodosha/.gem/ruby/3.2.2/gems/rack-2.2.8/lib/rack/builder.rb: in new
@use << proc { |app| middleware.new(app, *args, &block) }...
/Users/jodosha/.gem/ruby/3.2.2/gems/rack-2.2.8/lib/rack/builder.rb: in block in use
@use << proc { |app| middleware.new(app, *args, &block) }...
/Users/jodosha/.gem/ruby/3.2.2/gems/rack-2.2.8/lib/rack/builder.rb: in block in to_app
app = @use.reverse.inject(app) { |a, e| e[a].tap { |x| x.freeze if @freeze_app } }...
/Users/jodosha/.gem/ruby/3.2.2/gems/rack-2.2.8/lib/rack/builder.rb: in each
app = @use.reverse.inject(app) { |a, e| e[a].tap { |x| x.freeze if @freeze_app } }...
/Users/jodosha/.gem/ruby/3.2.2/gems/rack-2.2.8/lib/rack/builder.rb: in inject
app = @use.reverse.inject(app) { |a, e| e[a].tap { |x| x.freeze if @freeze_app } }...
/Users/jodosha/.gem/ruby/3.2.2/gems/rack-2.2.8/lib/rack/builder.rb: in to_app
app = @use.reverse.inject(app) { |a, e| e[a].tap { |x| x.freeze if @freeze_app } }...
/Users/jodosha/.gem/ruby/3.2.2/gems/hanami-router-2.1.0.beta1/lib/hanami/middleware/app.rb: in block in initialize
@trie.add(path, builder.to_app.freeze)...
/Users/jodosha/.gem/ruby/3.2.2/gems/hanami-router-2.1.0.beta1/lib/hanami/middleware/app.rb: in each
mapping.each do |path, stack|...
/Users/jodosha/.gem/ruby/3.2.2/gems/hanami-router-2.1.0.beta1/lib/hanami/middleware/app.rb: in initialize
mapping.each do |path, stack|...
/Users/jodosha/.gem/ruby/3.2.2/bundler/gems/hanami-ccf1a264e28a/lib/hanami/slice/routing/middleware/stack.rb: in new
Hanami::Middleware::App.new(app, mapping)...
/Users/jodosha/.gem/ruby/3.2.2/bundler/gems/hanami-ccf1a264e28a/lib/hanami/slice/routing/middleware/stack.rb: in to_rack_app
Hanami::Middleware::App.new(app, mapping)...
/Users/jodosha/.gem/ruby/3.2.2/bundler/gems/hanami-ccf1a264e28a/lib/hanami/slice/router.rb: in to_rack_app
middleware_stack.to_rack_app(self)...
/Users/jodosha/.gem/ruby/3.2.2/bundler/gems/hanami-ccf1a264e28a/lib/hanami/slice.rb: in rack_app
@rack_app ||= router.to_rack_app...
/Users/jodosha/.gem/ruby/3.2.2/bundler/gems/hanami-ccf1a264e28a/lib/hanami/slice.rb: in call
rack_app.call(...)...
/Users/jodosha/.gem/ruby/3.2.2/gems/rack-2.2.8/lib/rack/tempfile_reaper.rb: in call
status, headers, body = @app.call(env)...
/Users/jodosha/.gem/ruby/3.2.2/gems/rack-2.2.8/lib/rack/lint.rb: in _call
ary = @app.call(env)...
/Users/jodosha/.gem/ruby/3.2.2/gems/rack-2.2.8/lib/rack/lint.rb: in call
dup._call(env)...
/Users/jodosha/.gem/ruby/3.2.2/gems/rack-2.2.8/lib/rack/show_exceptions.rb: in call
@app.call(env)...
/Users/jodosha/.gem/ruby/3.2.2/gems/rack-2.2.8/lib/rack/common_logger.rb: in call
status, headers, body = @app.call(env)...
/Users/jodosha/.gem/ruby/3.2.2/gems/rack-2.2.8/lib/rack/content_length.rb: in call
status, headers, body = @app.call(env)...
/Users/jodosha/.gem/ruby/3.2.2/gems/puma-6.4.0/lib/puma/configuration.rb: in call
@app.call(env)...
/Users/jodosha/.gem/ruby/3.2.2/gems/puma-6.4.0/lib/puma/request.rb: in block in handle_request
@app.call(env)...
/Users/jodosha/.gem/ruby/3.2.2/gems/puma-6.4.0/lib/puma/thread_pool.rb: in with_force_shutdown
yield...
/Users/jodosha/.gem/ruby/3.2.2/gems/puma-6.4.0/lib/puma/request.rb: in handle_request
status, headers, app_body = @thread_pool.with_force_shutdown do...
/Users/jodosha/.gem/ruby/3.2.2/gems/puma-6.4.0/lib/puma/server.rb: in process_client
case handle_request(client, requests + 1)...
/Users/jodosha/.gem/ruby/3.2.2/gems/puma-6.4.0/lib/puma/server.rb: in block in run
@thread_pool = ThreadPool.new(thread_name, @options) { |client| process_client client }...
/Users/jodosha/.gem/ruby/3.2.2/gems/puma-6.4.0/lib/puma/thread_pool.rb: in block in spawn_thread
@out_of_band_pending = true if block.call(work)
Whey you run Hanami app inside Docker/Vagrant container (in dev env)
you request end up "as being from external REMOTE_ADDR" and BetterErrors does not show itself for security reasons.
We need a way to setup this option, for example:
BetterErrors::Middleware.allow_ip! '172.18.0.0/16'
Maybe it should be an ENV var available?
Like HANAMI_WEBCONSOLE_TRUSTED_IP
?
Details: https://github.com/charliesome/better_errors/wiki/Allowing-access-to-the-console
The change in #7 is sufficient for now, but in the longer term it would be good to propose a change to BetterErrors that supports our need to tailer the response code for responses generated from the middleware.
After upgrading to hanami 1.2 I ran into a problem on my Jenkins CI. The build console output:
+ bundle exec hanami db prepare
[hanami] [INFO] (0.000514s) SET standard_conforming_strings = ON
[hanami] [INFO] (0.000266s) SET client_min_messages = 'WARNING'
[hanami] [INFO] (0.009738s) SELECT version()
[hanami] [ERROR] Java::OrgPostgresqlUtil::PSQLException: ERROR: relation "schema_migrations" does not exist
Position: 27: SELECT NULL AS "nil" FROM "schema_migrations" LIMIT 1
caller binding only supported in interpreter
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/binding_of_caller-0.8.0/lib/binding_of_caller/jruby_interpreted.rb:101:in `binding_of_caller'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/binding_of_caller-0.8.0/lib/binding_of_caller/jruby_interpreted.rb:63:in `of_caller'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/binding_of_caller-0.8.0/lib/binding_of_caller/jruby_interpreted.rb:69:in `callers'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/better_errors-2.4.0/lib/better_errors/exception_extension.rb:7:in `set_backtrace'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/core.rb:132:in `convert_exception_class'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/database/misc.rb:421:in `raise_error'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/adapters/jdbc.rb:694:in `statement'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/adapters/jdbc.rb:254:in `block in execute'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/connection_pool/threaded.rb:103:in `hold'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/database/connecting.rb:306:in `synchronize'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/adapters/jdbc.rb:253:in `execute'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/dataset/actions.rb:1135:in `execute'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/adapters/jdbc.rb:765:in `fetch_rows'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/dataset/actions.rb:155:in `each'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/dataset/actions.rb:759:in `single_value'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/dataset/actions.rb:314:in `get'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/database/query.rb:210:in `_table_exists?'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/database/query.rb:199:in `block in table_exists?'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/database/transactions.rb:171:in `block in transaction'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/connection_pool/threaded.rb:107:in `hold'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/database/connecting.rb:306:in `synchronize'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/database/transactions.rb:165:in `transaction'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/database/query.rb:199:in `table_exists?'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/extensions/migration.rb:789:in `schema_dataset'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/extensions/migration.rb:457:in `initialize'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/extensions/migration.rb:687:in `initialize'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/sequel-4.49.0/lib/sequel/extensions/migration.rb:404:in `run'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/hanami-model-1.2.0/lib/hanami/model/migrator/adapter.rb:82:in `migrate'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/hanami-model-1.2.0/lib/hanami/model/migrator.rb:303:in `migrate'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/hanami-model-1.2.0/lib/hanami/model/migrator.rb:334:in `prepare'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/hanami-model-1.2.0/lib/hanami/model/migrator.rb:247:in `prepare'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/hanami-1.2.0/lib/hanami/cli/commands/db/prepare.rb:26:in `prepare_database'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/hanami-1.2.0/lib/hanami/cli/commands/db/prepare.rb:17:in `call'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/hanami-1.2.0/lib/hanami/cli/commands/command.rb:85:in `call'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/hanami-cli-0.2.0/lib/hanami/cli.rb:57:in `call'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/hanami-1.2.0/bin/hanami:6:in `<main>'
org/jruby/RubyKernel.java:974:in `load'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/bin/hanami:1:in `<main>'
org/jruby/RubyKernel.java:974:in `load'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/bin/hanami:23:in `(root)'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:1:in `(root)'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:75:in `kernel_load'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:28:in `run'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/bundler-1.16.1/lib/bundler/cli.rb:424:in `exec'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/bundler-1.16.1/lib/bundler/cli.rb:27:in `dispatch'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `block in start'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/bundler-1.16.1/lib/bundler/cli.rb:18:in `start'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/lib/ruby/gems/shared/gems/bundler-1.16.1/exe/bundle:30:in `<main>'
org/jruby/RubyKernel.java:974:in `load'
/var/lib/****/.rbenv/versions/jruby-9.1.16.0/bin/bundle:23:in `<main>'
At first I thought something was wrong with my database configuration, but then I figured it out: It seems the binding_of_caller
gem that hanami-webconsole
depends on is incompatible with JRuby and led to this cryptic error.
Changing the Gemfile
line to gem 'hanami-webconsole', platforms: :mri
fixed it for me.
At the very least, we should probably add a warning to the README about this. In the best case, there might be an alternative for JRuby?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.