Configure a Mini Program package

更新时间:
复制 MD 格式

Set up the virtual domain name and RSA public key that Mini Program packages require before you can create and release packages.

How it works

Two configuration items control how the client handles Mini Program packages:

Virtual domain name — When the client loads a Mini Program package from local storage, it uses a virtual domain name as the file address suffix to unify local file paths. Enter any registered domain name. This value is a configuration identifier, not a live network endpoint.

RSA key pair — The key is an RSA private key generated by OpenSSL, which is used to encrypt the Mini Program package. The corresponding public key is used to decrypt on the client.

Generate the key pair with the following commands:

# Generate a private key
openssl genrsa -out private_key.pem 2048

# Generate a public key
openssl rsa -in private_key.pem -outform PEM -pubout -out public.pem

Configure package settings

Log in to the mPaaS console and perform the following steps:

  1. Click Mini Program > Release Mini Program in the left navigation bar.

  2. On the Mini Program package list page, click Configuration management.

  3. In the Domain name management section, enter the virtual domain name, such as example.com.

  4. Note
    • The domain name cannot start with HTTP or HTTPS. Second-level and third-level domain names with these prefixes are not accepted.

    • Use a domain name you have already registered.

  5. I

  6. In the Key management section, click Choose file and select the key file to upload.

    Note

    Skip this step if the client has signature verification disabled. The key file is only required when signature verification is active.

  7. Select The above information has been confirmed to be accurate and will not be modified after submission, and click Upload.

What to do next

Create a Mini Program package