Commit graph

1563 commits

Author SHA1 Message Date
Akinori MUSHA
ed9da9f35e Add working and url to AgentDrop for diagnostic purposes 2017-09-08 18:39:37 +09:00
Shaya G
5e1e5a1907 only add itunes icon if ns_itunes 2017-09-06 23:43:34 -04:00
HyShai
23f8efa109 add itunes podcast icon 2017-09-05 13:42:10 -04:00
Akinori MUSHA
ef03f9f8b6 Fix DataOutputAgent so that it can output items with multiple categories
The to_xml method encodes `{ "category": ["a", "b"] }` as follows:
```xml
<item>
 <category>
  <category>a</category>
  <category>b</category>
 </category>
</item>
```
Instead of this:
```xml
<item>
 <category>a</category>
 <category>b</category>
</item>
```
Even if `category` is a singular noun.  This feature prevents
DataOutputAgent from emitting multiple `<category>` elements (or
`<enclosure>`, etc.) properly, so I've added a tweak to fix the
resulted XML document.

I know the code in the current form is far from optimal, so I think
we'll have to revisit here soon or later...
2017-09-04 20:01:22 +09:00
Akinori MUSHA
d76ea3dea5 Replace some other occurrences of the references to the old URL 2017-09-04 11:15:56 +09:00
Akinori MUSHA
30a4a67a0f Replace references to https://github.com/cantino/huginn with huginn/huginn 2017-09-01 18:56:10 +09:00
Dominik Sander
e9709aec0a Prevent PeakDetectorAgent from storing invalid data in it's memory
The Agent expects the data in its memory groups to be castable to a
float. By attempting the type cast when receiving events we prevent the
memory from being corrupted with invalid data which lead exceptions
while trying to access it.

 #2101
2017-08-31 21:17:42 +02:00
Moritz Stückler
673db8d0b3 add all parameters except token to the log output 2017-08-07 10:40:30 +02:00
Moritz Stückler
309ae9cc1c add logging output for pushover agent
for debugging purposes there should be a logging output. however the pushover does not have a log output. i added a simple logging output.
2017-08-07 00:57:37 +02:00
Akinori MUSHA
db5c7ab056 Merge pull request #2076 from huginn/enrich_imap_agent_payload
Enrich ImapFolderAgent payload
2017-08-07 01:32:03 +09:00
Akinori MUSHA
4665c305c7 Add a new option include_raw_mail to ImapFolderAgent 2017-08-06 10:01:42 +09:00
Brandon Murphy
94605f5772 address issue #2059 2017-08-04 07:02:22 -07:00
Akinori MUSHA
734b84d185 Add message_id to the payload format of ImapFolderAgent 2017-08-03 20:38:40 +09:00
Dominik Sander
af5da3a165 Merge pull request #2074 from dsander/add-callback-to-growlagent
Add more options to the GrowlAgent
2017-08-01 19:35:16 +02:00
Akinori MUSHA
cec6ce1a56 Merge pull request #2047 from albertsun/update-google-api-client
Update google-api-client and Google agents
2017-08-01 22:46:43 +09:00
Albert Sun
9a17bc68b9 use of_type 2017-08-01 08:37:59 -04:00
Dominik Sander
5f92b38f6e Add more options to the GrowlAgent
It now additionally allows to use `sticky`, `priority` and
`callback_url`. The Agent is now `FormConfigurable` and supports Liquid
in all options.
`register_growl` had to be moved inside of the `events` loop to allow
Liquid interpolation for the previously static `growl_*` options.

 #2018
