server/server -> server/core
This commit is contained in:
parent
114327d4ce
commit
5a3d0650c9
|
@ -69,8 +69,8 @@ npx @redocly/cli preview-docs ./support/doc/api/openapi.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
Some hints:
|
Some hints:
|
||||||
* Routes are defined in [/server/server/controllers/](https://github.com/Chocobozzz/PeerTube/tree/develop/server/server/controllers) directory
|
* Routes are defined in [/server/core/controllers/](https://github.com/Chocobozzz/PeerTube/tree/develop/server/core/controllers) directory
|
||||||
* Parameters validators are defined in [/server/server/middlewares/validators](https://github.com/Chocobozzz/PeerTube/tree/develop/server/server/middlewares/validators) directory
|
* Parameters validators are defined in [/server/core/middlewares/validators](https://github.com/Chocobozzz/PeerTube/tree/develop/server/core/middlewares/validators) directory
|
||||||
* Models sent/received by the controllers are defined in [/packages/models](https://github.com/Chocobozzz/PeerTube/tree/develop/packages/models) directory
|
* Models sent/received by the controllers are defined in [/packages/models](https://github.com/Chocobozzz/PeerTube/tree/develop/packages/models) directory
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,9 @@ import {
|
||||||
activityPubContextify,
|
activityPubContextify,
|
||||||
buildGlobalHTTPHeaders,
|
buildGlobalHTTPHeaders,
|
||||||
signAndContextify
|
signAndContextify
|
||||||
} from '@peertube/peertube-server/server/helpers/activity-pub-utils.js'
|
} from '@peertube/peertube-server/core/helpers/activity-pub-utils.js'
|
||||||
import { buildDigest } from '@peertube/peertube-server/server/helpers/peertube-crypto.js'
|
import { buildDigest } from '@peertube/peertube-server/core/helpers/peertube-crypto.js'
|
||||||
import { ACTIVITY_PUB, HTTP_SIGNATURE } from '@peertube/peertube-server/server/initializers/constants.js'
|
import { ACTIVITY_PUB, HTTP_SIGNATURE } from '@peertube/peertube-server/core/initializers/constants.js'
|
||||||
import { makePOSTAPRequest } from '@tests/shared/requests.js'
|
import { makePOSTAPRequest } from '@tests/shared/requests.js'
|
||||||
import { SQLCommand } from '@tests/shared/sql-command.js'
|
import { SQLCommand } from '@tests/shared/sql-command.js'
|
||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
|
|
|
@ -12,7 +12,7 @@ import {
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
waitJobs
|
waitJobs
|
||||||
} from '@peertube/peertube-server-commands'
|
} from '@peertube/peertube-server-commands'
|
||||||
import { DEFAULT_AUDIO_RESOLUTION } from '@peertube/peertube-server/server/initializers/constants.js'
|
import { DEFAULT_AUDIO_RESOLUTION } from '@peertube/peertube-server/core/initializers/constants.js'
|
||||||
import { checkDirectoryIsEmpty, checkTmpIsEmpty } from '@tests/shared/directories.js'
|
import { checkDirectoryIsEmpty, checkTmpIsEmpty } from '@tests/shared/directories.js'
|
||||||
import { completeCheckHlsPlaylist } from '@tests/shared/streaming-playlists.js'
|
import { completeCheckHlsPlaylist } from '@tests/shared/streaming-playlists.js'
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { getAllFiles, getMaxTheoreticalBitrate, getMinTheoreticalBitrate, omit } from '@peertube/peertube-core-utils'
|
import { getAllFiles, getMaxTheoreticalBitrate, getMinTheoreticalBitrate, omit } from '@peertube/peertube-core-utils'
|
||||||
import { HttpStatusCode, VideoFileMetadata, VideoState } from '@peertube/peertube-models'
|
import { HttpStatusCode, VideoFileMetadata, VideoState } from '@peertube/peertube-models'
|
||||||
import { canDoQuickTranscode } from '@peertube/peertube-server/server/lib/transcoding/transcoding-quick-transcode.js'
|
import { canDoQuickTranscode } from '@peertube/peertube-server/core/lib/transcoding/transcoding-quick-transcode.js'
|
||||||
import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils'
|
import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils'
|
||||||
import {
|
import {
|
||||||
ffprobePromise,
|
ffprobePromise,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { basename } from 'path'
|
import { basename } from 'path'
|
||||||
import { ACTOR_IMAGES_SIZE } from '@peertube/peertube-server/server/initializers/constants.js'
|
import { ACTOR_IMAGES_SIZE } from '@peertube/peertube-server/core/initializers/constants.js'
|
||||||
import { testFileExistsOrNot, testImage } from '@tests/shared/checks.js'
|
import { testFileExistsOrNot, testImage } from '@tests/shared/checks.js'
|
||||||
import { SQLCommand } from '@tests/shared/sql-command.js'
|
import { SQLCommand } from '@tests/shared/sql-command.js'
|
||||||
import { wait } from '@peertube/peertube-core-utils'
|
import { wait } from '@peertube/peertube-core-utils'
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||||
|
|
||||||
import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils'
|
import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils'
|
||||||
import { signAndContextify } from '@peertube/peertube-server/server/helpers/activity-pub-utils.js'
|
import { signAndContextify } from '@peertube/peertube-server/core/helpers/activity-pub-utils.js'
|
||||||
import {
|
import {
|
||||||
isHTTPSignatureVerified,
|
isHTTPSignatureVerified,
|
||||||
isJsonLDSignatureVerified,
|
isJsonLDSignatureVerified,
|
||||||
parseHTTPSignature
|
parseHTTPSignature
|
||||||
} from '@peertube/peertube-server/server/helpers/peertube-crypto.js'
|
} from '@peertube/peertube-server/core/helpers/peertube-crypto.js'
|
||||||
import { buildRequestStub } from '@tests/shared/tests.js'
|
import { buildRequestStub } from '@tests/shared/tests.js'
|
||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { readJsonSync } from 'fs-extra/esm'
|
import { readJsonSync } from 'fs-extra/esm'
|
||||||
|
|
|
@ -5,7 +5,7 @@ import snakeCase from 'lodash-es/snakeCase.js'
|
||||||
import validator from 'validator'
|
import validator from 'validator'
|
||||||
import { getAverageTheoreticalBitrate, getMaxTheoreticalBitrate, parseChapters } from '@peertube/peertube-core-utils'
|
import { getAverageTheoreticalBitrate, getMaxTheoreticalBitrate, parseChapters } from '@peertube/peertube-core-utils'
|
||||||
import { VideoResolution } from '@peertube/peertube-models'
|
import { VideoResolution } from '@peertube/peertube-models'
|
||||||
import { objectConverter, parseBytes, parseDurationToMs, parseSemVersion } from '@peertube/peertube-server/server/helpers/core-utils.js'
|
import { objectConverter, parseBytes, parseDurationToMs, parseSemVersion } from '@peertube/peertube-server/core/helpers/core-utils.js'
|
||||||
|
|
||||||
describe('Parse Bytes', function () {
|
describe('Parse Bytes', function () {
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||||
|
|
||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { decrypt, encrypt } from '@peertube/peertube-server/server/helpers/peertube-crypto.js'
|
import { decrypt, encrypt } from '@peertube/peertube-server/core/helpers/peertube-crypto.js'
|
||||||
|
|
||||||
describe('Encrypt/Descrypt', function () {
|
describe('Encrypt/Descrypt', function () {
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||||
|
|
||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { isResolvingToUnicastOnly } from '@peertube/peertube-server/server/helpers/dns.js'
|
import { isResolvingToUnicastOnly } from '@peertube/peertube-server/core/helpers/dns.js'
|
||||||
|
|
||||||
describe('DNS helpers', function () {
|
describe('DNS helpers', function () {
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@ import { remove } from 'fs-extra/esm'
|
||||||
import { readFile } from 'fs/promises'
|
import { readFile } from 'fs/promises'
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { buildAbsoluteFixturePath, root } from '@peertube/peertube-node-utils'
|
import { buildAbsoluteFixturePath, root } from '@peertube/peertube-node-utils'
|
||||||
import { execPromise } from '@peertube/peertube-server/server/helpers/core-utils.js'
|
import { execPromise } from '@peertube/peertube-server/core/helpers/core-utils.js'
|
||||||
import { processImage } from '@peertube/peertube-server/server/helpers/image-utils.js'
|
import { processImage } from '@peertube/peertube-server/core/helpers/image-utils.js'
|
||||||
|
|
||||||
async function checkBuffers (path1: string, path2: string, equals: boolean) {
|
async function checkBuffers (path1: string, path2: string, equals: boolean) {
|
||||||
const [ buf1, buf2 ] = await Promise.all([
|
const [ buf1, buf2 ] = await Promise.all([
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||||
|
|
||||||
import { mdToOneLinePlainText } from '@peertube/peertube-server/server/helpers/markdown.js'
|
import { mdToOneLinePlainText } from '@peertube/peertube-server/core/helpers/markdown.js'
|
||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
|
|
||||||
describe('Markdown helpers', function () {
|
describe('Markdown helpers', function () {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||||
|
|
||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { extractMentions } from '@peertube/peertube-server/server/helpers/mentions.js'
|
import { extractMentions } from '@peertube/peertube-server/core/helpers/mentions.js'
|
||||||
|
|
||||||
describe('Comment model', function () {
|
describe('Comment model', function () {
|
||||||
it('Should correctly extract mentions', async function () {
|
it('Should correctly extract mentions', async function () {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { pathExists, remove } from 'fs-extra/esm'
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { wait } from '@peertube/peertube-core-utils'
|
import { wait } from '@peertube/peertube-core-utils'
|
||||||
import { root } from '@peertube/peertube-node-utils'
|
import { root } from '@peertube/peertube-node-utils'
|
||||||
import { doRequest, doRequestAndSaveToFile } from '@peertube/peertube-server/server/helpers/requests.js'
|
import { doRequest, doRequestAndSaveToFile } from '@peertube/peertube-server/core/helpers/requests.js'
|
||||||
import { Mock429 } from '@tests/shared/mock-servers/mock-429.js'
|
import { Mock429 } from '@tests/shared/mock-servers/mock-429.js'
|
||||||
import { FIXTURE_URLS } from '@tests/shared/tests.js'
|
import { FIXTURE_URLS } from '@tests/shared/tests.js'
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { expect } from 'chai'
|
||||||
import {
|
import {
|
||||||
isPluginStableOrUnstableVersionValid,
|
isPluginStableOrUnstableVersionValid,
|
||||||
isPluginStableVersionValid
|
isPluginStableVersionValid
|
||||||
} from '@peertube/peertube-server/server/helpers/custom-validators/plugins.js'
|
} from '@peertube/peertube-server/core/helpers/custom-validators/plugins.js'
|
||||||
|
|
||||||
describe('Validators', function () {
|
describe('Validators', function () {
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,8 @@ import {
|
||||||
VIDEO_LICENCES,
|
VIDEO_LICENCES,
|
||||||
VIDEO_PLAYLIST_PRIVACIES,
|
VIDEO_PLAYLIST_PRIVACIES,
|
||||||
VIDEO_PRIVACIES
|
VIDEO_PRIVACIES
|
||||||
} from '@peertube/peertube-server/server/initializers/constants.js'
|
} from '@peertube/peertube-server/core/initializers/constants.js'
|
||||||
import { VideoConstantManagerFactory } from '@peertube/peertube-server/server/lib/plugins/video-constant-manager-factory.js'
|
import { VideoConstantManagerFactory } from '@peertube/peertube-server/core/lib/plugins/video-constant-manager-factory.js'
|
||||||
|
|
||||||
describe('VideoConstantManagerFactory', function () {
|
describe('VideoConstantManagerFactory', function () {
|
||||||
const factory = new VideoConstantManagerFactory('peertube-plugin-constants')
|
const factory = new VideoConstantManagerFactory('peertube-plugin-constants')
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { doRequest } from '@peertube/peertube-server/server/helpers/requests.js'
|
import { doRequest } from '@peertube/peertube-server/core/helpers/requests.js'
|
||||||
|
|
||||||
export function makePOSTAPRequest (url: string, body: any, httpSignature: any, headers: any) {
|
export function makePOSTAPRequest (url: string, body: any, httpSignature: any, headers: any) {
|
||||||
const options = {
|
const options = {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import {
|
||||||
VIDEO_LANGUAGES,
|
VIDEO_LANGUAGES,
|
||||||
VIDEO_LICENCES,
|
VIDEO_LICENCES,
|
||||||
VIDEO_PRIVACIES
|
VIDEO_PRIVACIES
|
||||||
} from '@peertube/peertube-server/server/initializers/constants.js'
|
} from '@peertube/peertube-server/core/initializers/constants.js'
|
||||||
import { getLowercaseExtension } from '@peertube/peertube-node-utils'
|
import { getLowercaseExtension } from '@peertube/peertube-node-utils'
|
||||||
import { makeRawRequest, PeerTubeServer, VideoEdit, waitJobs } from '@peertube/peertube-server-commands'
|
import { makeRawRequest, PeerTubeServer, VideoEdit, waitJobs } from '@peertube/peertube-server-commands'
|
||||||
import { dateIsValid, expectStartWith, testImageGeneratedByFFmpeg } from './checks.js'
|
import { dateIsValid, expectStartWith, testImageGeneratedByFFmpeg } from './checks.js'
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"tsBuildInfoFile": "./dist/.tsbuildinfo",
|
"tsBuildInfoFile": "./dist/.tsbuildinfo",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@tests/*": [ "src/*" ],
|
"@tests/*": [ "src/*" ],
|
||||||
"@server/*": [ "../../server/server/*" ]
|
"@server/*": [ "../../server/core/*" ]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"references": [
|
"references": [
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
],
|
],
|
||||||
"baseUrl": "./dist",
|
"baseUrl": "./dist",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@server/*": [ "server/server/*" ],
|
"@server/*": [ "server/core/*" ],
|
||||||
"@client/*": [ "client/*" ],
|
"@client/*": [ "client/*" ],
|
||||||
"@peertube/peertube-models": [ "peertube-models" ],
|
"@peertube/peertube-models": [ "peertube-models" ],
|
||||||
"@peertube/peertube-typescript-utils": [ "peertube-typescript-utils" ]
|
"@peertube/peertube-typescript-utils": [ "peertube-typescript-utils" ]
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"tsBuildInfoFile": "./dist/tsconfig.server.types.tsbuildinfo",
|
"tsBuildInfoFile": "./dist/tsconfig.server.types.tsbuildinfo",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@server/*": [ "../../server/server/*" ]
|
"@server/*": [ "../../server/core/*" ]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"references": [
|
"references": [
|
||||||
|
|
|
@ -7,6 +7,6 @@ rm -rf ./dist ./packages/*/dist
|
||||||
npm run tsc -- -b --verbose server/tsconfig.json
|
npm run tsc -- -b --verbose server/tsconfig.json
|
||||||
npm run resolve-tspaths:server
|
npm run resolve-tspaths:server
|
||||||
|
|
||||||
cp -r "./server/server/static" "./server/server/assets" ./dist/server
|
cp -r "./server/core/static" "./server/core/assets" ./dist/core
|
||||||
cp -r "./server/server/lib/emails" "./dist/server/lib"
|
cp -r "./server/core/lib/emails" "./dist/core/lib"
|
||||||
cp "./server/scripts/upgrade.sh" "./dist/scripts"
|
cp "./server/scripts/upgrade.sh" "./dist/scripts"
|
||||||
|
|
|
@ -14,12 +14,12 @@ mkdir -p "./client/dist"
|
||||||
rm -rf "./client/dist/locale"
|
rm -rf "./client/dist/locale"
|
||||||
cp -r "./client/src/locale" "./client/dist/locale"
|
cp -r "./client/src/locale" "./client/dist/locale"
|
||||||
|
|
||||||
mkdir -p "./dist/server/lib"
|
mkdir -p "./dist/core/lib"
|
||||||
|
|
||||||
npm run tsc -- -b -v --incremental server/tsconfig.json
|
npm run tsc -- -b -v --incremental server/tsconfig.json
|
||||||
npm run resolve-tspaths:server
|
npm run resolve-tspaths:server
|
||||||
|
|
||||||
cp -r ./server/server/static ./server/server/assets ./dist/server
|
cp -r ./server/core/static ./server/core/assets ./dist/core
|
||||||
cp -r "./server/server/lib/emails" "./dist/server/lib"
|
cp -r "./server/core/lib/emails" "./dist/core/lib"
|
||||||
|
|
||||||
./node_modules/.bin/tsc-watch --build --preserveWatchOutput --verbose --onSuccess 'sh -c "npm run resolve-tspaths:server && NODE_ENV=dev node dist/server"' server/tsconfig.json
|
./node_modules/.bin/tsc-watch --build --preserveWatchOutput --verbose --onSuccess 'sh -c "npm run resolve-tspaths:server && NODE_ENV=dev node dist/server"' server/tsconfig.json
|
||||||
|
|
|
@ -15,7 +15,7 @@ import {
|
||||||
VIDEO_PLAYLIST_TYPES,
|
VIDEO_PLAYLIST_TYPES,
|
||||||
VIDEO_PRIVACIES,
|
VIDEO_PRIVACIES,
|
||||||
VIDEO_STATES
|
VIDEO_STATES
|
||||||
} from '@peertube/peertube-server/server/initializers/constants.js'
|
} from '@peertube/peertube-server/core/initializers/constants.js'
|
||||||
|
|
||||||
const videojs = readJsonSync(join(root(), 'client', 'src', 'locale', 'videojs.en-US.json'))
|
const videojs = readJsonSync(join(root(), 'client', 'src', 'locale', 'videojs.en-US.json'))
|
||||||
const playerKeys = {
|
const playerKeys = {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../dist/scripts",
|
"outDir": "../dist/scripts",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@server/*": [ "./server/server/*" ]
|
"@server/*": [ "./server/core/*" ]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"references": [
|
"references": [
|
||||||
|
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue