Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request custom support for blob storage when emulated #54

Open
wn-na opened this issue Nov 29, 2024 · 7 comments
Open

Request custom support for blob storage when emulated #54

wn-na opened this issue Nov 29, 2024 · 7 comments

Comments

@wn-na
Copy link

wn-na commented Nov 29, 2024

hello.

I have an issue where the download URL comes out as 127.0.0.1 when emulated.

To solve this, I am using the following method.

  • api/script/routes/acquisition.ts add to line 182
          if (process.env.EMULATED) {
            updateCheckBody.updateInfo.downloadURL = updateCheckBody.updateInfo.downloadURL.replace(
              "http://127.0.0.1:10000",
              "http://MY_LOACL_HOST_IP:10000"
            );
          }

Is it possible to officially add a custom env setting for the blob storage address?

@felixchan
Copy link

I have tried the same hack to replace 127.0.0.1 azurite URL to my own domain.
The result is that my client will download the package from is something like this.

http://api2.mydomain.com:10000/devstoreaccount1/storagev2/sWXwSg7ek5XAktIXLVNIW6nczYRzV1CPmJbV-x

However, when my client attempts to actually download the package (from my remote server, port 10000, azurite emulated), azurite returns 404

@wn-na
Copy link
Author

wn-na commented Dec 11, 2024

@felixchan Did you give --blobHost 0.0.0.0 option when running azurite?

@felixchan
Copy link

felixchan commented Dec 11, 2024

@felixchan Did you give --blobHost 0.0.0.0 option when running azurite?

Yes, I did

When my iOS react-native client app gets the update package, it correctly lists my domain:

{
  description: 'menu4',
  label: 'v6',
  appVersion: '3.0',
  isMandatory: false,
  packageHash: 'c89b441277e1e0499b8617ff1b1634ea3de8d13e39f74e3f31',
  packageSize: 307082160,
  downloadUrl: 'http://api2.mydomain.com:10000/devstoreaccount1/storagev2/sWXwSg7ek5mAktIXIW6nczYRzV1CPmJbV-x',
 }

However, when I GET that downloadUrl (either on client or normal Curl) I get a 404.

Were you able to successfully download from azurite?

@wn-na
Copy link
Author

wn-na commented Dec 11, 2024

@felixchan yes, i can download for ios and android. can you check it for info.plist to allow your download domain?

@felixchan
Copy link

@felixchan yes, i can download for ios and android. can you check it for info.plist to allow your download domain?

Info.plist allows my custom domain for HTTP.

	<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
    <key>NSExceptionDomains</key>
    <dict>
        <key>api2.mydomain.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSTemporaryExceptionMinimumTLSVersion</key>
            <string>TLSv1.0</string>
        </dict>
    </dict>
</dict>

When you GET the downloadUrl normally, does it download?

It's 404 even for a normal GET.

@wn-na
Copy link
Author

wn-na commented Dec 11, 2024

@felixchan I've been downloading just fine.

Image

i run azurite for this command
azurite --skipApiVersionCheck --disableProductStyleUrl --blobHost 0.0.0.0 --loose

i think 404 is maybe issue for your domain (like nginx setting or tomcat, etc...)

@felixchan
Copy link

@wn-na I was able to download the package after applying your patch to azure-storage. (Before , I forgot a step)

Thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants