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

Load the local hostname's config, where possible #2071

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

nexy7574
Copy link
Contributor

@nexy7574 nexy7574 commented Nov 30, 2024

Description

This change mirrors some nice but niche behaviour from Element, wherein config.$HOSTNAME.json is tried before config.json.
This is very handy, at least for me, because I serve cinny from a multitude of domains, but all from the same dist directory. This means if you visit cinny from one of my domains that is for a different homeserver, you will get the config for only one of my homeservers.
An example of this is https://cinny.transgender.ing - the config.json is loaded, which is intended for https://cinny.nexy7574.co.uk. Element, however, nicely tries to load config.element.transgender.ing.json in the first case, meaning I can serve a different default login server.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Copy link

github-actions bot commented Dec 3, 2024

Preview: https://2071--pr-cinny.netlify.app
⚠️ Exercise caution. Use test accounts. ⚠️

This is really stupid, why does the dev mode return 200 for a non-existent file?
Also had reports that not trying to load the config first results in cinny never trying the default config for some reason.
src/app/components/ClientConfigLoader.tsx Outdated Show resolved Hide resolved
src/app/components/ClientConfigLoader.tsx Outdated Show resolved Hide resolved
@nexy7574 nexy7574 force-pushed the nexy7574/per-site-config branch from 1a5e0f1 to 50bb5b2 Compare January 13, 2025 16:53
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

Successfully merging this pull request may close these issues.

2 participants