server/server -> server/core

This commit is contained in:
Chocobozzz 2023-10-04 15:13:25 +02:00
parent 114327d4ce
commit 5a3d0650c9
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
838 changed files with 111 additions and 111 deletions

View File

@ -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

View File

@ -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'

View File

@ -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'

View File

@ -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,

View File

@ -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'

View File

@ -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'

View File

@ -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 () {

View File

@ -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 () {

View File

@ -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 () {

View File

@ -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([

View File

@ -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 () {

View File

@ -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 () {

View File

@ -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'

View File

@ -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 () {

View File

@ -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')

View File

@ -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 = {

View File

@ -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'

View File

@ -7,7 +7,7 @@
"tsBuildInfoFile": "./dist/.tsbuildinfo", "tsBuildInfoFile": "./dist/.tsbuildinfo",
"paths": { "paths": {
"@tests/*": [ "src/*" ], "@tests/*": [ "src/*" ],
"@server/*": [ "../../server/server/*" ] "@server/*": [ "../../server/core/*" ]
} }
}, },
"references": [ "references": [

View File

@ -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" ]

View File

@ -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": [

View File

@ -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"

View File

@ -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

View File

@ -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 = {

View File

@ -3,7 +3,7 @@
"compilerOptions": { "compilerOptions": {
"outDir": "../dist/scripts", "outDir": "../dist/scripts",
"paths": { "paths": {
"@server/*": [ "./server/server/*" ] "@server/*": [ "./server/core/*" ]
} }
}, },
"references": [ "references": [

View File

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

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