This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"total": 4, | |
"data": [ | |
{ | |
"host": "framatube.org" | |
}, | |
{ | |
"host": "peertube.cpy.re" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@context": [ | |
"https://www.w3.org/ns/activitystreams", | |
{ | |
"owl": "http://www.w3.org/2002/07/owl#", | |
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", | |
"rdfs": "http://www.w3.org/2000/01/rdf-schema#", | |
"schema": "http://schema.org/", | |
"xsd": "http://www.w3.org/2001/XMLSchema#" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Security middleware | |
app.use(helmet({ | |
frameguard: { | |
action: 'deny' // we only allow it for /videos/embed, see server/controllers/client.ts | |
}, | |
hsts: false, | |
contentSecurityPolicy: { | |
directives: { | |
defaultSrc: ['*'], // by default, not specifying default-src = '*' | |
mediaSrc: ["'self'"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HotkeyModule.forRoot({ | |
cheatSheetCloseEsc: true, | |
cheatSheetDescription: this.i18n('Show / hide this help menu') | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function getVersion () { | |
const tag = await require('child_process') | |
.exec('[ ! -d .git ] || git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || true', { stdio: [0,1,2] }) | |
if (tag) return tag.replace(/^v/, '') | |
const version = await require('child_process') | |
.exec('[ ! -d .git ] || git rev-parse --short HEAD') | |
if (version) return version.toString().trim() | |
return require('../../../package.json').version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git server/helpers/ffmpeg-utils.ts server/helpers/ffmpeg-utils.ts | |
index ed823a67..92025092 100644 | |
--- server/helpers/ffmpeg-utils.ts | |
+++ server/helpers/ffmpeg-utils.ts | |
@@ -116,10 +116,6 @@ type TranscodeOptions = { | |
function transcode (options: TranscodeOptions) { | |
return new Promise<void>(async (res, rej) => { | |
- if (options.resolution === undefined) { | |
- return rej('Invalid video file') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
ComponentFixture, | |
TestBed | |
} from '@angular/core/testing' | |
import { FormsModule, ReactiveFormsModule } from '@angular/forms' | |
import { RouterTestingModule } from '@angular/router/testing' | |
import { VideosProvider, VideoService } from '../../shared/video/video.service' | |
import { VideoUpdateComponent } from '../+video-edit/video-update.component' | |
import { VideoEditComponent } from '../+video-edit/shared/video-edit.component' | |
import { VideosModule } from '../videos.module' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function isVideoFileStreamable (path: string): Promise<{ [key: string]: boolean }> { | |
let stream = fs.createReadStream(path, { | |
encoding: null, | |
start: 0, | |
end: 1024 * 1024 | |
}) | |
const isAVC = (await getVideoFileStream(path)).filter(s => { | |
return s['codec_name'] === 'h264' && | |
s['bit_rate'] < 3000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# source this file in /root/.bashrc or /root/.zshrc | |
# Sets up the server for chrooted users | |
configure_chrooted() { | |
grep ^chrooted: /etc/group | |
if [[ $? == 0 ]]; then | |
printf "The chrooted group already exists, aborting...\n" | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
we check feed validity using: | |
- XSD for RSS 2.0 -> https://raw.githubusercontent.com/ultraq/rss-xml-generator/master/Schema/RSS-2.0.xsd | |
- JSON Schema for… JSON Feed -> https://raw.githubusercontent.com/sonicdoe/jsonfeed-schema/master/schema-v1.json | |
*/ | |
const JSONFeedInstanceJSONSchema = require('jsonfeed-schema') | |
JSONFeedInstanceJSONSchema.properties.items.items.additionalProperties = true | |
async function loadXSD (path): Promise<string> { |
NewerOlder