Progmasoft Git

progmaweb

The site and account service of Progmasoft: a Next.js frontend and an ASP.NET Core API.

Clonegit clone https://git.progmasoft.com/progmaweb

Serve JSON Schemas on schemastore.progmasoft.com

schemastore.progmasoft.com/json/ holds the JSON Schemas of Progmasoft's file
formats. The first is progmasoft-cpp-index.json, which describes the
index.json of each folder of guidelines in Progmasoft/progmasoft-cpp: the
language versions with exactly one default, and every document with its
chapter, path and versions.

- ops/schemastore/json: the schemas, under CC0-1.0 (REUSE.toml, the legal
  code in LICENSES/CC0-1.0.txt) so that projects and schema catalogs can copy
  them.
- ops/schemastore/nginx/schemastore.conf: static files from
  /srv/schemastore, GET only, readable from every origin for editors in the
  browser, an hour of caching; everything outside /json/ is 404.
- ops/README.md: the install steps, the SELinux label and the rule that a
  schema which would reject files it accepted before gets a new name.

Live on 91.151.88.130; the progmasoft.com certificate names the host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ji7xZMYjc4zankoc7hGBE1
Commit
30b799ffe9f67aac0abe9ce8426cec8b2d6163f8
Author
Leitwolf11 ·
Parents
1a73486c0f67

Files · Download .tar.gz

Changes

 LICENSES/CC0-1.0.txt                           | 121 +++++++++++++++++++++++++
 REUSE.toml                                     |   8 ++
 ops/README.md                                  |  18 ++++
 ops/schemastore/json/progmasoft-cpp-index.json | 118 ++++++++++++++++++++++++
 ops/schemastore/nginx/schemastore.conf         |  69 ++++++++++++++
 5 files changed, 334 insertions(+)

