cloudfall 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. cloudfall/__init__.py +19 -0
  2. cloudfall/__main__.py +5 -0
  3. cloudfall/_bundled/schemas/v1/alert-rule.schema.json +63 -0
  4. cloudfall/_bundled/schemas/v1/application.schema.json +60 -0
  5. cloudfall/_bundled/schemas/v1/artifact.schema.json +71 -0
  6. cloudfall/_bundled/schemas/v1/backup-receipt.schema.json +58 -0
  7. cloudfall/_bundled/schemas/v1/common.schema.json +115 -0
  8. cloudfall/_bundled/schemas/v1/component.schema.json +234 -0
  9. cloudfall/_bundled/schemas/v1/deployment-receipt.schema.json +53 -0
  10. cloudfall/_bundled/schemas/v1/domain.schema.json +208 -0
  11. cloudfall/_bundled/schemas/v1/environment-receipt.schema.json +55 -0
  12. cloudfall/_bundled/schemas/v1/logging-stack.schema.json +473 -0
  13. cloudfall/_bundled/schemas/v1/observed-domain.schema.json +158 -0
  14. cloudfall/_bundled/schemas/v1/observed-server.schema.json +627 -0
  15. cloudfall/_bundled/schemas/v1/operator-policy.schema.json +97 -0
  16. cloudfall/_bundled/schemas/v1/operator-proposal.schema.json +253 -0
  17. cloudfall/_bundled/schemas/v1/release-receipt.schema.json +66 -0
  18. cloudfall/_bundled/schemas/v1/server-type.schema.json +289 -0
  19. cloudfall/_bundled/schemas/v1/server.schema.json +146 -0
  20. cloudfall/_bundled/schemas/v1/service.schema.json +222 -0
  21. cloudfall/_bundled/schemas/v1/ssh-public-key.schema.json +55 -0
  22. cloudfall/agent_tools.py +868 -0
  23. cloudfall/arguments.py +92 -0
  24. cloudfall/audit.py +905 -0
  25. cloudfall/authoring.py +341 -0
  26. cloudfall/cli.py +1748 -0
  27. cloudfall/commands.py +257 -0
  28. cloudfall/cutover.py +370 -0
  29. cloudfall/dashboard.py +407 -0
  30. cloudfall/dashboard_server.py +201 -0
  31. cloudfall/domain.py +1157 -0
  32. cloudfall/importer.py +906 -0
  33. cloudfall/inventory.py +2116 -0
  34. cloudfall/lifecycle.py +874 -0
  35. cloudfall/mcp_server.py +704 -0
  36. cloudfall/migrate.py +730 -0
  37. cloudfall/observation.py +143 -0
  38. cloudfall/operations.py +1228 -0
  39. cloudfall/operator.py +1099 -0
  40. cloudfall/project.py +841 -0
  41. cloudfall/py.typed +0 -0
  42. cloudfall/render_api.py +338 -0
  43. cloudfall/resources.py +67 -0
  44. cloudfall/secrets.py +262 -0
  45. cloudfall/service_evidence.py +659 -0
  46. cloudfall/validation.py +1340 -0
  47. cloudfall-0.2.0.dist-info/METADATA +408 -0
  48. cloudfall-0.2.0.dist-info/RECORD +165 -0
  49. cloudfall-0.2.0.dist-info/WHEEL +4 -0
  50. cloudfall-0.2.0.dist-info/entry_points.txt +4 -0
  51. cloudfall-0.2.0.dist-info/licenses/LICENSE +661 -0
  52. cloudfall_engine/__init__.py +5 -0
  53. cloudfall_engine/__main__.py +5 -0
  54. cloudfall_engine/_bundled/ansible/ansible.cfg +7 -0
  55. cloudfall_engine/_bundled/ansible/playbooks/backup.yml +86 -0
  56. cloudfall_engine/_bundled/ansible/playbooks/baseline.yml +35 -0
  57. cloudfall_engine/_bundled/ansible/playbooks/bootstrap.yml +24 -0
  58. cloudfall_engine/_bundled/ansible/playbooks/data.yml +28 -0
  59. cloudfall_engine/_bundled/ansible/playbooks/deploy.yml +35 -0
  60. cloudfall_engine/_bundled/ansible/playbooks/domains.yml +21 -0
  61. cloudfall_engine/_bundled/ansible/playbooks/health.yml +31 -0
  62. cloudfall_engine/_bundled/ansible/playbooks/inspect.yml +15 -0
  63. cloudfall_engine/_bundled/ansible/playbooks/logging.yml +35 -0
  64. cloudfall_engine/_bundled/ansible/playbooks/restart.yml +31 -0
  65. cloudfall_engine/_bundled/ansible/playbooks/rollback.yml +33 -0
  66. cloudfall_engine/_bundled/ansible/playbooks/services.yml +37 -0
  67. cloudfall_engine/_bundled/ansible/playbooks/time.yml +9 -0
  68. cloudfall_engine/_bundled/ansible/roles/cloudfall_access/defaults/main.yml +2 -0
  69. cloudfall_engine/_bundled/ansible/roles/cloudfall_access/handlers/main.yml +5 -0
  70. cloudfall_engine/_bundled/ansible/roles/cloudfall_access/meta/argument_specs.yml +34 -0
  71. cloudfall_engine/_bundled/ansible/roles/cloudfall_access/meta/main.yml +13 -0
  72. cloudfall_engine/_bundled/ansible/roles/cloudfall_access/tasks/main.yml +59 -0
  73. cloudfall_engine/_bundled/ansible/roles/cloudfall_bootstrap/defaults/main.yml +11 -0
  74. cloudfall_engine/_bundled/ansible/roles/cloudfall_bootstrap/meta/argument_specs.yml +52 -0
  75. cloudfall_engine/_bundled/ansible/roles/cloudfall_bootstrap/meta/main.yml +13 -0
  76. cloudfall_engine/_bundled/ansible/roles/cloudfall_bootstrap/tasks/main.yml +99 -0
  77. cloudfall_engine/_bundled/ansible/roles/cloudfall_data_migration/defaults/main.yml +15 -0
  78. cloudfall_engine/_bundled/ansible/roles/cloudfall_data_migration/meta/argument_specs.yml +36 -0
  79. cloudfall_engine/_bundled/ansible/roles/cloudfall_data_migration/meta/main.yml +13 -0
  80. cloudfall_engine/_bundled/ansible/roles/cloudfall_data_migration/tasks/main.yml +201 -0
  81. cloudfall_engine/_bundled/ansible/roles/cloudfall_deploy/defaults/main.yml +10 -0
  82. cloudfall_engine/_bundled/ansible/roles/cloudfall_deploy/meta/argument_specs.yml +125 -0
  83. cloudfall_engine/_bundled/ansible/roles/cloudfall_deploy/meta/main.yml +13 -0
  84. cloudfall_engine/_bundled/ansible/roles/cloudfall_deploy/tasks/health.yml +3 -0
  85. cloudfall_engine/_bundled/ansible/roles/cloudfall_deploy/tasks/health_gate.yml +37 -0
  86. cloudfall_engine/_bundled/ansible/roles/cloudfall_deploy/tasks/main.yml +285 -0
  87. cloudfall_engine/_bundled/ansible/roles/cloudfall_deploy/tasks/restart.yml +17 -0
  88. cloudfall_engine/_bundled/ansible/roles/cloudfall_deploy/tasks/rollback.yml +52 -0
  89. cloudfall_engine/_bundled/ansible/roles/cloudfall_deploy/templates/component.service.j2 +24 -0
  90. cloudfall_engine/_bundled/ansible/roles/cloudfall_firewall/defaults/main.yml +2 -0
  91. cloudfall_engine/_bundled/ansible/roles/cloudfall_firewall/handlers/main.yml +5 -0
  92. cloudfall_engine/_bundled/ansible/roles/cloudfall_firewall/meta/argument_specs.yml +33 -0
  93. cloudfall_engine/_bundled/ansible/roles/cloudfall_firewall/meta/main.yml +13 -0
  94. cloudfall_engine/_bundled/ansible/roles/cloudfall_firewall/tasks/main.yml +51 -0
  95. cloudfall_engine/_bundled/ansible/roles/cloudfall_firewall/templates/nftables.conf.j2 +31 -0
  96. cloudfall_engine/_bundled/ansible/roles/cloudfall_inspect/defaults/main.yml +6 -0
  97. cloudfall_engine/_bundled/ansible/roles/cloudfall_inspect/meta/argument_specs.yml +24 -0
  98. cloudfall_engine/_bundled/ansible/roles/cloudfall_inspect/meta/main.yml +13 -0
  99. cloudfall_engine/_bundled/ansible/roles/cloudfall_inspect/tasks/main.yml +643 -0
  100. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_backend/defaults/main.yml +6 -0
  101. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_backend/handlers/main.yml +29 -0
  102. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_backend/meta/argument_specs.yml +227 -0
  103. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_backend/meta/main.yml +11 -0
  104. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_backend/tasks/main.yml +487 -0
  105. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_backend/templates/alertmanager-defaults.j2 +2 -0
  106. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_backend/templates/alertmanager.yaml.j2 +33 -0
  107. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_backend/templates/grafana.ini.j2 +20 -0
  108. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_backend/templates/loki-datasource.yml.j2 +11 -0
  109. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_backend/templates/loki-systemd-override.conf.j2 +3 -0
  110. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_backend/templates/loki.yaml.j2 +49 -0
  111. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_backend/templates/nginx-loki-gateway.conf.j2 +45 -0
  112. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_backend/templates/prometheus-datasource.yml.j2 +11 -0
  113. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_backend/templates/prometheus-defaults.j2 +2 -0
  114. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_backend/templates/prometheus-rules.yaml.j2 +20 -0
  115. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_backend/templates/prometheus.yaml.j2 +24 -0
  116. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_collector/defaults/main.yml +7 -0
  117. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_collector/handlers/main.yml +6 -0
  118. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_collector/meta/argument_specs.yml +122 -0
  119. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_collector/meta/main.yml +11 -0
  120. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_collector/tasks/main.yml +224 -0
  121. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_collector/templates/alloy-systemd-override.conf.j2 +3 -0
  122. cloudfall_engine/_bundled/ansible/roles/cloudfall_logging_collector/templates/config.alloy.j2 +127 -0
  123. cloudfall_engine/_bundled/ansible/roles/cloudfall_nginx_site/defaults/main.yml +4 -0
  124. cloudfall_engine/_bundled/ansible/roles/cloudfall_nginx_site/handlers/main.yml +5 -0
  125. cloudfall_engine/_bundled/ansible/roles/cloudfall_nginx_site/meta/argument_specs.yml +69 -0
  126. cloudfall_engine/_bundled/ansible/roles/cloudfall_nginx_site/meta/main.yml +13 -0
  127. cloudfall_engine/_bundled/ansible/roles/cloudfall_nginx_site/tasks/main.yml +212 -0
  128. cloudfall_engine/_bundled/ansible/roles/cloudfall_nginx_site/templates/domain-site.conf.j2 +54 -0
  129. cloudfall_engine/_bundled/ansible/roles/cloudfall_postgresql/defaults/main.yml +6 -0
  130. cloudfall_engine/_bundled/ansible/roles/cloudfall_postgresql/handlers/main.yml +9 -0
  131. cloudfall_engine/_bundled/ansible/roles/cloudfall_postgresql/meta/argument_specs.yml +91 -0
  132. cloudfall_engine/_bundled/ansible/roles/cloudfall_postgresql/meta/main.yml +13 -0
  133. cloudfall_engine/_bundled/ansible/roles/cloudfall_postgresql/tasks/main.yml +295 -0
  134. cloudfall_engine/_bundled/ansible/roles/cloudfall_postgresql/templates/backup.service.j2 +11 -0
  135. cloudfall_engine/_bundled/ansible/roles/cloudfall_postgresql/templates/backup.sh.j2 +17 -0
  136. cloudfall_engine/_bundled/ansible/roles/cloudfall_postgresql/templates/backup.timer.j2 +10 -0
  137. cloudfall_engine/_bundled/ansible/roles/cloudfall_postgresql/templates/cloudfall.conf.j2 +3 -0
  138. cloudfall_engine/_bundled/ansible/roles/cloudfall_postgresql/templates/restore-check.service.j2 +11 -0
  139. cloudfall_engine/_bundled/ansible/roles/cloudfall_postgresql/templates/restore-check.sh.j2 +27 -0
  140. cloudfall_engine/_bundled/ansible/roles/cloudfall_postgresql/templates/restore-check.timer.j2 +10 -0
  141. cloudfall_engine/_bundled/ansible/roles/cloudfall_redis/defaults/main.yml +2 -0
  142. cloudfall_engine/_bundled/ansible/roles/cloudfall_redis/handlers/main.yml +6 -0
  143. cloudfall_engine/_bundled/ansible/roles/cloudfall_redis/meta/argument_specs.yml +68 -0
  144. cloudfall_engine/_bundled/ansible/roles/cloudfall_redis/meta/main.yml +13 -0
  145. cloudfall_engine/_bundled/ansible/roles/cloudfall_redis/tasks/main.yml +148 -0
  146. cloudfall_engine/_bundled/ansible/roles/cloudfall_redis/templates/backup.service.j2 +11 -0
  147. cloudfall_engine/_bundled/ansible/roles/cloudfall_redis/templates/backup.sh.j2 +14 -0
  148. cloudfall_engine/_bundled/ansible/roles/cloudfall_redis/templates/backup.timer.j2 +10 -0
  149. cloudfall_engine/_bundled/ansible/roles/cloudfall_redis/templates/cloudfall.conf.j2 +6 -0
  150. cloudfall_engine/_bundled/ansible/roles/cloudfall_redis/templates/restore-check.service.j2 +11 -0
  151. cloudfall_engine/_bundled/ansible/roles/cloudfall_redis/templates/restore-check.sh.j2 +15 -0
  152. cloudfall_engine/_bundled/ansible/roles/cloudfall_redis/templates/restore-check.timer.j2 +10 -0
  153. cloudfall_engine/_bundled/ansible/roles/cloudfall_time/defaults/main.yml +2 -0
  154. cloudfall_engine/_bundled/ansible/roles/cloudfall_time/meta/argument_specs.yml +10 -0
  155. cloudfall_engine/_bundled/ansible/roles/cloudfall_time/meta/main.yml +13 -0
  156. cloudfall_engine/_bundled/ansible/roles/cloudfall_time/tasks/main.yml +119 -0
  157. cloudfall_engine/_bundled/ansible/roles/cloudfall_unattended_upgrades/defaults/main.yml +3 -0
  158. cloudfall_engine/_bundled/ansible/roles/cloudfall_unattended_upgrades/meta/argument_specs.yml +8 -0
  159. cloudfall_engine/_bundled/ansible/roles/cloudfall_unattended_upgrades/meta/main.yml +13 -0
  160. cloudfall_engine/_bundled/ansible/roles/cloudfall_unattended_upgrades/tasks/main.yml +37 -0
  161. cloudfall_engine/ansible_inventory.py +253 -0
  162. cloudfall_engine/artifact.py +258 -0
  163. cloudfall_engine/cli.py +273 -0
  164. cloudfall_engine/playbook.py +175 -0
  165. cloudfall_engine/py.typed +0 -0
