Dobby
3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
|
Used to set http proxy environment variables and optionally add additional root ca certificates to the container. More...
#include <HttpProxyPlugin.h>
Public Member Functions | |
HttpProxyPlugin (std::shared_ptr< rt_dobby_schema > &containerConfig, const std::shared_ptr< DobbyRdkPluginUtils > &utils, const std::string &rootfsPath) | |
std::string | name () const override |
Should return the name of the plugin. More... | |
unsigned | hookHints () const override |
Set the bit flags for which hooks we're going to use. More... | |
bool | postInstallation () override |
Dobby Hook - run in host namespace once when container bundle is downloaded. | |
bool | preCreation () override |
Dobby Hook - run in host namespace before container creation process. | |
bool | postHalt () override |
Dobby Hook - Run in host namespace when container terminates. | |
std::vector< std::string > | getDependencies () const override |
Should return the names of the plugins this plugin depends on. More... | |
Public Member Functions inherited from RdkPluginBase | |
virtual bool | createRuntime () |
virtual bool | createContainer () |
virtual bool | postStart () |
virtual bool | postStop () |
Private Member Functions | |
bool | setupHttpProxy () |
Adds the httpproxy and no_proxy environment variables to the container. More... | |
bool | addProxyToRootCABundle () |
Adds the proxy's CA cert to the bundle used by the container. More... | |
bool | cleanup () |
Cleans up any temp ca-certifice.crt files created for the container. More... | |
bool | addCACertificateMount () |
Adds a mount to the new ca-certificates.crt file created in the container's bundle directory in the preCreation hook. More... | |
Private Attributes | |
bool | mValid |
const std::string | mName |
std::shared_ptr< rt_dobby_schema > | mContainerConfig |
const std::string | mMountedCACertsPath |
const rt_defs_plugins_http_proxy_data * | mPluginData |
const std::shared_ptr< DobbyRdkPluginUtils > | mUtils |
Additional Inherited Members | |
Public Types inherited from IDobbyRdkPlugin | |
enum | HintFlags : unsigned { PostInstallationFlag = (1 << 0) , PreCreationFlag = (1 << 1) , CreateRuntimeFlag = (1 << 2) , CreateContainerFlag = (1 << 3) , PostStartFlag = (1 << 5) , PostHaltFlag = (1 << 6) , PostStopFlag = (1 << 7) , Unknown = 0 } |
Bit flags that should be returned by hookHints. More... | |
Used to set http proxy environment variables and optionally add additional root ca certificates to the container.
It sets the http_proxy and no_proxy environment variables based on the plugin data. And if a root CA certificate is included in the plugin data it will append that onto the end of the /etc/ssl/certs/ca-certificates.crt file.
|
private |
Adds a mount to the new ca-certificates.crt file created in the container's bundle directory in the preCreation hook.
|
private |
Adds the proxy's CA cert to the bundle used by the container.
It copies the existing /etc/ssl/certs/ca-certificates.crt file to the container bundle location and then appends the supplied .crt / .pem certificate to it.
It then adds a bind mount to the container start-up so that we overlay the modified the file into the container.
|
private |
Cleans up any temp ca-certifice.crt files created for the container.
|
overridevirtual |
Should return the names of the plugins this plugin depends on.
This can be used to determine the order in which the plugins should be processed when running hooks.
Reimplemented from RdkPluginBase.
|
overridevirtual |
Set the bit flags for which hooks we're going to use.
This plugin uses all the hooks so set all the flags
Implements IDobbyRdkPlugin.
|
inlineoverridevirtual |
Should return the name of the plugin.
Implements IDobbyRdkPlugin.
|
private |
Adds the httpproxy and no_proxy environment variables to the container.