2017-07-31 22:19:52 +02:00
Dominik Sander
613bb423dc Merge pull request #2069 from chrishein/issue_1723
Add `output_mode` to PostAgent
2017-07-31 10:35:36 +02:00
Christian Hein
463aba9584 Add output_mode to PostAgent
This allows to merge the contents of the the emitted event into
the received event by setting this option to `merge`.
2017-07-30 16:58:42 -03:00
nogre
79fc461bd9 Keep X events to make Digest from (#2041)
* Keep X events to make Digest from

Added a configuration option to save a fixed number of events for the Digest. Currently all received events are purged when an event is emitted by this agent. This option allows received events to be remembered and reused for future Digests.

* added validate_options for new config

Added a check to prevent negative numbers, which would cause breakage. Also gave an upper limit at 999, just to set a sane maximum.

* removed unnecessary while loop

As suggested by @dsander here: https://github.com/huginn/huginn/pull/2041#discussion_r123965060

* Updated name of feature and description

* ensure retained_events is an Integer

* typo in check if retained events is int

* specs for digest_agent

* removed validate as integer

* removed check for integer status

* Rspec mostly working

Got rspec mostly working. The #'working?' check for events received in last few days is failing for me, but it was failing for other agents too on my setup. Likely a local problem, so lets see if this passes the automated builds.

* removed comments

ack. forgot about those
2017-07-28 14:29:25 +02:00
Dominik Sander
4cf58ebbd3 Merge pull request #2070 from chrishein/event_formatting_agent_fix
Add validations for `mode` values in EventFormattingAgent
2017-07-27 11:05:11 +02:00
Christian Hein
4565c73a33 Add validations for mode values
Fix conditional event_description. Should check for `merge` instead of
`merged`.
2017-07-26 10:38:03 -03:00
Géza Búza
6a71295205 Improve documentation of Website Agent (#2066)
Add sample JSON input and output events to clarify how JSONPath works.
2017-07-25 10:10:37 -07:00
Albert Sun
34b56885c8 Use a wrapper class method to invoke GoogleCalendar, per knu's PR feedback 2017-07-22 16:13:07 -04:00
Akinori MUSHA
2fcee4ec28 Remove an obsolete style 2017-07-19 17:49:53 +09:00
Akinori MUSHA
ef82bfabb7 Inherit receivers when cloning 2017-07-19 11:25:02 +09:00
Akinori MUSHA
3ffe667f9e Allow controllers to be selected 2017-07-19 11:24:22 +09:00
Albert Sun
b4fb6e2e27 put calendar cleanup in ensure block 2017-07-10 11:51:04 -04:00
Albert Sun
675700ac2d update changelog / upgrade warning to be clearer about backward compatibility 2017-07-10 11:20:08 -04:00
Akinori MUSHA
7dd9e518d4 Apply a cosmetic change 2017-07-10 12:28:35 +09:00
Akinori MUSHA
8645323dfe Expose target to CommanderAgent in templating
This allows a CommanderAgent to control only some of the targets
depending on the agent attributes.  For example, you can update the
threshold value of a target agent only if the current value is
lower (or higher) than the suggested new value.
2017-07-09 03:34:05 +09:00
Albert Sun
dee9cc1533 add a bit of compatibility code for old configs of this agent 2017-07-07 16:54:27 -04:00
Albert Sun
f9695499ae add an upgrade warning for google cal publish agent. other cleanup. 2017-07-05 10:59:54 -04:00
Albert Sun
78b68ae4c3 Update Google Agents
Updates google-api-client to 0.13 along with GoogleCalendarPublishAgent
and GoogleTranslationAgent to newer API signatures. In preparation for
including a google-cloud-bigquery gem and Agent which would otherwise
have dependency version mismatches.

May break backwards compatibility for the GoogleCalendarPublishAgent due to Google's new preferred
  authentication method. PKCS12 keys are no longer support by the gem,
  in favor of RSA private keys / JSON key files.

The new API no longer uses a discovery method and implements methods in
Ruby, adopting snake case names for object keys. So `dateTime` becomes
`date_time`. `time_zone` also appears to now be required.
2017-06-30 18:04:28 -04:00
Akinori MUSHA
fe36ce1166 Merge pull request #2014 from huginn/fix_1940
Protect the latest event from automatic deletion when using MySQL
2017-06-06 11:01:28 +09:00
Akinori MUSHA
5fadd12be6 Protect the latest event from automatic deletion when using MySQL
Detecting the database type by the name this time, because
ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter is defined only
if the mysql2 gem is loaded.

This works around #1940 for the most typical cases.
2017-05-28 01:41:59 +09:00
Akinori MUSHA
d2d557dc7b Enable liberal_parsing for ruby >=2.4 2017-05-28 01:07:54 +09:00
Akinori MUSHA
6a7221a9da Use URI Template (RFC 6570) for interpolating search_url 2017-05-25 06:40:54 +09:00
Aleksey Ivanov
0e9c24ab54 Falling back to default 'search_url' and docs 2017-05-23 12:21:31 +03:00
Aleksey Ivanov
a4b7f1b1f5 Fallback to default value for existing agents 2017-05-23 03:47:51 +03:00
Aleksey Ivanov
eccb449dfd Add configurable search_url #1552 2017-05-22 22:34:20 +03:00
Dominik Sander
1d3d3ebf16 Utilize strong parameter API to pass arbitrary hashes
By passing an empty hash to `permit` strong parameters permits
the complete hash.

e86524c0c5

Refactor ApplicationController#agent_params
2017-05-19 09:24:48 +02:00
Dominik Sander
ff2615a71f Upgrade rails and configuration to 5.1.1
Use `to_unsafe_h` to convert unpermitted parameters to a Hash
Specify rails version in migrations
2017-05-19 09:24:44 +02:00
Akinori MUSHA
1b84518b7f Merge pull request #1990 from huginn/shell_out_unbundled
Add a new option `unbundle` to ShellCommandAgent
2017-05-18 21:47:29 +09:00
Dominik Sander
f064e6bfdd Push docker images to new huginn namespace
For now we keep pushing to the old namespace but add a warning to users a
chance to change their images to the new namespace.
2017-05-17 21:18:39 +02:00
Andrew Cantino
9ad4741212 Revert "Protect the latest event from automatic deletion when using MySQL" (#1993) 2017-05-01 14:17:42 +12:00
Akinori MUSHA
eb48fd3f6d Merge pull request #1974 from cantino/fix_1940
Protect the latest event from automatic deletion when using MySQL
2017-04-28 19:29:25 +09:00
Akinori MUSHA
10e0398444 Add a new option unbundle to ShellCommandAgent
This addresses #1989.
2017-04-28 19:23:03 +09:00
Albert Sun
2ac6927a6a Option for custom response headers for receive_web_request (#1977)
* Option for custom response headers for receive_web_request

In DataOutputAgent, WebhookAgent, LiquidOutputAgent, this enables
setting options['response_headers'] as a JSON object with custom
response headers to set on the HTTP response through the
WebRequestsController.

* code copy edits from @cantino
2017-04-27 12:19:59 +12:00
Dominik Sander
e1f702adf1 Upgrade liquid (#1982)
* Update Liquid to 4.0

* Handle Liquid renaming before_method to liquid_method_missing

* Adopt `regex_replace` tags to new Liquid BlockBody class
2017-04-26 22:09:21 +02:00