cloudfall/__init__.py ADDED
@@ -0,0 +1,19 @@
1
+ """Cloudfall platform SDK."""
2
+
3
+ from cloudfall.domain import ResourceDocument, ResourceId, ResourceKind
4
+ from cloudfall.inventory import PlatformInventory
5
+ from cloudfall.operations import FleetOperations, UtcTimestamp, build_operations_view
6
+ from cloudfall.validation import ConfigValidationError, ValidatedConfig, validate_config
7
+
8
+ __all__ = [
9
+ "ConfigValidationError",
10
+ "FleetOperations",
11
+ "PlatformInventory",
12
+ "ResourceDocument",
13
+ "ResourceId",
14
+ "ResourceKind",
15
+ "UtcTimestamp",
16
+ "ValidatedConfig",
17
+ "build_operations_view",
18
+ "validate_config",
19
+ ]
cloudfall/__main__.py ADDED
@@ -0,0 +1,5 @@
1
+ """Allow ``python -m cloudfall`` at the system boundary."""
2
+
3
+ from cloudfall.cli import run
4
+
5
+ run()
@@ -0,0 +1,63 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://cloudfall.internal/schemas/v1/alert-rule.schema.json",
4
+ "title": "Cloudfall alert rule",
5
+ "x-cloudfall-kind": "AlertRule",
6
+ "type": "object",
7
+ "properties": {
8
+ "apiVersion": {
9
+ "$ref": "common.schema.json#/$defs/apiVersion"
10
+ },
11
+ "kind": {
12
+ "const": "AlertRule"
13
+ },
14
+ "metadata": {
15
+ "$ref": "common.schema.json#/$defs/metadata"
16
+ },
17
+ "spec": {
18
+ "type": "object",
19
+ "properties": {
20
+ "environment": {
21
+ "$ref": "common.schema.json#/$defs/resourceId"
22
+ },
23
+ "expr": {
24
+ "type": "string",
25
+ "minLength": 1,
26
+ "maxLength": 1000,
27
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
28
+ },
29
+ "for": {
30
+ "type": "string",
31
+ "pattern": "^[0-9]{1,5}[smh]$"
32
+ },
33
+ "severity": {
34
+ "enum": [
35
+ "warning",
36
+ "critical"
37
+ ]
38
+ },
39
+ "summary": {
40
+ "type": "string",
41
+ "minLength": 1,
42
+ "maxLength": 200,
43
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
44
+ }
45
+ },
46
+ "required": [
47
+ "environment",
48
+ "expr",
49
+ "for",
50
+ "severity",
51
+ "summary"
52
+ ],
53
+ "additionalProperties": false
54
+ }
55
+ },
56
+ "required": [
57
+ "apiVersion",
58
+ "kind",
59
+ "metadata",
60
+ "spec"
61
+ ],
62
+ "additionalProperties": false
63
+ }
@@ -0,0 +1,60 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://cloudfall.internal/schemas/v1/application.schema.json",
4
+ "title": "Cloudfall application",
5
+ "x-cloudfall-kind": "Application",
6
+ "type": "object",
7
+ "properties": {
8
+ "apiVersion": {
9
+ "$ref": "common.schema.json#/$defs/apiVersion"
10
+ },
11
+ "kind": {
12
+ "const": "Application"
13
+ },
14
+ "metadata": {
15
+ "$ref": "common.schema.json#/$defs/metadata"
16
+ },
17
+ "spec": {
18
+ "type": "object",
19
+ "properties": {
20
+ "linuxUser": {
21
+ "$ref": "common.schema.json#/$defs/linuxUser"
22
+ },
23
+ "approval": {
24
+ "enum": [
25
+ "automatic",
26
+ "manual"
27
+ ]
28
+ },
29
+ "components": {
30
+ "type": "array",
31
+ "items": {
32
+ "$ref": "common.schema.json#/$defs/resourceId"
33
+ },
34
+ "minItems": 1,
35
+ "uniqueItems": true
36
+ },
37
+ "secretRefs": {
38
+ "type": "array",
39
+ "items": {
40
+ "$ref": "common.schema.json#/$defs/secretReference"
41
+ },
42
+ "uniqueItems": true
43
+ }
44
+ },
45
+ "required": [
46
+ "linuxUser",
47
+ "approval",
48
+ "components"
49
+ ],
50
+ "additionalProperties": false
51
+ }
52
+ },
53
+ "required": [
54
+ "apiVersion",
55
+ "kind",
56
+ "metadata",
57
+ "spec"
58
+ ],
59
+ "additionalProperties": false
60
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://cloudfall.internal/schemas/v1/artifact.schema.json",
4
+ "title": "Cloudfall release artifact metadata",
5
+ "type": "object",
6
+ "properties": {
7
+ "apiVersion": {
8
+ "$ref": "common.schema.json#/$defs/apiVersion"
9
+ },
10
+ "kind": {
11
+ "const": "Artifact"
12
+ },
13
+ "metadata": {
14
+ "$ref": "common.schema.json#/$defs/metadata"
15
+ },
16
+ "spec": {
17
+ "type": "object",
18
+ "properties": {
19
+ "component": {
20
+ "$ref": "common.schema.json#/$defs/resourceId"
21
+ },
22
+ "release": {
23
+ "type": "string",
24
+ "pattern": "^[0-9]{8}T[0-9]{6}Z-[0-9a-f]{7,40}$"
25
+ },
26
+ "gitRef": {
27
+ "type": "string",
28
+ "minLength": 1,
29
+ "maxLength": 200
30
+ },
31
+ "gitCommit": {
32
+ "type": "string",
33
+ "pattern": "^[0-9a-f]{40}$"
34
+ },
35
+ "builtAt": {
36
+ "type": "string",
37
+ "format": "date-time"
38
+ },
39
+ "archive": {
40
+ "type": "string",
41
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*\\.tar\\.gz$"
42
+ },
43
+ "archiveSha256": {
44
+ "$ref": "common.schema.json#/$defs/sha256"
45
+ },
46
+ "sizeBytes": {
47
+ "type": "integer",
48
+ "minimum": 1
49
+ }
50
+ },
51
+ "required": [
52
+ "component",
53
+ "release",
54
+ "gitRef",
55
+ "gitCommit",
56
+ "builtAt",
57
+ "archive",
58
+ "archiveSha256",
59
+ "sizeBytes"
60
+ ],
61
+ "additionalProperties": false
62
+ }
63
+ },
64
+ "required": [
65
+ "apiVersion",
66
+ "kind",
67
+ "metadata",
68
+ "spec"
69
+ ],
70
+ "additionalProperties": false
71
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://cloudfall.internal/schemas/v1/backup-receipt.schema.json",
4
+ "title": "Cloudfall backup operation receipt",
5
+ "type": "object",
6
+ "properties": {
7
+ "apiVersion": {
8
+ "$ref": "common.schema.json#/$defs/apiVersion"
9
+ },
10
+ "kind": {
11
+ "const": "BackupReceipt"
12
+ },
13
+ "metadata": {
14
+ "$ref": "common.schema.json#/$defs/metadata"
15
+ },
16
+ "spec": {
17
+ "type": "object",
18
+ "properties": {
19
+ "service": {
20
+ "$ref": "common.schema.json#/$defs/resourceId"
21
+ },
22
+ "server": {
23
+ "$ref": "common.schema.json#/$defs/resourceId"
24
+ },
25
+ "action": {
26
+ "enum": [
27
+ "backup",
28
+ "restore-check"
29
+ ]
30
+ },
31
+ "executedAt": {
32
+ "type": "string",
33
+ "format": "date-time"
34
+ },
35
+ "summary": {
36
+ "type": "string",
37
+ "minLength": 1,
38
+ "maxLength": 2000
39
+ }
40
+ },
41
+ "required": [
42
+ "service",
43
+ "server",
44
+ "action",
45
+ "executedAt",
46
+ "summary"
47
+ ],
48
+ "additionalProperties": false
49
+ }
50
+ },
51
+ "required": [
52
+ "apiVersion",
53
+ "kind",
54
+ "metadata",
55
+ "spec"
56
+ ],
57
+ "additionalProperties": false
58
+ }
@@ -0,0 +1,115 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://cloudfall.internal/schemas/v1/common.schema.json",
4
+ "title": "Cloudfall common definitions",
5
+ "$defs": {
6
+ "apiVersion": {
7
+ "const": "cloudfall/v1"
8
+ },
9
+ "resourceId": {
10
+ "type": "string",
11
+ "minLength": 1,
12
+ "maxLength": 63,
13
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
14
+ },
15
+ "metadata": {
16
+ "type": "object",
17
+ "properties": {
18
+ "id": {
19
+ "$ref": "#/$defs/resourceId"
20
+ },
21
+ "description": {
22
+ "type": "string",
23
+ "minLength": 1,
24
+ "maxLength": 500
25
+ }
26
+ },
27
+ "required": [
28
+ "id"
29
+ ],
30
+ "additionalProperties": false
31
+ },
32
+ "linuxUser": {
33
+ "type": "string",
34
+ "minLength": 1,
35
+ "maxLength": 32,
36
+ "pattern": "^[a-z_][a-z0-9_-]*$"
37
+ },
38
+ "packageName": {
39
+ "type": "string",
40
+ "minLength": 1,
41
+ "maxLength": 200,
42
+ "pattern": "^[a-z0-9][a-z0-9+.-]*$"
43
+ },
44
+ "serviceName": {
45
+ "type": "string",
46
+ "minLength": 1,
47
+ "maxLength": 255,
48
+ "pattern": "^[A-Za-z0-9@_.:-]+\\.service$"
49
+ },
50
+ "systemdUnitName": {
51
+ "type": "string",
52
+ "minLength": 1,
53
+ "maxLength": 255,
54
+ "pattern": "^[A-Za-z0-9@_.:-]+\\.(?:service|timer)$"
55
+ },
56
+ "networkPort": {
57
+ "type": "integer",
58
+ "minimum": 1,
59
+ "maximum": 65535
60
+ },
61
+ "networkProtocol": {
62
+ "enum": [
63
+ "tcp",
64
+ "udp"
65
+ ]
66
+ },
67
+ "fileMode": {
68
+ "type": "string",
69
+ "pattern": "^0[0-7]{3}$"
70
+ },
71
+ "sha256": {
72
+ "type": "string",
73
+ "pattern": "^[a-f0-9]{64}$"
74
+ },
75
+ "absolutePath": {
76
+ "type": "string",
77
+ "minLength": 1,
78
+ "pattern": "^/(?:[^/\\u0000]+/?)*$",
79
+ "not": {
80
+ "anyOf": [
81
+ {
82
+ "pattern": "(?:^|/)\\.\\.(?:/|$)"
83
+ },
84
+ {
85
+ "pattern": "//"
86
+ }
87
+ ]
88
+ }
89
+ },
90
+ "secretReference": {
91
+ "type": "object",
92
+ "properties": {
93
+ "scope": {
94
+ "enum": [
95
+ "platform",
96
+ "application",
97
+ "component"
98
+ ]
99
+ },
100
+ "environment": {
101
+ "$ref": "#/$defs/resourceId"
102
+ },
103
+ "path": {
104
+ "$ref": "#/$defs/absolutePath"
105
+ }
106
+ },
107
+ "required": [
108
+ "scope",
109
+ "environment",
110
+ "path"
111
+ ],
112
+ "additionalProperties": false
113
+ }
114
+ }
115
+ }
@@ -0,0 +1,234 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://cloudfall.internal/schemas/v1/component.schema.json",
4
+ "title": "Cloudfall component",
5
+ "x-cloudfall-kind": "Component",
6
+ "type": "object",
7
+ "properties": {
8
+ "apiVersion": {
9
+ "$ref": "common.schema.json#/$defs/apiVersion"
10
+ },
11
+ "kind": {
12
+ "const": "Component"
13
+ },
14
+ "metadata": {
15
+ "$ref": "common.schema.json#/$defs/metadata"
16
+ },
17
+ "spec": {
18
+ "type": "object",
19
+ "properties": {
20
+ "application": {
21
+ "$ref": "common.schema.json#/$defs/resourceId"
22
+ },
23
+ "repository": {
24
+ "type": "object",
25
+ "properties": {
26
+ "url": {
27
+ "type": "string",
28
+ "format": "uri",
29
+ "pattern": "^(?:https|ssh|file)://"
30
+ },
31
+ "subdirectory": {
32
+ "type": "string",
33
+ "minLength": 1,
34
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$)).+$"
35
+ }
36
+ },
37
+ "required": [
38
+ "url"
39
+ ],
40
+ "additionalProperties": false
41
+ },
42
+ "runtime": {
43
+ "type": "object",
44
+ "properties": {
45
+ "type": {
46
+ "enum": [
47
+ "python",
48
+ "node",
49
+ "pm2"
50
+ ]
51
+ },
52
+ "version": {
53
+ "type": "string",
54
+ "minLength": 1,
55
+ "maxLength": 30
56
+ },
57
+ "packageManager": {
58
+ "enum": [
59
+ "uv",
60
+ "npm",
61
+ "pnpm",
62
+ "yarn"
63
+ ]
64
+ }
65
+ },
66
+ "required": [
67
+ "type",
68
+ "version",
69
+ "packageManager"
70
+ ],
71
+ "additionalProperties": false
72
+ },
73
+ "deployment": {
74
+ "type": "object",
75
+ "properties": {
76
+ "strategy": {
77
+ "const": "artifact-symlink"
78
+ },
79
+ "servers": {
80
+ "type": "array",
81
+ "items": {
82
+ "$ref": "common.schema.json#/$defs/resourceId"
83
+ },
84
+ "minItems": 1,
85
+ "uniqueItems": true
86
+ },
87
+ "installRoot": {
88
+ "$ref": "common.schema.json#/$defs/absolutePath"
89
+ },
90
+ "retainUntilCleanup": {
91
+ "const": true
92
+ }
93
+ },
94
+ "required": [
95
+ "strategy",
96
+ "servers",
97
+ "installRoot",
98
+ "retainUntilCleanup"
99
+ ],
100
+ "additionalProperties": false
101
+ },
102
+ "service": {
103
+ "type": "object",
104
+ "properties": {
105
+ "manager": {
106
+ "const": "systemd"
107
+ },
108
+ "name": {
109
+ "$ref": "common.schema.json#/$defs/resourceId"
110
+ },
111
+ "command": {
112
+ "type": "array",
113
+ "items": {
114
+ "type": "string",
115
+ "minLength": 1
116
+ },
117
+ "minItems": 1
118
+ }
119
+ },
120
+ "required": [
121
+ "manager",
122
+ "name",
123
+ "command"
124
+ ],
125
+ "additionalProperties": false
126
+ },
127
+ "healthCheck": {
128
+ "oneOf": [
129
+ {
130
+ "type": "object",
131
+ "properties": {
132
+ "type": {
133
+ "const": "http"
134
+ },
135
+ "scheme": {
136
+ "enum": [
137
+ "http",
138
+ "https"
139
+ ]
140
+ },
141
+ "port": {
142
+ "type": "integer",
143
+ "minimum": 1,
144
+ "maximum": 65535
145
+ },
146
+ "path": {
147
+ "type": "string",
148
+ "pattern": "^/"
149
+ },
150
+ "expectedStatuses": {
151
+ "type": "array",
152
+ "items": {
153
+ "type": "integer",
154
+ "minimum": 100,
155
+ "maximum": 599
156
+ },
157
+ "minItems": 1,
158
+ "uniqueItems": true
159
+ },
160
+ "timeoutSeconds": {
161
+ "type": "integer",
162
+ "minimum": 1,
163
+ "maximum": 300
164
+ },
165
+ "attempts": {
166
+ "type": "integer",
167
+ "minimum": 1,
168
+ "maximum": 20
169
+ }
170
+ },
171
+ "required": [
172
+ "type",
173
+ "scheme",
174
+ "port",
175
+ "path",
176
+ "expectedStatuses",
177
+ "timeoutSeconds",
178
+ "attempts"
179
+ ],
180
+ "additionalProperties": false
181
+ },
182
+ {
183
+ "type": "object",
184
+ "properties": {
185
+ "type": {
186
+ "const": "none"
187
+ }
188
+ },
189
+ "required": [
190
+ "type"
191
+ ],
192
+ "additionalProperties": false
193
+ }
194
+ ]
195
+ },
196
+ "environment": {
197
+ "type": "object",
198
+ "minProperties": 1,
199
+ "patternProperties": {
200
+ "^[A-Za-z_][A-Za-z0-9_]*$": {
201
+ "type": "string",
202
+ "maxLength": 1000,
203
+ "pattern": "^[^\\u0000-\\u001f\\u007f]*$"
204
+ }
205
+ },
206
+ "additionalProperties": false
207
+ },
208
+ "secretRefs": {
209
+ "type": "array",
210
+ "items": {
211
+ "$ref": "common.schema.json#/$defs/secretReference"
212
+ },
213
+ "uniqueItems": true
214
+ }
215
+ },
216
+ "required": [
217
+ "application",
218
+ "repository",
219
+ "runtime",
220
+ "deployment",
221
+ "service",
222
+ "healthCheck"
223
+ ],
224
+ "additionalProperties": false
225
+ }
226
+ },
227
+ "required": [
228
+ "apiVersion",
229
+ "kind",
230
+ "metadata",
231
+ "spec"
232
+ ],
233
+ "additionalProperties": false
234
+ }
@@ -0,0 +1,53 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://cloudfall.internal/schemas/v1/deployment-receipt.schema.json",
4
+ "title": "Cloudfall domain deployment receipt",
5
+ "type": "object",
6
+ "properties": {
7
+ "apiVersion": {
8
+ "$ref": "common.schema.json#/$defs/apiVersion"
9
+ },
10
+ "kind": {
11
+ "const": "DeploymentReceipt"
12
+ },
13
+ "metadata": {
14
+ "$ref": "common.schema.json#/$defs/metadata"
15
+ },
16
+ "spec": {
17
+ "type": "object",
18
+ "properties": {
19
+ "domain": {
20
+ "$ref": "common.schema.json#/$defs/resourceId"
21
+ },
22
+ "server": {
23
+ "$ref": "common.schema.json#/$defs/resourceId"
24
+ },
25
+ "deployedAt": {
26
+ "type": "string",
27
+ "format": "date-time"
28
+ },
29
+ "configurationPath": {
30
+ "$ref": "common.schema.json#/$defs/absolutePath"
31
+ },
32
+ "configurationSha256": {
33
+ "$ref": "common.schema.json#/$defs/sha256"
34
+ }
35
+ },
36
+ "required": [
37
+ "domain",
38
+ "server",
39
+ "deployedAt",
40
+ "configurationPath",
41
+ "configurationSha256"
42
+ ],
43
+ "additionalProperties": false
44
+ }
45
+ },
46
+ "required": [
47
+ "apiVersion",
48
+ "kind",
49
+ "metadata",
50
+ "spec"
51
+ ],
52
+ "additionalProperties": false
53
+ }