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

File attachments via API #39

Closed
mariomare22 opened this issue Feb 16, 2021 · 9 comments
Closed

File attachments via API #39

mariomare22 opened this issue Feb 16, 2021 · 9 comments
Labels
enhancement New feature or request

Comments

@mariomare22
Copy link

Question
Is the a possibility beides sending a picture to telegram to send a log file?

Thanks

@caronc
Copy link
Owner

caronc commented Feb 16, 2021

Sure you can:

# Below I've added my configuration to ~/.apprise and kept my telegram
# entry tagged as telegram
 apprise -t "my log" -b "see attached" --attach /var/log/messages -g telegram

# But you could just spell out the whole URL too this way:
 apprise -t "my log" -b "see attached" --attach /var/log/messages tgram://apprise/url/details

@mariomare22
Copy link
Author

Thaaaanks!
how can I do it with the api? if possible?

@caronc
Copy link
Owner

caronc commented Feb 16, 2021

No unfortunately.

I'm not sure the best way to go about implement something like that. I'd have to build it in such a way where you post the attachment with the notification itself. To add attachment support adds an element of Denial of Service since you can technically post a lot and fill the file-system. I'd have to have something clean up uploads that had been already notified.

Your request is definitely do-able, but I'd have to think of a effective way of doing it.

I'll move this ticket over to the Apprise-API project.

@caronc caronc transferred this issue from caronc/apprise Feb 16, 2021
@mariomare22
Copy link
Author

I think I found a workaround:
docker exec apprise apprise -t "my log" -b "see attached" --attach /config/test.txt -g tg_grp --config=http://localhost:8080/get/zfstg

This works but implies that I have previously copied the log file into the container or I have mounted a volume on the host.
Thanks!

@caronc
Copy link
Owner

caronc commented Feb 17, 2021

I'm glad you found a workaround. If you want to take that approach, you could add --mount and mount stuff to be available inside your container for messaging purposes that exist outside (see here).

$ docker run -d \
  --name=apprise \
  --mount source=/path/on/local/filesystem,destination=/path/on/docker/filesysteml,readonly \
 ...

That way you don't need to use the COPY directive. You can just access whatever is current that you popped into your share.

@mariomare22
Copy link
Author

Yup this is what I am doing! closed for me, Thank you

@schklom
Copy link

schklom commented Oct 25, 2022

@caronc

To add attachment support adds an element of Denial of Service since you can technically post a lot and fill the file-system

Not necessarily. Write a warning in capital letters and let the feature be disabled by default if you want, but I personally do not mind this attack vector because I restrict the API for my personal use (basic auth on the reverse-proxy).

I have a feeling I am far from the only person who only uses Apprise only for themselves.

If the day comes that my username and password for basic auth are leaked, it means they will have access to all my other passwords, and a Denial of Service will be the least of my worries.

@caronc
Copy link
Owner

caronc commented Oct 26, 2022

Will reopen for reconsideration

@caronc caronc reopened this Oct 26, 2022
@caronc caronc changed the title Telegram file attachment File attachments via API Oct 26, 2022
@caronc caronc added the enhancement New feature or request label Oct 26, 2022
@caronc
Copy link
Owner

caronc commented May 15, 2023

Attachment support is complete and merged as part of the latest Apprise API and is only compatible with the latest version of Apprise (v1.4.0) just released today as well.

@caronc caronc closed this as completed May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants