Skip to content

Commit ef23662

Browse files
Added support for changing config via API
closes #268, closes #698 Signed-off-by: Petu Eusebiu <[email protected]>
1 parent f9f388f commit ef23662

33 files changed

+1826
-922
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ TESTDATA := $(TOP_LEVEL)/test/data
1919
OS ?= linux
2020
ARCH ?= amd64
2121
BENCH_OUTPUT ?= stdout
22-
EXTENSIONS ?= sync,search,scrub,metrics,ui_base,lint
22+
EXTENSIONS ?= sync,search,scrub,metrics,ui_base,lint,config
2323
comma:= ,
2424
hyphen:= -
2525
extended-name:=

examples/config-allextensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
"level": "debug"
1212
},
1313
"extensions": {
14+
"sysconfig": {
15+
"enable": true
16+
},
1417
"metrics": {},
1518
"sync": {
1619
"credentialsFile": "./examples/sync-auth-filepath.json",

examples/config-anonymous-authz.json

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,30 @@
88
"port": "8080",
99
"realm": "zot",
1010
"accessControl": {
11-
"**": {
12-
"anonymousPolicy": [
13-
"read",
14-
"create"
15-
]
16-
},
17-
"tmp/**": {
18-
"anonymousPolicy": [
19-
"read",
20-
"create",
21-
"update"
22-
]
23-
},
24-
"infra/**": {
25-
"anonymousPolicy": [
26-
"read"
27-
]
28-
},
29-
"repos2/repo": {
30-
"anonymousPolicy": [
31-
"read"
32-
]
11+
"repositories": {
12+
"**": {
13+
"anonymousPolicy": [
14+
"read",
15+
"create"
16+
]
17+
},
18+
"tmp/**": {
19+
"anonymousPolicy": [
20+
"read",
21+
"create",
22+
"update"
23+
]
24+
},
25+
"infra/**": {
26+
"anonymousPolicy": [
27+
"read"
28+
]
29+
},
30+
"repos2/repo": {
31+
"anonymousPolicy": [
32+
"read"
33+
]
34+
}
3335
}
3436
}
3537
},

examples/config-cfg-extension.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"distspecversion": "1.0.1-dev",
3+
"extensions": {
4+
"sysconfig": {
5+
"enable": true
6+
}
7+
},
8+
"http": {
9+
"accesscontrol": {
10+
"adminpolicy": {
11+
"actions": [
12+
"read",
13+
"create",
14+
"update",
15+
"delete"
16+
],
17+
"users": [
18+
"sebi"
19+
]
20+
}
21+
},
22+
"address": "127.0.0.1",
23+
"auth": {
24+
"htpasswd": {
25+
"path": "/home/peusebiu/htpasswd"
26+
}
27+
},
28+
"port": "5000"
29+
},
30+
"log": {
31+
"level": "debug"
32+
},
33+
"storage": {
34+
"rootdirectory": "/tmp/zot"
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"distspecversion": "1.0.1-dev",
3+
"extensions": {
4+
"sysconfig": {
5+
"enable": true
6+
}
7+
},
8+
"http": {
9+
"accesscontrol": {
10+
"adminpolicy": {
11+
"actions": [
12+
"read",
13+
"create",
14+
"update",
15+
"delete"
16+
],
17+
"users": [
18+
"sebi"
19+
]
20+
}
21+
},
22+
"address": "127.0.0.1",
23+
"auth": {
24+
"htpasswd": {
25+
"path": "/home/peusebiu/htpasswd"
26+
}
27+
},
28+
"port": "5000"
29+
},
30+
"log": {
31+
"level": "debug"
32+
},
33+
"storage": {
34+
"rootdirectory": "/tmp/zot"
35+
}
36+
}

examples/config-cve.json.bkp.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"distspecversion": "1.0.1-dev",
3+
"extensions": {
4+
"search": {
5+
"cve": {
6+
"updateinterval": "24h"
7+
},
8+
"enable": true
9+
}
10+
},
11+
"http": {
12+
"address": "127.0.0.1",
13+
"port": "8080"
14+
},
15+
"log": {
16+
"level": "debug"
17+
},
18+
"storage": {
19+
"rootdirectory": "/tmp/zot"
20+
}
21+
}

0 commit comments

Comments
 (0)