diff options
Diffstat (limited to 'shared/server-commands/server/config-command.ts')
-rw-r--r-- | shared/server-commands/server/config-command.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/shared/server-commands/server/config-command.ts b/shared/server-commands/server/config-command.ts index e47a0d346..1dd6e1ea4 100644 --- a/shared/server-commands/server/config-command.ts +++ b/shared/server-commands/server/config-command.ts | |||
@@ -123,6 +123,21 @@ export class ConfigCommand extends AbstractCommand { | |||
123 | }) | 123 | }) |
124 | } | 124 | } |
125 | 125 | ||
126 | async getIndexHTMLConfig (options: OverrideCommandOptions = {}) { | ||
127 | const text = await this.getRequestText({ | ||
128 | ...options, | ||
129 | |||
130 | path: '/', | ||
131 | implicitToken: false, | ||
132 | defaultExpectedStatus: HttpStatusCode.OK_200 | ||
133 | }) | ||
134 | |||
135 | const match = text.match('<script type="application/javascript">window.PeerTubeServerConfig = (".+?")</script>') | ||
136 | |||
137 | // We parse the string twice, first to extract the string and then to extract the JSON | ||
138 | return JSON.parse(JSON.parse(match[1])) as ServerConfig | ||
139 | } | ||
140 | |||
126 | getAbout (options: OverrideCommandOptions = {}) { | 141 | getAbout (options: OverrideCommandOptions = {}) { |
127 | const path = '/api/v1/config/about' | 142 | const path = '/api/v1/config/about' |
128 | 143 | ||