@@ -63,6 +63,12 @@ ComposeAppManager::Config::Config(const PackageConfig& pconfig) {
6363 if (raw.count (" composectl_bin" ) == 1 ) {
6464 composectl_bin = raw.at (" composectl_bin" );
6565 }
66+ if (raw.count (" compose_apps_proxy" ) == 1 ) {
67+ apps_proxy = raw.at (" compose_apps_proxy" );
68+ }
69+ if (raw.count (" compose_apps_proxy_ca" ) == 1 ) {
70+ apps_proxy_ca = raw.at (" compose_apps_proxy_ca" );
71+ }
6672#endif // USE_COMPOSEAPP_ENGINE
6773
6874 if (raw.count (" docker_prune" ) == 1 ) {
@@ -145,10 +151,24 @@ ComposeAppManager::ComposeAppManager(const PackageConfig& pconfig, const Bootloa
145151 }
146152#ifdef USE_COMPOSEAPP_ENGINE
147153 const auto composectl_cmd{boost::filesystem::canonical (cfg_.composectl_bin ).string ()};
154+ composeapp::ProxyProvider proxy{nullptr };
155+ if (!cfg_.apps_proxy .empty ()) {
156+ proxy = [this ]() {
157+ std::string proxy_url;
158+ const auto & proxyUrlResp{http_->post (cfg_.apps_proxy , " " )};
159+ if (proxyUrlResp.isOk ()) {
160+ proxy_url = proxyUrlResp.body ;
161+ LOG_DEBUG << " Got app proxy URL: " << proxy_url;
162+ } else {
163+ LOG_ERROR << " Failed to obtain proxy URL: " << proxyUrlResp.getStatusStr ();
164+ }
165+ return std::make_pair (proxy_url, cfg_.apps_proxy_ca );
166+ };
167+ }
148168 app_engine_ = std::make_shared<composeapp::AppEngine>(
149169 cfg_.reset_apps_root , cfg_.apps_root , cfg_.images_data_root , registry_client,
150170 std::make_shared<Docker::DockerClient>(), docker_host, compose_cmd, composectl_cmd, cfg_.storage_watermark ,
151- Docker::RestorableAppEngine::GetDefStorageSpaceFunc (cfg_.storage_watermark ));
171+ Docker::RestorableAppEngine::GetDefStorageSpaceFunc (cfg_.storage_watermark ), nullptr , true , " " , proxy );
152172#else
153173 const std::string skopeo_cmd{boost::filesystem::canonical (cfg_.skopeo_bin ).string ()};
154174 app_engine_ = std::make_shared<Docker::RestorableAppEngine>(
0 commit comments