From 1eb23e12f757dc4e9a6161b1b933f35a761755c3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 5 Sep 2019 15:39:52 +0200 Subject: Add contributors in about peertube page --- .../about-instance/about-instance.component.html | 14 +- .../about-peertube-contributors.component.html | 13 ++ .../about-peertube-contributors.component.scss | 15 ++ .../about-peertube-contributors.component.ts | 19 +++ .../about-peertube/about-peertube.component.html | 163 +++++++++++---------- .../about-peertube/about-peertube.component.scss | 43 +++++- client/src/app/+about/about.module.ts | 3 +- client/src/app/shared/renderer/markdown.service.ts | 19 ++- 8 files changed, 195 insertions(+), 94 deletions(-) create mode 100644 client/src/app/+about/about-peertube/about-peertube-contributors.component.html create mode 100644 client/src/app/+about/about-peertube/about-peertube-contributors.component.scss create mode 100644 client/src/app/+about/about-peertube/about-peertube-contributors.component.ts (limited to 'client/src/app') diff --git a/client/src/app/+about/about-instance/about-instance.component.html b/client/src/app/+about/about-instance/about-instance.component.html index 9499bbe4e..25d416740 100644 --- a/client/src/app/+about/about-instance/about-instance.component.html +++ b/client/src/app/+about/about-instance/about-instance.component.html @@ -4,7 +4,7 @@
About {{ instanceName }} instance
-
Contact administrator
+
Contact administrator
@@ -16,10 +16,10 @@
{{ shortDescription }}
-
This instance is dedicated to sensitive/NSFW content.
+
This instance is dedicated to sensitive/NSFW content.
-
+
Administrators & sustainability
@@ -47,7 +47,7 @@

{{ businessModel }}

-
+
Information
@@ -57,7 +57,7 @@
-
+
Moderation
@@ -79,7 +79,7 @@
-
+
Other information
@@ -91,7 +91,7 @@
- +
diff --git a/client/src/app/+about/about-peertube/about-peertube-contributors.component.html b/client/src/app/+about/about-peertube/about-peertube-contributors.component.html new file mode 100644 index 000000000..997a6a3e1 --- /dev/null +++ b/client/src/app/+about/about-peertube/about-peertube-contributors.component.html @@ -0,0 +1,13 @@ +

Who made this software?

+ +

+ Developed with ❤ by Framasoft +

+ +

+ + Framasoft logo + +

+ +
diff --git a/client/src/app/+about/about-peertube/about-peertube-contributors.component.scss b/client/src/app/+about/about-peertube/about-peertube-contributors.component.scss new file mode 100644 index 000000000..9c3b0a46b --- /dev/null +++ b/client/src/app/+about/about-peertube/about-peertube-contributors.component.scss @@ -0,0 +1,15 @@ +@import '_variables'; +@import '_mixins'; + +/deep/ h1 { + font-size: 1rem; +} + +/deep/ ul { + padding: 0; + + li { + display: inline-block; + margin-right: 10px; + } +} diff --git a/client/src/app/+about/about-peertube/about-peertube-contributors.component.ts b/client/src/app/+about/about-peertube/about-peertube-contributors.component.ts new file mode 100644 index 000000000..fa2c0daa0 --- /dev/null +++ b/client/src/app/+about/about-peertube/about-peertube-contributors.component.ts @@ -0,0 +1,19 @@ +import { Component, OnInit } from '@angular/core' +import { MarkdownService } from '@app/shared/renderer' + +@Component({ + selector: 'my-about-peertube-contributors', + templateUrl: './about-peertube-contributors.component.html', + styleUrls: [ './about-peertube-contributors.component.scss' ] +}) +export class AboutPeertubeContributorsComponent implements OnInit { + creditsHtml: string + + private markdown = require('raw-loader!../../../../../CREDITS.md') + + constructor (private markdownService: MarkdownService) { } + + async ngOnInit () { + this.creditsHtml = await this.markdownService.completeMarkdownToHTML(this.markdown) + } +} diff --git a/client/src/app/+about/about-peertube/about-peertube.component.html b/client/src/app/+about/about-peertube/about-peertube.component.html index d3fc9a828..423f7bce7 100644 --- a/client/src/app/+about/about-peertube/about-peertube.component.html +++ b/client/src/app/+about/about-peertube/about-peertube.component.html @@ -14,84 +14,89 @@

-
-

P2P & Privacy

+
+ + +
+

P2P & Privacy

+ +

+ PeerTube uses the BitTorrent protocol to share bandwidth between users. + This implies that your IP address is stored in the instance's BitTorrent tracker as long as you download or watch the video. +

+ +
What are the consequences?
+ +

+ In theory, someone with enough technical skills could create a script that tracks which IP is downloading which video. + In practice, this is much more difficult because: +

