Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow agents to attach files to events #433

Open
andrewcurioso opened this issue Aug 8, 2014 · 6 comments
Open

Allow agents to attach files to events #433

andrewcurioso opened this issue Aug 8, 2014 · 6 comments

Comments

@andrewcurioso
Copy link
Contributor

I think it would be useful to be able to attach files to an event. It would open Hugann up to a whole new level of integration.

Example user stories that this would open up the possibility for:

  • As a user I want to be able to write an agent that grabs the latest image from a Wifi enabled security camera.
  • As a user I want to generate a PDF report from Hugann.
  • As a user I want attachments from source events to be attached to mail sent via the email agent.
  • As a user I want images generated from other events to be automatically uploaded to an FTP server.
  • As a user I want to screenshot a website.
@cantino
Copy link
Member

cantino commented Aug 9, 2014

Hey @andrewcurioso, I like this idea. How should the binary data be stored? For a Huginn deployment, you can't write to disk, so you need to use something like S3. For other deployments, disk might be fine. How large files do you think make sense to support? Small files can be serialized in the DB.

@andrewcurioso
Copy link
Contributor Author

cc @cantino

I can thing of three possible deployment configurations (there are likely more):

  • File uploaded to Amazon S3
  • File put in a location on disk
  • Serialization in a database table (I say table because presumably it would have a 1:* relationship with events)

Did you mean to say file upload is not possible on Heroku deployments or did you actually mean to say Huginn? If you meant Huginn there might be some background I'm missing.

I would think that we could have helper methods that return objects for reading and writing (these are just examples):
new_attachment mimetype may return an object that has a write method to a brand new file
get_attachment name may return an object that has a read method to read an existing file

That way for filesystem configurations it could return a new instance of File and for S3 it would be AWS::S3::S3Object.

Then there would just need to be a function to get the URL of the new attachment so that it can be included in the emitted event. I'm going under the assumption that Huginn will assign a non-conflicting filename for each attachment.

Disclaimer: I'm just thinking out-loud.

@cantino
Copy link
Member

cantino commented Aug 9, 2014

You're right @andrewcurioso, I definitely meant Heroku, which has a read-only file system.

@andrewcurioso
Copy link
Contributor Author

@cantino If there are no objections I'd like to try to implement this one myself.

@cantino
Copy link
Member

cantino commented Aug 10, 2014

By all means!

@virtadpt
Copy link
Collaborator

"As a user, I'd like to be able to automatically send a file in the event that longer than 'expected_update_period_in_days' passes for a particular agent."

Incidentally, being able to download a file from an arbitrary link stored in the agent's configuration would be handy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants