-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconstants.py
More file actions
177 lines (163 loc) · 6.7 KB
/
constants.py
File metadata and controls
177 lines (163 loc) · 6.7 KB
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
import os
from pathlib import Path
ARCHS = ["amd64", "arm64"]
# GardenLinux "bare" feature
BARE_FLAVOR_FEATURE_CONTENT = {"description": "Bare flavor", "type": "platform"}
BARE_FLAVOR_LIBC_FEATURE_CONTENT = {
"description": "Bare libc feature",
"type": "element",
}
# GardenLinux flavors schema for validation
GL_FLAVORS_SCHEMA = {
"type": "object",
"version": {"type": "integer"},
"properties": {
"targets": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {"type": "string"},
"category": {"type": "string"},
"flavors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"features": {
"type": "array",
"items": {"type": "string"},
},
"arch": {"type": "string"},
"build": {"type": "boolean"},
"test": {"type": "boolean"},
"test-platform": {"type": "boolean"},
"publish": {"type": "boolean"},
},
"required": [
"features",
"arch",
"build",
"test",
"test-platform",
"publish",
],
},
},
},
"required": ["name", "category", "flavors"],
},
},
},
"required": ["targets"],
}
# It is important that this list is sorted in descending length of the entries
GL_MEDIA_TYPES = [
"secureboot.aws-efivars",
"secureboot.kek.auth",
"secureboot.pk.auth",
"secureboot.kek.crt",
"secureboot.kek.der",
"secureboot.db.auth",
"firecracker.tar.gz",
"secureboot.pk.crt",
"secureboot.pk.der",
"secureboot.db.crt",
"secureboot.db.der",
"secureboot.db.arn",
"platform.test.log",
"platform.test.xml",
"gcpimage.tar.gz",
"chroot.test.log",
"chroot.test.xml",
"initrd.unified",
"root.squashfs",
"requirements",
"pxe.tar.gz",
"test-log",
"squashfs",
"manifest",
"vmlinuz",
"cmdline",
"release",
"initrd",
"tar.gz",
"qcow2",
"tar",
"iso",
"oci",
"vhd",
"vmdk",
"ova",
"efi",
"uki",
"raw",
"log",
]
GL_MEDIA_TYPE_LOOKUP = {
"tar": "application/io.gardenlinux.image.archive.format.tar",
"tar.gz": "application/io.gardenlinux.image.archive.format.tar.gz",
"log": "application/io.gardenlinux.log",
"pxe.tar.gz": "application/io.gardenlinux.image.archive.format.pxe.tar.gz",
"iso": "application/io.gardenlinux.image.archive.format.iso",
"oci": "application/io.gardenlinux.image.archive.format.oci",
"firecracker.tar.gz": "application/io.gardenlinux.image.archive.format.firecracker.tar.gz",
"qcow2": "application/io.gardenlinux.image.format.qcow2",
"vhd": "application/io.gardenlinux.image.format.vhd",
"gcpimage.tar.gz": "application/io.gardenlinux.image.format.gcpimage.tar.gz",
"vmdk": "application/io.gardenlinux.image.format.vmdk",
"ova": "application/io.gardenlinux.image.format.ova",
"requirements": "application/io.gardenlinux.image.requirements",
"efi": "application/io.gardenlinux.efi",
"uki": "application/io.gardenlinux.uki",
"raw": "application/io.gardenlinux.image.archive.format.raw",
"test-log": "application/io.gardenlinux.test-log",
"manifest": "application/io.gardenlinux.manifest",
"release": "application/io.gardenlinux.release",
"vmlinuz": "application/io.gardenlinux.kernel",
"initrd": "application/io.gardenlinux.initrd",
"cmdline": "application/io.gardenlinux.cmdline",
"initrd.unified": "application/io.gardenlinux.initrd",
"root.squashfs": "application/io.gardenlinux.squashfs",
"squashfs": "application/io.gardenlinux.squashfs",
"platform.test.log": "application/io.gardenlinux.io.platform.test.log",
"platform.test.xml": "application/io.gardenlinux.io.platform.test.xml",
"chroot.test.log": "application/io.gardenlinux.io.chroot.test.log",
"chroot.test.xml": "application/io.gardenlinux.io.chroot.test.xml",
"secureboot.pk.crt": "application/io.gardenlinux.cert.secureboot.pk.crt",
"secureboot.pk.der": "application/io.gardenlinux.cert.secureboot.pk.der",
"secureboot.pk.auth": "application/io.gardenlinux.cert.secureboot.pk.auth",
"secureboot.kek.crt": "application/io.gardenlinux.cert.secureboot.kek.crt",
"secureboot.kek.der": "application/io.gardenlinux.cert.secureboot.kek.der",
"secureboot.kek.auth": "application/io.gardenlinux.cert.secureboot.kek.auth",
"secureboot.db.crt": "application/io.gardenlinux.cert.secureboot.db.crt",
"secureboot.db.der": "application/io.gardenlinux.cert.secureboot.db.der",
"secureboot.db.auth": "application/io.gardenlinux.cert.secureboot.db.auth",
"secureboot.db.arn": "application/io.gardenlinux.cert.secureboot.db.arn",
"secureboot.aws-efivars": "application/io.gardenlinux.cert.secureboot.aws-efivars",
}
GL_BUG_REPORT_URL = "https://github.com/gardenlinux/gardenlinux/issues"
GL_COMMIT_SPECIAL_VALUES = ("local",)
GL_DEB_REPO_BASE_URL = "https://packages.gardenlinux.io/gardenlinux"
GL_DISTRIBUTION_NAME = "Garden Linux"
GL_HOME_URL = "https://gardenlinux.io"
GL_PLATFORM_FRANKENSTEIN = "frankenstein"
GL_RELEASE_ID = "gardenlinux"
GL_REPOSITORY_URL = "https://github.com/gardenlinux/gardenlinux"
GL_SUPPORT_URL = "https://github.com/gardenlinux/gardenlinux"
OCI_ANNOTATION_SIGNATURE_KEY = "io.gardenlinux.oci.signature"
OCI_ANNOTATION_SIGNED_STRING_KEY = "io.gardenlinux.oci.signed-string"
OCI_IMAGE_INDEX_MEDIA_TYPE = "application/vnd.oci.image.index.v1+json"
RELEASE_ID_FILE = ".github_release_id"
REQUESTS_TIMEOUTS = (5, 60) # connect, read
S3_DOWNLOADS_DIR = Path(os.path.dirname(__file__)) / ".." / "s3_downloads"
GARDENLINUX_GITHUB_RELEASE_BUCKET_NAME = "gardenlinux-github-releases"
GLVD_BASE_URL = "https://security.gardenlinux.org/v1"
PODMAN_CONNECTION_MAX_IDLE_SECONDS = 3
PODMAN_FS_CHANGE_ADDED = "added"
PODMAN_FS_CHANGE_DELETED = "deleted"
PODMAN_FS_CHANGE_MODIFIED = "modified"
PODMAN_FS_CHANGE_UNSUPPORTED = "unsupported"
# https://github.com/gardenlinux/gardenlinux/issues/3044
# Empty string is the 'legacy' variant with traditional root fs and still needed/supported
IMAGE_VARIANTS = ["", "_usi", "_tpm2_trustedboot"]