Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Creating a test datasource for Peertube #100

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions dev/peertube/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@ services:
image: chocobozzz/peertube:production-bullseye
env_file:
- .env

ports:
# - "1935:1935" # Comment if you don't want to use the live feature
- "9000:9000" # Uncomment if you use another webserver/proxy or test PeerTube in local, otherwise not suitable for production
- "${PT_PORT:-9000}:9000" # Uncomment if you use another webserver/proxy or test PeerTube in local, otherwise not suitable for production
volumes:
# - ./docker-volume/assets:/app/client/dist
- ./docker-volume/data:/data
- ./docker-volume/config:/config
# - ${VOLUME_ROOT:-./docker-volume}/assets:/app/client/dist
- ${VOLUME_ROOT:-./docker-volume}/data:/data
- ${VOLUME_ROOT:-./docker-volume}/config:/config
depends_on:
- postgres
- redis
# - postfix
environment:
- PEERTUBE_WEBSERVER_PORT=${PT_PORT:-9000}
restart: "always"
extra_hosts:
- "host.docker.internal:host-gateway"
Expand All @@ -31,20 +32,20 @@ services:
env_file:
- .env
volumes:
- ./docker-volume/db:/var/lib/postgresql/data
- ${VOLUME_ROOT:-./docker-volume}/db:/var/lib/postgresql/data
restart: "always"

redis:
image: redis:6-alpine
volumes:
- ./docker-volume/redis:/data
- ${VOLUME_ROOT:-./docker-volume}/redis:/data
restart: "always"

# postfix:
# image: mwader/postfix-relay
# env_file:
# - .env
# volumes:
# - ./docker-volume/opendkim/keys:/etc/opendkim/keys
# restart: "always"
postfix:
image: mwader/postfix-relay
env_file:
- .env
volumes:
- ${VOLUME_ROOT:-./docker-volume}/opendkim/keys:/etc/opendkim/keys
restart: "always"

2 changes: 2 additions & 0 deletions packages/repco-activitypub/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import express from 'express'
import { createLogger } from 'repco-common'
import { ActivityPub } from './ap.js'
import { ApiError } from './error.js'
import { PeertubeClient } from './util/peertube.js'

export { ActivityPub } from './ap.js'
export { PeertubeClient } from './util/peertube.js'

export const logger = createLogger('ap')

Expand Down
169 changes: 162 additions & 7 deletions packages/repco-activitypub/src/util/peertube.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fetch, Headers, RequestInit } from 'undici'
import { fetch, Headers, RequestInit, FormData } from 'undici'
import { FetchError } from '../ap/fetch.js'

export interface ClientToken {
Expand Down Expand Up @@ -48,26 +48,181 @@ export class PeertubeClient {
}
}

