diff --git a/backend/public/providers.json b/backend/public/providers.json new file mode 100644 index 000000000..ef9f04bff --- /dev/null +++ b/backend/public/providers.json @@ -0,0 +1,257 @@ +[ + { + "provider_name": "Codepen", + "provider_url": "https:\/\/codepen.io", + "endpoints": [ + { + "schemes": [ + "http:\/\/codepen.io\/*", + "https:\/\/codepen.io\/*" + ], + "url": "http:\/\/codepen.io\/api\/oembed" + } + ] + }, + { + "provider_name": "DTube", + "provider_url": "https:\/\/d.tube\/", + "endpoints": [ + { + "schemes": [ + "https:\/\/d.tube\/v\/*" + ], + "url": "https:\/\/api.d.tube\/oembed", + "discovery": true + } + ] + }, + { + "provider_name": "Facebook (Post)", + "provider_url": "https:\/\/www.facebook.com\/", + "endpoints": [ + { + "schemes": [ + "https:\/\/www.facebook.com\/*\/posts\/*", + "https:\/\/www.facebook.com\/photos\/*", + "https:\/\/www.facebook.com\/*\/photos\/*", + "https:\/\/www.facebook.com\/photo.php*", + "https:\/\/www.facebook.com\/photo.php", + "https:\/\/www.facebook.com\/*\/activity\/*", + "https:\/\/www.facebook.com\/permalink.php", + "https:\/\/www.facebook.com\/media\/set?set=*", + "https:\/\/www.facebook.com\/questions\/*", + "https:\/\/www.facebook.com\/notes\/*\/*\/*" + ], + "url": "https:\/\/www.facebook.com\/plugins\/post\/oembed.json", + "discovery": true + } + ] + }, + { + "provider_name": "Facebook (Video)", + "provider_url": "https:\/\/www.facebook.com\/", + "endpoints": [ + { + "schemes": [ + "https:\/\/www.facebook.com\/*\/videos\/*", + "https:\/\/www.facebook.com\/video.php" + ], + "url": "https:\/\/www.facebook.com\/plugins\/video\/oembed.json", + "discovery": true + } + ] + }, + { + "provider_name": "Flickr", + "provider_url": "https:\/\/www.flickr.com\/", + "endpoints": [ + { + "schemes": [ + "http:\/\/*.flickr.com\/photos\/*", + "http:\/\/flic.kr\/p\/*", + "https:\/\/*.flickr.com\/photos\/*", + "https:\/\/flic.kr\/p\/*" + ], + "url": "https:\/\/www.flickr.com\/services\/oembed\/", + "discovery": true + } + ] + }, + { + "provider_name": "GIPHY", + "provider_url": "https:\/\/giphy.com", + "endpoints": [ + { + "schemes": [ + "https:\/\/giphy.com\/gifs\/*", + "http:\/\/gph.is\/*", + "https:\/\/media.giphy.com\/media\/*\/giphy.gif" + ], + "url": "https:\/\/giphy.com\/services\/oembed", + "discovery": true + } + ] + }, + { + "provider_name": "Instagram", + "provider_url": "https:\/\/instagram.com", + "endpoints": [ + { + "schemes": [ + "http:\/\/instagram.com\/p\/*", + "http:\/\/instagr.am\/p\/*", + "http:\/\/www.instagram.com\/p\/*", + "http:\/\/www.instagr.am\/p\/*", + "https:\/\/instagram.com\/p\/*", + "https:\/\/instagr.am\/p\/*", + "https:\/\/www.instagram.com\/p\/*", + "https:\/\/www.instagr.am\/p\/*" + ], + "url": "https:\/\/api.instagram.com\/oembed", + "formats": [ + "json" + ] + } + ] + }, + { + "provider_name": "Meetup", + "provider_url": "http:\/\/www.meetup.com", + "endpoints": [ + { + "schemes": [ + "http:\/\/meetup.com\/*", + "https:\/\/www.meetup.com\/*", + "https:\/\/meetup.com\/*", + "http:\/\/meetu.ps\/*" + ], + "url": "https:\/\/api.meetup.com\/oembed", + "formats": [ + "json" + ] + } + ] + }, + { + "provider_name": "MixCloud", + "provider_url": "https:\/\/mixcloud.com\/", + "endpoints": [ + { + "schemes": [ + "http:\/\/www.mixcloud.com\/*\/*\/", + "https:\/\/www.mixcloud.com\/*\/*\/" + ], + "url": "https:\/\/www.mixcloud.com\/oembed\/" + } + ] + }, + { + "provider_name": "Reddit", + "provider_url": "https:\/\/reddit.com\/", + "endpoints": [ + { + "schemes": [ + "https:\/\/reddit.com\/r\/*\/comments\/*\/*", + "https:\/\/www.reddit.com\/r\/*\/comments\/*\/*" + ], + "url": "https:\/\/www.reddit.com\/oembed" + } + ] + }, + { + "provider_name": "SlideShare", + "provider_url": "http:\/\/www.slideshare.net\/", + "endpoints": [ + { + "schemes": [ + "http:\/\/www.slideshare.net\/*\/*", + "http:\/\/fr.slideshare.net\/*\/*", + "http:\/\/de.slideshare.net\/*\/*", + "http:\/\/es.slideshare.net\/*\/*", + "http:\/\/pt.slideshare.net\/*\/*" + ], + "url": "http:\/\/www.slideshare.net\/api\/oembed\/2", + "discovery": true + } + ] + }, + { + "provider_name": "SoundCloud", + "provider_url": "http:\/\/soundcloud.com\/", + "endpoints": [ + { + "schemes": [ + "http:\/\/soundcloud.com\/*", + "https:\/\/soundcloud.com\/*" + ], + "url": "https:\/\/soundcloud.com\/oembed" + } + ] + }, + { + "provider_name": "Twitch", + "provider_url": "https:\/\/www.twitch.tv", + "endpoints": [ + { + "schemes": [ + "http:\/\/clips.twitch.tv\/*", + "https:\/\/clips.twitch.tv\/*", + "http:\/\/www.twitch.tv\/*", + "https:\/\/www.twitch.tv\/*", + "http:\/\/twitch.tv\/*", + "https:\/\/twitch.tv\/*" + ], + "url": "https:\/\/api.twitch.tv\/v4\/oembed", + "formats": [ + "json" + ] + } + ] + }, + { + "provider_name": "Twitter", + "provider_url": "http:\/\/www.twitter.com\/", + "endpoints": [ + { + "schemes": [ + "https:\/\/twitter.com\/*\/status\/*", + "https:\/\/*.twitter.com\/*\/status\/*" + ], + "url": "https:\/\/publish.twitter.com\/oembed" + } + ] + }, + { + "provider_name": "Vimeo", + "provider_url": "https:\/\/vimeo.com\/", + "endpoints": [ + { + "schemes": [ + "https:\/\/vimeo.com\/*", + "https:\/\/vimeo.com\/album\/*\/video\/*", + "https:\/\/vimeo.com\/channels\/*\/*", + "https:\/\/vimeo.com\/groups\/*\/videos\/*", + "https:\/\/vimeo.com\/ondemand\/*\/*", + "https:\/\/player.vimeo.com\/video\/*" + ], + "url": "https:\/\/vimeo.com\/api\/oembed.{format}", + "discovery": true + } + ] + }, + { + "provider_name": "YouTube", + "provider_url": "https:\/\/www.youtube.com\/", + "endpoints": [ + { + "schemes": [ + "https:\/\/*.youtube.com\/watch*", + "https:\/\/*.youtube.com\/v\/*", + "https:\/\/youtu.be\/*" + ], + "url": "https:\/\/www.youtube.com\/oembed", + "discovery": true + } + ] + } +] \ No newline at end of file diff --git a/backend/src/schema/resolvers/embeds/findProvider.spec.js b/backend/src/schema/resolvers/embeds/findProvider.spec.js index 963b255ab..878fe741c 100644 --- a/backend/src/schema/resolvers/embeds/findProvider.spec.js +++ b/backend/src/schema/resolvers/embeds/findProvider.spec.js @@ -1,4 +1,4 @@ -import findProvider from './findProvider' +import findProvider from '~/json/findProvider' describe('Vimeo', () => { it('matches `https://vimeo.com/showcase/2098620/video/4082288`', () => { diff --git a/webapp/assets/json/providers.json b/webapp/assets/json/providers.json new file mode 100644 index 000000000..ef9f04bff --- /dev/null +++ b/webapp/assets/json/providers.json @@ -0,0 +1,257 @@ +[ + { + "provider_name": "Codepen", + "provider_url": "https:\/\/codepen.io", + "endpoints": [ + { + "schemes": [ + "http:\/\/codepen.io\/*", + "https:\/\/codepen.io\/*" + ], + "url": "http:\/\/codepen.io\/api\/oembed" + } + ] + }, + { + "provider_name": "DTube", + "provider_url": "https:\/\/d.tube\/", + "endpoints": [ + { + "schemes": [ + "https:\/\/d.tube\/v\/*" + ], + "url": "https:\/\/api.d.tube\/oembed", + "discovery": true + } + ] + }, + { + "provider_name": "Facebook (Post)", + "provider_url": "https:\/\/www.facebook.com\/", + "endpoints": [ + { + "schemes": [ + "https:\/\/www.facebook.com\/*\/posts\/*", + "https:\/\/www.facebook.com\/photos\/*", + "https:\/\/www.facebook.com\/*\/photos\/*", + "https:\/\/www.facebook.com\/photo.php*", + "https:\/\/www.facebook.com\/photo.php", + "https:\/\/www.facebook.com\/*\/activity\/*", + "https:\/\/www.facebook.com\/permalink.php", + "https:\/\/www.facebook.com\/media\/set?set=*", + "https:\/\/www.facebook.com\/questions\/*", + "https:\/\/www.facebook.com\/notes\/*\/*\/*" + ], + "url": "https:\/\/www.facebook.com\/plugins\/post\/oembed.json", + "discovery": true + } + ] + }, + { + "provider_name": "Facebook (Video)", + "provider_url": "https:\/\/www.facebook.com\/", + "endpoints": [ + { + "schemes": [ + "https:\/\/www.facebook.com\/*\/videos\/*", + "https:\/\/www.facebook.com\/video.php" + ], + "url": "https:\/\/www.facebook.com\/plugins\/video\/oembed.json", + "discovery": true + } + ] + }, + { + "provider_name": "Flickr", + "provider_url": "https:\/\/www.flickr.com\/", + "endpoints": [ + { + "schemes": [ + "http:\/\/*.flickr.com\/photos\/*", + "http:\/\/flic.kr\/p\/*", + "https:\/\/*.flickr.com\/photos\/*", + "https:\/\/flic.kr\/p\/*" + ], + "url": "https:\/\/www.flickr.com\/services\/oembed\/", + "discovery": true + } + ] + }, + { + "provider_name": "GIPHY", + "provider_url": "https:\/\/giphy.com", + "endpoints": [ + { + "schemes": [ + "https:\/\/giphy.com\/gifs\/*", + "http:\/\/gph.is\/*", + "https:\/\/media.giphy.com\/media\/*\/giphy.gif" + ], + "url": "https:\/\/giphy.com\/services\/oembed", + "discovery": true + } + ] + }, + { + "provider_name": "Instagram", + "provider_url": "https:\/\/instagram.com", + "endpoints": [ + { + "schemes": [ + "http:\/\/instagram.com\/p\/*", + "http:\/\/instagr.am\/p\/*", + "http:\/\/www.instagram.com\/p\/*", + "http:\/\/www.instagr.am\/p\/*", + "https:\/\/instagram.com\/p\/*", + "https:\/\/instagr.am\/p\/*", + "https:\/\/www.instagram.com\/p\/*", + "https:\/\/www.instagr.am\/p\/*" + ], + "url": "https:\/\/api.instagram.com\/oembed", + "formats": [ + "json" + ] + } + ] + }, + { + "provider_name": "Meetup", + "provider_url": "http:\/\/www.meetup.com", + "endpoints": [ + { + "schemes": [ + "http:\/\/meetup.com\/*", + "https:\/\/www.meetup.com\/*", + "https:\/\/meetup.com\/*", + "http:\/\/meetu.ps\/*" + ], + "url": "https:\/\/api.meetup.com\/oembed", + "formats": [ + "json" + ] + } + ] + }, + { + "provider_name": "MixCloud", + "provider_url": "https:\/\/mixcloud.com\/", + "endpoints": [ + { + "schemes": [ + "http:\/\/www.mixcloud.com\/*\/*\/", + "https:\/\/www.mixcloud.com\/*\/*\/" + ], + "url": "https:\/\/www.mixcloud.com\/oembed\/" + } + ] + }, + { + "provider_name": "Reddit", + "provider_url": "https:\/\/reddit.com\/", + "endpoints": [ + { + "schemes": [ + "https:\/\/reddit.com\/r\/*\/comments\/*\/*", + "https:\/\/www.reddit.com\/r\/*\/comments\/*\/*" + ], + "url": "https:\/\/www.reddit.com\/oembed" + } + ] + }, + { + "provider_name": "SlideShare", + "provider_url": "http:\/\/www.slideshare.net\/", + "endpoints": [ + { + "schemes": [ + "http:\/\/www.slideshare.net\/*\/*", + "http:\/\/fr.slideshare.net\/*\/*", + "http:\/\/de.slideshare.net\/*\/*", + "http:\/\/es.slideshare.net\/*\/*", + "http:\/\/pt.slideshare.net\/*\/*" + ], + "url": "http:\/\/www.slideshare.net\/api\/oembed\/2", + "discovery": true + } + ] + }, + { + "provider_name": "SoundCloud", + "provider_url": "http:\/\/soundcloud.com\/", + "endpoints": [ + { + "schemes": [ + "http:\/\/soundcloud.com\/*", + "https:\/\/soundcloud.com\/*" + ], + "url": "https:\/\/soundcloud.com\/oembed" + } + ] + }, + { + "provider_name": "Twitch", + "provider_url": "https:\/\/www.twitch.tv", + "endpoints": [ + { + "schemes": [ + "http:\/\/clips.twitch.tv\/*", + "https:\/\/clips.twitch.tv\/*", + "http:\/\/www.twitch.tv\/*", + "https:\/\/www.twitch.tv\/*", + "http:\/\/twitch.tv\/*", + "https:\/\/twitch.tv\/*" + ], + "url": "https:\/\/api.twitch.tv\/v4\/oembed", + "formats": [ + "json" + ] + } + ] + }, + { + "provider_name": "Twitter", + "provider_url": "http:\/\/www.twitter.com\/", + "endpoints": [ + { + "schemes": [ + "https:\/\/twitter.com\/*\/status\/*", + "https:\/\/*.twitter.com\/*\/status\/*" + ], + "url": "https:\/\/publish.twitter.com\/oembed" + } + ] + }, + { + "provider_name": "Vimeo", + "provider_url": "https:\/\/vimeo.com\/", + "endpoints": [ + { + "schemes": [ + "https:\/\/vimeo.com\/*", + "https:\/\/vimeo.com\/album\/*\/video\/*", + "https:\/\/vimeo.com\/channels\/*\/*", + "https:\/\/vimeo.com\/groups\/*\/videos\/*", + "https:\/\/vimeo.com\/ondemand\/*\/*", + "https:\/\/player.vimeo.com\/video\/*" + ], + "url": "https:\/\/vimeo.com\/api\/oembed.{format}", + "discovery": true + } + ] + }, + { + "provider_name": "YouTube", + "provider_url": "https:\/\/www.youtube.com\/", + "endpoints": [ + { + "schemes": [ + "https:\/\/*.youtube.com\/watch*", + "https:\/\/*.youtube.com\/v\/*", + "https:\/\/youtu.be\/*" + ], + "url": "https:\/\/www.youtube.com\/oembed", + "discovery": true + } + ] + } +] \ No newline at end of file diff --git a/webapp/locales/de.json b/webapp/locales/de.json index 5b83821f5..e101cf67d 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -2,7 +2,7 @@ "maintenance": { "title": "Human Connection befindet sich in der Wartung", "explanation": "Zurzeit führen wir einige geplante Wartungsarbeiten durch, bitte versuch es später erneut.", - "questions": "Bei Fragen oder Problemen erreichst du uns per E-Mail an" + "questions": "Bei Fragen oder Problemen erreichst du uns per E-Mail an" }, "index": { "no-results": "Keine Beiträge gefunden.", @@ -306,6 +306,20 @@ "submit": "Kommentiere", "submitted": "Kommentar Gesendet", "updated": "Änderungen gespeichert" + }, + "allowEmbeds": { + "name": "Drittanbieter", + "description": "In unseren Beiträgen können aus der folgenden Liste an Providern Fremdcode von anderen Anbietern (Drittanbietern) in Form von eingebundenen Videos, Bilder oder Text eingebunden werden.", + "statustext": "Momentan ist das automatische einbinden:", + "statuschange": "Einstellung ändern", + "false": "Abgestellt", + "true": "Zugelassen", + "button-tofalse": "Abstellen", + "button-toonlysession": "Zugelassen für diese Sitzung", + "button-totrue": "dauerhaft zulassen", + "third-party-false": "Es wird kein Service von Drittanbietern automatisch eingebunden.", + "third-party-onlysession": "Sie haben das automatische einbinden für diese Sitzung zugelassen. Nach einem neuen Login ist es wieder abgestellt.", + "third-party-true": "Das einbinden der Services von Drittanbietern ist dauerhaft zugelassen und gespeichert für komende Sitzungen." } }, "comment": { @@ -592,4 +606,4 @@ "have-fun": "Jetzt aber viel Spaß mit der Alpha von Human Connection! Für den ersten Weltfrieden. ♥︎", "closing": "Herzlichst

Euer Human Connection Team" } -} +} \ No newline at end of file diff --git a/webapp/pages/settings.vue b/webapp/pages/settings.vue index 67493c333..11fde8c75 100644 --- a/webapp/pages/settings.vue +++ b/webapp/pages/settings.vue @@ -32,8 +32,8 @@ export default { path: `/settings/my-social-media`, }, { - name: this.$t('settings.blocked-users.name'), - path: `/settings/blocked-users`, + name: this.$t('post.allowEmbeds.name'), + path: `/settings/allow-embeds`, }, { name: this.$t('settings.deleteUserAccount.name'), diff --git a/webapp/pages/settings/allow-embeds.vue b/webapp/pages/settings/allow-embeds.vue new file mode 100644 index 000000000..143211510 --- /dev/null +++ b/webapp/pages/settings/allow-embeds.vue @@ -0,0 +1,94 @@ + + + + +