🌳
pt0/deployF/k8sF/initialSetupF/regcacheF/zotCfgAI.mts
3const upstreamUrlH: Record<string, string> = {
4 'docker.io': 'https://registry-1.docker.io',
5 'ghcr.io': 'https://ghcr.io',
6 'quay.io': 'https://quay.io',
7 'registry.k8s.io': 'https://registry.k8s.io',
8 'gcr.io': 'https://gcr.io',
9}
11export const regcacheRegUser = 'reguser'
13export const getZotCfgJson = () => JSON.stringify({
14 distSpecVersion: '1.1.1',
15 storage: {rootDirectory: '/var/lib/registry', dedupe: true, gc: true, gcDelay: '1h', gcInterval: '1h'},
16 http: {
17 address: '0.0.0.0', port: '8080', compat: ['docker2s2'],
18 auth: {
19 htpasswd: {path: '/auth/htpasswd'},
20 failDelay: 5,
21 },
22 accessControl: {
23 repositories: Object.fromEntries([
24 ...upstreamRegHosts.map((host) => [`${host}/**`, {anonymousPolicy: ['read'], defaultPolicy: []}]),
25 ['**', {defaultPolicy: []}],
26 ]),
27 adminPolicy: {users: [regcacheRegUser], actions: ['read', 'create', 'update', 'delete']},
28 },
29 },
30 log: {level: 'info'},
31 extensions: {
32 sync: {
33 enable: true,
34 registries: upstreamRegHosts.map((host) => ({
35 urls: [upstreamUrlH[host]],
36 onDemand: true,
37 tlsVerify: true,
38 preserveDigest: true,
39 maxRetries: 3,
40 retryDelay: '1m',
41 content: [{prefix: '**', destination: `/${host}`}],
42 })),
43 },
44 },
45}, null, 2)