view.rb
img_url
/var/www/thinkheaven/controllers/view.rb
in
img_url
(a.junctions + @parents.to_a).compact
else
(a.junctions + @parents.to_a + @f['handle'].to_a).compact
end
end
def img_url(width = 1000)
a.kit_url(base_folder + ['main_image'], [{ width: width.to_s }]) if @f['image']
end
# Find any resources available for the file.
def check_resources
{ 'video' => @f['video'],
'image' => @f['image'],
'icon' => @f['icon'],
/var/www/thinkheaven/controllers/view.rb
in
post_template
</div>
<verseResult><div class='esv'></div></verseResult>
</versebar>
</rightmargin>)
end
def post_template
main_image = img_url(1500)
%(<div class="main">
<div class="words" style="#{%(--img_url: url('#{main_image}');) unless main_image.nil?}">
<div class="title"><h2>#{@f['title'].smart_format.hyphenate}</h2></div>
<div class="divider short"></div>
<div class="info">
<div class="brief">#{@f['brief']}</div>
</div>
/var/www/thinkheaven/views/main_page.erb
in
__tilt_72680
<%
post = cfile
$css += %w[howto_basic articles_page sub_main]
$js += %w[jquery.appear verse]
$js << 'plyr' if junctions[0] = 'howto'
%>
<%= junctions[0] == 'howto' ? v.lesson_template : v.post_template%>
<% content_for :extra_scripts do %>
<%= v.scripts if junctions[0] == 'howto' %>
<script>
verseBarObj["verses"] = <%= post['verse_data'].to_json %>;
verseBarObj["notes"] = <%= post['notes'].tap{|k| !k.nil? ? k.transform_values{|x| x.hyphenate} : k}.to_json %>;
</script>
<% end %>
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/tilt-2.1.0/lib/tilt/template.rb
in
bind_call
scope_class = Module === scope ? scope : scope.class
else
scope_class = USE_BIND_CALL ? CLASS_METHOD.bind_call(scope) : CLASS_METHOD.bind(scope).call
end
method = compiled_method(locals_keys, scope_class)
if USE_BIND_CALL
method.bind_call(scope, locals, &block)
else
method.bind(scope).call(locals, &block)
end
end
# Generates all template source by combining the preamble, template, and
# postamble and returns a two-tuple of the form: [source, offset], where
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/tilt-2.1.0/lib/tilt/template.rb
in
evaluate
scope_class = Module === scope ? scope : scope.class
else
scope_class = USE_BIND_CALL ? CLASS_METHOD.bind_call(scope) : CLASS_METHOD.bind(scope).call
end
method = compiled_method(locals_keys, scope_class)
if USE_BIND_CALL
method.bind_call(scope, locals, &block)
else
method.bind(scope).call(locals, &block)
end
end
# Generates all template source by combining the preamble, template, and
# postamble and returns a two-tuple of the form: [source, offset], where
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/tilt-2.1.0/lib/tilt/template.rb
in
render
# Render the template in the given scope with the locals specified. If a
# block is given, it is typically available within the template via
# +yield+.
def render(scope=nil, locals={}, &block)
scope ||= Object.new
current_template = Thread.current[:tilt_current_template]
Thread.current[:tilt_current_template] = self
evaluate(scope, locals || {}, &block)
ensure
Thread.current[:tilt_current_template] = current_template
end
# The basename of the template file.
def basename(suffix='')
File.basename(file, suffix) if file
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
render
options[:default_encoding] ||= settings.default_encoding
# compile and render template
begin
layout_was = @default_layout
@default_layout = false
template = compile_template(engine, data, options, views)
output = template.render(scope, locals, &block)
ensure
@default_layout = layout_was
end
# render layout
if layout
extra_options = { views: views, layout: false, eat_errors: eat_errors, scope: scope }
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
erb
def initialize
super
@default_layout = :layout
@preferred_extension = nil
end
def erb(template, options = {}, locals = {}, &block)
render(:erb, template, options, locals, &block)
end
def haml(template, options = {}, locals = {}, &block)
render(:haml, template, options, locals, &block)
end
def builder(template = nil, options = {}, locals = {}, &block)
/var/www/thinkheaven/routes/main_page.rb
in
block (4 levels) in <class:App>
end
end
end
['*/:page', '*/:page/'].each do |path|
get path do
v.load(cfile)
erb :main_page, layout: :root
# erb junctions[0].to_sym, locals: @vars, layout: :root
end
end
end
end
end
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
call
pattern = compile(path, route_mustermann_opts)
method_name = "#{verb} #{path}"
unbound_method = generate_method(method_name, &block)
conditions = @conditions
@conditions = []
wrapper = block.arity.zero? ?
proc { |a, _p| unbound_method.bind(a).call } :
proc { |a, p| unbound_method.bind(a).call(*p) }
[pattern, conditions, wrapper]
end
def compile(path, route_mustermann_opts = {})
Mustermann.new(path, **mustermann_opts.merge(route_mustermann_opts))
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
block in compile!
pattern = compile(path, route_mustermann_opts)
method_name = "#{verb} #{path}"
unbound_method = generate_method(method_name, &block)
conditions = @conditions
@conditions = []
wrapper = block.arity.zero? ?
proc { |a, _p| unbound_method.bind(a).call } :
proc { |a, p| unbound_method.bind(a).call(*p) }
[pattern, conditions, wrapper]
end
def compile(path, route_mustermann_opts = {})
Mustermann.new(path, **mustermann_opts.merge(route_mustermann_opts))
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
block (3 levels) in route!
routes = base.routes[@request.request_method]
routes&.each do |pattern, conditions, block|
response.delete_header('Content-Type') unless @pinned_response
returned_pass_block = process_route(pattern, conditions) do |*args|
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
end
# Run routes defined in superclass.
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
route_eval
route_eval(&pass_block) if pass_block
route_missing
end
# Run a route block and throw :halt with the result.
def route_eval
throw :halt, yield
end
# If the current request matches pattern and conditions, fill params
# with keys and call the given block.
# Revert params afterwards.
#
# Returns pass block.
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
block (2 levels) in route!
routes = base.routes[@request.request_method]
routes&.each do |pattern, conditions, block|
response.delete_header('Content-Type') unless @pinned_response
returned_pass_block = process_route(pattern, conditions) do |*args|
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
end
# Run routes defined in superclass.
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
block in process_route
@params[:captures] = force_encoding(captures) unless captures.nil? || captures.empty?
else
values += params.values.flatten
end
catch(:pass) do
conditions.each { |c| throw :pass if c.bind(self).call == false }
block ? block[self, values] : yield(self, values)
end
rescue StandardError
@env['sinatra.error.params'] = @params
raise
ensure
params ||= {}
params.each { |k, _| @params.delete(k) } unless @env['sinatra.error.params']
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
catch
captures = pattern.match(route).captures.map { |c| URI_INSTANCE.unescape(c) if c }
values += captures
@params[:captures] = force_encoding(captures) unless captures.nil? || captures.empty?
else
values += params.values.flatten
end
catch(:pass) do
conditions.each { |c| throw :pass if c.bind(self).call == false }
block ? block[self, values] : yield(self, values)
end
rescue StandardError
@env['sinatra.error.params'] = @params
raise
ensure
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
process_route
captures = pattern.match(route).captures.map { |c| URI_INSTANCE.unescape(c) if c }
values += captures
@params[:captures] = force_encoding(captures) unless captures.nil? || captures.empty?
else
values += params.values.flatten
end
catch(:pass) do
conditions.each { |c| throw :pass if c.bind(self).call == false }
block ? block[self, values] : yield(self, values)
end
rescue StandardError
@env['sinatra.error.params'] = @params
raise
ensure
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
block in route!
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
routes = base.routes[@request.request_method]
routes&.each do |pattern, conditions, block|
response.delete_header('Content-Type') unless @pinned_response
returned_pass_block = process_route(pattern, conditions) do |*args|
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
end
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
each
end
end
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
routes = base.routes[@request.request_method]
routes&.each do |pattern, conditions, block|
response.delete_header('Content-Type') unless @pinned_response
returned_pass_block = process_route(pattern, conditions) do |*args|
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
route_eval { block[*args] }
end
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
route!
end
end
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
routes = base.routes[@request.request_method]
routes&.each do |pattern, conditions, block|
response.delete_header('Content-Type') unless @pinned_response
returned_pass_block = process_route(pattern, conditions) do |*args|
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
route_eval { block[*args] }
end
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
block in dispatch!
end
invoke do
static! if settings.static? && (request.get? || request.head?)
filter! :before do
@pinned_response = !response['Content-Type'].nil?
end
route!
end
rescue ::Exception => e
invoke { handle_exception!(e) }
ensure
begin
filter! :after unless env['sinatra.static_file']
rescue ::Exception => e
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
catch
env['sinatra.static_file'] = path
cache_control(*settings.static_cache_control) if settings.static_cache_control?
send_file path, options.merge(disposition: nil)
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke(&block)
res = catch(:halt, &block)
res = [res] if (Integer === res) || (String === res)
if (Array === res) && (Integer === res.first)
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
invoke
env['sinatra.static_file'] = path
cache_control(*settings.static_cache_control) if settings.static_cache_control?
send_file path, options.merge(disposition: nil)
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke(&block)
res = catch(:halt, &block)
res = [res] if (Integer === res) || (String === res)
if (Array === res) && (Integer === res.first)
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
dispatch!
@params.merge!(@request.params).each do |key, val|
next unless val.respond_to?(:force_encoding)
val = val.dup if val.frozen?
@params[key] = force_encoding(val)
end
invoke do
static! if settings.static? && (request.get? || request.head?)
filter! :before do
@pinned_response = !response['Content-Type'].nil?
end
route!
end
rescue ::Exception => e
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
block in call!
@env = env
@params = IndifferentHash.new
@request = Request.new(env)
@response = Response.new
@pinned_response = nil
template_cache.clear if settings.reload_templates
invoke { dispatch! }
invoke { error_block!(response.status) } unless @env['sinatra.error']
unless @response['Content-Type']
if Array === body && body[0].respond_to?(:content_type)
content_type body[0].content_type
elsif (default = settings.default_content_type)
content_type default
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
catch
env['sinatra.static_file'] = path
cache_control(*settings.static_cache_control) if settings.static_cache_control?
send_file path, options.merge(disposition: nil)
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke(&block)
res = catch(:halt, &block)
res = [res] if (Integer === res) || (String === res)
if (Array === res) && (Integer === res.first)
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
invoke
env['sinatra.static_file'] = path
cache_control(*settings.static_cache_control) if settings.static_cache_control?
send_file path, options.merge(disposition: nil)
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke(&block)
res = catch(:halt, &block)
res = [res] if (Integer === res) || (String === res)
if (Array === res) && (Integer === res.first)
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
call!
@env = env
@params = IndifferentHash.new
@request = Request.new(env)
@response = Response.new
@pinned_response = nil
template_cache.clear if settings.reload_templates
invoke { dispatch! }
invoke { error_block!(response.status) } unless @env['sinatra.error']
unless @response['Content-Type']
if Array === body && body[0].respond_to?(:content_type)
content_type body[0].content_type
elsif (default = settings.default_content_type)
content_type default
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
call
@template_cache = Tilt::Cache.new
@pinned_response = nil # whether a before! filter pinned the content-type
yield self if block_given?
end
# Rack call interface.
def call(env)
dup.call!(env)
end
def call!(env) # :nodoc:
@env = env
@params = IndifferentHash.new
@request = Request.new(env)
@response = Response.new
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rack-protection-3.0.6/lib/rack/protection/xss_header.rb
in
call
#
# Options:
# xss_mode:: How the browser should prevent the attack (default: :block)
class XSSHeader < Base
default_options xss_mode: :block, nosniff: true
def call(env)
status, headers, body = @app.call(env)
headers['X-XSS-Protection'] ||= "1; mode=#{options[:xss_mode]}" if html? headers
headers['X-Content-Type-Options'] ||= 'nosniff' if options[:nosniff]
[status, headers, body]
end
end
end
end
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rack-protection-3.0.6/lib/rack/protection/path_traversal.rb
in
call
#
# Unescapes '/' and '.', expands +path_info+.
# Thus <tt>GET /foo/%2e%2e%2fbar</tt> becomes <tt>GET /bar</tt>.
class PathTraversal < Base
def call(env)
path_was = env['PATH_INFO']
env['PATH_INFO'] = cleanup path_was if path_was && !path_was.empty?
app.call env
ensure
env['PATH_INFO'] = path_was
end
def cleanup(path)
encoding = path.encoding
dot = '.'.encode(encoding)
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rack-protection-3.0.6/lib/rack/protection/json_csrf.rb
in
call
class JsonCsrf < Base
default_options allow_if: nil
alias react deny
def call(env)
request = Request.new(env)
status, headers, body = app.call(env)
if has_vector?(request, headers)
warn env, "attack prevented by #{self.class}"
react_and_close(env, body) or [status, headers, body]
else
[status, headers, body]
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rack-protection-3.0.6/lib/rack/protection/base.rb
in
call
end
def call(env)
unless accepts? env
instrument env
result = react env
end
result or app.call(env)
end
def react(env)
result = send(options[:reaction], env)
result if (Array === result) && (result.size == 3)
end
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rack-protection-3.0.6/lib/rack/protection/base.rb
in
call
end
def call(env)
unless accepts? env
instrument env
result = react env
end
result or app.call(env)
end
def react(env)
result = send(options[:reaction], env)
result if (Array === result) && (result.size == 3)
end
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rack-protection-3.0.6/lib/rack/protection/frame_options.rb
in
call
frame_options = options[:frame_options]
frame_options = options[:frame_options].to_s.upcase unless frame_options.respond_to? :to_str
frame_options.to_str
end
end
def call(env)
status, headers, body = @app.call(env)
headers['X-Frame-Options'] ||= frame_options if html? headers
[status, headers, body]
end
end
end
end
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rack-2.2.8/lib/rack/null_logger.rb
in
call
class NullLogger
def initialize(app)
@app = app
end
def call(env)
env[RACK_LOGGER] = self
@app.call(env)
end
def info(progname = nil, &block); end
def debug(progname = nil, &block); end
def warn(progname = nil, &block); end
def error(progname = nil, &block); end
def fatal(progname = nil, &block); end
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rack-2.2.8/lib/rack/head.rb
in
call
# all other requests unchanged.
class Head
def initialize(app)
@app = app
end
def call(env)
status, headers, body = @app.call(env)
if env[REQUEST_METHOD] == HEAD
[
status, headers, Rack::BodyProxy.new([]) do
body.close if body.respond_to? :close
end
]
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/show_exceptions.rb
in
call
def @@eats_errors.puts(*) end
def initialize(app)
@app = app
end
def call(env)
@app.call(env)
rescue Exception => e
errors = env['rack.errors']
env['rack.errors'] = @@eats_errors
if prefers_plain_text?(env)
content_type = 'text/plain'
body = dump_exception(e)
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
call
# Some Rack handlers (Rainbows!) implement an extended body object protocol, however,
# some middleware (namely Rack::Lint) will break it by not mirroring the methods in question.
# This middleware will detect an extended body object and will make sure it reaches the
# handler directly. We do this here, so our middleware and middleware set up by the app will
# still be able to run.
class ExtendedRack < Struct.new(:app)
def call(env)
result = app.call(env)
callback = env['async.callback']
return result unless callback && async?(*result)
after_response { callback.call result }
setup_close(env, *result)
throw :async
end
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
call
end
def helpers
@instance
end
def call(env)
@stack.call(env)
end
def inspect
"#<#{@instance.class} app_file=#{settings.app_file.inspect}>"
end
end
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
block in call
setup_default_middleware builder
setup_middleware builder
builder.run app
builder
end
def call(env)
synchronize { prototype.call(env) }
end
# Like Kernel#caller but excluding certain magic entries and without
# line / method information; the resulting array contains filenames only.
def caller_files
cleaned_caller(1).flatten
end
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
synchronize
end
@@mutex = Mutex.new
def synchronize(&block)
if lock?
@@mutex.synchronize(&block)
else
yield
end
end
# used for deprecation warnings
def warn_for_deprecation(message)
warn message + "\n\tfrom #{cleaned_caller.first.join(':')}"
end
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
call
setup_default_middleware builder
setup_middleware builder
builder.run app
builder
end
def call(env)
synchronize { prototype.call(env) }
end
# Like Kernel#caller but excluding certain magic entries and without
# line / method information; the resulting array contains filenames only.
def caller_files
cleaned_caller(1).flatten
end
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/passenger-6.0.17/src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb
in
process_request
env[HTTP_VERSION] = HTTP_1_1
# Rails somehow modifies env['REQUEST_METHOD'], so we perform the comparison
# before the Rack application object is called.
is_head_request = env[REQUEST_METHOD] == HEAD
begin
status, headers, body = @app.call(env)
rescue => e
if e.is_a?(Errno::ENOBUFS)
raise e
end
if !should_swallow_app_error?(e, socket_wrapper)
# It's a good idea to catch application exceptions here because
# otherwise maliciously crafted responses can crash the app,
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/passenger-6.0.17/src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb
in
accept_and_process_next_request
channel.io = connection
headers = parse_request(connection, channel, buffer)
end
if headers
prepare_request(connection, headers)
begin
if headers[REQUEST_METHOD] == GET
process_request(headers, connection, socket_wrapper, @protocol == :http)
elsif headers[REQUEST_METHOD] == PING
process_ping(headers, connection)
false
elsif headers[REQUEST_METHOD] == OOBW
process_oobw(headers, connection)
false
else
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/passenger-6.0.17/src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb
in
main_loop
channel = MessageChannel.new
buffer = ''
buffer.force_encoding('binary') if buffer.respond_to?(:force_encoding)
begin
finish_callback.call
while true
hijacked = accept_and_process_next_request(socket_wrapper, channel, buffer)
socket_wrapper = Utils::UnseekableSocket.new if hijacked
end
rescue Interrupted
# Do nothing.
end
debug("Thread handler main loop exited normally")
ensure
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/passenger-6.0.17/src/ruby_supportlib/phusion_passenger/request_handler.rb
in
block (3 levels) in start_threads
@threads_mutex.synchronize do
@concurrency.times do |i|
thread = create_thread_and_abort_on_exception(i) do |number|
begin
Thread.current[:name] = "Worker #{number + 1}"
handler = thread_handler.new(self, main_socket_options)
handler.install
handler.main_loop(set_initialization_state_to_true)
ensure
set_initialization_state.call(false)
unregister_current_thread
end
end
@threads << thread
expected_nthreads += 1
/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/passenger-6.0.17/src/ruby_supportlib/phusion_passenger/utils.rb
in
block in create_thread_and_abort_on_exception
# This method requires 'thread' and 'ruby_core_enhancements'.
# If 'debug_logging' is loaded and included in the current module,
# it will use that for logging.
def create_thread_and_abort_on_exception(*args)
Thread.new do
Thread.current.abort_on_exception = true
begin
yield(*args)
rescue SystemExit
raise
rescue Exception => e
print_exception(nil, e)
exit(1)
end
end
No GET data.
No POST data.
Variable | Value |
---|---|
HTTPS | on |
HTTP_ACCEPT | */* |
HTTP_HOST | www.thinkheaven.com |
HTTP_REFERER | http://www.thinkheaven.com/articles/how-fear |
HTTP_USER_AGENT | claudebot |
HTTP_VERSION | HTTP/1.1 |
PASSENGER_CONNECT_PASSWORD | 63lPvBJ9Q7Mk8ury |
PATH_INFO | /articles/how-fear |
QUERY_STRING | |
REMOTE_ADDR | 3.237.186.170 |
REMOTE_PORT | 37218 |
REQUEST_METHOD | GET |
REQUEST_URI | /articles/how-fear |
SCRIPT_NAME | |
SERVER_NAME | www.thinkheaven.com |
SERVER_PORT | 443 |
SERVER_PROTOCOL | HTTP/1.1 |
SERVER_SOFTWARE | Apache/2.4.52 (Ubuntu) Phusion_Passenger/6.0.17 |
SSL_TLS_SNI | www.thinkheaven.com |
rack.errors | #<Object:0x00007f2387f90b58> |
rack.hijack | #<Proc:0x00007f237c033878 /root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/passenger-6.0.17/src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb:94 (lambda)> |
rack.hijack? | true |
rack.input | #<PhusionPassenger::Utils::TeeInput:0x00007f237e8e7a30 @len=0, @socket=#<PhusionPassenger::Utils::UnseekableSocket:0x00007f2352d0f530 @socket=#<UNIXSocket:fd 6>, @simulate_eof=true>, @bytes_read=0, @tmp=#<StringIO:0x00007f237c0338c8>> |
rack.logger | #<Rack::NullLogger:0x00007f2352d01598 @app=#<Rack::Protection::FrameOptions:0x00007f2352d016d8 @app=#<Rack::Protection::HttpOrigin:0x00007f2352d01818 @app=#<Rack::Protection::IPSpoofing:0x00007f2352d01930 @app=#<Rack::Protection::JsonCsrf:0x00007f2352d01a70 @app=#<Rack::Protection::PathTraversal:0x00007f2352d01b88 @app=#<Rack::Protection::XSSHeader:0x00007f2352d01d18 @app=#<App:0x00007f2352d0de88 @default_layout=:layout, @preferred_extension=nil, @app=nil, @template_cache=#<Tilt::Cache:0x00007f2352d0dd48 @cache={[:nested, #<Module:0x00007f23877c1af8>]=>#<Tilt::Cache:0x00007f235c1a0988 @cache={[:erb, :main_page, {:outvar=>"@_out_buf", :default_encoding=>"utf-8"}, "/var/www/thinkheaven/views"]=>#<Tilt::ErubiTemplate:0x00007f237e8dbe10 @options={:outvar=>"@_out_buf", :preamble=>false, :postamble=>false, :ensure=>true}, @line=1, @file="/var/www/thinkheaven/views/main_page.erb", @compiled_method={[App, []]=>#<UnboundMethod: Tilt::CompiledTemplates#__tilt_72680(locals) /var/www/thinkheaven/views/main_page.erb:-2>}, @default_encoding="utf-8", @reader=#<Proc:0x00007f235c1a0780 /root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/tilt-2.1.0/lib/tilt/template.rb:85 (lambda)>, @data="<%\r\n\tpost = cfile\r\n\t$css += %w[howto_basic articles_page sub_main]\r\n\t$js += %w[jquery.appear verse]\r\n\t$js << 'plyr' if junctions[0] = 'howto'\r\n%>\r\n<%= junctions[0] == 'howto' ? v.lesson_template : v.post_template%>\r\n<% content_for :extra_scripts do %>\r\n\t<%= v.scripts if junctions[0] == 'howto' %>\r\n\t<script>\r\n\t\tverseBarObj[\"verses\"] = <%= post['verse_data'].to_json %>;\r\n\t\tverseBarObj[\"notes\"] = <%= post['notes'].tap{|k| !k.nil? ? k.transform_values{|x| x.hyphenate} : k}.to_json %>;\r\n\t</script>\r\n<% end %>\r\n<% content_for :extra_css do %>\r\n <%= %(<style>.words:before {content: \"\";background: transparent var(--img_url) no-repeat center;background-size: cover;width: 61.5em;height: 28em;max-width: 100vw;/* padding: 0 0.5em; */}</style>) unless junctions[0] == 'howto' %>\r\n <%= ['plyr'].gen_css %>\r\n<% end %>", @freeze_string_literals=false, @engine=#<Erubi::Engine:0x00007f237e7c5be8 @escape=false, @filename=nil, @bufvar="@_out_buf", @chain_appends=nil, @text_end="'.freeze", @buffer_on_stack=false, @src="begin; __original_outvar = @_out_buf; @_out_buf = ::String.new;\r\n\tpost = cfile\r\n\t$css += %w[howto_basic articles_page sub_main]\r\n\t$js += %w[jquery.appear verse]\r\n\t$js << 'plyr' if junctions[0] = 'howto'\r\n\r\n @_out_buf << ( junctions[0] == 'howto' ? v.lesson_template : v.post_template).to_s; @_out_buf << '\r\n'.freeze; content_for :extra_scripts do \r\n @_out_buf << '\t'.freeze; @_out_buf << ( v.scripts if junctions[0] == 'howto' ).to_s; @_out_buf << '\r\n'.freeze; @_out_buf << '\t<script>\r\n\t\tverseBarObj[\"verses\"] = '.freeze; @_out_buf << ( post['verse_data'].to_json ).to_s; @_out_buf << ';\r\n\t\tverseBarObj[\"notes\"] = '.freeze; @_out_buf << ( post['notes'].tap{|k| !k.nil? ? k.transform_values{|x| x.hyphenate} : k}.to_json ).to_s; @_out_buf << ';\r\n\t</script>\r\n'.freeze; end \r\n content_for :extra_css do \r\n @_out_buf << ' '.freeze; @_out_buf << ( %(<style>.words:before {content: \"\";background: transparent var(--img_url) no-repeat center;background-size: cover;width: 61.5em;height: 28em;max-width: 100vw;/* padding: 0 0.5em; */}</style>) unless junctions[0] == 'howto' ).to_s; @_out_buf << '\r\n'.freeze; @_out_buf << ' '.freeze; @_out_buf << ( ['plyr'].gen_css ).to_s; @_out_buf << '\r\n'.freeze; end ;\n@_out_buf.to_s\n; ensure\n @_out_buf = __original_outvar\nend\n", @escapefunc="::Erubi.h">, @outvar="@_out_buf", @src="begin; __original_outvar = @_out_buf; @_out_buf = ::String.new;\r\n\tpost = cfile\r\n\t$css += %w[howto_basic articles_page sub_main]\r\n\t$js += %w[jquery.appear verse]\r\n\t$js << 'plyr' if junctions[0] = 'howto'\r\n\r\n @_out_buf << ( junctions[0] == 'howto' ? v.lesson_template : v.post_template).to_s; @_out_buf << '\r\n'.freeze; content_for :extra_scripts do \r\n @_out_buf << '\t'.freeze; @_out_buf << ( v.scripts if junctions[0] == 'howto' ).to_s; @_out_buf << '\r\n'.freeze; @_out_buf << '\t<script>\r\n\t\tverseBarObj[\"verses\"] = '.freeze; @_out_buf << ( post['verse_data'].to_json ).to_s; @_out_buf << ';\r\n\t\tverseBarObj[\"notes\"] = '.freeze; @_out_buf << ( post['notes'].tap{|k| !k.nil? ? k.transform_values{|x| x.hyphenate} : k}.to_json ).to_s; @_out_buf << ';\r\n\t</script>\r\n'.freeze; end \r\n content_for :extra_css do \r\n @_out_buf << ' '.freeze; @_out_buf << ( %(<style>.words:before {content: \"\";background: transparent var(--img_url) no-repeat center;background-size: cover;width: 61.5em;height: 28em;max-width: 100vw;/* padding: 0 0.5em; */}</style>) unless junctions[0] == 'howto' ).to_s; @_out_buf << '\r\n'.freeze; @_out_buf << ' '.freeze; @_out_buf << ( ['plyr'].gen_css ).to_s; @_out_buf << '\r\n'.freeze; end ;\n@_out_buf.to_s\n; ensure\n @_out_buf = __original_outvar\nend\n">}>}>, @pinned_response=nil>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :xss_mode=>:block, :nosniff=>true, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>true}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>true}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :allow_if=>nil, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>true}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>true}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :allow_if=>nil, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>true}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :frame_options=>:sameorigin, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>true}, @frame_options="SAMEORIGIN">> |
rack.multiprocess | true |
rack.multithread | false |
rack.request.cookie_hash | {} |
rack.request.query_hash | {} |
rack.request.query_string | |
rack.run_once | false |
rack.url_scheme | https |
rack.version | [1, 2] |
sinatra.accept | [#<Sinatra::Request::AcceptEntry:0x00007f237e7c47e8 @entry="*/*", @type="*/*", @params={}, @q=1.0>] |
sinatra.error | #<NoMethodError: undefined method `[]' for nil:NilClass> |
sinatra.error.params | {"splat"=>[""], "page"=>"how-fear"} |
sinatra.route | GET /articles{+splat}/{page} |
You're seeing this error because you have
enabled the show_exceptions
setting.