+ +
    +
  • + An HTTP request has to be sent on each tracker for each video to spy. + If we want to spy all PeerTube's videos, we have to send as many requests as there are videos (so potentially a lot) +
  • + +
  • + For each request sent, the tracker returns random peers at a limited number. + For instance, if there are 1000 peers in the swarm and the tracker sends only 20 peers for each request, there must be at least 50 requests sent to know every peers in the swarm +
  • + +
  • + Those requests have to be sent regularly to know who starts/stops watching a video. It is easy to detect that kind of behaviour +
  • + +
  • + If an IP address is stored in the tracker, it doesn't mean that the person behind the IP (if this person exists) has watched the video +
  • + +
  • + The IP address is a vague information : usually, it regularly changes and can represent many persons or entities +
  • + +
  • + Web peers are not publicly accessible: because we use WebRTC inside the web browser (with the WebTorrent library), the protocol is different from classic BitTorrent. + When you are in a web browser, you send a signal containing your IP address to the tracker that will randomly choose other peers to forward the information to. + See this document for more information +
  • +
+ +

+ The worst-case scenario of an average person spying on their friends is quite unlikely. + There are much more effective ways to get that kind of information. +

+ +
How does PeerTube compare with YouTube?
+ +

+ The threats to privacy in YouTube are different from PeerTube's. + In YouTube's case, the platform gathers a huge amount of your personal information (not only your IP) to analyze them and track you. + Moreover, YouTube is owned by Google/Alphabet, a company that tracks you across many websites (via AdSense or Google Analytics). +

+ +
What can I do to limit the exposure of my IP address?
+ +

+ Your IP address is public so every time you consult a website, there is a number of actors (in addition to the final website) seeing your IP in their connection logs: ISP/routers/trackers/CDN and more. + PeerTube is transparent about it: we warn you that if you want to keep your IP private, you must use a VPN or Tor Browser. + Thinking that removing P2P from PeerTube will give you back anonymity doesn't make sense. +

+ +
What will be done to mitigate this problem?
+ +

+ PeerTube is in its early stages, and want to deliver the best countermeasures possible by the time the stable is released. + In the meantime, we want to test different ideas related to this issue: +

+ +
    +
  • Set a limit to the number of peers sent by the tracker
  • +
  • Set a limit on the request frequency received by the tracker (being tested)
  • +
  • Ring a bell if there are unusual requests (being tested)
  • +
  • Disable P2P from the administration interface
  • +
  • An automatic video redundancy program: we wouldn't know if the IP downloaded the video on purpose or if it was the automatized program
  • +
+
-

- PeerTube uses the BitTorrent protocol to share bandwidth between users. - This implies that your IP address is stored in the instance's BitTorrent tracker as long as you download or watch the video. -

- -
What are the consequences?
- -

- In theory, someone with enough technical skills could create a script that tracks which IP is downloading which video. - In practice, this is much more difficult because: -

- -
    -
  • - An HTTP request has to be sent on each tracker for each video to spy. - If we want to spy all PeerTube's videos, we have to send as many requests as there are videos (so potentially a lot) -
  • - -
  • - For each request sent, the tracker returns random peers at a limited number. - For instance, if there are 1000 peers in the swarm and the tracker sends only 20 peers for each request, there must be at least 50 requests sent to know every peers in the swarm -
  • - -
  • - Those requests have to be sent regularly to know who starts/stops watching a video. It is easy to detect that kind of behaviour -
  • - -
  • - If an IP address is stored in the tracker, it doesn't mean that the person behind the IP (if this person exists) has watched the video -
  • - -
  • - The IP address is a vague information : usually, it regularly changes and can represent many persons or entities -
  • - -
  • - Web peers are not publicly accessible: because we use WebRTC inside the web browser (with the WebTorrent library), the protocol is different from classic BitTorrent. - When you are in a web browser, you send a signal containing your IP address to the tracker that will randomly choose other peers to forward the information to. - See this document for more information -
  • -
- -

- The worst-case scenario of an average person spying on their friends is quite unlikely. - There are much more effective ways to get that kind of information. -

- -
How does PeerTube compare with YouTube?
- -

- The threats to privacy in YouTube are different from PeerTube's. - In YouTube's case, the platform gathers a huge amount of your personal information (not only your IP) to analyze them and track you. - Moreover, YouTube is owned by Google/Alphabet, a company that tracks you across many websites (via AdSense or Google Analytics). -

- -
What can I do to limit the exposure of my IP address?
- -

- Your IP address is public so every time you consult a website, there is a number of actors (in addition to the final website) seeing your IP in their connection logs: ISP/routers/trackers/CDN and more. - PeerTube is transparent about it: we warn you that if you want to keep your IP private, you must use a VPN or Tor Browser. - Thinking that removing P2P from PeerTube will give you back anonymity doesn't make sense. -

- -
What will be done to mitigate this problem?
- -

- PeerTube is in its early stages, and want to deliver the best countermeasures possible by the time the stable is released. - In the meantime, we want to test different ideas related to this issue: -

