forem / selfhost

Selfhost your Forem Community on your own infrastructure 🎉
https://www.forem.com/get-started/
GNU Affero General Public License v3.0
1.43k stars 169 forks source link

Add referrer policy option #35

Closed djuber closed 2 years ago

djuber commented 2 years ago

I suspect youtube embedded video playback is not working if referrer policy is set to "same-origin".

Add a configuration variable to support relaxing this during setup.

Add a hint in setup.yml that you might change this, and a note in the generated toml file that this came from a variable upstream.

andygeorge commented 2 years ago

This logic is sound, if it worked for you I say merge.

djuber commented 2 years ago

I'll copy the caveat I discovered back to this PR since it's more obvious

If you had already customized/copied the file inventory/example/setup.yml to inventory/forem/setup.yml - the new variable added here (referrer_policy) will not be present in your (untracked by git) copy of the file - you will need to manually add that back in (copying from the lines in the example setup worked fine).

Otherwise you'll see a failure after updating the selfhost repo

TASK [butane : Copy Butane YAML into temporary file] ***************************
fatal: [forem]: FAILED! => 
  msg: |-
    The task includes an option with an undefined variable. The error was: 'referrer_policy' is undefined

    The error appears to be in 'path/to/selfhost/roles/butane/tasks/butane.yml': line 21, column 3, but may
    be elsewhere in the file depending on the exact syntax problem.

    The offending line appears to be:

    - name: Copy Butane YAML into temporary file
      ^ here