Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with the feed in production (Docker) and suggestions. #2

Open
sneridagh opened this issue Dec 8, 2024 · 3 comments
Open

Comments

@sneridagh
Copy link
Member

Hi @ziming-yuan !
Nice job! Congratulations! We've met at the PC in Brasilia and I just tried it out in my site:

https://sneridagh.dev

I created the feed in:

https://sneridagh.dev/rss/rss.xml

And this is the output:

<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title><![CDATA[RSS]]></title>
        <description><![CDATA[RSS]]></description>
        <link>http://localhost:3000</link>
        <generator>RSS Feed Generator</generator>
        <lastBuildDate>Sat, 07 Dec 2024 23:37:28 GMT</lastBuildDate>
        <atom:link href="http://localhost:3000/rss/rss.xml" rel="self" type="application/rss+xml"/>
        <pubDate>Sat, 07 Dec 2024 23:27:03 GMT</pubDate>
        <language><![CDATA[en]]></language>
        <item>
            <title><![CDATA[Sprint, sprint, sprint!]]></title>
            <description><![CDATA[An overview on the Plone Sprints happened this year and the ones to come.]]></description>
            <link>http://backend:8080/Plone/blog/sprint-sprint-sprint</link>
            <guid isPermaLink="false">1339ded8d2ba46749563f6f71203dd89</guid>
            <dc:creator><![CDATA[admin]]></dc:creator>
            <pubDate>Wed, 11 Sep 2024 14:12:09 GMT</pubDate>
            <enclosure url="http://backend:8080/Plone/blog/sprint-sprint-sprint/@@images/image-400-d50f7fcfcd52c25928815e7957c89b2f.jpeg" length="1635217" type="image/jpeg"/>
        </item>
        <item>
            <title><![CDATA[A new build setup for Volto]]></title>
            <link>http://backend:8080/Plone/blog/a-new-build-setup</link>
            <guid isPermaLink="false">a2cc582181f64fa99661b064d9bc1b56</guid>
            <dc:creator><![CDATA[admin]]></dc:creator>
            <pubDate>Wed, 27 Mar 2024 14:07:46 GMT</pubDate>
            <enclosure url="http://backend:8080/Plone/blog/a-new-build-setup/@@images/image-400-55d7db6f65c6bce8e7fa71deb8e004c0.jpeg" length="2093745" type="image/jpeg"/>
        </item>
        <item>
            <title><![CDATA[Plone Frontend experimental packages]]></title>
            <description><![CDATA[A little taste of the new breed of frontend packages]]></description>
            <link>http://backend:8080/Plone/blog/plone-frontend-experimental-packages</link>
            <guid isPermaLink="false">d533377a89b6489bbfbea14ced843898</guid>
            <dc:creator><![CDATA[admin]]></dc:creator>
            <pubDate>Sun, 18 Feb 2024 16:58:27 GMT</pubDate>
            <enclosure url="http://backend:8080/Plone/blog/plone-frontend-experimental-packages/@@images/image-400-a319aca26d573ddfa1a9c09a7295084e.jpeg" length="3306284" type="image/jpeg"/>
        </item>
        <item>
            <title><![CDATA[The Plone Volto Monorepo]]></title>
            <link>http://backend:8080/Plone/blog/monorepo</link>
            <guid isPermaLink="false">6b57b74392bb46a2b99e0587123ef6fd</guid>
            <dc:creator><![CDATA[admin]]></dc:creator>
            <pubDate>Wed, 07 Feb 2024 15:28:54 GMT</pubDate>
            <enclosure url="http://backend:8080/Plone/blog/monorepo/@@images/image-400-4572792c8212bbdcc74dbd1e6a3018ac.jpeg" length="3989388" type="image/jpeg"/>
        </item>
        <item>
            <title><![CDATA[We are so back!]]></title>
            <description><![CDATA[As they say now, this viral motto has become popular in the ReactJS community lately...]]></description>
            <link>http://backend:8080/Plone/blog/we-are-so-back</link>
            <guid isPermaLink="false">f1b2a657f7d844e094413eb21bbfc3cb</guid>
            <dc:creator><![CDATA[admin]]></dc:creator>
            <pubDate>Fri, 26 Jan 2024 08:56:20 GMT</pubDate>
            <enclosure url="http://backend:8080/Plone/blog/we-are-so-back/@@images/image-400-ec85d2741dce3d2ab63d6f87efbfbdbb.jpeg" length="319364" type="image/jpeg"/>
        </item>
    </channel>
</rss>

My site is deployed using Docker, and as you can see, the URLs are using the internal backend URL. I think that the code is missing a couple of flattenToAppURL here and there, so the URL is set correctly. That would remove the whole server URL, so after that, I guess you should add the real server URL using publicURL too. I see you've used the publicURL in there, which is correct, but you are passing it from the add-on config. Probably is not working because it's not initialized yet. I recommend just get the config again in the middleware (as a direct import, as other middlewares do), so you get it "fresh" when the middleware is executed.

Please let me know if you are able to take a look into it, I can make a PR too.

While on it, please also allow me other suggestions:

Use cookieplone as boilerplate, unifying both backend and frontend in the same repo.
For some reason, the initial blocks are not working for the rss_feed content type?
Why are you overriding the Title block? Are you aware that this is going to be applied to all Title blocks in the site? I'd rather not do it, unless it's harmless and absolutely strictly necessary.

Overall, great work again! Thanks for your contribution!

@ziming-yuan
Copy link
Collaborator

ziming-yuan commented Dec 8, 2024

Hi Víctor,

Thanks so much for testing and for your detailed feedback! I really appreciate it.

Next week is a bit hectic for me, but I’ll make time to look into these issues and suggestions the week after.

@nileshgulia1
Copy link
Member

@ziming-yuan Victor is right, we shouldn't customize the Title block, Sorry I might have overlooked it. maybe you did it because the disableNewBlocks weren't working?

@sneridagh The idea is to disable the deletion of Title and Listing block as they are required to create the feeds. Somehow the initialBlocks is not passing the correct blockProps or DXlayout props to the AddForm 🤔

Another solution might be is to add those props in the setup_handlers in backend addon.
I'm almost finished with the holidays after ploneConf, I will look into the initialBlocks in the coming weekend.

@sneridagh
Copy link
Member Author

@nileshgulia1 the initialBlocks was my bad, in fact, there was a problem in VLT, which I already fixed and released.
It should be ok now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants