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


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Calibre Web
  3. How can a Calibre web URL be embedded in a Moodle iFrame?

How can a Calibre web URL be embedded in a Moodle iFrame?

Scheduled Pinned Locked Moved Calibre Web
6 Posts 2 Posters 87 Views 2 Watching
  • 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.
  • osoboO Offline
    osoboO Offline
    osobo
    wrote last edited by osobo
    #1

    Hello everyone,

    I'm trying to display the content of Calibre-web in a Moodle activity page to use it as a digital library.

    Both apps are installed on the same domain managed by Cloudron.

    In Moodle

    1. I've created a page with this iFrame
    <p><iframe style="border: none;" src="https://library.example.com" width="100%"
        height="600px" sandbox="allow-scripts allow-same-origin"></iframe></p>
    
    1. I've enabled the "Allow EMBED and OBJECT" and "Trusted Content" tags.
    2. The HTML format filter is toggled off

    In Cloudron I've modified the Calibre-web CSP as following

    default-src 'self'; frame-ancestors 'https://moodle.example.com';
    

    cd365c6b-c638-42a8-b1e7-4bf8aa7b19ae-image.png

    So far no success. The iframe shows "library.example.com has refused connexion"

    Thanks for your support
    Best wishes

    BrutalBirdieB 1 Reply Last reply
    1
    • osoboO osobo

      Hello everyone,

      I'm trying to display the content of Calibre-web in a Moodle activity page to use it as a digital library.

      Both apps are installed on the same domain managed by Cloudron.

      In Moodle

      1. I've created a page with this iFrame
      <p><iframe style="border: none;" src="https://library.example.com" width="100%"
          height="600px" sandbox="allow-scripts allow-same-origin"></iframe></p>
      
      1. I've enabled the "Allow EMBED and OBJECT" and "Trusted Content" tags.
      2. The HTML format filter is toggled off

      In Cloudron I've modified the Calibre-web CSP as following

      default-src 'self'; frame-ancestors 'https://moodle.example.com';
      

      cd365c6b-c638-42a8-b1e7-4bf8aa7b19ae-image.png

      So far no success. The iframe shows "library.example.com has refused connexion"

      Thanks for your support
      Best wishes

      BrutalBirdieB Offline
      BrutalBirdieB Offline
      BrutalBirdie
      Partner
      wrote last edited by BrutalBirdie
      #2

      @osobo said in How can a Calibre web URL be embedded in a Moodle iFrame?:

      In Cloudron I've modified the Calibre-web CSP as following

      You need to edit the CSP of the moodle app to allow calibre as an iframe embed.
      You just did it vice versa 😄

      Did the same once for peertube and Bookstack so I could embed peertube videos into bookstack for video guides / documentation.

      Like my work? Consider donating a drink. Cheers!

      osoboO 1 Reply Last reply
      2
      • BrutalBirdieB BrutalBirdie

        @osobo said in How can a Calibre web URL be embedded in a Moodle iFrame?:

        In Cloudron I've modified the Calibre-web CSP as following

        You need to edit the CSP of the moodle app to allow calibre as an iframe embed.
        You just did it vice versa 😄

        Did the same once for peertube and Bookstack so I could embed peertube videos into bookstack for video guides / documentation.

        osoboO Offline
        osoboO Offline
        osobo
        wrote last edited by osobo
        #3

        @BrutalBirdie Thank you. I've tried to override Moodle's app CSP but it doesn't change the outcome 😧 I get the same error. Maybe the code I use isn't correct (?)

        1 Reply Last reply
        1
        • BrutalBirdieB Offline
          BrutalBirdieB Offline
          BrutalBirdie
          Partner
          wrote last edited by BrutalBirdie
          #4

          In the moodle app view you have to add the following CSP:

          frame-src https://library.example.com;
          

          did you do that?

          Note: add not override, keep the defaults and add the frame-src
          More details about frame-src => https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/frame-src

          Like my work? Consider donating a drink. Cheers!

          osoboO 1 Reply Last reply
          3
          • BrutalBirdieB Offline
            BrutalBirdieB Offline
            BrutalBirdie
            Partner
            wrote last edited by
            #5

            I take your Coffee donation as a solved notion? 😄 Thanks again for the Coffee 🤗

            Like my work? Consider donating a drink. Cheers!

            1 Reply Last reply
            3
            • BrutalBirdieB BrutalBirdie

              In the moodle app view you have to add the following CSP:

              frame-src https://library.example.com;
              

              did you do that?

              Note: add not override, keep the defaults and add the frame-src
              More details about frame-src => https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/frame-src

              osoboO Offline
              osoboO Offline
              osobo
              wrote last edited by osobo
              #6

              @BrutalBirdie Thanks a lot. It works 🙂 !
              So just to wrap-up for other people, in order to embed your calibre-web app page (ie library.example.com) in Moodle (ie moodle.example.com) iframe you just need to add instructions in both app CSPs :

              In Calibre-Web CSP:

              frame-ancestors https://moodle.example.com;
              

              In Moodle CSP:

              frame-src https://library.example.com;
              
              1 Reply Last reply
              4
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Bookmarks
              • Search