snicker / gntp-regrowl

Regrowl GNTP Messages to Other Machines over Network
MIT License
7 stars 2 forks source link

How to set it to take effect #7

Closed tortoo closed 3 years ago

tortoo commented 3 years ago

Hi, snicker! Sorry to bother you again. 😹

A few years later I try to find a way to let Growl Agent get rid of the shackles of Mac to forward the messages to prowl or Android directly. After going in a big circle, I went back to regrowl, hope it’s not too late. 🙈

After a little trouble, regrowl was finally installed on the VPS which also deployed huginn. Next I created a new file named .regrowl and copied the content in the Config File into it and added my prowlAPIkey.

But I don't know how to set it next, such as address and port.

I tested the command regrowl -d and it gave me the flollwing:

regrowl.server            INFO:Loading Server
regrowl.bridge            INFO:Scanning regrowl.bridge.forward module
regrowl.bridge            INFO:Loaded GrowlForwarder
regrowl.bridge            INFO:Scanning regrowl.bridge.echo module
regrowl.bridge            INFO:Loaded EchoNotifier
regrowl.server            INFO:Starting Server
regrowl.server            INFO:Listening for GNTP on 0.0.0.0 port 12345

Hope to get your help, thanks a lot!

tortoo commented 3 years ago

When I did dry run in Growl Agent with above settings, it showed connection refused. After changing port to 23053 it gave me this:

[00:00:00] INFO -- : Dry Run failed
[00:00:00] ERROR -- : Exception during dry-run. undefined method `strip' for nil:NilClass: /app/vendor/bundle/ruby/2.5.0/gems/ruby-growl-4.1/lib/ruby-growl/gntp.rb:490:in `receive'
/app/vendor/bundle/ruby/2.5.0/gems/ruby-growl-4.1/lib/ruby-growl/gntp.rb:541:in `send'
/app/vendor/bundle/ruby/2.5.0/gems/ruby-growl-4.1/lib/ruby-growl/gntp.rb:273:in `notify'
/app/app/models/agents/growl_agent.rb:70:in `notify_growl'
/app/app/models/agents/growl_agent.rb:81:in `block (2 levels) in receive'
/app/app/concerns/liquid_interpolatable.rb:64:in `interpolate_with'
/app/app/models/agents/growl_agent.rb:75:in `block in receive'
/app/app/models/agents/growl_agent.rb:74:in `each'
/app/app/models/agents/growl_agent.rb:74:in `receive'
/app/app/concerns/dry_runnable.rb:29:in `dry_run!'
/app/app/controllers/agents/dry_runs_controller.rb:41:in `create'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/abstract_controller/base.rb:195:in `process_action'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_controller/metal/rendering.rb:30:in `process_action'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.3.1/lib/active_support/callbacks.rb:135:in `run_callbacks'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/abstract_controller/callbacks.rb:41:in `process_action'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_controller/metal/rescue.rb:22:in `process_action'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_controller/metal/instrumentation.rb:33:in `block in process_action'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.3.1/lib/active_support/notifications.rb:180:in `block in instrument'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.3.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.3.1/lib/active_support/notifications.rb:180:in `instrument'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_controller/metal/instrumentation.rb:32:in `process_action'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-6.0.3.1/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/abstract_controller/base.rb:136:in `process'
/app/vendor/bundle/ruby/2.5.0/gems/actionview-6.0.3.1/lib/action_view/rendering.rb:39:in `process'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_controller/metal.rb:190:in `dispatch'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_controller/metal.rb:254:in `dispatch'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_dispatch/routing/route_set.rb:33:in `serve'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_dispatch/journey/router.rb:49:in `block in serve'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_dispatch/journey/router.rb:32:in `each'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_dispatch/journey/router.rb:32:in `serve'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_dispatch/routing/route_set.rb:834:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/warden-1.2.8/lib/warden/manager.rb:36:in `block in call'
/app/vendor/bundle/ruby/2.5.0/gems/warden-1.2.8/lib/warden/manager.rb:34:in `catch'
/app/vendor/bundle/ruby/2.5.0/gems/warden-1.2.8/lib/warden/manager.rb:34:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/rack-2.2.2/lib/rack/tempfile_reaper.rb:15:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/rack-2.2.2/lib/rack/etag.rb:27:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/rack-2.2.2/lib/rack/conditional_get.rb:40:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/rack-2.2.2/lib/rack/head.rb:12:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_dispatch/http/content_security_policy.rb:18:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/rack-2.2.2/lib/rack/session/abstract/id.rb:266:in `context'
/app/vendor/bundle/ruby/2.5.0/gems/rack-2.2.2/lib/rack/session/abstract/id.rb:260:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_dispatch/middleware/cookies.rb:648:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.3.1/lib/active_support/callbacks.rb:101:in `run_callbacks'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/railties-6.0.3.1/lib/rails/rack/logger.rb:37:in `call_app'
/app/vendor/bundle/ruby/2.5.0/gems/railties-6.0.3.1/lib/rails/rack/logger.rb:26:in `block in call'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.3.1/lib/active_support/tagged_logging.rb:80:in `block in tagged'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.3.1/lib/active_support/tagged_logging.rb:28:in `tagged'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.3.1/lib/active_support/tagged_logging.rb:80:in `tagged'
/app/vendor/bundle/ruby/2.5.0/gems/railties-6.0.3.1/lib/rails/rack/logger.rb:26:in `call'
/app/config/initializers/silence_worker_status_logger.rb:3:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_dispatch/middleware/request_id.rb:27:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/rack-2.2.2/lib/rack/method_override.rb:24:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/rack-2.2.2/lib/rack/runtime.rb:22:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_dispatch/middleware/executor.rb:14:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_dispatch/middleware/static.rb:126:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/rack-2.2.2/lib/rack/sendfile.rb:110:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-6.0.3.1/lib/action_dispatch/middleware/host_authorization.rb:76:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/railties-6.0.3.1/lib/rails/engine.rb:527:in `call'
/app/vendor/bundle/ruby/2.5.0/gems/railties-6.0.3.1/lib/rails/railtie.rb:190:in `public_send'
/app/vendor/bundle/ruby/2.5.0/gems/railties-6.0.3.1/lib/rails/railtie.rb:190:in `method_missing'
/app/vendor/bundle/ruby/2.5.0/gems/rack-2.2.2/lib/rack/handler/webrick.rb:95:in `service'
/usr/lib/ruby/2.5.0/webrick/httpserver.rb:140:in `service'
/usr/lib/ruby/2.5.0/webrick/httpserver.rb:96:in `run'
/usr/lib/ruby/2.5.0/webrick/server.rb:307:in `block in start_thread'

And in terminal it gave this:

regrowl.server            INFO:Handling request from 170.10.0.5:43483
regrowl.server            INFO:Reading 810 Bytes
regrowl.server            ERROR:GNTP Error
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/regrowl-0.0.1-py2.7.egg/regrowl/server.py", line 64, in handle
    message = parse_gntp(self.data, self.server.options.password)
  File "/usr/local/lib/python2.7/dist-packages/gntp/core.py", line 511, in parse_gntp
    return GNTPNotice(data, password=password)
  File "/usr/local/lib/python2.7/dist-packages/gntp/core.py", line 407, in __init__
    self.decode(data, password)
  File "/usr/local/lib/python2.7/dist-packages/gntp/core.py", line 425, in decode
    self._validate_password(password)
  File "/usr/local/lib/python2.7/dist-packages/gntp/core.py", line 181, in _validate_password
    raise errors.AuthError('Invalid Hash')
AuthError: Invalid Hash
tortoo commented 3 years ago

@snicker Finally solved the above problem, prowl can receive notifications! But the new problem is, the url seemed not to be delivered when the message forwarded to prowl. The notification received in prowl does not contain url.