From 3b62672c196ecaa519ec4af45df6c31f48f78e12 Mon Sep 17 00:00:00 2001 From: hellekin Date: Wed, 14 Nov 2018 10:33:17 +0100 Subject: [PATCH 1/3] Reinforce URL regular expression The previous one was only checking that the domain was part of the string. Now it ensures the URL starts with the protocol and domain, effectively limiting the source to `https://pad.libreho.st/*`. --- plugin.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.rb b/plugin.rb index e0cbd8d..32b1303 100644 --- a/plugin.rb +++ b/plugin.rb @@ -6,8 +6,8 @@ class Onebox::Engine::CodimdOnebox include Onebox::Engine - #we only want to match for a specific codimd domain - matches_regexp /pad.libreho.st/ + # we only want to match for a specific codimd domain + matches_regexp %r{\Ahttps://pad\.libreho\.st/} def to_html "
Goto this Pad" -- GitLab From c06968a51f4f52152a265ed8694f86364fa2dbaa Mon Sep 17 00:00:00 2001 From: hellekin Date: Wed, 14 Nov 2018 10:55:32 +0100 Subject: [PATCH 2/3] Bump version to v0.1.0 - Add CHANGELOG.md - Update README.md --- CHANGELOG.md | 17 +++++++++++++++++ README.md | 9 +++++---- 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..749652f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,17 @@ +# Change Log + +## [UNRELEASED] + +(nothing yet) + +## 0.1.0 -- 2018-11-14 + +- Limit pad URL to `https://pad.libreho.st/*` +- Put in production at https://talk.libreho.st + +## 0.0.1 -- 2018-11-12 + +- Fork from https://github.com/fuerst/embed-etherpad-lite +- Point to https://pad.libreho.st/ + +[unreleased]: ../compare/v0.1.0...HEAD diff --git a/README.md b/README.md index b3393d4..cb99cad 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ # Embed codimd pads into Discourse for libreho.st -This allows you to embed libreho.st pads into discourse. Its based on https://github.com/fuerst/embed-etherpad-lite which embeds pads into posts using the Onebox mechanism. +This allows you to embed libreho.st pads into discourse. It is based on https://github.com/fuerst/embed-etherpad-lite which embeds pads into posts using the Onebox mechanism. # Usage -After installation just insert codimd links into your Discourse posts or comments. The Etherpad will be embedded using the famous and beloved [IFRAME](https://en.wikipedia.org/wiki/HTML_element#Frames) tag and is fully operational. +**This is meant to use with . You need to fork and adapt to your case.** + +After installation just insert codimd links into your Discourse posts or comments. The pad will be embedded using the famous and beloved [IFRAME](https://en.wikipedia.org/wiki/HTML_element#Frames) tag and is fully operational. # Installation @@ -18,5 +20,4 @@ The configuration line you have to add to your container's app.yml file looks li # Details -The plugin uses the ["Brand new plugin interface"](https://meta.discourse.org/t/brand-new-plugin-interface/8793/88) to change URL's like `http(s)://domain.tld/pad-id` into HTML code like ``. - +The plugin uses the ["Brand new plugin interface"](https://meta.discourse.org/t/brand-new-plugin-interface/8793/88) to change URL's like `http(s)://domain.example/pad-id` into HTML code like ``. -- GitLab From 29a8e1e9e643f1b0ce04232fc82ae78033ac6cce Mon Sep 17 00:00:00 2001 From: hellekin Date: Wed, 14 Nov 2018 11:04:32 +0100 Subject: [PATCH 3/3] Fix compare URL --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 749652f..f953925 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,4 +14,4 @@ - Fork from https://github.com/fuerst/embed-etherpad-lite - Point to https://pad.libreho.st/ -[unreleased]: ../compare/v0.1.0...HEAD +[unreleased]: /../compare/v0.1.0...HEAD -- GitLab