diff --git a/LICENSES/CC0-1.0.txt b/LICENSES/CC0-1.0.txt
new file mode 100644
index 0000000..0e259d4
--- /dev/null
+++ b/LICENSES/CC0-1.0.txt
@@ -0,0 +1,121 @@
+Creative Commons Legal Code
+
+CC0 1.0 Universal
+
+    CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
+    LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
+    ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
+    INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
+    REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
+    PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
+    THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
+    HEREUNDER.
+
+Statement of Purpose
+
+The laws of most jurisdictions throughout the world automatically confer
+exclusive Copyright and Related Rights (defined below) upon the creator
+and subsequent owner(s) (each and all, an "owner") of an original work of
+authorship and/or a database (each, a "Work").
+
+Certain owners wish to permanently relinquish those rights to a Work for
+the purpose of contributing to a commons of creative, cultural and
+scientific works ("Commons") that the public can reliably and without fear
+of later claims of infringement build upon, modify, incorporate in other
+works, reuse and redistribute as freely as possible in any form whatsoever
+and for any purposes, including without limitation commercial purposes.
+These owners may contribute to the Commons to promote the ideal of a free
+culture and the further production of creative, cultural and scientific
+works, or to gain reputation or greater distribution for their Work in
+part through the use and efforts of others.
+
+For these and/or other purposes and motivations, and without any
+expectation of additional consideration or compensation, the person
+associating CC0 with a Work (the "Affirmer"), to the extent that he or she
+is an owner of Copyright and Related Rights in the Work, voluntarily
+elects to apply CC0 to the Work and publicly distribute the Work under its
+terms, with knowledge of his or her Copyright and Related Rights in the
+Work and the meaning and intended legal effect of CC0 on those rights.
+
+1. Copyright and Related Rights. A Work made available under CC0 may be
+protected by copyright and related or neighboring rights ("Copyright and
+Related Rights"). Copyright and Related Rights include, but are not
+limited to, the following:
+
+  i. the right to reproduce, adapt, distribute, perform, display,
+     communicate, and translate a Work;
+ ii. moral rights retained by the original author(s) and/or performer(s);
+iii. publicity and privacy rights pertaining to a person's image or
+     likeness depicted in a Work;
+ iv. rights protecting against unfair competition in regards to a Work,
+     subject to the limitations in paragraph 4(a), below;
+  v. rights protecting the extraction, dissemination, use and reuse of data
+     in a Work;
+ vi. database rights (such as those arising under Directive 96/9/EC of the
+     European Parliament and of the Council of 11 March 1996 on the legal
+     protection of databases, and under any national implementation
+     thereof, including any amended or successor version of such
+     directive); and
+vii. other similar, equivalent or corresponding rights throughout the
+     world based on applicable law or treaty, and any national
+     implementations thereof.
+
+2. Waiver. To the greatest extent permitted by, but not in contravention
+of, applicable law, Affirmer hereby overtly, fully, permanently,
+irrevocably and unconditionally waives, abandons, and surrenders all of
+Affirmer's Copyright and Related Rights and associated claims and causes
+of action, whether now known or unknown (including existing as well as
+future claims and causes of action), in the Work (i) in all territories
+worldwide, (ii) for the maximum duration provided by applicable law or
+treaty (including future time extensions), (iii) in any current or future
+medium and for any number of copies, and (iv) for any purpose whatsoever,
+including without limitation commercial, advertising or promotional
+purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
+member of the public at large and to the detriment of Affirmer's heirs and
+successors, fully intending that such Waiver shall not be subject to
+revocation, rescission, cancellation, termination, or any other legal or
+equitable action to disrupt the quiet enjoyment of the Work by the public
+as contemplated by Affirmer's express Statement of Purpose.
+
+3. Public License Fallback. Should any part of the Waiver for any reason
+be judged legally invalid or ineffective under applicable law, then the
+Waiver shall be preserved to the maximum extent permitted taking into
+account Affirmer's express Statement of Purpose. In addition, to the
+extent the Waiver is so judged Affirmer hereby grants to each affected
+person a royalty-free, non transferable, non sublicensable, non exclusive,
+irrevocable and unconditional license to exercise Affirmer's Copyright and
+Related Rights in the Work (i) in all territories worldwide, (ii) for the
+maximum duration provided by applicable law or treaty (including future
+time extensions), (iii) in any current or future medium and for any number
+of copies, and (iv) for any purpose whatsoever, including without
+limitation commercial, advertising or promotional purposes (the
+"License"). The License shall be deemed effective as of the date CC0 was
+applied by Affirmer to the Work. Should any part of the License for any
+reason be judged legally invalid or ineffective under applicable law, such
+partial invalidity or ineffectiveness shall not invalidate the remainder
+of the License, and in such case Affirmer hereby affirms that he or she
+will not (i) exercise any of his or her remaining Copyright and Related
+Rights in the Work or (ii) assert any associated claims and causes of
+action with respect to the Work, in either case contrary to Affirmer's
+express Statement of Purpose.
+
+4. Limitations and Disclaimers.
+
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
+    surrendered, licensed or otherwise affected by this document.
+ b. Affirmer offers the Work as-is and makes no representations or
+    warranties of any kind concerning the Work, express, implied,
+    statutory or otherwise, including without limitation warranties of
+    title, merchantability, fitness for a particular purpose, non
+    infringement, or the absence of latent or other defects, accuracy, or
+    the present or absence of errors, whether or not discoverable, all to
+    the greatest extent permissible under applicable law.
+ c. Affirmer disclaims responsibility for clearing rights of other persons
+    that may apply to the Work or any use thereof, including without
+    limitation any person's Copyright and Related Rights in the Work.
+    Further, Affirmer disclaims responsibility for obtaining any necessary
+    consents, permissions or other rights required for any use of the
+    Work.
+ d. Affirmer understands and acknowledges that Creative Commons is not a
+    party to this document and has no duty or obligation with respect to
+    this CC0 or use of the Work.
diff --git a/REUSE.toml b/REUSE.toml
index c038c0d..17c7939 100644
--- a/REUSE.toml
+++ b/REUSE.toml
@@ -8,3 +8,11 @@ path = ["**/*.json", "pnpm-lock.yaml"]
 precedence = "aggregate"
 SPDX-FileCopyrightText = "2026 Progmasoft <support@progmasoft.com>"
 SPDX-License-Identifier = "AGPL-3.0-or-later WITH AdditionRef-Progmasoft-Patent-Grant-1.1"
+
+# The JSON Schemas of schemastore.progmasoft.com are free to copy into any
+# project or schema catalog.
+[[annotations]]
+path = "ops/schemastore/json/**"
+precedence = "override"
+SPDX-FileCopyrightText = "2026 Progmasoft <support@progmasoft.com>"
+SPDX-License-Identifier = "CC0-1.0"
diff --git a/ops/README.md b/ops/README.md
index b3c95bf..36b44bd 100644
--- a/ops/README.md
+++ b/ops/README.md
@@ -295,6 +295,24 @@ ssh root@91.151.88.130 'chown -R root:root /srv/maven && restorecon -R /srv/mave
 
 Published versions are never changed. The certificate of `progmasoft.com` must name `maven.progmasoft.com`.
 
+## JSON Schemas
+
+`schemastore.progmasoft.com/json/` serves the JSON Schemas of Progmasoft's file formats, such as
+`progmasoft-cpp-index.json` for the `index.json` of each folder of guidelines in Progmasoft/progmasoft-cpp. The schemas
+are in `ops/schemastore/json`, under CC0-1.0, and are served from `/srv/schemastore/json` by
+`ops/schemastore/nginx/schemastore.conf` (installed as `/etc/nginx/conf.d/schemastore.conf`), to any origin, with GET
+only:
+
+```sh
+install -d -m 0755 /srv/schemastore /srv/schemastore/json
+semanage fcontext -a -t httpd_sys_content_t '/srv/schemastore(/.*)?'
+scp ops/schemastore/json/*.json root@91.151.88.130:/srv/schemastore/json/
+ssh root@91.151.88.130 'chown -R root:root /srv/schemastore && chmod 0644 /srv/schemastore/json/*.json && restorecon -R /srv/schemastore'
+```
+
+A schema's `$id` is its address. A change that would reject files the schema accepted before gets a new file name
+instead. The certificate of `progmasoft.com` must name `schemastore.progmasoft.com`.
+
 ## Git mirrors
 
 `git.progmasoft.com` shows read-only mirrors of the public repositories under development, such as
diff --git a/ops/schemastore/json/progmasoft-cpp-index.json b/ops/schemastore/json/progmasoft-cpp-index.json
new file mode 100644
index 0000000..e467d4b
--- /dev/null
+++ b/ops/schemastore/json/progmasoft-cpp-index.json
@@ -0,0 +1,118 @@
+{
+  "$schema": "https://json-schema.org/draft/2020-12/schema",
+  "$id": "https://schemastore.progmasoft.com/json/progmasoft-cpp-index.json",
+  "title": "Progmasoft C/C++ Styles guidelines index",
+  "description": "The index.json of a guidelines folder in Progmasoft C/C++ Styles (https://github.com/Progmasoft/progmasoft-cpp): the language versions it covers and every document with its chapter and the versions it applies to.",
+  "type": "object",
+  "required": ["title", "license", "standards", "documents"],
+  "additionalProperties": false,
+  "properties": {
+    "$schema": {
+      "description": "This schema: https://schemastore.progmasoft.com/json/progmasoft-cpp-index.json.",
+      "type": "string",
+      "format": "uri"
+    },
+    "title": {
+      "description": "The name of the guidelines, such as \"Progmasoft Core C++ Coding Guidelines\".",
+      "type": "string",
+      "minLength": 1
+    },
+    "license": {
+      "description": "The SPDX license identifier of the text of the guidelines.",
+      "type": "string",
+      "minLength": 1
+    },
+    "standards": {
+      "description": "The language versions the guidelines cover. Exactly one is the default.",
+      "type": "array",
+      "minItems": 1,
+      "items": { "$ref": "#/$defs/standard" },
+      "contains": {
+        "type": "object",
+        "properties": { "default": { "const": true } },
+        "required": ["default"]
+      },
+      "minContains": 1,
+      "maxContains": 1
+    },
+    "documents": {
+      "description": "Every document of the guidelines.",
+      "type": "array",
+      "minItems": 1,
+      "items": { "$ref": "#/$defs/document" }
+    }
+  },
+  "$defs": {
+    "id": {
+      "description": "A lowercase identifier: letters, digits and hyphens.",
+      "type": "string",
+      "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
+    },
+    "path": {
+      "description": "A Markdown file, relative to the folder of index.json, with forward slashes.",
+      "type": "string",
+      "pattern": "^[A-Za-z0-9_-]+(/[A-Za-z0-9_.-]+)*\\.md$"
+    },
+    "standard": {
+      "type": "object",
+      "required": ["id", "name", "default", "for", "documents"],
+      "additionalProperties": false,
+      "properties": {
+        "id": {
+          "$ref": "#/$defs/id",
+          "description": "The identifier documents use in their standards list, such as \"cpp20\"."
+        },
+        "name": {
+          "description": "The name of the version, such as \"C++20\".",
+          "type": "string",
+          "minLength": 1
+        },
+        "default": {
+          "description": "Whether a project uses this version unless it says otherwise.",
+          "type": "boolean"
+        },
+        "for": {
+          "description": "The projects this version is meant for.",
+          "type": "string",
+          "minLength": 1
+        },
+        "documents": {
+          "description": "The documents that hold the rules of this version alone.",
+          "type": "array",
+          "minItems": 1,
+          "uniqueItems": true,
+          "items": { "$ref": "#/$defs/path" }
+        }
+      }
+    },
+    "document": {
+      "type": "object",
+      "required": ["id", "title", "path", "standards"],
+      "additionalProperties": false,
+      "properties": {
+        "id": {
+          "$ref": "#/$defs/id",
+          "description": "The identifier of the document, unique in the index."
+        },
+        "chapter": {
+          "description": "The chapter number of a document shared by every version; a version's own page has none.",
+          "type": "integer",
+          "minimum": 1
+        },
+        "title": {
+          "description": "The title of the document.",
+          "type": "string",
+          "minLength": 1
+        },
+        "path": { "$ref": "#/$defs/path" },
+        "standards": {
+          "description": "The identifiers of the versions the document applies to.",
+          "type": "array",
+          "minItems": 1,
+          "uniqueItems": true,
+          "items": { "$ref": "#/$defs/id" }
+        }
+      }
+    }
+  }
+}
diff --git a/ops/schemastore/nginx/schemastore.conf b/ops/schemastore/nginx/schemastore.conf
new file mode 100644
index 0000000..199d3ee
--- /dev/null
+++ b/ops/schemastore/nginx/schemastore.conf
@@ -0,0 +1,69 @@
+# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com>
+# SPDX-License-Identifier: AGPL-3.0-or-later WITH AdditionRef-Progmasoft-Patent-Grant-1.1
+
+# https://schemastore.progmasoft.com: the JSON Schemas of Progmasoft's file
+# formats, such as /json/progmasoft-cpp-index.json. Static files only, copied
+# from ops/schemastore/json; see ops/README.md. Installed as
+# /etc/nginx/conf.d/schemastore.conf.
+
+server {
+    listen 80;
+    listen [::]:80;
+    server_name schemastore.progmasoft.com;
+
+    location ^~ /.well-known/acme-challenge/ {
+        root /var/lib/letsencrypt;
+        default_type text/plain;
+    }
+
+    location / {
+        return 308 https://schemastore.progmasoft.com$request_uri;
+    }
+}
+
+server {
+    listen 443 ssl;
+    listen [::]:443 ssl;
+    http2 on;
+    server_name schemastore.progmasoft.com;
+
+    ssl_certificate /etc/letsencrypt/live/progmasoft.com/fullchain.pem;
+    ssl_certificate_key /etc/letsencrypt/live/progmasoft.com/privkey.pem;
+    include /etc/letsencrypt/options-ssl-nginx.conf;
+
+    root /srv/schemastore;
+    client_max_body_size 1k;
+
+    add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
+    add_header X-Content-Type-Options "nosniff" always;
+    add_header Referrer-Policy "strict-origin-when-cross-origin" always;
+
+    location = / {
+        return 302 https://schemastore.progmasoft.com/json/;
+    }
+
+    # Editors in the browser fetch schemas from other origins, so every origin
+    # may read them. Nothing here takes cookies or writes anything.
+    location ^~ /json/ {
+        limit_except GET {
+            deny all;
+        }
+        autoindex on;
+        charset utf-8;
+        charset_types application/json;
+        types {
+            application/json json;
+        }
+        expires 1h;
+        add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
+        add_header X-Content-Type-Options "nosniff" always;
+        add_header Referrer-Policy "strict-origin-when-cross-origin" always;
+        add_header Access-Control-Allow-Origin "*" always;
+        add_header Content-Security-Policy "default-src 'none'; frame-ancestors 'none'" always;
+        try_files $uri $uri/ =404;
+    }
+
+    location / {
+        return 404;
+    }
+}