Commit graph

156 commits

Author SHA1 Message Date
Dominik Sander
2cd37e2ab4 Do not seed when a user exists
Previously the seed logic ran when `SEED_EMAIL` was unset and the `admin`
users email address was changed, or if `SEED_EMAIL` did not match it
anymore.

We run `db:seed` on every docker container start to make it easy to get
started with Huginn. That could lead to situations in which the
container did not start if the admin users email address was changed (the
Seeder failed due to the uniqueness constraint on `username`).

Since we "seed" the database I think it is best to bail out of the
seeding logic as long as at least one user exists.

Fixes #2362
2018-10-03 12:03:31 +02: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
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
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
722349c5cd Make DataOutputAgent serve RSS output as application/rss+xml
For backward compatibility, a new option `rss_content_type` is added
and existing agents will have its value set to `text/xml`, which was
the Content-Type value before this change.

This fixes #1968.
2017-04-19 17:35:46 +09:00
aeter
d75e4c7cef Close #801 - peak detector min datapoints (#1924)
Closes -- https://github.com/cantino/huginn/issues/801
Testing -- ran rspec
About --
  Adds an option `min_events` to the peak detector agent. The
  agent will start looking for peaks only after min number of
  events are accumulated.
2017-03-10 19:05:10 -05:00
Lucas Verney
2dab52ae9b Make migrations compatible with SQLite (#1842) 2017-01-03 07:55:36 -05:00
Akinori MUSHA
3a0c9e6274 Disable automatic URL normalization and absolutization on url
This was discussed in #1766.

For backward compatibility, existing WebsiteAgents with a key named
`url` will be given a `template` to resolve `url`.
2016-11-27 13:38:23 +09:00
Akinori MUSHA
3d91469733 Make WebsiteAgent merge template with the results of extract (#1816)
A new extraction option `hidden` is added so that keys with it gets
excluded from the final payloads while they can be used in `template`.
2016-11-27 13:33:24 +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
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
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
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
Andrew Cantino
7550274578 Remove unused contact model (#1680) 2016-09-10 10:24:23 -04: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
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
Akinori MUSHA
9b23c28049 Merge pull request #1444 from cantino/data_output_agent_limits_events_after_ordering
DataOutputAgent limits events after ordering
2016-08-08 14:12:25 +09:00
Dominik Sander
d6e185f0f3 Docker: fix usage of ENV variables that are not in .env.example
Variables that are usable but not present with default values in .env.example were located with this one-liner:

```
diff --changed-group-format='%<' --unchanged-group-format='' <(ack "ENV\[.(.+?).\]" --output='$1' -h app config lib db| sort | uniq) <(grep = .env.example | sed -e 's/^#\([^ ]\)/\1/' | grep -v -e '^#'| ack "(.+?)=" --output='$1'|sort)
```
2016-08-06 14:54:08 +02:00
Judy Ngai
1abcd947f5 Uploadicons (#1427)
* checking in work for glyph upload

* checking in icon selections

* added more icon options

* work on upload icon

* fix issue

* switched to options for select

* removed wrapper and removed commment

* add migration to support icon

* remove right floating

* rm params session add it to model

* rebuilt the menu

* rm extra div

* converted js to coffee

* quick change in indentation

* using the view helper

* submitting icons and loading into form

* added icon to both scenario export and import

* added icon to spec

* low level caching the icons

* tentative work in making a new coffee class

* renamed js page

* switched to cache in memory and worked on coffee class

* made pathsmatching compatible for all scenarios

* switched to rails root

* fixed all rubocop stylings

* fixed line is too long styling

* rm private method definition

* patch to avoid having no icon

* blank or nil?

* reordering the lines
2016-06-15 23:52:50 -07:00
Akinori MUSHA
978ec06199 Rename events_order to events_list_order and readd events_order
`events_order` determines how to select events for outputting, whereas
`events_list_order` determines how to list selected events in the
output.
2016-06-07 15:11:47 +09:00
Irfan Charania
50aff67a8a Make itunes compatible optional (#1411)
* Make itunes compatible optional

in generated xml

* Add tests + migration

* Description change

as per comment
2016-04-30 13:44:09 -07:00
Akinori MUSHA
4280bdc5e0 Merge pull request #1340 from cantino/post_agent_downcase_response_headers
Downcase header names in Events that PostAgent emits
2016-04-12 16:31:04 +09:00
Akinori MUSHA
b095317e4c Add an option event_headers_style to PostAgent
It is defaulted to `capitalized`, normalizing emitted headers by
capitalizing the names so downstream agents don't need to bother with
the letter cases.

Previously, the style of header names in an emitted event would vary
depending on the server and the backend HTTP library.  Most notably, the
`net_http` backend downcases header names whereas other backends do not.

For backward compatibility, preexisting PostAgents are automatically
configured to have `event_headers_style` set to `raw` via migration.
2016-04-12 16:08:19 +09:00
Will Read
98f50de06b Sets the new user up with an example set of agents
- gives them a place to start from
- leverages existing code to import scenarios
- adds test coverage to seeds to ensure sees can run multiple times against the same db as is the case for Docker
- adds env variable to set if importing is turned on for new user
- adds env variable to point to a custom scenario for new users
2016-04-10 16:03:21 -07:00
Dominik Sander
9d1bfeb778 Make FtpsiteAgent FileHandling aware
It emits file_pointers for changed files and writes received events to the FTP server.
2016-03-18 20:43:35 +01:00
Dominik Sander
8508928943 Admins can deactivate user accounts 2016-03-17 20:47:51 +01:00
Dominik Sander
ee1ebea830 Allow to configure various devise settings in .env 2016-03-17 20:47:45 +01:00
Dominik Sander
4722ebfe4e Add admin user management interface 2016-03-17 20:36:07 +01:00
Dominik Sander
e32067862f Do not seed the database when the configured seed user already exists
#1315
2016-02-22 22:19:22 +01:00
Andrew Cantino
3469ed2a5e Add a migration to set url_from_event and remove direct usage of Event url payload value 2016-01-08 15:05:35 -08:00
Will Read
4fdc600788 Remove schema.rb from git
- Huginn supports MySQL and Postgres which generates conflicts in the schema
- Remvoing it shows that schema.rb is not a source of truth

Closes TildeWill/huginn#13
Related Issue cantino/huginn#1195
2016-01-03 05:36:00 +00:00
Will Read
f36b39b85c Provide a default value in the case that the ENV variable isn't set 2015-08-08 13:05:40 -07:00
Will Read
5b6d7c7e85 Adds the ability to allow public signup without invite code
- Introduces new ENV variable SKIP_INVITATION_CODE, intentionally
  phrased in the negative so that the absence of the variable
  will not change the behavior of existing deployments.
2015-08-08 12:33:45 -07:00
Andrew Cantino
b3e6275e4a grammer 2015-07-17 13:41:16 -04:00
Andrew Cantino
b31a0ec3e7 fix specs and add support for translation in Scenario exports 2015-05-25 11:38:51 -07:00
stvnrlly
38a5dbfd87 db migration for new cleanup time 2015-05-11 08:24:59 -04:00
Dominik Sander
da77a8a333 Merge pull request #711 from dsander/pushbullet-unification
Pushbullet pull request unification
2015-02-25 22:52:56 +01:00
Akinori MUSHA
7c6224d7eb Do not refer to AbstractMysqlAdapter for checking the connection adapter type. 2015-02-25 19:06:43 +09:00
Dominik Sander
0b979dd1c0 PushbulletAgent moved device creation to a before_validation callback 2015-02-24 20:26:31 +01:00
Dominik Sander
9902c2313c Added migration for existing PushbulletAgents and fixed the specs 2015-02-19 23:47:39 +01:00
Dean Putney
b263b1c9f6 Creating TumblrPublishAgent 2014-09-25 19:09:21 -07:00
Akinori MUSHA
10ce9d598b Merge remote-tracking branch 'knu/scheduler_agent'
Conflicts:
	db/schema.rb
	spec/lib/huginn_scheduler_spec.rb
2014-09-08 17:03:14 +09:00
Andrew Cantino
142bb35d4e Only update Agent's last_event_at on Event creation, not when Events are updated. 2014-09-05 20:19:39 -07:00
Akinori MUSHA
12f18398f1 Squash migrations during the development of the scheduler_agent branch. 2014-09-03 17:07:29 +09:00
Akinori MUSHA
99c3fc0309 Update db/schema.rb. 2014-09-03 17:03:39 +09:00
Akinori MUSHA
8dc5244e6e Merge remote-tracking branch 'origin/master' into scheduler_agent
Conflicts:
	db/schema.rb
2014-09-03 16:59:57 +09:00
Akinori MUSHA
9a7f7fe6b6 Add NOT NULL contraints. 2014-09-03 13:19:14 +09:00