diff options
Diffstat (limited to 'shared/extra-utils/server')
-rw-r--r-- | shared/extra-utils/server/config-command.ts | 12 | ||||
-rw-r--r-- | shared/extra-utils/server/plugins-command.ts | 5 | ||||
-rw-r--r-- | shared/extra-utils/server/server.ts | 12 |
3 files changed, 23 insertions, 6 deletions
diff --git a/shared/extra-utils/server/config-command.ts b/shared/extra-utils/server/config-command.ts index 7a768b4df..a061ca89e 100644 --- a/shared/extra-utils/server/config-command.ts +++ b/shared/extra-utils/server/config-command.ts | |||
@@ -194,6 +194,18 @@ export class ConfigCommand extends AbstractCommand { | |||
194 | whitelisted: true | 194 | whitelisted: true |
195 | } | 195 | } |
196 | }, | 196 | }, |
197 | client: { | ||
198 | videos: { | ||
199 | miniature: { | ||
200 | preferAuthorDisplayName: false | ||
201 | } | ||
202 | }, | ||
203 | menu: { | ||
204 | login: { | ||
205 | redirectOnSingleExternalAuth: false | ||
206 | } | ||
207 | } | ||
208 | }, | ||
197 | cache: { | 209 | cache: { |
198 | previews: { | 210 | previews: { |
199 | size: 2 | 211 | size: 2 |
diff --git a/shared/extra-utils/server/plugins-command.ts b/shared/extra-utils/server/plugins-command.ts index b944475a2..9bf24afff 100644 --- a/shared/extra-utils/server/plugins-command.ts +++ b/shared/extra-utils/server/plugins-command.ts | |||
@@ -158,15 +158,16 @@ export class PluginsCommand extends AbstractCommand { | |||
158 | install (options: OverrideCommandOptions & { | 158 | install (options: OverrideCommandOptions & { |
159 | path?: string | 159 | path?: string |
160 | npmName?: string | 160 | npmName?: string |
161 | pluginVersion?: string | ||
161 | }) { | 162 | }) { |
162 | const { npmName, path } = options | 163 | const { npmName, path, pluginVersion } = options |
163 | const apiPath = '/api/v1/plugins/install' | 164 | const apiPath = '/api/v1/plugins/install' |
164 | 165 | ||
165 | return this.postBodyRequest({ | 166 | return this.postBodyRequest({ |
166 | ...options, | 167 | ...options, |
167 | 168 | ||
168 | path: apiPath, | 169 | path: apiPath, |
169 | fields: { npmName, path }, | 170 | fields: { npmName, path, pluginVersion }, |
170 | implicitToken: true, | 171 | implicitToken: true, |
171 | defaultExpectedStatus: HttpStatusCode.OK_200 | 172 | defaultExpectedStatus: HttpStatusCode.OK_200 |
172 | }) | 173 | }) |
diff --git a/shared/extra-utils/server/server.ts b/shared/extra-utils/server/server.ts index 31224ebe9..9da293877 100644 --- a/shared/extra-utils/server/server.ts +++ b/shared/extra-utils/server/server.ts | |||
@@ -220,10 +220,11 @@ export class PeerTubeServer { | |||
220 | 220 | ||
221 | return new Promise<void>((res, rej) => { | 221 | return new Promise<void>((res, rej) => { |
222 | const self = this | 222 | const self = this |
223 | let aggregatedLogs = '' | ||
223 | 224 | ||
224 | this.app = fork(join(root(), 'dist', 'server.js'), options.peertubeArgs || [], forkOptions) | 225 | this.app = fork(join(root(), 'dist', 'server.js'), options.peertubeArgs || [], forkOptions) |
225 | 226 | ||
226 | const onPeerTubeExit = () => rej(new Error('Process exited')) | 227 | const onPeerTubeExit = () => rej(new Error('Process exited:\n' + aggregatedLogs)) |
227 | const onParentExit = () => { | 228 | const onParentExit = () => { |
228 | if (!this.app || !this.app.pid) return | 229 | if (!this.app || !this.app.pid) return |
229 | 230 | ||
@@ -238,10 +239,13 @@ export class PeerTubeServer { | |||
238 | this.app.stdout.on('data', function onStdout (data) { | 239 | this.app.stdout.on('data', function onStdout (data) { |
239 | let dontContinue = false | 240 | let dontContinue = false |
240 | 241 | ||
242 | const log: string = data.toString() | ||
243 | aggregatedLogs += log | ||
244 | |||
241 | // Capture things if we want to | 245 | // Capture things if we want to |
242 | for (const key of Object.keys(regexps)) { | 246 | for (const key of Object.keys(regexps)) { |
243 | const regexp = regexps[key] | 247 | const regexp = regexps[key] |
244 | const matches = data.toString().match(regexp) | 248 | const matches = log.match(regexp) |
245 | if (matches !== null) { | 249 | if (matches !== null) { |
246 | if (key === 'client_id') self.store.client.id = matches[1] | 250 | if (key === 'client_id') self.store.client.id = matches[1] |
247 | else if (key === 'client_secret') self.store.client.secret = matches[1] | 251 | else if (key === 'client_secret') self.store.client.secret = matches[1] |
@@ -252,7 +256,7 @@ export class PeerTubeServer { | |||
252 | 256 | ||
253 | // Check if all required sentences are here | 257 | // Check if all required sentences are here |
254 | for (const key of Object.keys(serverRunString)) { | 258 | for (const key of Object.keys(serverRunString)) { |
255 | if (data.toString().indexOf(key) !== -1) serverRunString[key] = true | 259 | if (log.includes(key)) serverRunString[key] = true |
256 | if (serverRunString[key] === false) dontContinue = true | 260 | if (serverRunString[key] === false) dontContinue = true |
257 | } | 261 | } |
258 | 262 | ||
@@ -260,7 +264,7 @@ export class PeerTubeServer { | |||
260 | if (dontContinue === true) return | 264 | if (dontContinue === true) return |
261 | 265 | ||
262 | if (options.hideLogs === false) { | 266 | if (options.hideLogs === false) { |
263 | console.log(data.toString()) | 267 | console.log(log) |
264 | } else { | 268 | } else { |
265 | process.removeListener('exit', onParentExit) | 269 | process.removeListener('exit', onParentExit) |
266 | self.app.stdout.removeListener('data', onStdout) | 270 | self.app.stdout.removeListener('data', onStdout) |