Commit graph

2582 commits

Author SHA1 Message Date
Akinori MUSHA
50b5833a3f Improve encoding detection in WebsiteAgent
Previously, WebsiteAgent always assumed that a content with no charset
specified in the Content-Type header would be encoded in UTF-8.  This
enhancement is to make use of the encoding detector implemented in
Nokogiri for HTML/XML documents, instead of blindly falling back to
UTF-8.

When the document `type` is `html` or `xml`, WebsiteAgent tries to
detect the encoding of a fetched document from the presence of a BOM,
XML declaration, or HTML `meta` tag.

This fixes #1742.
2016-10-27 13:00:37 +09:00
Akinori MUSHA
950975d7a8 Merge pull request #1744 from cantino/xpath-string
Use the XPath expression `string(.)` instead of `.//text()`
2016-10-23 09:57:06 +09:00
Akinori MUSHA
7ed40a6901 Use the XPath expression string(.) instead of .//text()
That is the correct way to extract a raw string with all text nodes
concatenated without entity escaping.
2016-10-21 00:23:00 +09:00
Akinori MUSHA
0fcd8e285e Normalize URL in to_uri and uri_expand liquid filters 2016-10-17 15:02:57 +09:00
Akinori MUSHA
22645a9441 Merge remote-tracking branch 'origin/data_output_agent_limits_events_after_ordering' 2016-10-17 14:38:52 +09:00
Akinori MUSHA
308f5ec888 Reset memory of all DataOutputAgents for the last fix to take effect 2016-10-17 14:37:13 +09:00
Dominik Sander
04e0436540 Merge pull request #1736 from dsander/delayed_job_active_record
Fix delayed_job_active_record overriding defaults
2016-10-15 16:37:44 +02:00
Dominik Sander
bf35a49f6c Fix delayed_job_active_record overriding defaults
Because `delayed_job_active_record` was loading active_record to early it used to override defaults set in our
initializers.
2016-10-15 12:45:23 +02:00
Akinori MUSHA
00fe9d890d Merge pull request #1729 from cantino/retire_ar_mysql_column_charset
Retire ar_mysql_column_charset
2016-10-14 21:35:44 +09:00
Dominik Sander
005f01a4ad Merge pull request #1716 from dsander/liquid-as-object
Add as_object Liquid filter
2016-10-14 12:53:24 +02:00
Dominik Sander
d2cbd04ac8 Add as_object Liquid filter
The `as_object` returns the received data/object as is without casting it to a string like liquid normally does. It
can be used as a JSONPath replacement or to emit result of a Liquid filter chain as an array.

