You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-1Lines changed: 33 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -193,8 +193,11 @@ Default configure file `overlaybd.json` is installed to `/etc/overlaybd/`.
193
193
| gzipCacheConfig.cacheSizeGB | The max size of cache, in GB. |
194
194
| gzipCacheConfig.refillSize | The refill size from source, in byte. `262144` is default (256 KB). |
195
195
| credentialFilePath(legacy) | The credential used for fetching images on registry. `/opt/overlaybd/cred.json` is the default value. |
196
-
| credentialConfig.mode | Authentication mode for lazy-loading. <br> - `file` means reading credential from `credentialConfig.path`. <br> - `http` means sending an http request to `credentialConfig.path`|
196
+
| credentialConfig.mode | Authentication mode for lazy-loading. <br> - `file` means reading credential from `credentialConfig.path`. <br> - `http` means sending an http request to `credentialConfig.path`<br> - `https` means sending an https request to `credentialConfig.path`, with optional client certificate authentication and CA pinning |
197
197
| credentialConfig.path | credential file path or url which is determined by `mode`|
198
+
| credentialConfig.client_cert_path | Optional. Path to the client certificate file (`https` mode). May contain the private key in the same PEM file. |
199
+
| credentialConfig.client_key_path | Optional. Path to the client private key file (`https` mode). Only needed when the key is separate from the certificate. |
200
+
| credentialConfig.server_ca_path | Optional. Path to the CA certificate used to verify the server (`https` mode). If omitted, the system CA bundle is used. When set, **only** this CA file is trusted. |
198
201
| download.enable | Whether background downloading is enabled or not. |
199
202
| download.delay | The seconds waiting to start downloading task after the overlaybd device launched. |
200
203
| download.delayExtra | A random extra delay is attached to delay, avoiding too many tasks started at the same time. |
@@ -293,6 +296,35 @@ Overlaybd supports serveral credential mode. Here are some example `credentialCo
293
296
```
294
297
we write a sample http server in `test/simple_auth_server.cpp`
295
298
299
+
- mode **https**
300
+
301
+
the `credentialConfig.path` should be an HTTPS server listening address. Unlike `http` mode, the `https://` scheme prefix must be included in the path (e.g. `https://localhost:19876/auth`). The optional `client_cert_path`/`client_key_path` fields enable client certificate authentication, and `server_ca_path` pins trust to a specific CA. For a local auth server, providing all three fields secures communication exclusively with that server (mutual TLS).
302
+
303
+
```json
304
+
#### /etc/overlaybd/config.json ####
305
+
{
306
+
"logLevel": 1,
307
+
"logPath": "/var/log/overlaybd.log",
308
+
...
309
+
"credentialConfig": {
310
+
"mode": "https",
311
+
"path": "https://localhost:19876/auth",
312
+
"client_cert_path": "/etc/overlaybd/client.crt",
313
+
"client_key_path": "/etc/overlaybd/client.key",
314
+
"server_ca_path": "/etc/overlaybd/ca.crt"
315
+
},
316
+
...
317
+
}
318
+
```
319
+
overlaybd will send an https request with mTLS to the server with `remote_url` like this:
320
+
> GET "https://localhost:19876/auth?remote_url=https://hub.docker.com/v2/overlaybd/ubuntu/blobs/sha256:47e63559a8487efb55b2f1ccea9cfc04110a185c49785fdf1329d1ea462ce5f0"
321
+
the server response format is the same as the `http` mode.
322
+
323
+
All three TLS fields are optional and independently configured:
324
+
-`client_cert_path` sets the client certificate. If the PEM file also contains the private key, `client_key_path` can be omitted.
325
+
-`client_key_path` sets the client private key. Only needed when the key is in a separate file from the certificate.
326
+
- If `server_ca_path` is omitted, the system CA bundle is used to verify the server certificate. When `server_ca_path` is set, **only** the specified CA file is used — the system CA bundle is not consulted.
0 commit comments