Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/ops
diff options
context:
space:
mode:
authorLeitwolf2026-11-15 17:33:13 +0300
committerGitHub2026-11-15 17:33:13 +0300
commit3154720c62c9fec2dfc8b7063e305ae39bba0ffd (patch)
tree986d4dc1c4eb774f48eac14a615587cfffe1dd83 /ops
parent18bfd1f74b8465987248c207ed39d3c671becaa2 (diff)
parent3dae09b3f2c90b8ae318085e22f93cbcc5d59b98 (diff)
downloadprogmaweb-content/catch3-0.4.0.tar.gz
Merge branch 'main' into content/catch3-0.4.0content/catch3-0.4.0
Diffstat (limited to 'ops')
-rw-r--r--ops/README.md18
-rw-r--r--ops/schemastore/json/progmasoft-cpp-index.json118
-rw-r--r--ops/schemastore/nginx/schemastore.conf69
3 files changed, 205 insertions, 0 deletions
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;
+ }
+}