├── LICENSE ├── README.md └── plugin.rb /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Ben Miller 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Discourse Allow Same Origin Plugin 2 | 3 | This plugin sets Discourse's Rails server to add the `X-Frame-Options: ALLOWALL` HTTP header to all responses. 4 | 5 | ## How to install 6 | 7 | There's already a template in the **app.yml** file for installing plugins due to the `docker_manager` plugin, so just add this plugin on the end! 8 | ``` 9 | hooks: 10 | after_code: 11 | - exec: 12 | cd: $home/plugins 13 | cmd: 14 | - mkdir -p plugins 15 | - git clone https://github.com/discourse/docker_manager.git 16 | - git clone https://github.com/discourse/discourse-spoiler-alert.git 17 | - git clone https://github.com/TheBunyip/discourse-allow-same-origin.git 18 | ``` 19 | 20 | Now you have to rebuild the container for the changes to be applied: 21 | ``` 22 | ./launcher rebuild app 23 | ``` 24 | 25 | References: 26 | - https://meta.discourse.org/t/advanced-troubleshooting-with-docker/15927 27 | - https://meta.discourse.org/t/x-frame-options-sameorigin-header-prevents-embedding/14928/7 28 | -------------------------------------------------------------------------------- /plugin.rb: -------------------------------------------------------------------------------- 1 | # name: allowsameorigin 2 | # about: allows Discourse site to be embedded in HTML iframe 3 | # version: 1 4 | # authors: Ben Miller 5 | 6 | Rails.application.config.action_dispatch.default_headers.merge!({'X-Frame-Options' => 'ALLOWALL'}) 7 | --------------------------------------------------------------------------------