mirror of https://github.com/Chocobozzz/PeerTube
Merge branch 'release/v1.0.0' into develop
commit
71e318b4fe
13
CHANGELOG.md
13
CHANGELOG.md
|
@ -1,5 +1,18 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v1.0.0
|
||||||
|
|
||||||
|
Announcement scheduled for october 15
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
* Check video exists before extending expiration
|
||||||
|
* Correctly delete redundancy files
|
||||||
|
* Fix account URI in remote comment modal ([@rigelk](https://github.com/rigelk))
|
||||||
|
* Fix avatar update
|
||||||
|
* Avoid old issue regarding duplicated hosts in database
|
||||||
|
|
||||||
|
|
||||||
## v1.0.0-rc.2
|
## v1.0.0-rc.2
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "peertube-client",
|
"name": "peertube-client",
|
||||||
"version": "1.0.0-rc.2",
|
"version": "1.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"licence": "GPLv3",
|
"licence": "GPLv3",
|
||||||
"author": {
|
"author": {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "peertube",
|
"name": "peertube",
|
||||||
"description": "Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.",
|
"description": "Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.",
|
||||||
"version": "1.0.0-rc.2",
|
"version": "1.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"licence": "AGPLv3",
|
"licence": "AGPLv3",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
|
@ -27,7 +27,7 @@ fi
|
||||||
maintainer_public_key=${MAINTAINER_GPG:-"583A612D890159BE"}
|
maintainer_public_key=${MAINTAINER_GPG:-"583A612D890159BE"}
|
||||||
|
|
||||||
branch=$(git symbolic-ref --short -q HEAD)
|
branch=$(git symbolic-ref --short -q HEAD)
|
||||||
if [ "$branch" != "develop" ] && [[ "$branch" != feature/* ]]; then
|
if [ "$branch" != "develop" ] && [[ "$branch" != release/* ]]; then
|
||||||
echo "Need to be on develop or release branch."
|
echo "Need to be on develop or release branch."
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
import * as bcrypt from 'bcrypt'
|
import * as bcrypt from 'bcrypt'
|
||||||
import * as createTorrent from 'create-torrent'
|
import * as createTorrent from 'create-torrent'
|
||||||
import { createHash, pseudoRandomBytes } from 'crypto'
|
import { createHash, HexBase64Latin1Encoding, pseudoRandomBytes } from 'crypto'
|
||||||
import { isAbsolute, join } from 'path'
|
import { isAbsolute, join } from 'path'
|
||||||
import * as pem from 'pem'
|
import * as pem from 'pem'
|
||||||
import { URL } from 'url'
|
import { URL } from 'url'
|
||||||
|
@ -126,8 +126,8 @@ function peertubeTruncate (str: string, maxLength: number) {
|
||||||
return truncate(str, options)
|
return truncate(str, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
function sha256 (str: string) {
|
function sha256 (str: string, encoding: HexBase64Latin1Encoding = 'hex') {
|
||||||
return createHash('sha256').update(str).digest('hex')
|
return createHash('sha256').update(str).digest(encoding)
|
||||||
}
|
}
|
||||||
|
|
||||||
function promisify0<A> (func: (cb: (err: any, result: A) => void) => void): () => Promise<A> {
|
function promisify0<A> (func: (cb: (err: any, result: A) => void) => void): () => Promise<A> {
|
||||||
|
|
|
@ -3,7 +3,7 @@ import * as Bluebird from 'bluebird'
|
||||||
import { logger } from '../../../helpers/logger'
|
import { logger } from '../../../helpers/logger'
|
||||||
import { doRequest } from '../../../helpers/requests'
|
import { doRequest } from '../../../helpers/requests'
|
||||||
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
|
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
|
||||||
import { buildSignedRequestOptions, computeBody } from './utils/activitypub-http-utils'
|
import { buildGlobalHeaders, buildSignedRequestOptions, computeBody } from './utils/activitypub-http-utils'
|
||||||
import { BROADCAST_CONCURRENCY, JOB_REQUEST_TIMEOUT } from '../../../initializers'
|
import { BROADCAST_CONCURRENCY, JOB_REQUEST_TIMEOUT } from '../../../initializers'
|
||||||
|
|
||||||
export type ActivitypubHttpBroadcastPayload = {
|
export type ActivitypubHttpBroadcastPayload = {
|
||||||
|
@ -25,7 +25,8 @@ async function processActivityPubHttpBroadcast (job: Bull.Job) {
|
||||||
uri: '',
|
uri: '',
|
||||||
json: body,
|
json: body,
|
||||||
httpSignature: httpSignatureOptions,
|
httpSignature: httpSignatureOptions,
|
||||||
timeout: JOB_REQUEST_TIMEOUT
|
timeout: JOB_REQUEST_TIMEOUT,
|
||||||
|
headers: buildGlobalHeaders(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
const badUrls: string[] = []
|
const badUrls: string[] = []
|
||||||
|
|
|
@ -2,7 +2,7 @@ import * as Bull from 'bull'
|
||||||
import { logger } from '../../../helpers/logger'
|
import { logger } from '../../../helpers/logger'
|
||||||
import { doRequest } from '../../../helpers/requests'
|
import { doRequest } from '../../../helpers/requests'
|
||||||
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
|
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
|
||||||
import { buildSignedRequestOptions, computeBody } from './utils/activitypub-http-utils'
|
import { buildGlobalHeaders, buildSignedRequestOptions, computeBody } from './utils/activitypub-http-utils'
|
||||||
import { JOB_REQUEST_TIMEOUT } from '../../../initializers'
|
import { JOB_REQUEST_TIMEOUT } from '../../../initializers'
|
||||||
|
|
||||||
export type ActivitypubHttpUnicastPayload = {
|
export type ActivitypubHttpUnicastPayload = {
|
||||||
|
@ -25,7 +25,8 @@ async function processActivityPubHttpUnicast (job: Bull.Job) {
|
||||||
uri,
|
uri,
|
||||||
json: body,
|
json: body,
|
||||||
httpSignature: httpSignatureOptions,
|
httpSignature: httpSignatureOptions,
|
||||||
timeout: JOB_REQUEST_TIMEOUT
|
timeout: JOB_REQUEST_TIMEOUT,
|
||||||
|
headers: buildGlobalHeaders(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
import { buildSignedActivity } from '../../../../helpers/activitypub'
|
import { buildSignedActivity } from '../../../../helpers/activitypub'
|
||||||
import { getServerActor } from '../../../../helpers/utils'
|
import { getServerActor } from '../../../../helpers/utils'
|
||||||
import { ActorModel } from '../../../../models/activitypub/actor'
|
import { ActorModel } from '../../../../models/activitypub/actor'
|
||||||
|
import { sha256 } from '../../../../helpers/core-utils'
|
||||||
|
|
||||||
async function computeBody (payload: { body: any, signatureActorId?: number }) {
|
type Payload = { body: any, signatureActorId?: number }
|
||||||
|
|
||||||
|
async function computeBody (payload: Payload) {
|
||||||
let body = payload.body
|
let body = payload.body
|
||||||
|
|
||||||
if (payload.signatureActorId) {
|
if (payload.signatureActorId) {
|
||||||
|
@ -14,7 +17,7 @@ async function computeBody (payload: { body: any, signatureActorId?: number }) {
|
||||||
return body
|
return body
|
||||||
}
|
}
|
||||||
|
|
||||||
async function buildSignedRequestOptions (payload: { signatureActorId?: number }) {
|
async function buildSignedRequestOptions (payload: Payload) {
|
||||||
let actor: ActorModel | null
|
let actor: ActorModel | null
|
||||||
if (payload.signatureActorId) {
|
if (payload.signatureActorId) {
|
||||||
actor = await ActorModel.load(payload.signatureActorId)
|
actor = await ActorModel.load(payload.signatureActorId)
|
||||||
|
@ -29,11 +32,21 @@ async function buildSignedRequestOptions (payload: { signatureActorId?: number }
|
||||||
algorithm: 'rsa-sha256',
|
algorithm: 'rsa-sha256',
|
||||||
authorizationHeaderName: 'Signature',
|
authorizationHeaderName: 'Signature',
|
||||||
keyId,
|
keyId,
|
||||||
key: actor.privateKey
|
key: actor.privateKey,
|
||||||
|
headers: [ 'date', 'host', 'digest', '(request-target)' ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildGlobalHeaders (body: object) {
|
||||||
|
const digest = 'SHA-256=' + sha256(JSON.stringify(body), 'base64')
|
||||||
|
|
||||||
|
return {
|
||||||
|
'Digest': digest
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
buildGlobalHeaders,
|
||||||
computeBody,
|
computeBody,
|
||||||
buildSignedRequestOptions
|
buildSignedRequestOptions
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue