saltyorg / Saltbox

Ansible-based solution for rapidly deploying a Docker containerized cloud media server.
https://docs.saltbox.dev
GNU General Public License v3.0
602 stars 68 forks source link

Toggles for qbittorrent's themepark "add-on" #184

Closed bonny1992 closed 7 months ago

bonny1992 commented 7 months ago

Describe the problem If using qbittorrent with themepark enabled with organizr, if you put it in iframe it won't work. It's because the themepark role sets the frame-ancestors self custom HTTP header in qbit's option.

Describe any solutions you think might work I solved it by using this header:

frame-ancestors https://organizr.mydomain.com http://organizr:80 self https://qbittorrent.mydomain.com http://qbittorrent:8080

(I'm unsure whether adding the internal address does something or not to be fair) Using the config file or the inventory system we could set add additional domains to the "base" install of themepark within Qbit, like this maybe:

qbittorrent_themepark_custom_domains: 
   - https://organizr.mydomain.com
   - http://organizr:80 
   - https://qbittorrent.mydomain.com 
   - http://qbittorrent:8080

and Saltbox can add it alongside the original self

saltydk commented 7 months ago

Specifically this is about these two settings tweaks here: https://github.com/saltyorg/Saltbox/blob/682a669bc7130df630fa9bbf1163cfe8787f2c9c/roles/qbittorrent/tasks/subtasks/post-install/settings/main.yml#L58-L80

saltydk commented 7 months ago

In the case of using theme.park you would probably just modify

qbittorrent_themepark_headers: "\"content-security-policy: default-src 'self'; style-src 'self' 'unsafe-inline' theme-park.dev raw.githubusercontent.com use.fontawesome.com; img-src 'self' theme-park.dev raw.githubusercontent.com data:; script-src 'self' 'unsafe-inline'; object-src 'none'; form-action 'self'; frame-ancestors 'self'; font-src use.fontawesome.com;\""