diff --git a/README.md b/README.md index 84f8972..af529b9 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,8 @@ For more information on how to generate these files, please consult the official [Docker documentation](https://docs.docker.com/engine/security/protect-access/). The files can be uploaded to the device using HTTP. -The dockerd service will restart, or try to start, after each HTTP POST request. +The request will be rejected if the file being uploaded has the incorrect header or footer for that file type. +The dockerd service will restart, or try to start, after each successful HTTP POST request. ```sh curl --anyauth -u "root:$DEVICE_PASSWORD" -F file=@ca.pem -X POST \ @@ -209,6 +210,21 @@ has a significantly higher inference time when using a small and slow SD card. To get more informed about specifications, check the [SD Card Standards](https://www.sdcard.org/developers/sd-standard-overview/). +## Additional configuration + +For even more control over the dockerd daemon, +a configuration file can be uploaded to the device using HTTP. + +```sh +curl --anyauth -u "root:$DEVICE_PASSWORD" -F file=@daemon.json -X POST \ + http://$DEVICE_IP/local/dockerdwrapper/daemon.json +``` + +The complete specification of this file can be found in the Docker reference, in section +[Daemon configuration file](https://docs.docker.com/reference/cli/dockerd/#daemon-configuration-file). + +The dockerd service will automatically restart after a new configuration file has been uploaded. + ## Using the Docker ACAP The Docker ACAP does not contain the docker client binary. This means that all diff --git a/app/app_paths.h b/app/app_paths.h index a25d300..361992b 100644 --- a/app/app_paths.h +++ b/app/app_paths.h @@ -2,3 +2,5 @@ #define APP_DIRECTORY "/usr/local/packages/" APP_NAME #define APP_LOCALDATA APP_DIRECTORY "/localdata" + +#define DAEMON_JSON "daemon.json" diff --git a/app/dockerdwrapper.c b/app/dockerdwrapper.c index 1fc11fd..d163a66 100644 --- a/app/dockerdwrapper.c +++ b/app/dockerdwrapper.c @@ -487,7 +487,7 @@ static bool start_dockerd(const struct settings* settings, struct app_state* app args_len - args_offset, "%s %s", "dockerd", - "--config-file " APP_LOCALDATA "/daemon.json"); + "--config-file " APP_LOCALDATA "/" DAEMON_JSON); g_strlcpy(msg, "Starting dockerd", msg_len); diff --git a/app/html/index.html b/app/html/index.html index 60412d6..54261c6 100644 --- a/app/html/index.html +++ b/app/html/index.html @@ -15,5 +15,10 @@
+ curl --anyauth -u $DEVICE_USER:$DEVICE_PASSWORD http://$DEVICE_IP/local/dockerdwrapper/daemon.json
+ curl --anyauth -u $DEVICE_USER:$DEVICE_PASSWORD -F file=@daemon.json -X POST http://$DEVICE_IP/local/dockerdwrapper/daemon.json.pem
+