- -
    -
  • Set a limit to the number of peers sent by the tracker
  • -
  • Set a limit on the request frequency received by the tracker (being tested)
  • -
  • Ring a bell if there are unusual requests (being tested)
  • -
  • Disable P2P from the administration interface
  • -
  • An automatic video redundancy program: we wouldn't know if the IP downloaded the video on purpose or if it was the automatized program
  • -
diff --git a/client/src/app/+about/about-peertube/about-peertube.component.scss b/client/src/app/+about/about-peertube/about-peertube.component.scss index 0d2e2bb68..8fca53e90 100644 --- a/client/src/app/+about/about-peertube/about-peertube.component.scss +++ b/client/src/app/+about/about-peertube/about-peertube.component.scss @@ -2,12 +2,12 @@ @import '_mixins'; .about-peertube-title { - font-size: 25px; - font-weight: bold; + font-size: 20px; + font-weight: $font-semibold; margin-bottom: 15px; } -.section-title { +/deep/ .section-title { font-weight: $font-semibold; font-size: 20px; margin-bottom: 5px; @@ -17,6 +17,41 @@ margin-bottom: 30px; } +.description, +.p2p-privacy, +my-about-peertube-contributors { + /deep/ { + p, li { + font-size: 15px; + } + } +} + .p2p-privacy-title { margin-top: 15px; -} \ No newline at end of file +} + +.privacy-contributors { + display: flex; + flex-direction: row; + + > div, + > my-about-peertube-contributors { + flex-basis: 100%; + display: block; + } + + .p2p-privacy { + h6 { + font-size: 20px; + } + } + + my-about-peertube-contributors { + margin: 0 40px 40px 0; + } + + @media screen and (max-width: $small-view) { + flex-direction: column; + } +} diff --git a/client/src/app/+about/about.module.ts b/client/src/app/+about/about.module.ts index 49a7a52f8..14bf76e55 100644 --- a/client/src/app/+about/about.module.ts +++ b/client/src/app/+about/about.module.ts @@ -1,5 +1,4 @@ import { NgModule } from '@angular/core' - import { AboutRoutingModule } from './about-routing.module' import { AboutComponent } from './about.component' import { SharedModule } from '../shared' @@ -7,6 +6,7 @@ import { AboutInstanceComponent } from '@app/+about/about-instance/about-instanc import { AboutPeertubeComponent } from '@app/+about/about-peertube/about-peertube.component' import { ContactAdminModalComponent } from '@app/+about/about-instance/contact-admin-modal.component' import { AboutFollowsComponent } from '@app/+about/about-follows/about-follows.component' +import { AboutPeertubeContributorsComponent } from '@app/+about/about-peertube/about-peertube-contributors.component' @NgModule({ imports: [ @@ -19,6 +19,7 @@ import { AboutFollowsComponent } from '@app/+about/about-follows/about-follows.c AboutInstanceComponent, AboutPeertubeComponent, AboutFollowsComponent, + AboutPeertubeContributorsComponent, ContactAdminModalComponent ], diff --git a/client/src/app/shared/renderer/markdown.service.ts b/client/src/app/shared/renderer/markdown.service.ts index 9a9066351..0e24f3085 100644 --- a/client/src/app/shared/renderer/markdown.service.ts +++ b/client/src/app/shared/renderer/markdown.service.ts @@ -13,9 +13,11 @@ export class MarkdownService { 'list' ] static ENHANCED_RULES = MarkdownService.TEXT_RULES.concat([ 'image' ]) + static COMPLETE_RULES = MarkdownService.ENHANCED_RULES.concat([ 'block', 'inline', 'heading', 'html_inline', 'html_block', 'paragraph' ]) private textMarkdownIt: MarkdownIt private enhancedMarkdownIt: MarkdownIt + private completeMarkdownIt: MarkdownIt async textMarkdownToHTML (markdown: string) { if (!markdown) return '' @@ -39,11 +41,22 @@ export class MarkdownService { return this.avoidTruncatedTags(html) } - private async createMarkdownIt (rules: string[]) { - // FIXME: import('..') returns a struct module, containing a "default" field corresponding to our sanitizeHtml function + async completeMarkdownToHTML (markdown: string) { + if (!markdown) return '' + + if (!this.completeMarkdownIt) { + this.completeMarkdownIt = await this.createMarkdownIt(MarkdownService.COMPLETE_RULES, true) + } + + const html = this.completeMarkdownIt.render(markdown) + return this.avoidTruncatedTags(html) + } + + private async createMarkdownIt (rules: string[], html = false) { + // FIXME: import('...') returns a struct module, containing a "default" field corresponding to our sanitizeHtml function const MarkdownItClass: typeof import ('markdown-it') = (await import('markdown-it') as any).default - const markdownIt = new MarkdownItClass('zero', { linkify: true, breaks: true }) + const markdownIt = new MarkdownItClass('zero', { linkify: true, breaks: true, html }) for (const rule of rules) { markdownIt.enable(rule) -- cgit v1.2.3