diff options
author | Chocobozzz <me@florianbigard.com> | 2018-10-11 09:52:16 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-10-11 09:52:16 +0200 |
commit | 71e318b4fe66175d03c7c82357d60062eb68af81 (patch) | |
tree | 1e6bbfa16c9aab32174ec2a87b44f357d5382f07 | |
parent | cc1903ad2a16adf14eaa4f5429e35c455cf93bea (diff) | |
parent | 333210d862fdba4bb114b756d4f964789f480196 (diff) | |
download | PeerTube-71e318b4fe66175d03c7c82357d60062eb68af81.tar.gz PeerTube-71e318b4fe66175d03c7c82357d60062eb68af81.tar.zst PeerTube-71e318b4fe66175d03c7c82357d60062eb68af81.zip |
Merge branch 'release/v1.0.0' into develop
-rw-r--r-- | CHANGELOG.md | 13 | ||||
-rw-r--r-- | client/package.json | 2 | ||||
-rw-r--r-- | package.json | 2 | ||||
-rwxr-xr-x | scripts/release.sh | 2 | ||||
-rw-r--r-- | server/helpers/core-utils.ts | 6 | ||||
-rw-r--r-- | server/lib/job-queue/handlers/activitypub-http-broadcast.ts | 5 | ||||
-rw-r--r-- | server/lib/job-queue/handlers/activitypub-http-unicast.ts | 5 | ||||
-rw-r--r-- | server/lib/job-queue/handlers/utils/activitypub-http-utils.ts | 19 |
8 files changed, 41 insertions, 13 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index ea6007b4c..6716c7bc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md | |||
@@ -1,5 +1,18 @@ | |||
1 | # Changelog | 1 | # Changelog |
2 | 2 | ||
3 | ## v1.0.0 | ||
4 | |||
5 | Announcement scheduled for october 15 | ||
6 | |||
7 | ### Bug fixes | ||
8 | |||
9 | * Check video exists before extending expiration | ||
10 | * Correctly delete redundancy files | ||
11 | * Fix account URI in remote comment modal ([@rigelk](https://github.com/rigelk)) | ||
12 | * Fix avatar update | ||
13 | * Avoid old issue regarding duplicated hosts in database | ||
14 | |||
15 | |||
3 | ## v1.0.0-rc.2 | 16 | ## v1.0.0-rc.2 |
4 | 17 | ||
5 | ### Bug fixes | 18 | ### Bug fixes |
diff --git a/client/package.json b/client/package.json index 76a4eedad..a1dd94b76 100644 --- a/client/package.json +++ b/client/package.json | |||
@@ -1,6 +1,6 @@ | |||
1 | { | 1 | { |
2 | "name": "peertube-client", | 2 | "name": "peertube-client", |
3 | "version": "1.0.0-rc.2", | 3 | "version": "1.0.0", |
4 | "private": true, | 4 | "private": true, |
5 | "licence": "GPLv3", | 5 | "licence": "GPLv3", |
6 | "author": { | 6 | "author": { |
diff --git a/package.json b/package.json index 034b40cbc..1fd6d7d19 100644 --- a/package.json +++ b/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "name": "peertube", | 2 | "name": "peertube", |
3 | "description": "Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.", | 3 | "description": "Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.", |
4 | "version": "1.0.0-rc.2", | 4 | "version": "1.0.0", |
5 | "private": true, | 5 | "private": true, |
6 | "licence": "AGPLv3", | 6 | "licence": "AGPLv3", |
7 | "engines": { | 7 | "engines": { |
diff --git a/scripts/release.sh b/scripts/release.sh index 7b577ef35..3a8643b5a 100755 --- a/scripts/release.sh +++ b/scripts/release.sh | |||
@@ -27,7 +27,7 @@ fi | |||
27 | maintainer_public_key=${MAINTAINER_GPG:-"583A612D890159BE"} | 27 | maintainer_public_key=${MAINTAINER_GPG:-"583A612D890159BE"} |
28 | 28 | ||
29 | branch=$(git symbolic-ref --short -q HEAD) | 29 | branch=$(git symbolic-ref --short -q HEAD) |
30 | if [ "$branch" != "develop" ] && [[ "$branch" != feature/* ]]; then | 30 | if [ "$branch" != "develop" ] && [[ "$branch" != release/* ]]; then |
31 | echo "Need to be on develop or release branch." | 31 | echo "Need to be on develop or release branch." |
32 | exit -1 | 32 | exit -1 |
33 | fi | 33 | fi |
diff --git a/server/helpers/core-utils.ts b/server/helpers/core-utils.ts index 00bc0bdda..224e4fe92 100644 --- a/server/helpers/core-utils.ts +++ b/server/helpers/core-utils.ts | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | import * as bcrypt from 'bcrypt' | 6 | import * as bcrypt from 'bcrypt' |
7 | import * as createTorrent from 'create-torrent' | 7 | import * as createTorrent from 'create-torrent' |
8 | import { createHash, pseudoRandomBytes } from 'crypto' | 8 | import { createHash, HexBase64Latin1Encoding, pseudoRandomBytes } from 'crypto' |
9 | import { isAbsolute, join } from 'path' | 9 | import { isAbsolute, join } from 'path' |
10 | import * as pem from 'pem' | 10 | import * as pem from 'pem' |
11 | import { URL } from 'url' | 11 | import { URL } from 'url' |
@@ -126,8 +126,8 @@ function peertubeTruncate (str: string, maxLength: number) { | |||
126 | return truncate(str, options) | 126 | return truncate(str, options) |
127 | } | 127 | } |
128 | 128 | ||
129 | function sha256 (str: string) { | 129 | function sha256 (str: string, encoding: HexBase64Latin1Encoding = 'hex') { |
130 | return createHash('sha256').update(str).digest('hex') | 130 | return createHash('sha256').update(str).digest(encoding) |
131 | } | 131 | } |
132 | 132 | ||
133 | function promisify0<A> (func: (cb: (err: any, result: A) => void) => void): () => Promise<A> { | 133 | function promisify0<A> (func: (cb: (err: any, result: A) => void) => void): () => Promise<A> { |
diff --git a/server/lib/job-queue/handlers/activitypub-http-broadcast.ts b/server/lib/job-queue/handlers/activitypub-http-broadcast.ts index 03a9e12a4..abbd89b3b 100644 --- a/server/lib/job-queue/handlers/activitypub-http-broadcast.ts +++ b/server/lib/job-queue/handlers/activitypub-http-broadcast.ts | |||
@@ -3,7 +3,7 @@ import * as Bluebird from 'bluebird' | |||
3 | import { logger } from '../../../helpers/logger' | 3 | import { logger } from '../../../helpers/logger' |
4 | import { doRequest } from '../../../helpers/requests' | 4 | import { doRequest } from '../../../helpers/requests' |
5 | import { ActorFollowModel } from '../../../models/activitypub/actor-follow' | 5 | import { ActorFollowModel } from '../../../models/activitypub/actor-follow' |
6 | import { buildSignedRequestOptions, computeBody } from './utils/activitypub-http-utils' | 6 | import { buildGlobalHeaders, buildSignedRequestOptions, computeBody } from './utils/activitypub-http-utils' |
7 | import { BROADCAST_CONCURRENCY, JOB_REQUEST_TIMEOUT } from '../../../initializers' | 7 | import { BROADCAST_CONCURRENCY, JOB_REQUEST_TIMEOUT } from '../../../initializers' |
8 | 8 | ||
9 | export type ActivitypubHttpBroadcastPayload = { | 9 | export type ActivitypubHttpBroadcastPayload = { |
@@ -25,7 +25,8 @@ async function processActivityPubHttpBroadcast (job: Bull.Job) { | |||
25 | uri: '', | 25 | uri: '', |
26 | json: body, | 26 | json: body, |
27 | httpSignature: httpSignatureOptions, | 27 | httpSignature: httpSignatureOptions, |
28 | timeout: JOB_REQUEST_TIMEOUT | 28 | timeout: JOB_REQUEST_TIMEOUT, |
29 | headers: buildGlobalHeaders(body) | ||
29 | } | 30 | } |
30 | 31 | ||
31 | const badUrls: string[] = [] | 32 | const badUrls: string[] = [] |
diff --git a/server/lib/job-queue/handlers/activitypub-http-unicast.ts b/server/lib/job-queue/handlers/activitypub-http-unicast.ts index c90d735f6..d36479032 100644 --- a/server/lib/job-queue/handlers/activitypub-http-unicast.ts +++ b/server/lib/job-queue/handlers/activitypub-http-unicast.ts | |||
@@ -2,7 +2,7 @@ import * as Bull from 'bull' | |||
2 | import { logger } from '../../../helpers/logger' | 2 | import { logger } from '../../../helpers/logger' |
3 | import { doRequest } from '../../../helpers/requests' | 3 | import { doRequest } from '../../../helpers/requests' |
4 | import { ActorFollowModel } from '../../../models/activitypub/actor-follow' | 4 | import { ActorFollowModel } from '../../../models/activitypub/actor-follow' |
5 | import { buildSignedRequestOptions, computeBody } from './utils/activitypub-http-utils' | 5 | import { buildGlobalHeaders, buildSignedRequestOptions, computeBody } from './utils/activitypub-http-utils' |
6 | import { JOB_REQUEST_TIMEOUT } from '../../../initializers' | 6 | import { JOB_REQUEST_TIMEOUT } from '../../../initializers' |
7 | 7 | ||
8 | export type ActivitypubHttpUnicastPayload = { | 8 | export type ActivitypubHttpUnicastPayload = { |
@@ -25,7 +25,8 @@ async function processActivityPubHttpUnicast (job: Bull.Job) { | |||
25 | uri, | 25 | uri, |
26 | json: body, | 26 | json: body, |
27 | httpSignature: httpSignatureOptions, | 27 | httpSignature: httpSignatureOptions, |
28 | timeout: JOB_REQUEST_TIMEOUT | 28 | timeout: JOB_REQUEST_TIMEOUT, |
29 | headers: buildGlobalHeaders(body) | ||
29 | } | 30 | } |
30 | 31 | ||
31 | try { | 32 | try { |
diff --git a/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts b/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts index 36092665e..d71c91a24 100644 --- a/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts +++ b/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts | |||
@@ -1,8 +1,11 @@ | |||
1 | import { buildSignedActivity } from '../../../../helpers/activitypub' | 1 | import { buildSignedActivity } from '../../../../helpers/activitypub' |
2 | import { getServerActor } from '../../../../helpers/utils' | 2 | import { getServerActor } from '../../../../helpers/utils' |
3 | import { ActorModel } from '../../../../models/activitypub/actor' | 3 | import { ActorModel } from '../../../../models/activitypub/actor' |
4 | import { sha256 } from '../../../../helpers/core-utils' | ||
4 | 5 | ||
5 | async function computeBody (payload: { body: any, signatureActorId?: number }) { | 6 | type Payload = { body: any, signatureActorId?: number } |
7 | |||
8 | async function computeBody (payload: Payload) { | ||
6 | let body = payload.body | 9 | let body = payload.body |
7 | 10 | ||
8 | if (payload.signatureActorId) { | 11 | if (payload.signatureActorId) { |
@@ -14,7 +17,7 @@ async function computeBody (payload: { body: any, signatureActorId?: number }) { | |||
14 | return body | 17 | return body |
15 | } | 18 | } |
16 | 19 | ||
17 | async function buildSignedRequestOptions (payload: { signatureActorId?: number }) { | 20 | async function buildSignedRequestOptions (payload: Payload) { |
18 | let actor: ActorModel | null | 21 | let actor: ActorModel | null |
19 | if (payload.signatureActorId) { | 22 | if (payload.signatureActorId) { |
20 | actor = await ActorModel.load(payload.signatureActorId) | 23 | actor = await ActorModel.load(payload.signatureActorId) |
@@ -29,11 +32,21 @@ async function buildSignedRequestOptions (payload: { signatureActorId?: number } | |||
29 | algorithm: 'rsa-sha256', | 32 | algorithm: 'rsa-sha256', |
30 | authorizationHeaderName: 'Signature', | 33 | authorizationHeaderName: 'Signature', |
31 | keyId, | 34 | keyId, |
32 | key: actor.privateKey | 35 | key: actor.privateKey, |
36 | headers: [ 'date', 'host', 'digest', '(request-target)' ] | ||
37 | } | ||
38 | } | ||
39 | |||
40 | function buildGlobalHeaders (body: object) { | ||
41 | const digest = 'SHA-256=' + sha256(JSON.stringify(body), 'base64') | ||
42 | |||
43 | return { | ||
44 | 'Digest': digest | ||
33 | } | 45 | } |
34 | } | 46 | } |
35 | 47 | ||
36 | export { | 48 | export { |
49 | buildGlobalHeaders, | ||
37 | computeBody, | 50 | computeBody, |
38 | buildSignedRequestOptions | 51 | buildSignedRequestOptions |
39 | } | 52 | } |