-
Notifications
You must be signed in to change notification settings - Fork 2
feat: tup-706 news on other sites #868
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
Conversation
NOT WORKING! Fails with: > NoReverseMatch at /feed/ > '' is not a registered namespace
Fails, because it renders nothing.
Load `/blog/remote`. BREAKING CHANGE: Changed `/blog` to `/blog/local`
⚠️ Does NOT render feed items.
This reverts commit 6bece39. This did not fix anything. `SESSION_COOKIE_SECURE=False` is still required locally.
bd3397d to
104fe71
Compare
|
Dropping this here for later - configuring Nginx CORS for multiple origins: https://stackoverflow.com/questions/79588791/how-to-properly-allow-multiple-origins-for-a-cross-origin-cors-request TL;DR: `Before outputting your Access-Control-Allow-Origin header, check to see if the Origin request header is an allowed origin. This is most easily done by having an array of allowed origins and using in_array. You could also do more complex approaches (e.g. using a regular expression) but be careful not to be more permissive that you need to be. If it is not, issue your "denied" response. If it is, then use that value in the response. If the request is a (preflight) OPTIONS request, then don't do any further processing. Just respond that it is OK to send the actual request.` |
Only pages testing this TUP-706 feature used `raw.html`. BREAKING CHANGE: Any pages using `raw.html` must switch to `bare.html`
|
After much self-review, before and after peer reviews, this PR is ready to be merged! All features are working on https://dev.cep.tacc.utexas.edu/news-from-tacc/. Image load is responsibility of CORS headers on source, so images not loading does not block this PR. |
Overview
Allow CMS News to be loaded on other websites.
Related
Changes
remote_contentraw.htmltoplain.htmlTesting
Follow https://github.com/wesleyboar/Core-CMS-Plugin-Remote-Content/blob/main/TESTING.md.
UI
News can be loaded from Site 1 (https://localhost) with or without styles.
No Styles
Site 2 (http://127.0.0.1) can use a plugin to load content from Site 1 (http://localhost).
Site 1 host is defined in setting
PORTAL_PLUGIN_CONTENT_NETLOC, which defaults to https://tacc.utexas.edu, but is set to http://localhost for this demo.Site 1 (http://localhost) news can be loaded on Site 2 (http://127.0.0.1).
Expected Issue
Proof that Cause is CORS
Image load error is because Site 1 (http://localhost) does not permit its content to be hijacked on Site 2 (http://127.0.0.1). Cumbersome to fix on a local test website, but can be fixed on a properly-served website.
We Can Fix It on Real Site
External articles open in new window.
external.article.links.mov
External articles are tagged
externaland have external link hidden within their abstract. Details.P.S. Site 2 (http://127.0.0.1) could still have its own news. I do not suggest this; it is merely proof that the content of each site is still independent.
Before Plugin Solution
Notes
Warning
Resources via CSS
@importand JSimportin HTML will not load.Status
Completed Tasks
and query paramfor URLhrefandsrcURLshttps://github.com/wesleyboar/Core-CMS-Plugin-Remote-Content/
support external articlese.g. on news page 4 (or later page), the link "NSF, TACC Announce Groundbreaking Leadership-Class Computing Facility" redirects to an external site's article instead of our internal article
PORTAL_CONTENT_…Answer: Yes. Note, we could choose to activate1 per site, but because CMS user permissions can manage plugin access, it is okay to also activate1 TACC plugins on every site.
Change links to absolute URLs by default.
Allow user to retain relative URLs for some links specified via new setting.
plain.htmlto TACC'sCMS_TEMPLATESV3.4.0/fp 1439 yearly site theme for texascale #508
Task/ecepweb-205-logos #509
Abandoned Tasks
(optional) publish to PyPi undertaccFootnotes
By "activate" I mean add to
INSTALLED_APPS. All apps used by Core-CMS are actually "installed" on every client as dependencies by Poetry. ↩ ↩2