Skip to content

Commit

Permalink
server/server -> server/core
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobozzz committed Oct 4, 2023
1 parent 114327d commit 5a3d065
Show file tree
Hide file tree
Showing 838 changed files with 111 additions and 111 deletions.
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ npx @redocly/cli preview-docs ./support/doc/api/openapi.yaml
```

Some hints:
* Routes are defined in [/server/server/controllers/](https://github.com/Chocobozzz/PeerTube/tree/develop/server/server/controllers) directory
* Parameters validators are defined in [/server/server/middlewares/validators](https://github.com/Chocobozzz/PeerTube/tree/develop/server/server/middlewares/validators) 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/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


Expand Down
6 changes: 3 additions & 3 deletions packages/tests/src/api/activitypub/security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {
activityPubContextify,
buildGlobalHTTPHeaders,
signAndContextify
} from '@peertube/peertube-server/server/helpers/activity-pub-utils.js'
import { buildDigest } from '@peertube/peertube-server/server/helpers/peertube-crypto.js'
import { ACTIVITY_PUB, HTTP_SIGNATURE } from '@peertube/peertube-server/server/initializers/constants.js'
} from '@peertube/peertube-server/core/helpers/activity-pub-utils.js'
import { buildDigest } from '@peertube/peertube-server/core/helpers/peertube-crypto.js'
import { ACTIVITY_PUB, HTTP_SIGNATURE } from '@peertube/peertube-server/core/initializers/constants.js'
import { makePOSTAPRequest } from '@tests/shared/requests.js'
import { SQLCommand } from '@tests/shared/sql-command.js'
import { expect } from 'chai'
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/src/api/transcoding/hls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
setAccessTokensToServers,
waitJobs
} 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 { completeCheckHlsPlaylist } from '@tests/shared/streaming-playlists.js'

Expand Down
2 changes: 1 addition & 1 deletion packages/tests/src/api/transcoding/transcoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { expect } from 'chai'
import { getAllFiles, getMaxTheoreticalBitrate, getMinTheoreticalBitrate, omit } from '@peertube/peertube-core-utils'
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 {
ffprobePromise,
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/src/api/videos/video-channels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { expect } from 'chai'
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 { SQLCommand } from '@tests/shared/sql-command.js'
import { wait } from '@peertube/peertube-core-utils'
Expand Down
4 changes: 2 additions & 2 deletions packages/tests/src/server-helpers/activitypub.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */

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 {
isHTTPSignatureVerified,
isJsonLDSignatureVerified,
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 { expect } from 'chai'
import { readJsonSync } from 'fs-extra/esm'
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/src/server-helpers/core-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import snakeCase from 'lodash-es/snakeCase.js'
import validator from 'validator'
import { getAverageTheoreticalBitrate, getMaxTheoreticalBitrate, parseChapters } from '@peertube/peertube-core-utils'
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 () {

Expand Down
2 changes: 1 addition & 1 deletion packages/tests/src/server-helpers/crypto.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */

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

Expand Down
2 changes: 1 addition & 1 deletion packages/tests/src/server-helpers/dns.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */

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

Expand Down
4 changes: 2 additions & 2 deletions packages/tests/src/server-helpers/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { remove } from 'fs-extra/esm'
import { readFile } from 'fs/promises'
import { join } from 'path'
import { buildAbsoluteFixturePath, root } from '@peertube/peertube-node-utils'
import { execPromise } from '@peertube/peertube-server/server/helpers/core-utils.js'
import { processImage } from '@peertube/peertube-server/server/helpers/image-utils.js'
import { execPromise } from '@peertube/peertube-server/core/helpers/core-utils.js'
import { processImage } from '@peertube/peertube-server/core/helpers/image-utils.js'

async function checkBuffers (path1: string, path2: string, equals: boolean) {
const [ buf1, buf2 ] = await Promise.all([
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/src/server-helpers/markdown.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* 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'

describe('Markdown helpers', function () {
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/src/server-helpers/mentions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */

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 () {
it('Should correctly extract mentions', async function () {
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/src/server-helpers/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { pathExists, remove } from 'fs-extra/esm'
import { join } from 'path'
import { wait } from '@peertube/peertube-core-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 { FIXTURE_URLS } from '@tests/shared/tests.js'

Expand Down
2 changes: 1 addition & 1 deletion packages/tests/src/server-helpers/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { expect } from 'chai'
import {
isPluginStableOrUnstableVersionValid,
isPluginStableVersionValid
} from '@peertube/peertube-server/server/helpers/custom-validators/plugins.js'
} from '@peertube/peertube-server/core/helpers/custom-validators/plugins.js'

describe('Validators', function () {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
VIDEO_LICENCES,
VIDEO_PLAYLIST_PRIVACIES,
VIDEO_PRIVACIES
} from '@peertube/peertube-server/server/initializers/constants.js'
import { VideoConstantManagerFactory } from '@peertube/peertube-server/server/lib/plugins/video-constant-manager-factory.js'
} from '@peertube/peertube-server/core/initializers/constants.js'
import { VideoConstantManagerFactory } from '@peertube/peertube-server/core/lib/plugins/video-constant-manager-factory.js'

describe('VideoConstantManagerFactory', function () {
const factory = new VideoConstantManagerFactory('peertube-plugin-constants')
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/src/shared/requests.ts
Original file line number Diff line number Diff line change
@@ -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) {
const options = {
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/src/shared/videos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
VIDEO_LANGUAGES,
VIDEO_LICENCES,
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 { makeRawRequest, PeerTubeServer, VideoEdit, waitJobs } from '@peertube/peertube-server-commands'
import { dateIsValid, expectStartWith, testImageGeneratedByFFmpeg } from './checks.js'
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"tsBuildInfoFile": "./dist/.tsbuildinfo",
"paths": {
"@tests/*": [ "src/*" ],
"@server/*": [ "../../server/server/*" ]
"@server/*": [ "../../server/core/*" ]
}
},
"references": [
Expand Down
2 changes: 1 addition & 1 deletion packages/types-generator/tsconfig.dist.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
],
"baseUrl": "./dist",
"paths": {
"@server/*": [ "server/server/*" ],
"@server/*": [ "server/core/*" ],
"@client/*": [ "client/*" ],
"@peertube/peertube-models": [ "peertube-models" ],
"@peertube/peertube-typescript-utils": [ "peertube-typescript-utils" ]
Expand Down
2 changes: 1 addition & 1 deletion packages/types-generator/tsconfig.types.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"rootDir": "./src",
"tsBuildInfoFile": "./dist/tsconfig.server.types.tsbuildinfo",
"paths": {
"@server/*": [ "../../server/server/*" ]
"@server/*": [ "../../server/core/*" ]
}
},
"references": [
Expand Down
4 changes: 2 additions & 2 deletions scripts/build/server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ rm -rf ./dist ./packages/*/dist
npm run tsc -- -b --verbose server/tsconfig.json
npm run resolve-tspaths:server

cp -r "./server/server/static" "./server/server/assets" ./dist/server
cp -r "./server/server/lib/emails" "./dist/server/lib"
cp -r "./server/core/static" "./server/core/assets" ./dist/core
cp -r "./server/core/lib/emails" "./dist/core/lib"
cp "./server/scripts/upgrade.sh" "./dist/scripts"
6 changes: 3 additions & 3 deletions scripts/dev/server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ mkdir -p "./client/dist"
rm -rf "./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 resolve-tspaths:server

cp -r ./server/server/static ./server/server/assets ./dist/server
cp -r "./server/server/lib/emails" "./dist/server/lib"
cp -r ./server/core/static ./server/core/assets ./dist/core
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
2 changes: 1 addition & 1 deletion scripts/i18n/create-custom-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
VIDEO_PLAYLIST_TYPES,
VIDEO_PRIVACIES,
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 playerKeys = {
Expand Down
2 changes: 1 addition & 1 deletion scripts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"outDir": "../dist/scripts",
"paths": {
"@server/*": [ "./server/server/*" ]
"@server/*": [ "./server/core/*" ]
}
},
"references": [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ wellKnownRouter.use('/.well-known/dnt-policy.txt',
(_, res: express.Response) => {
res.type('text/plain')

return res.sendFile(join(root(), 'dist/server/static/dnt-policy/dnt-policy-1.0.txt'))
return res.sendFile(join(root(), 'dist/core/static/dnt-policy/dnt-policy-1.0.txt'))
}
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 5a3d065

Please sign in to comment.