Implement read support for CDN3
This commit is contained in:
parent
8aac997b4f
commit
bbd43b6e38
6 changed files with 11 additions and 3 deletions
|
@ -2276,6 +2276,7 @@ ipc.on('get-config', async event => {
|
||||||
artCreatorUrl: config.get<string>('artCreatorUrl'),
|
artCreatorUrl: config.get<string>('artCreatorUrl'),
|
||||||
cdnUrl0: config.get<ConfigType>('cdn').get<string>('0'),
|
cdnUrl0: config.get<ConfigType>('cdn').get<string>('0'),
|
||||||
cdnUrl2: config.get<ConfigType>('cdn').get<string>('2'),
|
cdnUrl2: config.get<ConfigType>('cdn').get<string>('2'),
|
||||||
|
cdnUrl3: config.get<ConfigType>('cdn').get<string>('3'),
|
||||||
certificateAuthority: config.get<string>('certificateAuthority'),
|
certificateAuthority: config.get<string>('certificateAuthority'),
|
||||||
environment:
|
environment:
|
||||||
!isTestEnvironment(getEnvironment()) && ciMode
|
!isTestEnvironment(getEnvironment()) && ciMode
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
"directoryMRENCLAVE": "0f6fd79cdfdaa5b2e6337f534d3baf999318b0c462a7ac1f41297a3e4b424a57",
|
"directoryMRENCLAVE": "0f6fd79cdfdaa5b2e6337f534d3baf999318b0c462a7ac1f41297a3e4b424a57",
|
||||||
"cdn": {
|
"cdn": {
|
||||||
"0": "https://cdn-staging.signal.org",
|
"0": "https://cdn-staging.signal.org",
|
||||||
"2": "https://cdn2-staging.signal.org"
|
"2": "https://cdn2-staging.signal.org",
|
||||||
|
"3": "https://cdn3-staging.signal.org"
|
||||||
},
|
},
|
||||||
"contentProxyUrl": "http://contentproxy.signal.org:443",
|
"contentProxyUrl": "http://contentproxy.signal.org:443",
|
||||||
"updatesUrl": "https://updates2.signal.org/desktop",
|
"updatesUrl": "https://updates2.signal.org/desktop",
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
"directoryMRENCLAVE": "0f6fd79cdfdaa5b2e6337f534d3baf999318b0c462a7ac1f41297a3e4b424a57",
|
"directoryMRENCLAVE": "0f6fd79cdfdaa5b2e6337f534d3baf999318b0c462a7ac1f41297a3e4b424a57",
|
||||||
"cdn": {
|
"cdn": {
|
||||||
"0": "https://cdn.signal.org",
|
"0": "https://cdn.signal.org",
|
||||||
"2": "https://cdn2.signal.org"
|
"2": "https://cdn2.signal.org",
|
||||||
|
"3": "https://cdn3.signal.org"
|
||||||
},
|
},
|
||||||
"artCreatorUrl": "https://create.signal.art",
|
"artCreatorUrl": "https://create.signal.art",
|
||||||
"challengeUrl": "https://signalcaptchas.org/challenge/generate.html",
|
"challengeUrl": "https://signalcaptchas.org/challenge/generate.html",
|
||||||
|
|
|
@ -1203,6 +1203,9 @@ export function initialize({
|
||||||
if (!isString(cdnUrlObject['2'])) {
|
if (!isString(cdnUrlObject['2'])) {
|
||||||
throw new Error('WebAPI.initialize: Missing CDN 2 configuration');
|
throw new Error('WebAPI.initialize: Missing CDN 2 configuration');
|
||||||
}
|
}
|
||||||
|
if (!isString(cdnUrlObject['3'])) {
|
||||||
|
throw new Error('WebAPI.initialize: Missing CDN 3 configuration');
|
||||||
|
}
|
||||||
if (!isString(certificateAuthority)) {
|
if (!isString(certificateAuthority)) {
|
||||||
throw new Error('WebAPI.initialize: Invalid certificateAuthority');
|
throw new Error('WebAPI.initialize: Invalid certificateAuthority');
|
||||||
}
|
}
|
||||||
|
@ -2655,7 +2658,7 @@ export function initialize({
|
||||||
const abortController = new AbortController();
|
const abortController = new AbortController();
|
||||||
|
|
||||||
const cdnUrl = isNumber(cdnNumber)
|
const cdnUrl = isNumber(cdnNumber)
|
||||||
? cdnUrlObject[cdnNumber] || cdnUrlObject['0']
|
? cdnUrlObject[cdnNumber] ?? cdnUrlObject['0']
|
||||||
: cdnUrlObject['0'];
|
: cdnUrlObject['0'];
|
||||||
// This is going to the CDN, not the service, so we use _outerAjax
|
// This is going to the CDN, not the service, so we use _outerAjax
|
||||||
const stream = await _outerAjax(`${cdnUrl}/attachments/${cdnKey}`, {
|
const stream = await _outerAjax(`${cdnUrl}/attachments/${cdnKey}`, {
|
||||||
|
|
|
@ -33,6 +33,7 @@ export const rendererConfigSchema = z.object({
|
||||||
buildExpiration: z.number(),
|
buildExpiration: z.number(),
|
||||||
cdnUrl0: configRequiredStringSchema,
|
cdnUrl0: configRequiredStringSchema,
|
||||||
cdnUrl2: configRequiredStringSchema,
|
cdnUrl2: configRequiredStringSchema,
|
||||||
|
cdnUrl3: configRequiredStringSchema,
|
||||||
challengeUrl: configRequiredStringSchema,
|
challengeUrl: configRequiredStringSchema,
|
||||||
certificateAuthority: configRequiredStringSchema,
|
certificateAuthority: configRequiredStringSchema,
|
||||||
contentProxyUrl: configRequiredStringSchema,
|
contentProxyUrl: configRequiredStringSchema,
|
||||||
|
|
|
@ -31,6 +31,7 @@ window.WebAPI = window.textsecure.WebAPI.initialize({
|
||||||
cdnUrlObject: {
|
cdnUrlObject: {
|
||||||
0: config.cdnUrl0,
|
0: config.cdnUrl0,
|
||||||
2: config.cdnUrl2,
|
2: config.cdnUrl2,
|
||||||
|
3: config.cdnUrl3,
|
||||||
},
|
},
|
||||||
certificateAuthority: config.certificateAuthority,
|
certificateAuthority: config.certificateAuthority,
|
||||||
contentProxyUrl: config.contentProxyUrl,
|
contentProxyUrl: config.contentProxyUrl,
|
||||||
|
|
Loading…
Reference in a new issue