-
Notifications
You must be signed in to change notification settings - Fork 138
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
Adds subdomain handling #11001 #11002
base: dev/7.6.x
Are you sure you want to change the base?
Conversation
I'm looking forward to testing this. One question so I understand: is it mandatory now to serve stuff from an arches application under a subdomain? Or, if the arches application like arches-for-science doesn't use standalone plugins (whatever we call them), will things still work (i.e. disco can still access the arches for science URLs as they are, without manipulating hosts.py, and webpack still builds)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some very minor feedback from a code read -- will give a functional test once I get the instructions down (might need to meet with you to make sure I'm doing things right)!
@@ -135,7 +139,10 @@ INSTALLED_APPS = ( | |||
|
|||
ARCHES_APPLICATIONS = () | |||
|
|||
INSTALLED_APPS += ARCHES_APPLICATIONS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break if a user has INSTALLED_APPS
as a list, as documented in core django. (Well, it won't break in this very template, but it will break if folks follow the release note recipe and happened to have a list for INSTALLED_APPS.)
I know we're assuming people are starting with the arches createproject template, but this seems like we're further committing to these being tuples, when my hope would be to move in the other direction, see #9942.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, this complexity evaporates if we remove ARCHES_APPLICATIONS per the last comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine to leave this as is if we think #11009 has legs. I could probably put up a proof of concept before the 7.6 feature freeze.
arches/hosts.py
Outdated
from django_hosts import patterns, host | ||
|
||
host_patterns = patterns('', | ||
host(r'arches', 'arches.urls', name='arches'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably tighten up this regex to match on the exact string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you give an example of this? This is just following the documentation for django-hosts
https://django-hosts.readthedocs.io/en/latest/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tested, but since these are regexes, I assume something like changing arches
to arches$
so that it doesn't match arches-lingo
.
This is just the core arches hosts.py which will never have arches-lingo installed, but I figure people look to these settings as examples to riff on, and it would seem a shame if something only supposed to match arches
matched arches-for-science
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no yeah that's fair, will get the change in 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undoing this as it prevented navigation to subdomains. Tested with this pattern:
host_patterns = patterns('',
host(r'foo$', 'foo.urls', name='foo'),
host(r'foo-bar$', 'bar.urls', name='foo-bar'),
)
the regex anchors prevented navigation to foo-bar.localhost:8000. However removing the anchors allowed proper navigation to the subdomain, even though theoretically foo
should have matched first
Nope not mandatory 😄 -- should be an either or thing && the documentation has ( perhaps prematurely ) been updated to reflect that https://github.com/archesproject/arches-docs/pull/425/files Quite possibly it could even be a both thing, where the same resource is served at both a subdomain and a route -- though I haven't tested it 🤔 |
…nto 11001-cbyrd-subdomains-for-arches-apps
reverting to draft until #11009 is merged 👍 |
Types of changes
Description of Change
Adds the ability to have subdomains with Arches applications.
To test:
hosts.py
file in the the project to include application's urls. eg:my_arches_app.my_project.domain
These changes remove the concept of a standalone plugin. Instead there is a new template that can extended in projects:
standalone-component-base.htm
. It can be extended like so:with a corresponding .js file, eg:
we are now able to load Vue applications without the Arches chrome, and with optional custom theming via the PrimeVue api.
Issues Solved
Closes #11001 #10998 #10997
Checklist
Accessibility Checklist
Developer Guide
Further comments
Documentation: archesproject/arches-docs#425
@robgaston @jacobtylerwalls : This brings up a few interesting discussion points.
Do we really need the new template
standalone-component-base.htm
? There seems to be some cruft inbase.htm
, and it pulls injavascript.htm
which heavy, but still no UI chrome. If we decided to usebase.htm
instead, we can undo the business witharches_urls
being moved into its own template.Regardless of using
standalone-component-base.htm
orbase.htm
, there's still the issue of extending the template at the project level. This is fine and good and supported for now, but if we're trying to trend to not have a frontend bundler eat templates then we need to abandon Django template interpolation.There is significant overlap now between plugins and Arches applications. Not in 7.6 of course, but should we consider eventually dropping support for plugins?