`catch` and `throw` needs to be used to break out of Liquid render chain. Liquid aggregates the output of every
expression an array and [joins](https://github.com/Shopify/liquid/blob/v3.0.6/lib/liquid/block.rb#L147) it together that
join makes it impossible to get anything else than a string out of a Liquid template.
2016-10-14 12:33:31 +02:00
YURA BUYLOV
864b0708a7 Agent form: ace-editor highlighting and theme (#1727) 2016-10-11 19:25:12 -04:00
Akinori MUSHA
ba0d2ee0de Retire ar_mysql_column_charset
Rails 5 has native support for charset/collate.
2016-10-11 22:25:54 +09:00
Enfop
8efe50ad99 manual event agent validate JSON field before form submit (#1728) 2016-10-11 07:53:56 -04:00
Andrew Cantino
005be58d30 Update forecast_io gem and language (#1722) 2016-10-09 10:49:12 -04:00
Dominik Sander
3d709088f1 Merge pull request #1725 from dsander/ruby-version-docs
Update documentation
2016-10-09 13:54:29 +02:00
Dominik Sander
b0ae9581d2 Update documentation
Ruby > 2.2 is now required
Manual installation guide works on Ubuntu 16.04
Remove obsolete `string-scrub` gem
2016-10-09 13:18:07 +02:00
Akinori MUSHA
12534837da Update CHANGES.md 2016-10-07 20:36:39 +09:00
Akinori MUSHA
8a4b10c268 Use rb-kqueue on BSD systems
See: https://github.com/guard/listen#on-bsd
2016-10-07 20:06:28 +09:00
Akinori MUSHA
4bd7822454 Merge branch 'rss_agent-feedjira' 2016-10-07 20:06:04 +09:00
Akinori MUSHA
df6fb7e5fc Fix super which is not defined yet here 2016-10-07 19:32:02 +09:00
Akinori MUSHA
12cecb8392 Merge branch 'data_output_agent_limits_events_after_ordering' 2016-10-07 19:22:42 +09:00
Akinori MUSHA
63c7ec5fdd Reorder received_events by id asc
The implementation of latest_events() assumed that while it wasn't
actually the case; the association of received_events has a default
scope of `order(id: :desc)`.
2016-10-07 19:22:00 +09:00
Akinori MUSHA
654da6a4e6 Add a failing test
There needs more than 2 * events_to_show events to check if selection
before limiting actually works.
2016-10-07 19:21:57 +09:00
Akinori MUSHA
5596dde21d Merge pull request #1564 from cantino/rss_agent-feedjira
RssAgent: Migrate from FeedNormalizer to Feedjira
2016-10-06 12:06:29 +09:00
Akinori MUSHA
d63f714ae9 RssAgent: Migrate from FeedNormalizer to Feedjira
FeedNormalizer is no longer maintained, and its Atom support has flaws
in that it throws away what RSS::Parser returns and falls back to using
SimpleRSS which is not capable of handling XML entities, resulting in
getting ususable URLs such as ones including `&`.

Feedjira is highly customizable as it implements parsers for various
feed formats on its own using sax-machine.

The `clean` option is reimplemented using the loofah gem.
`Feedjira::FeedUtilities#sanitize_entries!` is not used because it
tries to sanitize non-HTML properties too.

A new option `include_feed_info` is added, with which turned on feed
information is added to each event payload.

A new key `links` is added, which lists all `link` elements.

A new key `enclosure` is added.
2016-10-06 11:49:34 +09:00
Dominik Sander
cd5b209571 Merge pull request #1688 from dsander/rails5
Update to Rails 5
2016-10-05 23:31:26 +02:00
Dominik Sander
bade1a1a32 Work around counter cache bug when not selecting the cached column 2016-10-05 22:47:38 +02:00
Dominik Sander
5cfca6bf68 Ensure helper classes are available in production
Due to eager_loading being active in production helper classes in lib need to be explicitly required.
2016-10-05 22:47:38 +02:00
Dominik Sander
b3a5592583 Update kaminari to fix URL sanitization exceptions in production 2016-10-05 22:47:38 +02:00
Dominik Sander
f1e554cfff Add integration test for dry running Agents 2016-10-05 22:47:38 +02:00
Dominik Sander
5b5da87c3a Add integration tests for Scenario imports 2016-10-05 22:47:38 +02:00
Dominik Sander
aceace7950 Docker: update ruby to 2.3 and use RAILS_LOG_TO_STDOUT 2016-10-05 22:47:38 +02:00
Dominik Sander
ad33e280eb Remove superseded rails_12factor gem 2016-10-05 22:47:38 +02:00
Dominik Sander
b651f08cc5 Fix the specs on rails5 2016-10-05 22:47:38 +02:00
Dominik Sander
26e878c61a Fix the rest of the deprecation warnings 2016-10-05 22:47:38 +02:00
Dominik Sander
03b628dadb Fix "request methods will accept only keyword arguments" deprecation 2016-10-05 22:47:38 +02:00
Dominik Sander
5fbeb105b2 Update gems and configs to Rails5 2016-10-05 22:47:38 +02:00
Akinori MUSHA
7e79d576b5 Improve Utils.normalize_uri (#1719)
* Improve Utils.normalize_uri

Globally replacing generally unsafe characters in a URL would not fix
invalid authorities and paths, so use Addressable::URI to normalize them
when necessary.

This should fix #1701.

* Remove an unused function

* Fix the test case to make sure an IPv6 address is supported
2016-10-05 14:17:04 +09:00
Akinori MUSHA
4150b1e29c Merge pull request #1720 from cantino/pushover_parameters
PushoverAgent: Treat parameter options as templates rather than default values
2016-10-05 10:07:09 +09:00
Akinori MUSHA
44efff5a46 Fix grammar 2016-10-05 09:28:24 +09:00
Akinori MUSHA
a47c5c8a80 PushoverAgent: Treat parameter options as templates rather than default values
This should fix #1718.

While at it, character limit implementation is fixed: `slice(0..n)`
would take the first n+1 characters instead of n.
2016-10-04 21:57:30 +09:00
Akinori MUSHA
fd5bd093ef Update binstubs (spring binstub --all) 2016-10-04 18:57:18 +09:00
Dominik Sander
b4bf5c499d Merge pull request #1715 from dsander/fix-dry-run-event-escaping
Fix escape characters of events when dry running
2016-09-30 17:23:19 +02:00
Dominik Sander
4309460896 Fix escape characters of events when dry running
JSONEditor double escapes escape characters to properly display them in the UI, however when dry running Agents we
actually need to send the Event's characters as they were.
Before an event containing new lines like this `Line A\nLineB` would be send as `Line A\\nLineB` to the backend. By
replacing the double escaped slashes we ensure the event is handled as it would be when not dry running.

 #1677
2016-09-30 17:06:50 +02:00
Andrew Cantino
4469213425 Update README.md 2016-09-29 13:43:18 -04:00
Andrew Cantino
5e5d1ea828 Allow style tags (#1712) 2016-09-28 13:55:42 -04:00
bobbysteel
1497712e04 Clarify path for a simple body_text event. (#1705)
* Clarify path for a simple body_text event. 

It's not really clear with regard to a normal agent that this is simply the name of the field.

* updated text
2016-09-23 15:36:18 -04:00
Dominik Sander
e0fa7f00d0 Merge pull request #1695 from kreuzwerker/missing-agent-warning
Rescue from AR:SubclassNotFound and allow to delete agents
2016-09-21 21:04:46 +02:00
Dominik Sander
d2b26a0684 Merge pull request #1698 from kreuzwerker/fix-form-completion
Replace jquery.serializeObject with new implementation
2016-09-21 20:58:03 +02:00