Serving Static Files
  • 19 Apr 2023
  • Dark
    Light
  • PDF

Serving Static Files

  • Dark
    Light
  • PDF

Article summary

Deprecation of Serving Static Files

Beginning in the 2023.1 release, serving static files will be controlled by a new uiDirectories property at the root level of the pronghorn.json file that is an array of strings (directory names) as its elements. By implementing uiDirectories as a single property, IAP can serve static files required for the user interface (UI) in each directory at the path of the file and only in those directories. Moreover, static files can be managed and served more efficiently with all appropriate security headers in place. While directory traversal poses low security risk, this change further reduces that risk, but permits customers who require access to UI-related files to continue serving them in a controlled manner.

Item Description Deprecation Release Scheduled Removal Release Replacement
staticFiles Files that store and serve static content (e.g. images, JavaScript, JSON, CSS, HTML, etc). 2031.1 2024.1 uiDirectories

Property

"uiDirectories": ["build", "img"]

What Should I Do?

For custom applications, developers need to manually add the uiDirectories property. If the property is not added to the pronghorn.json prior to the end of the deprecation cycle, the UI will not be served (i.e., function). The config sample below illustrates how to add this property. From the example, all files within the build and img directories will be served recursively. No other files will be served outside the directories within build and img. Moreover, any custom applications that rely on serving static files will need to be modified to the new file paths, where appropriate, to accommodate this new pattern.

Sample Config

{
  "id": "@itential/app-admin_essentials",
  "export": "AdminEssentials",
  "title": "admin",
  "type": "UI",
  "summary": "Itential Automation Platform's administration suite.",
  "roles": ["admin"],
  "methods": [],
  "uiDirectories": ["build", "img"],
  "views": [
    {
      "path": "/",
      "roles": ["admin"],
      "template": "../build/index.html",
      "title": "Admin Essentials",
      "type": "view",
      "icon": "/admin/img/appIcon.svg"
    }
  ]
}

For standard IAP users (i.e., non-customized), this does not require any special configuration. By default, all static assets will use the uiDirectories inside the following apps:

"@itential/app-admin_essentials"
"@itential/app-ag_manager"
"@itential/app-automation_catalog"
"@itential/app-automation_studio"
"@itential/app-configuration_manager"
"@itential/app-form_builder"
"@itential/app-json_forms"
"@itential/app-jst"
"@itential/app-mop"
"@itential/app-nso_manager"
"@itential/app-operations_manager"
"@itential/app-service_catalog"
"@itential/app-service_management"
"@itential/app-template_builder"
"@itential/app-workflow_builder"
"@itential/app-workflow_engine"

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.