mirror of
https://github.com/koush/scrypted.git
synced 2026-05-04 21:30:30 +01:00
cloud: more fixes for having a dangling custom domain value
This commit is contained in:
4
plugins/cloud/package-lock.json
generated
4
plugins/cloud/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/cloud",
|
||||
"version": "0.1.6",
|
||||
"version": "0.1.7",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/cloud",
|
||||
"version": "0.1.6",
|
||||
"version": "0.1.7",
|
||||
"dependencies": {
|
||||
"@eneris/push-receiver": "../../external/push-receiver",
|
||||
"@scrypted/common": "file:../../common",
|
||||
|
||||
@@ -52,5 +52,5 @@
|
||||
"@types/nat-upnp": "^1.1.2",
|
||||
"@types/node": "^18.11.18"
|
||||
},
|
||||
"version": "0.1.6"
|
||||
"version": "0.1.7"
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class ScryptedPush extends ScryptedDeviceBase implements BufferConverter {
|
||||
}
|
||||
|
||||
async convert(data: Buffer | string, fromMimeType: string): Promise<Buffer> {
|
||||
if (this.cloud.storageSettings.values.hostname) {
|
||||
if (this.cloud.storageSettings.values.forwardingMode === 'Custom Domain' && this.cloud.storageSettings.values.hostname) {
|
||||
return Buffer.from(`https://${this.cloud.getHostname()}${await this.cloud.getCloudMessagePath()}/${data}`);
|
||||
}
|
||||
|
||||
@@ -229,6 +229,9 @@ class ScryptedCloud extends ScryptedDeviceBase implements OauthClient, Settings,
|
||||
? this.storageSettings.values.hostname?.toString()
|
||||
: 'localhost';
|
||||
|
||||
if (!ip)
|
||||
throw new Error('Hostname is required for port Custom Domain setup.');
|
||||
|
||||
if (this.storageSettings.values.forwardingMode === 'Custom Domain')
|
||||
upnpPort = 443;
|
||||
|
||||
@@ -331,7 +334,7 @@ class ScryptedCloud extends ScryptedDeviceBase implements OauthClient, Settings,
|
||||
async whitelist(localUrl: string, ttl: number, baseUrl: string): Promise<Buffer> {
|
||||
const local = Url.parse(localUrl);
|
||||
|
||||
if (this.storageSettings.values.hostname) {
|
||||
if (this.storageSettings.values.forwardingMode === 'Custom Domain' && this.storageSettings.values.hostname) {
|
||||
return Buffer.from(`${baseUrl}${local.path}`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user