New debug mode:
Debug mode is no more triggered by the NODE_ENV value, but by testing the existance of a file in the plugin data directory.
This commit is contained in:
committed by
John Livingston
parent
f8b83defb5
commit
b4dabfeeb9
@ -5,6 +5,6 @@ export async function diagBackend (test: string, _options: RegisterServerOptions
|
||||
const result = newResult(test)
|
||||
result.label = 'Backend connection'
|
||||
result.ok = true
|
||||
result.next = 'webchat-video'
|
||||
result.next = 'debug'
|
||||
return result
|
||||
}
|
||||
|
12
server/lib/diagnostic/debug.ts
Normal file
12
server/lib/diagnostic/debug.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import type { RegisterServerOptions } from '@peertube/peertube-types'
|
||||
import { newResult, TestResult } from './utils'
|
||||
import { isDebugMode } from '../../lib/debug'
|
||||
|
||||
export async function diagDebug (test: string, options: RegisterServerOptions): Promise<TestResult> {
|
||||
const result = newResult(test)
|
||||
result.label = 'Test debug mode'
|
||||
result.ok = true
|
||||
result.messages = [isDebugMode(options) ? 'Debug mode is ON' : 'Debug mode is OFF']
|
||||
result.next = 'webchat-video'
|
||||
return result
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
import type { RegisterServerOptions } from '@peertube/peertube-types'
|
||||
import { diagBackend } from './backend'
|
||||
import { TestResult, newResult } from './utils'
|
||||
import { diagDebug } from './debug'
|
||||
import { diagProsody } from './prosody'
|
||||
import { diagVideo } from './video'
|
||||
|
||||
@ -9,6 +10,8 @@ export async function diag (test: string, options: RegisterServerOptions): Promi
|
||||
|
||||
if (test === 'backend') {
|
||||
result = await diagBackend(test, options)
|
||||
} else if (test === 'debug') {
|
||||
result = await diagDebug(test, options)
|
||||
} else if (test === 'webchat-video') {
|
||||
result = await diagVideo(test, options)
|
||||
} else if (test === 'prosody') {
|
||||
|
@ -1,4 +1,4 @@
|
||||
type nextValue = 'backend' | 'webchat-video' | 'prosody'
|
||||
type nextValue = 'backend' | 'debug' | 'webchat-video' | 'prosody'
|
||||
|
||||
interface MessageWithLevel {
|
||||
level: 'info' | 'warning' | 'error'
|
||||
|
Reference in New Issue
Block a user