Commit graph

2545 commits

Author SHA1 Message Date
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
Dominik Sander
42b132017f Rescue from AR:SubclassNotFound and allow to delete agents
Especially when using Agent gems it happens that an Agent was deleted from the gem or the user removed a gem from the
configuration. Instead of failing with an Internal Server Error the user now is offered to delete all undefined agents.

`type.constantize` is needed to invoke the Rails auto_loader in development since not all Agent classes are loaded when
the application boots.
2016-09-21 20:10:49 +02:00
Dominik Sander
517e42c9d2 Replace jquery.serializeObject with new implementation
The old serializeObject function serialized checked checkboxes as an array which was not correct and with
strong_parameters enabled it triggered a `UnpermittedParameters` error.

In the AgentEditPage javascript we only need to initialize `select2` when then `#agent_type` field is a select
box (trying to call `select2` on normal text fields caused a javascript error in the feature specs)
2016-09-21 20:05:18 +02:00
Andrew Cantino
0dd1c78ae0 Ignore the fixture API key in WeatherAgent (#1694) 2016-09-20 20:31:44 -04:00
Andrew Cantino
89cfe8e6a0 Update README.md 2016-09-19 23:23:57 -04:00
Dominik Sander
2e4c851f8b Merge pull request #1690 from kreuzwerker/post-agent-file-upload
Add multipart file upload to PostAgent
2016-09-19 11:55:03 +02:00
Dominik Sander
663eebc080 Add multipart file upload to PostAgent
This allows the PostAgent to receive `file_pointer` events and upload the data to a website.
2016-09-19 10:39:48 +02:00
Dominik Sander
8c4e528130 Merge pull request #1681 from thiagotalma/docker-composev2
docker-compose version 2
2016-09-16 14:42:54 +02:00
Thiago Talma
4fdd69c6f4 interpolated response (#1682) 2016-09-15 19:15:46 -04:00
Dominik Sander
5868c7b4b2 Merge pull request #1686 from dsander/fix-agent-params
`service_id` is a valid part of the agent_params
2016-09-15 17:11:28 +02:00
Dominik Sander
58f388d530 service_id is a valid part of the agent_params
Fixes #1685
2016-09-15 16:17:46 +02:00
Dominik Sander
d40a372c83 Merge pull request #1684 from evertsemeijn/fourleafed
Change mysql SET storage_engine to default_storage_engine in manual installation guide.
2016-09-14 23:27:26 +02:00
Thiago Talma
5182a09de0 docker-compose version 2 2016-09-14 15:00:27 -03:00
Dominik Sander
e44b524ab9 Merge pull request #1683 from kares/update-net-ssh
bundle update net-ssh to 3.0.x (to avoid deprecation warn on Ruby 2.3)
2016-09-14 15:25:29 +02:00
Evert Semeijn
fc12f604d1 storage_engine removed since 5.7.5 replaced by default_storage_engine and small typo in numbering sections 2016-09-14 10:37:08 +02:00
kares
1696600b98 bundle update net-ssh to 3.0.x (to avoid deprecation warn on Ruby 2.3)
```
ruby-2.3.1@huginn/gems/net-ssh-2.9.2/lib/net/ssh/transport/session.rb:67:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
ruby-2.3.1@huginn/gems/net-ssh-2.9.2/lib/net/ssh/transport/session.rb:84:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
```
2016-09-14 09:34:28 +02:00
Dominik Sander
9ad83299af Merge pull request #1679 from dsander/strong-parameters
Use strong_parameters and drop protected_attributes
2016-09-12 19:11:25 +02:00
Dominik Sander
b2f031003f Use strong_parameters and drop protected_attributes
* Ensure admin attribute can not be set at sign up and the agents user_id is not changeable
* Remove ACCESSIBLE_ATTRIBUTES from the User model
* Remove side effect on agent_params from AgentsController#build_agent
2016-09-12 15:54:26 +02:00
Gergely Brautigam
b815e836b2 Updated JsonPathV2 version to latest. (#1674) 2016-09-11 10:14:16 -04:00
Andrew Cantino
7550274578 Remove unused contact model (#1680) 2016-09-10 10:24:23 -04:00
Thiago Talma
c3d5380f98 Option to set response code for webhook agent (#1676)
* setting for webhook response code

* some adjustments
2016-09-09 09:53:29 -04:00
Karol Bucek
c6a17c90fe can_enqueue? propagation detection that does not depend on Rails (#1672) 2016-09-09 09:50:32 -04:00
Dominik Sander
f42ad96ed6 Merge pull request #1645 from dsander/retry-twitter-action-agent
Allow TwitterUserAgent to retry failed actions
2016-09-08 20:44:20 +02:00
Dominik Sander
6a20afea04 Merge pull request #1673 from kreuzwerker/disable-completable-cache
Add cache_response option to completable form fields
2016-09-08 20:38:53 +02:00
Dominik Sander
3e76fa0e41 Add cache_response option to completable form fields
When `cache_response` is set to `false` for completable fields the returned options will not be
cached on the client side. The default is `true`.

Clearing the cache is needed when the completable response depends on a different option of the Agent.

Usage Example:

```
form_configurable :models, roles: :completable, cache_response: false
```

* Disable the completion callback when `select2` is opened programmatically to avoid an infinite loop
* Moved the completion ajax call from `select2-open` to `select2-opening` to clear the cached results before
 `completableDefaultOptions` is called (shows the "Loading ..." message instead of the previous results)
2016-09-08 12:21:49 +02:00
Andrew Cantino
e114202f5f Update libv8 to fix build issues on OS X (#1671) 2016-09-06 14:46:02 -04:00
Karol Bucek
8ca39a5802 minor tweaks (#1669)
* avoid unnecesary  method pollution

* production.rake typo fix

* remove un-used local variable assignment
2016-09-06 13:36:10 -04:00
Will Read
6b459ef412 Extract service option prviders for non-standard Omniauth payloads (#1655)
* Extract option prviders for non-standard Omniauth payloads

- should enable huginn_agent gem developers to add their own providers
- devs would reopen OmniauthCallbacksController and define their specific action, supplying their own option provider

* Creates a registry for option providers on the Service class

- enables huginn_agent gem developers to register their own omniauth option interpreters

* Cleans up changes to the global Service class after the spec
2016-09-04 19:39:49 -04:00
Dominik Sander
15dd51378d Merge pull request #1663 from dsander/fix-smtp-config-regression
Fix SMTP config regression when not using authentication
2016-09-03 10:07:57 +02:00
Albert Sun
6bb61065ec Allow admins to login as another user (#1659)
* switch_to_user and switch_back routes

* Uses session to store original user id
2016-09-02 15:32:38 -04:00
Dominik Sander
7e43e07736 Fix SMTP config regression when not using authentication
`user_name` and `password` need to be set to nil when no authentication should be performed

Fixes #1657
2016-09-01 22:12:29 +02:00
Géza Búza
c3ab764efc Feature/add language option to weather agent (#1544)
* Add language parameter to the weather agent

* Add text forecast for Wunderground data provider

Wunderground API returns forecast for the next few days. Returned JSON response has two types of data under the "forecast" key:
- "txt_forecast": pre-formatted text representation
- "simpleforecast": raw data representation

The "period" key contains which day the node belongs to.

Currently only "simpleforecast" is available to users of the Weather agent.
This commit appends the "txt_forecast" representation to the current data set.
2016-08-31 08:37:51 -07:00
Dominik Sander
49d3611273 Allow TwitterUserAgent to retry failed actions
Add new `emit_error_events` option which is set to `false` for all new `TwitterActionAgent`s. This will ensure the Agent
is retried when the action failed by raising an exception.

For all existing `TwitterUserAgent`s the option is set to `true` to keep the previous behavior.
2016-08-25 19:49:31 +02:00
Will Read
a6fe9743f6 EmailDigestAgent relies on received events, rather in memory (#1624)
* EmailDigestAgent relies on received events, rather than storing them in memory

- Addressing a problem where 40,000+ events were stored in one agent's memory, and the agent never loaded from the database

* Cleans up references to memory["queue"]

- incorporates suggested style and safeguards

* Adds clarification on event inclusion in email

* Use `reorder` rather than stripping away all scoping
2016-08-16 23:05:16 -04:00
Dominik Sander
944fa56e35 Merge pull request #1630 from dsander/upgrade-rails
Update rails to 4.2.7.1
2016-08-15 22:08:16 +02:00
Andrew Cantino
577b441382 Handle removed events when rendering logs (#1634) 2016-08-15 11:50:54 -04:00
Dominik Sander
fade736381 Update rails to 4.2.7.1
* Update dependencies to fix deprecation warnings
* Fix BoxcarAgent specs (found by rspec warning about expecting `raise_error` without specifying the exception)
2016-08-11 20:56:32 +02:00
Dominik Sander
76c4622bf3 Merge pull request #1620 from dsander/fix-env-in-docker
Docker: fix usage of ENV variables that are not in .env.example
2016-08-10 00:00:30 +02:00