Onebox on a self hosted invitation only discourse site

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

1 Like

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.

2 Likes

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.

1 Like

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

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.

8 Likes