ordinary-config 0.11.1

Config for Ordinary
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "OrdinaryHostConfig",
  "description": "Config definition for an Ordinary API Instance",
  "type": "object",
  "properties": {
    "domain": {
      "type": "string"
    },
    "contacts": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "public_dns_ip": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "integer",
        "format": "uint8",
        "minimum": 0,
        "maximum": 255
      },
      "minItems": 4,
      "maxItems": 4
    },
    "env_name": {
      "type": "string",
      "default": "development"
    },
    "limits": {
      "$ref": "#/$defs/OrdinaryHostLimits",
      "default": {
        "app_domains": [],
        "privileged_domains": [],
        "proxy": {
          "count": 255,
          "disallowed_targets": []
        },
        "middleware": {
          "count": 65535,
          "disallowed_endpoints": []
        },
        "function": {
          "count": 255,
          "max_timeout": 10
        },
        "auth": {},
        "monitor": {},
        "storage": {
          "max_storage": 20000000000,
          "max_app_storage": 50000000,
          "assets": {
            "allowed_extensions": [
              "otf",
              "ttf",
              "woff",
              "woff2",
              "txt",
              "xml",
              "html",
              "css",
              "css.map",
              "csv",
              "js",
              "png",
              "apng",
              "gif",
              "svg",
              "jpg",
              "jpeg",
              "bmp",
              "tif",
              "tiff",
              "webp",
              "avif",
              "ico",
              "pdf",
              "json",
              "wasm"
            ],
            "max_store_size": 100000000,
            "max_asset_size": 1500000
          },
          "artifact": {
            "max_store_size": 25000000,
            "max_artifact_size": 15000000
          },
          "cache": {
            "max_size_range": [
              1000000,
              10000000
            ],
            "max_count_range": [
              100,
              500
            ]
          },
          "database": {
            "max_model_definitions": 255,
            "max_model_fields": 255,
            "max_item_size": 400000,
            "max_field_size": 100000
          },
          "secrets": {
            "max_count": 225,
            "max_size": 2000
          }
        }
      }
    },
    "proxied_metrics": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ProxiedMetric"
      },
      "default": []
    },
    "console": {
      "description": "whether to serve the web console",
      "type": "boolean",
      "default": false
    },
    "invite_token_link": {
      "description": "link to the location where you are able to obtain an invite token",
      "type": "string",
      "default": "/"
    },
    "extensions": {
      "description": "configuration for extensions",
      "type": "array",
      "items": {
        "$ref": "#/$defs/OrdinaryHostExtensionConfig"
      },
      "default": []
    }
  },
  "required": [
    "domain",
    "contacts"
  ],
  "$defs": {
    "OrdinaryHostLimits": {
      "type": "object",
      "properties": {
        "app_domains": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "privileged_domains": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "proxy": {
          "$ref": "#/$defs/ProxyLimits"
        },
        "middleware": {
          "$ref": "#/$defs/MiddlewareLimits"
        },
        "function": {
          "$ref": "#/$defs/FunctionLimits"
        },
        "auth": {
          "$ref": "#/$defs/AuthLimits"
        },
        "monitor": {
          "$ref": "#/$defs/MonitorLimits"
        },
        "storage": {
          "$ref": "#/$defs/StorageLimits"
        }
      },
      "required": [
        "app_domains",
        "privileged_domains",
        "proxy",
        "middleware",
        "function",
        "auth",
        "monitor",
        "storage"
      ]
    },
    "ProxyLimits": {
      "type": "object",
      "properties": {
        "count": {
          "description": "max number of proxies per application.",
          "type": "integer",
          "format": "uint8",
          "minimum": 0,
          "maximum": 255
        },
        "disallowed_targets": {
          "description": "a list of any internal or external target\nregexes that should be disallowed.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "count",
        "disallowed_targets"
      ]
    },
    "MiddlewareLimits": {
      "type": "object",
      "properties": {
        "count": {
          "description": "max number of proxies per application.",
          "type": "integer",
          "format": "uint16",
          "minimum": 0,
          "maximum": 65535
        },
        "disallowed_endpoints": {
          "description": "a list of any internal or external target\nregexes that should be disallowed.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "count",
        "disallowed_endpoints"
      ]
    },
    "FunctionLimits": {
      "type": "object",
      "properties": {
        "count": {
          "description": "Max number of functions per app.",
          "type": "integer",
          "format": "uint8",
          "minimum": 0,
          "maximum": 255
        },
        "max_timeout": {
          "description": "Function request timeout.\n\nUnit: seconds.",
          "type": "integer",
          "format": "uint16",
          "minimum": 0,
          "maximum": 65535
        }
      },
      "required": [
        "count",
        "max_timeout"
      ]
    },
    "AuthLimits": {
      "type": "object"
    },
    "MonitorLimits": {
      "type": "object"
    },
    "StorageLimits": {
      "type": "object",
      "properties": {
        "max_storage": {
          "description": "Maximum total storage for all apps and api.\n\nUnit: bytes.\n\nDefault: 10 GB",
          "type": "integer",
          "format": "uint64",
          "minimum": 0
        },
        "max_app_storage": {
          "description": "Maximum per-app storage.\n\nUnit: bytes.\n\nDefault: 50 MB",
          "type": "integer",
          "format": "uint64",
          "minimum": 0
        },
        "assets": {
          "$ref": "#/$defs/AssetsLimits"
        },
        "artifact": {
          "$ref": "#/$defs/ArtifactLimits"
        },
        "cache": {
          "$ref": "#/$defs/CacheLimits"
        },
        "database": {
          "$ref": "#/$defs/DatabaseLimits"
        },
        "secrets": {
          "$ref": "#/$defs/SecretsLimits"
        }
      },
      "required": [
        "max_storage",
        "max_app_storage",
        "assets",
        "artifact",
        "cache",
        "database",
        "secrets"
      ]
    },
    "AssetsLimits": {
      "type": "object",
      "properties": {
        "allowed_extensions": {
          "description": "Allowed extensions corresponding to\n[MIME](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/MIME_types/Common_types) types.\n\n(More to be supported in the future)\n\nSupported:\n- \"txt\"\n- \"xml\"\n- \"html\"\n- \"css\"\n- \"css.map\"\n- \"csv\"\n- \"js\"\n- \"png\"\n- \"apng\"\n- \"gif\"\n- \"svg\"\n- \"jpg\"\n- \"jpeg\"\n- \"bmp\"\n- \"tif\"\n- \"tiff\"\n- \"webp\"\n- \"avif\"\n- \"ico\"\n- \"pdf\"\n- \"json\"\n- \"wasm\"\n\nSpecial:\n- \"none\" (for no extension; uses \"application/octet-stream\")\n- \"any\" (for unsupported extensions; also uses \"application/octet-stream\")",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "max_store_size": {
          "description": "Limit on total storage for all assets within an app\n(bytes).",
          "type": "integer",
          "format": "uint64",
          "minimum": 0
        },
        "max_asset_size": {
          "description": "Limit on individual asset size (bytes).",
          "type": "integer",
          "format": "uint64",
          "minimum": 0
        }
      },
      "required": [
        "allowed_extensions",
        "max_store_size",
        "max_asset_size"
      ]
    },
    "ArtifactLimits": {
      "type": "object",
      "properties": {
        "max_store_size": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0
        },
        "max_artifact_size": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0
        }
      },
      "required": [
        "max_store_size",
        "max_artifact_size"
      ]
    },
    "CacheLimits": {
      "type": "object",
      "properties": {
        "max_size_range": {
          "type": "array",
          "prefixItems": [
            {
              "type": "integer",
              "format": "uint64",
              "minimum": 0
            },
            {
              "type": "integer",
              "format": "uint64",
              "minimum": 0
            }
          ],
          "minItems": 2,
          "maxItems": 2
        },
        "max_count_range": {
          "type": "array",
          "prefixItems": [
            {
              "type": "integer",
              "format": "uint",
              "minimum": 0
            },
            {
              "type": "integer",
              "format": "uint",
              "minimum": 0
            }
          ],
          "minItems": 2,
          "maxItems": 2
        }
      },
      "required": [
        "max_size_range",
        "max_count_range"
      ]
    },
    "DatabaseLimits": {
      "type": "object",
      "properties": {
        "max_model_definitions": {
          "type": "integer",
          "format": "uint8",
          "minimum": 0,
          "maximum": 255
        },
        "max_model_fields": {
          "type": "integer",
          "format": "uint8",
          "minimum": 0,
          "maximum": 255
        },
        "max_item_size": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0
        },
        "max_field_size": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0
        }
      },
      "required": [
        "max_model_definitions",
        "max_model_fields",
        "max_item_size",
        "max_field_size"
      ]
    },
    "SecretsLimits": {
      "type": "object",
      "properties": {
        "max_count": {
          "type": "integer",
          "format": "uint8",
          "minimum": 0,
          "maximum": 255
        },
        "max_size": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0
        }
      },
      "required": [
        "max_count",
        "max_size"
      ]
    },
    "ProxiedMetric": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "endpoint": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "endpoint"
      ]
    },
    "OrdinaryHostExtensionConfig": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "operations": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/ExtensionOperationConfig"
          }
        }
      },
      "required": [
        "name",
        "operations"
      ]
    },
    "ExtensionOperationConfig": {
      "type": "object",
      "properties": {
        "idx": {
          "type": "integer",
          "format": "uint16",
          "minimum": 0,
          "maximum": 65535
        },
        "input": {
          "$ref": "#/$defs/Kind"
        },
        "output": {
          "$ref": "#/$defs/Kind"
        }
      },
      "required": [
        "idx",
        "input",
        "output"
      ]
    },
    "Kind": {
      "description": "Defines the types recognized by this framework.",
      "oneOf": [
        {
          "description": "In the case of one-to-many the deletion of the\nparent reference causes a cascading delete (i.e if you have a user, chat, message\nrelationship structure, deletion of the user or the chat automatically\ndeletes messages owned by either).\n\nReferences must always be bidirectionally defined.",
          "type": "object",
          "properties": {
            "Ref": {
              "type": "object",
              "properties": {
                "model": {
                  "description": "name of model you're referencing.",
                  "type": "string"
                },
                "field": {
                  "description": "name of the field on the model.",
                  "type": "string"
                },
                "many": {
                  "description": "whether you have many of the referenced model.",
                  "type": [
                    "boolean",
                    "null"
                  ]
                }
              },
              "required": [
                "model",
                "field"
              ]
            }
          },
          "required": [
            "Ref"
          ],
          "additionalProperties": false
        },
        {
          "description": "null/void/undefined/None",
          "type": "string",
          "const": "Void"
        },
        {
          "description": "boolean/true/false",
          "type": "string",
          "const": "Bool"
        },
        {
          "description": "integers between",
          "type": "string",
          "const": "I8"
        },
        {
          "description": "integers between",
          "type": "string",
          "const": "U8"
        },
        {
          "description": "integers between",
          "type": "string",
          "const": "I16"
        },
        {
          "description": "integers between",
          "type": "string",
          "const": "U16"
        },
        {
          "description": "integers between",
          "type": "string",
          "const": "I32"
        },
        {
          "description": "integers between",
          "type": "string",
          "const": "U32"
        },
        {
          "description": "integers between",
          "type": "string",
          "const": "I64"
        },
        {
          "description": "integers between",
          "type": "string",
          "const": "U64"
        },
        {
          "description": "floats between",
          "type": "string",
          "const": "F32"
        },
        {
          "description": "floats between",
          "type": "string",
          "const": "F64"
        },
        {
          "description": "universal unique identifiers. 16 bytes\nor 36 characters.",
          "type": "string",
          "const": "Uuid"
        },
        {
          "description": "must be a valid URL",
          "type": "string",
          "const": "Url"
        },
        {
          "description": "unix timestamp",
          "type": "object",
          "properties": {
            "Timestamp": {
              "type": "object",
              "properties": {
                "unit": {
                  "$ref": "#/$defs/TimeUnit"
                },
                "fmt": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "unit"
              ]
            }
          },
          "required": [
            "Timestamp"
          ],
          "additionalProperties": false
        },
        {
          "description": "array of bytes.",
          "type": "string",
          "const": "Blob"
        },
        {
          "description": "text/string/characters.",
          "type": "string",
          "const": "String"
        },
        {
          "description": "JSON formatted string.",
          "type": "string",
          "const": "Json"
        },
        {
          "description": "Markdown formatted string",
          "type": "string",
          "const": "Markdown"
        },
        {
          "description": "array of values.",
          "type": "object",
          "properties": {
            "List": {
              "type": "object",
              "properties": {
                "kind": {
                  "description": "the type for the values stored in the list.",
                  "$ref": "#/$defs/Kind"
                }
              },
              "required": [
                "kind"
              ]
            }
          },
          "required": [
            "List"
          ],
          "additionalProperties": false
        },
        {
          "description": "Select from a list of options. Stored as its u8 index value.",
          "type": "object",
          "properties": {
            "Enum": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "opts": {
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/EnumOpt"
                  }
                }
              },
              "required": [
                "name",
                "opts"
              ]
            }
          },
          "required": [
            "Enum"
          ],
          "additionalProperties": false
        },
        {
          "description": "complex kind with its own name and subfields.",
          "type": "object",
          "properties": {
            "Object": {
              "type": "object",
              "properties": {
                "name": {
                  "description": "the object definition's name.",
                  "type": "string"
                },
                "fields": {
                  "description": "nested subfields.",
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/Field"
                  }
                }
              },
              "required": [
                "name",
                "fields"
              ]
            }
          },
          "required": [
            "Object"
          ],
          "additionalProperties": false
        }
      ]
    },
    "TimeUnit": {
      "type": "string",
      "enum": [
        "Seconds"
      ]
    },
    "EnumOpt": {
      "type": "object",
      "properties": {
        "idx": {
          "type": "integer",
          "format": "uint8",
          "minimum": 0,
          "maximum": 255
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "idx",
        "name"
      ]
    },
    "Field": {
      "description": "Fields are used to describe properties on a model,\nIO for functions/integrations and content definitions.",
      "type": "object",
      "properties": {
        "idx": {
          "description": "The index used for compact, vector based serialization.\nThe index is preserved even if the property name changes.\nEach field must be assigned an index value from 0-255, with\nno gaps (i.e. cannot go from 2 to 4 without also having a field\nwith an index of 3).",
          "type": "integer",
          "format": "uint8",
          "minimum": 0,
          "maximum": 255
        },
        "name": {
          "description": "this is the name that is used when accessing a property in a template\nand will be the name that is used in the JSON serialized format.",
          "type": "string"
        },
        "kind": {
          "description": "the \"kind\" represents the type of the value that will\nbe stored or sent.",
          "$ref": "#/$defs/Kind"
        },
        "indexed": {
          "description": "Used for models and content definitions. Determines whether\nyou can access an object/item by this property. All items\nhave are automatically stored ID that can be used for look\nup if no properties are indexed.\n\nNote: `indexed` fields also have a uniqueness constraint.\n\n!! Important: only `String`, `Uuid` and `Url` kinds can be indexed",
          "type": [
            "boolean",
            "null"
          ]
        },
        "queryable": {
          "description": "Specifies whether field can be queried via Gte/Gt, Lte/Lt, Eq and `BeginsWith`.\n\n!! Important: only `Bool`, `String`, `Url`, `Uuid`, `Timestamp`, `U8/16/32/64`, `I8/16/32/64`,\n!! and `F32/64` kinds can be made queryable.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "mapping": {
          "description": "Used for integrations, so that a property on the external\nresource's response can be renamed.",
          "type": [
            "string",
            "null"
          ]
        },
        "doc": {
          "description": "Optional message to hint to the user\nin an editor.",
          "type": [
            "string",
            "null"
          ]
        },
        "compressed": {
          "description": "Compresses the value of the field using the Zstd compression algorithm (level 4).\n\nNote: at some point in the future, compression levels and compression algorithm\nselection will be configurable.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "encrypted": {
          "description": "Encrypts the field using `XChaCha20Poly1305`.\n\nNote: The storage encryption key is stored on the same\nserver as the data it's encrypting; anyone with full access\nto the server. This is mostly useful for protecting\nsensitive data in backups (assuming the key isn't stored with the\nbackup), and can potentially limit exposure in partial-access context\nstemming from a misconfiguration or a mistake in a multi-tenant scenario\n(i.e. for whatever reason tenant A's database contents is moved to tenant B's\ndirectory, without the keys also being shifted over).\n\n!! Important: this is not currently intended for storing *any* meaningfully\n!! sensitive data (e.g. SSNs, credit card numbers, passwords, encryption keys, etc.)\n!! use (or don't) at your own risk.",
          "type": [
            "boolean",
            "null"
          ]
        }
      },
      "required": [
        "idx",
        "name",
        "kind"
      ]
    }
  }
}