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

Post from CLI #15

Open
daedric7 opened this issue Mar 22, 2023 · 19 comments
Open

Post from CLI #15

daedric7 opened this issue Mar 22, 2023 · 19 comments

Comments

@daedric7
Copy link

First of all, great project. I love how fast everything is.

Are there alternative clients, of means to post messages to a given topic?

I would find useful to be able to post and attach files from CLI for example.

@balzack
Copy link
Owner

balzack commented Mar 22, 2023

I don't have a CLI client yet, but I've had several requests for one so I'll push it up in the backlog. Thanks for the feedback!

@daedric7
Copy link
Author

If you need help testing don't hesitate :)

@balzack
Copy link
Owner

balzack commented Mar 22, 2023

I was thinking of adding a button to the topic thread in the webapp. It would copy a tiny bash script to the clipboard. You could then run the bash script from the command line to post a new message to that topic, which could include an image/audio/video file. Would this be of interest, or are you looking for a more complete client app?

@daedric7
Copy link
Author

This would suffice, but some questions rise:

Security? Anyone with the script can post to the given topic ?

How do we specify if it's a simple text message or a image, or a video? Maybe --switches ?

@balzack
Copy link
Owner

balzack commented Mar 22, 2023

Great point on security. The script would need to contain a login prompt so that the access tokens aren't stored on disk and easily compromised. Unfortunately the login prompt would make the script more cumbersome to use.

I was thinking the script would have a switches { --image, --audio, --video } coupled with a file path and/or { ---message } coupled with quoted string for the text.

Let me know if you still think something like this would be useful?

@daedric7
Copy link
Author

Something like https://databag.server.com/post?room=123456&token=1234567890 ?

Most other apps that i've known use tokens, or user and pass (?user=aaaa&pass=bbbb )

There's really no silver bullet here, but i would like the option.

@balzack
Copy link
Owner

balzack commented Mar 22, 2023

The process of adding a message to a topic with an asset currently involves hitting 3 endpoints. I suppose I could add a new endpoint that combines the logic of the three. I think the user would still need to write a cURL command to post to that URL. If I were to provide a script for that cURL command, then I might as well leave it as the 3 endpoints.

@balzack
Copy link
Owner

balzack commented Mar 22, 2023

...perhaps I missed your point in the last message

@daedric7
Copy link
Author

Not at all, i think you're spot on.

If we can post a message to a topic via a cURL command, no matter how complex, we're good to go.

A dedicated cli app would only make sense if it is not possible to post via a HTTP POST.

Nevertheless, whatever you decide is good for me.

@balzack
Copy link
Owner

balzack commented Mar 23, 2023

Okay, right now I'm leaning towards adding a 'helper' endpoint that would allow this to be done via a POST. Im in the middle of webrtc integration, so it will probably be a little while before I can get to this feature, but it should be easy to do. Thanks for your interest in the project!

@daedric7
Copy link
Author

OffTopic but, WebRTC as in, voice and video chats ?

@balzack
Copy link
Owner

balzack commented Mar 23, 2023

Yup, I'm going for it...I think I have a handle on it, just not sure if I will be able to implement it the way I want to.

@daedric7
Copy link
Author

Perhaps a topic in the discussion side is better for this case :)

@benjaminbhollon
Copy link

I'm curious (this is a bit off topic), is there any documentation anywhere on the API? Would be neat if so, since it would help encourage potential third-party clients such as a CLI.

I'm planning to set databag up for myself and give it a spin (I only just discovered it—looks awesome), and I'm tentatively willing to help write up documentation for said API if I end up continuing to use databag after trying it.

@benjaminbhollon
Copy link

I just found this: https://github.com/balzack/databag/blob/main/doc/api.oa3

Does this exist somewhere in a more human-readable format? (If not that's okay)

@balzack
Copy link
Owner

balzack commented May 30, 2023

Yes, that is open api format, and the swagger export in html form is here:
https://github.com/balzack/databag/raw/main/doc/swagger.html

Thanks for your interest in doing this. Let me know if I can support you in any way.

@benjaminbhollon
Copy link

I've got an instance setup (https://verboseguacamole.com), so I'll play around with it over the next few days and see where I can help document things. This is a really cool project! :D

@balzack
Copy link
Owner

balzack commented May 30, 2023

I'm really happy you like it! Any feedback on issues or areas you think I need to improve would be greatly appreciated as well. Thanks for your support!

@balzack
Copy link
Owner

balzack commented May 30, 2023

I just checked out your instance, it's awesome to see the project running out in the 'wild'. Did you have any issues setting it up?

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

No branches or pull requests

3 participants