Server Media
Validation
The checks that run on every submission, in order, and how to run them locally.
Validation is one pipeline with one rule: a repository that does not pass it is not published. It runs on your machine with npm run validate, and in continuous integration on every pull request. All problems are reported together, so a contributor can fix them in one pass.
The stages
| Stage | What is checked | Example rejection |
|---|---|---|
| 1. Filesystem | Real directories only under servers/. Only the allowed file names inside each one. No symbolic links, subdirectories or hidden files. | a symlinked icon.png, notes.txt, .DS_Store |
| 2. Metadata | UTF-8 JSON, at most 16 KiB, no byte-order mark. | is not valid JSON |
| 3. Schema | Every field: required fields, types, closed lists, patterns, lengths and unknown fields. | Field "socials.discord": has an invalid value |
| 4. Identity | id equals the directory name, is not retired, and primaryAddress is one of addresses. | must equal the directory name |
| 5. Images | The file signature, the extension, the byte size, a single frame, a full decode, the exact aspect ratio, and the minimum and maximum dimensions. | contains unrecognized image data, is 63x63; the minimum is 64x64 |
| 6. Duplicates | Each address belongs to one server. Wildcards do not overlap or capture another server's address. | "play.example.net" is also claimed by other-server |
| 7. Build | The catalog is generated and validated against its own schema. The build is run twice and the output is compared byte for byte. | the two builds differ |
Reading the output
Each problem names the file, then the field, then what to do:
servers/foo/metadata.json
Field "addresses[0]": "Play.Example.net" must be lowercase (use "play.example.net")In continuous integration, the same problems also appear as annotations on the pull request, next to the change that caused them.
Commands
npm ci # install the pinned dependencies
npm run validate # stages 1 to 6; exit code 1 on any problem
npm test # tests for every rule above
npm run build # stage 7, output in dist/
npm run check # lint, typecheck, tests, validate and buildWhat validation does not check
- Whether a hostname resolves, or whether the server is online. Those are review tasks.
- That an image belongs to the server. That is the contributor's responsibility; see licensing.