Onebox on a self hosted invitation only discourse site

AI-generated summary

Oneboxing is not working as expected on a self-hosted, invite-only Discourse site. csmu initially reported the issue, but Johani explained that oneboxes should work out of the box. After further investigation, Johani determined that the issue is due to the site being invite-only, which prevents the onebox gem from accessing the content. This is an intentional result of a recent change, which prevents oneboxing of links to invite-only or login-required sites. The issue occurs when trying to onebox a link from the production site on the staging site, or when trying to onebox a link to the production site on the same site.

How do you enable onebox to work on a self hosted discourse site?

There’s no need for you to do anything special to make oneboxes work.

They should work right out of the box. Can you paste the link here or on try.discourse.org and see if it behaves as expected? If it does, then there might be some issues with the way that instance was set up.

https://discourse.bd2l.com.au/t/ceiteach-plan-2019-08-23-0650/2220

That sort of worked … the site is invite only.

From the site one boxes works for many other sites … just not locally.

It I past a link form production into staging I get the same result as above.

The settings seem ok.

Thank you for the extra details.

If your production site is invite-only, then what you’re experiencing is the expected result.

The onebox gem cannot get the information from the production site because it’s set to invite-only and the content is not available unless you’re logged in. So if you try to add a link - a onebox - to your production site, on your staging site, then you’ll get this

https://discourse.bd2l.com.au/t/ceiteach-plan-2019-08-23-0650/2220

Note that this ^ will directly take you to the login page of the production site.

If on the other hand you try to add a link to your production site on your production site, then it will not be oneboxed. and you’ll get this

https://discourse.bd2l.com.au/t/ceiteach-plan-2019-08-23-0650/2220

this is very intentional and is actually the result of a recent change

https://github.com/discourse/discourse/commit/b0e781e2d4fc7790102f1a4f3a9d514c4ebe7b26

but again, this will only happen if your site is set to invite-only or login-required.