From 624e42fdf9456816f92000e632d01390f3b5c840 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 10 Sep 2021 15:05:53 +0200 Subject: Remove peertube watch and peertube repl I don't have time to maintain these scripts that cause some install issues/maintenance difficulties --- server/tools/peertube-repl.ts | 83 ------------------------------------------- 1 file changed, 83 deletions(-) delete mode 100644 server/tools/peertube-repl.ts (limited to 'server/tools/peertube-repl.ts') diff --git a/server/tools/peertube-repl.ts b/server/tools/peertube-repl.ts deleted file mode 100644 index eb0a776b8..000000000 --- a/server/tools/peertube-repl.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { registerTSPaths } from '../helpers/register-ts-paths' -registerTSPaths() - -import * as repl from 'repl' -import * as path from 'path' -import * as _ from 'lodash' -import * as Sequelize from 'sequelize' -import * as YoutubeDL from 'youtube-dl' -import { initDatabaseModels, sequelizeTypescript } from '../initializers/database' -import * as cli from '../tools/cli' -import { logger } from '../helpers/logger' -import * as constants from '../initializers/constants' -import * as modelsUtils from '../models/utils' -import * as coreUtils from '../helpers/core-utils' -import * as ffmpegUtils from '../helpers/ffmpeg-utils' -import * as peertubeCryptoUtils from '../helpers/peertube-crypto' -import * as utils from '../helpers/utils' -import * as YoutubeDLUtils from '../helpers/youtube-dl' - -const start = async () => { - await initDatabaseModels(true) - - const versionCommitHash = await utils.getServerCommit() - - const initContext = (replServer) => { - return (context) => { - const properties = { - context, - repl: replServer, - env: process.env, - lodash: _, - path, - cli, - logger, - constants, - Sequelize, - sequelizeTypescript, - modelsUtils, - models: sequelizeTypescript.models, - transaction: sequelizeTypescript.transaction, - query: sequelizeTypescript.query, - queryInterface: sequelizeTypescript.getQueryInterface(), - YoutubeDL, - coreUtils, - ffmpegUtils, - peertubeCryptoUtils, - utils, - YoutubeDLUtils - } - - for (const prop in properties) { - Object.defineProperty(context, prop, { - configurable: false, - enumerable: true, - value: properties[prop] - }) - } - } - } - - const replServer = repl.start({ - prompt: `PeerTube [${cli.version}] (${versionCommitHash})> ` - }) - - initContext(replServer)(replServer.context) - replServer.on('reset', initContext(replServer)) - replServer.on('exit', () => process.exit()) - - const resetCommand = { - help: 'Reset REPL', - action () { - this.write('.clear\n') - this.displayPrompt() - } - } - replServer.defineCommand('reset', resetCommand) - replServer.defineCommand('r', resetCommand) -} - -start() - .catch((err) => { - console.error(err) - }) -- cgit v1.2.3