Skip to content

[Proposal] Hosting Update #4695

Open
Open
@hyperupcall

Description

@hyperupcall

Description of the feature / enhancement.

Me and @madskristensen have been discussing how to improve the hosting. We're looking to move towards hosting that more leverages GitHub to improve reliability. There are a few proposals:

Proposal 1

In catalog.json, swap all https://json.schemastore.org/* with https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/* URLs.

Proposal 2

Create extra GitHub repositories for every subdomain needed (limitation of GitHub). For each of these repositories, publish to GitHub actions and configure the schemastore.org DNS servers (through a CNAME record) to:

  1. "Direct" json.schemastore.org requests to the GitHub Pages of SchemaStore/schemastore. On every commit on master, we can run an action that publishes to GitHub Pages. Must copy schemas so each one is available at, for example /ava.json and /ava

  2. "Direct" www.schemastore.org requests to the GitHub Pages of (the new) SchemaStore/schemastore-www. The catalog is hosted at www.schemastore.org/api/json/catalog.json, so for every change in catalog.json on master in SchemaStore/schemastore, it will need to be copied (and committed) over

  3. "Direct" schemastore.org requests to the GitHub Pages of (the new) SchemaStore/schemastore-apex. This repository either:

  • A. Has the same content as www.schemastore.org
  • B. Has HTML redirects for all the routes under www.schemastore.org
  • C. Has an HTML redirect for only schemastore.org/index.html
  • D. Same as C, but also a copy (no redirect) of api/json/catalog.json

It's not uncommon to omit the www part of URLs (I certainly do). The old site automatically added www to everything, but that can't be done server-side anymore. I'm learning towards C or D. This apex URL is used in the wild and users currently have the expectation that going to schemastore.org will show the up-to-date site. catalog.json can also be copied over, but I poked around at a few projects with links to the catalog, and they all use URLs with the www subdomain.

Implementation Timeline

Phase A:

  • Create schemastore-{www,apex} GitHub repositories
  • For all three repositories, set Settings > Pages > Build and deployment > Source to "GitHub Actions"
  • Add configuration/code to all three repositories to get the desired behavior

Phase B:

  • For all three repositories, hook up GitHub pages with DNS for a testing domain
  • Edit DNS records for schemastore.org, wait at least the TTL, then tell GitHub to use schemastore.org

Proposal 3

  1. Do Proposal 1

  2. But also "Direct" json.schemastore.org requests to the GitHub Pages of SchemaStore/schemastore (no extra repositories)

Summary

Proposal 1 is much simpler. But proposal 2 covers nearly all uses of SchemaStore (including direct reference like "$schema": "https://json.schemastore.org/ava.json"). Proposal 2 won't break the implicit contract that json.schemastore.org links are always up to date. I also noticed that both will allow schemas to be transferred over HTTP/2 (thanks to GitHub).

Proposal 1 is simpler and follows the original intent of the catalog. Proposal 2 does a lot of work to be very backwards-compatible, but is too complex. Proposal 3 is a hybrid approach that attempts to follow the original intent of the catalog, but also keeps json.schemastore.org/* URLs up to date for current consumers that access it directly.

Are you making a PR for this?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement:build-serverPropose something new for the SchemaStore web site or build server. (auto-generated by issue forms)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions