documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Simplify the introductory container installation docs

Open davisagli opened this issue 2 years ago • 14 comments

It's a best practice to run Volto in seamless mode, where the API is served at the same domain with the /++api++ prefix. This avoids complications with browser cross-origin restrictions when the browser accesses the backend directly at a different domain.

So, we should show this best practice here. The current example sets RAZZLE_API_PATH, because the default is http://localhost:8080/Plone which does not work inside a container. But, setting RAZZLE_API_PATH also stops using the best practice of seamless mode. We can avoid this by setting RAZZLE_DEV_PROXY_API_PATH instead.

(Future improvement: make Volto recognize when it is running in a container, so that it can use http://host.docker.internal:8080/Plone as the default API path instead of localhost. Then it would not be necessary to set RAZZLE_DEV_PROXY_API_PATH here.)

davisagli avatar Feb 25 '23 17:02 davisagli

Deploy Preview for 6-docs-plone-org ready!

Name Link
Latest commit 4648cef841e333b20eb6029987ba8f3716ed0f55
Latest deploy log https://app.netlify.com/sites/6-docs-plone-org/deploys/63fa472baab1030008f20f3a
Deploy Preview https://deploy-preview-1456--6-docs-plone-org.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Feb 25 '23 17:02 netlify[bot]

Hmm. I started checking the rest of the docs, but I'm getting myself confused. I think https://github.com/plone/documentation/blob/6-dev/docs/install/containers/images/frontend.md also needs to be updated to mention RAZZLE_DEV_PROXY_API_PATH. But here's my confusion:

The dev proxy is clearly working when using the plone-frontend image, which I understand is running Volto in production mode. That matches what it says in https://6.docs.plone.org/volto/configuration/internalproxy.html ("You could also use the internal proxy for production setups. For convenience and for testing/demoing using the stock build, it is also enabled in production mode since Volto 14.") But I also see code in Volto that is clearly only using settings.devProxyToApiPath in development mode (__DEVELOPMENT__). So why/how is it working in the image? What am I missing, @sneridagh @tiberiuichim

I can follow up and update the docs about this in more places but first I need to understand better myself.

davisagli avatar Feb 26 '23 04:02 davisagli

Answering my own question: the dev proxy is indeed always enabled. There are a couple places where things are done differently when __DEVELOPMENT__ is true, but it's nothing very significant. Probably things left over from before the dev proxy was always enabled.

davisagli avatar Feb 26 '23 04:02 davisagli

I need to stop for today, but I'll come back to this and make some more updates. I got sidetracked working on https://github.com/plone/volto/pull/4434

davisagli avatar Feb 26 '23 05:02 davisagli

Indeed, I would not take the Volto docs as being 100% accurate. When we imported them initially into the main docs, they were not curated or reviewed for accuracy.

The Volto docs evolved over time, and some things were not updated, but just buried beneath new stuff that was current. Just like Plone 5 docs.

stevepiercy avatar Feb 26 '23 05:02 stevepiercy

@stevepiercy Sure, that's my general expectation, and I'm trying to help review them now. The bit I pointed out above is in fact accurate -- I thought I saw something in the code that contradicted the docs, but I was mistaken.

davisagli avatar Feb 26 '23 05:02 davisagli

Is this documentation update something that can be moved forward with the recent fixes to seamless mode and the dev proxy path variables in Volto 16.18.0? (https://plone.org/news-and-events/news/2023/plone-6-0-3-released)

fredvd avatar Apr 01 '23 07:04 fredvd

@davisagli would you please nudge this PR onward?

stevepiercy avatar Oct 27 '23 17:10 stevepiercy

@stevepiercy I'll be honest, I've been procrastinating on this because I discovered that the "install from containers" section has some subsections that have useful information but don't belong in their current location. I think a lot of it probably should move into the deployment section. Anyway this is just excuses but that's why I haven't gotten to what might at first glance look like a small fix.

davisagli avatar Oct 28 '23 21:10 davisagli

Look at it this way, you can't make the Deployment section any worse than it is now. 🤡 Do you want to chat and figure out where bits should go?

stevepiercy avatar Oct 28 '23 22:10 stevepiercy

@stevepiercy Yes, but I'm out of time for today. Sometime this next week?

davisagli avatar Oct 28 '23 22:10 davisagli

Yup, hit me up on Discord.

stevepiercy avatar Oct 28 '23 22:10 stevepiercy

@davisagli poke.

stevepiercy avatar Mar 09 '24 13:03 stevepiercy

@davisagli what's the status of this PR?

What's the relation to #1652?

stevepiercy avatar Apr 28 '24 23:04 stevepiercy