async login() {
async createChannel(name: string) {
const data = { name, displayName: name }
const res = await this.fetch('/video-channels', { method: 'POST', data })
console.log("RES", res)
return (res as any).videoChannel.id as number
}

async uploadVideo(channelId: number, name: string) {
const path = '/videos/upload'
const url = this.url + '/api/v1' + path
const body = new FormData()
body.set("channelId", "" + channelId)
body.set("name", name)
body.set("videofile", new Blob([testVideo()]), "cbalogo.mp4")
body.set("privacy", 1)
const headers = new Headers()
if (this.token) {
headers.set('authorization', 'Bearer ' + this.token.access_token)
}
// headers.set('content-type', 'multipart/form-data')
const res = await fetch(url, { body, headers, method: 'POST' })
if (!res.ok) {
throw await FetchError.fromResponse(res)
}
if (res.status === 204) return undefined
try {
const text = await res.text()
return JSON.parse(text)
} catch (err) {
throw await FetchError.fromResponse(res, err as Error)
}
}

async login(username = process.env.PEERTUBE_USERNAME, password = process.env.PEERTUBE_PASSWORD) {
const clientTokens = await this.fetch<ClientToken>('/oauth-clients/local')
const { PEERTUBE_USERNAME, PEERTUBE_PASSWORD } = process.env
if (!PEERTUBE_PASSWORD) {
if (!password) {
throw new Error('Missing PEERTUBE_PASSWORD environment variable')
}
if (!PEERTUBE_USERNAME) {
if (!username) {
throw new Error('Missing PEERTUBE_USERNAME environment variable')
}
const params = new URLSearchParams({
client_id: clientTokens.client_id,
client_secret: clientTokens.client_secret,
grant_type: 'password',
response_type: 'code',
username: PEERTUBE_USERNAME,
password: PEERTUBE_PASSWORD,
username,
password,
})
this.token = await this.fetch<UserToken>('/users/token', {
method: 'POST',
body: params,
})
}
}

function testVideo() {
return Buffer.from(`
AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAAFd5tZGF0AAACrgYF//+q
3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE1NSByMjkxNyAwYTg0ZDk4IC0gSC4yNjQvTVBF
Ry00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxOCAtIGh0dHA6Ly93d3cudmlkZW9sYW4u
b3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTMgZGVibG9jaz0xOjA6MCBhbmFs
eXNlPTB4MzoweDExMyBtZT1oZXggc3VibWU9NyBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVk
X3JlZj0xIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MSA4eDhkY3Q9MSBjcW09MCBk
ZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0tMiB0aHJlYWRzPTcg
bG9va2FoZWFkX3RocmVhZHM9MSBzbGljZWRfdGhyZWFkcz0wIG5yPTAgZGVjaW1hdGU9MSBpbnRl
cmxhY2VkPTAgYmx1cmF5X2NvbXBhdD0wIGNvbnN0cmFpbmVkX2ludHJhPTAgYmZyYW1lcz0zIGJf
cHlyYW1pZD0yIGJfYWRhcHQ9MSBiX2JpYXM9MCBkaXJlY3Q9MSB3ZWlnaHRiPTEgb3Blbl9nb3A9
MCB3ZWlnaHRwPTIga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQw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YZ2QADazZQUH6EAAAAwAQAAADAyDxQplgAQAGaOvjyyLAAAAAGHN0dHMAAAAAAAAA
AQAAABkAAAIAAAAAFHN0c3MAAAAAAAAAAQAAAAEAAADYY3R0cwAAAAAAAAAZAAAAAQAABAAAAAAB
AAAKAAAAAAEAAAQAAAAAAQAAAAAAAAABAAACAAAAAAEAAAoAAAAAAQAABAAAAAABAAAAAAAAAAEA
AAIAAAAAAQAACgAAAAABAAAEAAAAAAEAAAAAAAAAAQAAAgAAAAABAAAKAAAAAAEAAAQAAAAAAQAA
AAAAAAABAAACAAAAAAEAAAoAAAAAAQAABAAAAAABAAAAAAAAAAEAAAIAAAAAAQAACgAAAAABAAAE
AAAAAAEAAAAAAAAAAQAAAgAAAAAcc3RzYwAAAAAAAAABAAAAAQAAABkAAAABAAAAeHN0c3oAAAAA
AAAAAAAAABkAABQRAAAALAAAABUAAAAQAAAADgAAABcAAAAVAAAADgAAAA4AAAAXAAAAFQAAAA4A
AAAOAAAAFwAAABUAAAAOAAAADgAAABYAAAAVAAAADgAAAA4AAAAWAAAAFQAAAA4AAAAOAAAAFHN0
Y28AAAAAAAAAAQAAADAAAABidWR0YQAAAFptZXRhAAAAAAAAACFoZGxyAAAAAAAAAABtZGlyYXBw
bAAAAAAAAAAAAAAAAC1pbHN0AAAAJal0b28AAAAdZGF0YQAAAAEAAAAATGF2ZjU4LjI5LjEwMA==
`.replace('\ņ', ''), 'base64')
}
8 changes: 8 additions & 0 deletions packages/repco-activitypub/util/peertube-upload-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Repl from 'repl'
import { PeertubeClient } from '../dist/src/util/peertube.js'

const pt = new PeertubeClient("http://host.docker.internal:9000")
await pt.login("root", "peertube")
const channelId = await pt.createChannel("foochannel1")
await pt.uploadVideo(channelId, "testvideo2")

3 changes: 2 additions & 1 deletion packages/repco-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"iso8601-duration": "^2.1.1",
"level": "^8.0.0",
"multiformats": "^11.0.2",
"repco-common": "*",
"repco-activitypub": "*",
"repco-common": "*",
"repco-prisma": "*",
"rss-parser": "^3.12.0",
"speedometer": "^1.1.0",
Expand All @@ -44,6 +44,7 @@
"@types/tempy": "^0.3.0",
"brittle": "^2.4.0",
"esbuild": "^0.14.51",
"express": "^4.18.2",
"get-port": "^6.1.2",
"nanobench-utils": "^1.0.1",
"split2": "^4.2.0",
Expand Down
Loading
Loading