richard-to / mesop-app-runner

Run generated code from Mesop App Maker.
Apache License 2.0
0 stars 0 forks source link

Running the runner prompts a SecurityPolicy error #1

Open RemixaWorld opened 2 weeks ago

RemixaWorld commented 2 weeks ago

Here's the error, but I've already gotten inside the container and changed the strategy in main.py: 1) I was prompted to add http://192.168.1.5:8080 to the allowed_iframe_parents list; 2) I enable dangerously_disable_trusted_types.

But you still get the error.

⚠️  Content Security Policy Error  ⚠️
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Directive:   frame-ancestors
Blocked URL: http://192.168.1.5:8080/
App path:    /

ℹ️  If this is coming from your web component,
   update your security policy like this:

@me.page(
  security_policy=me.SecurityPolicy(
    allowed_iframe_parents=[
      'http://192.168.1.5:8080',
    ]
  )
)

⚠️  Content Security Policy Error  ⚠️
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Directive:   trusted-types
Blocked URL: trusted-types-policy
App path:    /

ℹ️  If this is coming from your web component,
   update your security policy like this:

@me.page(
  security_policy=me.SecurityPolicy(
    dangerously_disable_trusted_types=True
  )
)
richard-to commented 5 days ago

Sorry for the late reply @RemixaWorld. For some reason I don't get email notifications for when people post issues on my repositories. Thanks for bringing this to my attention. I think the iframe thing makes sense. I'll try to update the docs to make that clearer. As for the security policy thing, I find that a bit strange. Could be a change in more recent versions of Mesop. I'll have to take a look when I get the chance. Been busy with other stuff.

RemixaWorld commented 4 days ago

@richard-to Thanks for your contribution, I have little web knowledge but had an idea to implement an interface for my llm application and for that I found this awesome project. Looking forward to your further treatment!