Embed Etherpad Lite pads into Discourse

I created a plugin to embed Etherpad Lite pads into Discourse posts using the Onebox mechanism. Would be glad if you give it a try:

Usage

After installation just insert Etherpad Lite links like https://beta.etherpad.org/p/embed-me-into-discourse into your Discourse posts or comments. The Etherpad will be embedded using the famous and beloved IFRAME tag and is fully operational.

Installation

Read Install a Plugin at meta.discourse.org.

The configuration line you have to add to your container’s app.yml file looks like:

- git clone https://github.com/fuerst/embed-etherpad-lite.git

Details

The plugin uses the “Brand new plugin interface” to change URL’s like http(s)://domain.tld/p/pad-id into HTML code like <iframe src='http(s)://domain.tld/p/pad-id'></iframe>.

That means it also changes your non-Etherpad URL’s which looks just like Etherpad Lite links. Please drop me a note if you got a better idea about how to avoid this.

14 Likes

Interesting idea.

Do you have any screenshots of how this looks in practice? I’m not sure I fully understand the description?

As with other Oneboxes, does it take a one-time capture of the Etherpad document content and insert that as (static) content into the post? (i.e., if the pad changes or goes away, the onebox content stays?) Or is it more like the Google Doc UI, where it shows the actual “live” document?

It’s the “live” and editable document (pad). As I understand Onebox it not only capture a “moment” of a web page. For instance the lazyYT plugin is converting a Youtube link into a video player which you can use to watch the video. Even the Onebox readme is refering to that kind of application.

Here is how it looks like:

7 Likes

This plugin is great, however I have a small issue : links from my etherpad instances are not detected as pads.

Inserting the example link works great (link on beta.etherpad.org), but my links are not replaced by the iframe…

My links have the following format :
https://sub.composed-domain.fr/p/xo0MvCGYhB

Going directly to the URL shows that the pad is working normally.

Could this be related to the “-” character in the domain name ? Would you have the regexp used to detect the link ?

Thank you for your work !
Nicolas

The regex checks for the path like /p/xo0MvCGYhB1 only. The part before doesn’t matter.

May be it is a cross-domain related issue?

And does it blindly replaces this URL with an iFrame or does it checks if there is a running pad ?
Maybe it is the detection of my etherpad instance that does not work…

Also the discourse instance is on something.my-domain.tld and the etherpad instance is on somethingelse.my-domain.tld.
Could the fact that they are both subdomains of the same domain have any impact ?

Would you have any hint to check for cross domain issues ?

Edit : ah ! I have a 404 network call when inserting my link (from the preview screen I guess), on the following URL :
[mydiscourseURL]/onebox?url=[myEtherpadURL]&refresh=false&user_id=2
Strange… As it works for other links, and following the complete link that is in params works fine…

It looks like the onebox call is used to check if there is something behind the URL to replace the link with a onebox or not. So it would not detect my pad as a working pad… While going to the URL loads my pad exactly like these other platforms…

EDIT : ping @fuerst, would you have any insight ?

Up ? @fuerst maybe ?

Insight to the Onebox behaviour? No, not exactly.

Thank you for your answer Bernhard.
That is quite weird, but I actually just tried again, and it works now… So problem seems to be fixed !

The only config change I did to my server was providing the fullchain certificate for https instead of basic cert. No idea how this could have any impact…

I’ve installed this plugin and I’m having an issue with embedding working… depending on the pad name:

https://pad.riseup.net/p/nbmeeting
Does not embed, and this is the url I need.

https://pad.riseup.net/p/nbmeetin
Works
https://pad.riseup.net/p/nbmeetingg
Works

2 Likes