Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved Override Content Security Policy not working

    Mattermost
    3
    6
    69
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sufian.mughal last edited by

      i need to run mattermost in iframe and overriding the

      Content Security Policy
      Setting this option will override any CSP headers sent by the app itself

      i am trying to override to "frame-ancestors 'xyz.zyz';

      can anyone help in this regard

      1 Reply Last reply Reply Quote 0
      • nebulon
        nebulon Staff last edited by

        Have you seen the documentation for this at https://docs.cloudron.io/apps/#custom-csp ?

        S 1 Reply Last reply Reply Quote 0
        • Topic has been marked as a question  nebulon nebulon 
        • S
          sufian.mughal @nebulon last edited by

          @nebulon yes i tried exactly but its not working

          1 Reply Last reply Reply Quote 0
          • nebulon
            nebulon Staff last edited by

            I just tried this on a fresh installation and I can see the CSP header correctly sent after configuring it through the Cloudron dashboard. Can you maybe curl the page with -v and check the sent headers there?

            1 Reply Last reply Reply Quote 0
            • girish
              girish Staff last edited by

              Looks like https://forum.mattermost.com/t/recipe-embedding-mattermost-in-web-applications-using-an-iframe-unsupported-recipe/10233 is the latest recipe.

              1 Reply Last reply Reply Quote 0
              • girish
                girish Staff last edited by

                Configure mattermost like so:

                4834cffc-77c7-4d4a-8c7c-5c571d67a905-image.png

                Then in surfer app (the app configured above), use the following code:

                <!DOCTYPE html>
                <html>
                
                <body style="text-align: center">
                	<iframe src="https://mattermost.smartserver.io" height="200" width="400">
                	</iframe>
                </body>
                
                </html>
                

                The going to surfer.smartserver.io, I get:

                cb562414-4350-48ad-b114-30832ed029d0-image.png

                1 Reply Last reply Reply Quote 0
                • Topic has been marked as solved  girish girish 
                • First post
                  Last post
                Powered by NodeBB