:-'Generic Commit'

This commit is contained in:
Your Name
2025-05-28 22:47:30 +12:00
parent 03ce71ecbe
commit f875d76103
4 changed files with 10 additions and 309 deletions

View File

@ -12,13 +12,13 @@ if [ ! -f "${DROPSHELL_BUILD_DIR}/dropshell-build.sh" ]; then
echo "Error: dropshell-build.sh not found"
exit 1
fi
if [ ! -f "${DROPSHELL_BUILD_DIR}/install_host.sh" ]; then
echo "Error: install_host.sh not found"
if [ ! -f "${DROPSHELL_BUILD_DIR}/install_dropshell_build_host.sh" ]; then
echo "Error: install_dropshell_build_host.sh not found"
exit 1
fi
# install host dependencies
"${DROPSHELL_BUILD_DIR}/install_host.sh"
"${DROPSHELL_BUILD_DIR}/install_dropshell_build_host.sh"
# run the build script

View File

@ -19,7 +19,10 @@ bool GetbinClient::download(const std::string& toolName, const std::string& arch
httplib::SSLClient cli(SERVER_HOST, 443);
std::string object_path = "/object/" + toolName + ":" + arch;
auto res = cli.Get(object_path.c_str());
if (!res || res->status != 200) return false;
if (!res || res->status != 200) {
std::cerr << "[GetbinClient::download] HTTP request failed (no response)." << std::endl;
return false;
}
std::ofstream ofs(outPath, std::ios::binary);
if (!ofs) return false;
ofs.write(res->body.data(), res->body.size());
@ -27,7 +30,7 @@ bool GetbinClient::download(const std::string& toolName, const std::string& arch
}
bool GetbinClient::upload(const std::string& archivePath, std::string& outUrl, std::string& outHash, const std::string& token) {
httplib::SSLClient cli(SERVER_HOST);
httplib::SSLClient cli(SERVER_HOST,443);
httplib::MultipartFormDataItems items;
// Read file
std::ifstream ifs(archivePath, std::ios::binary);
@ -47,6 +50,8 @@ bool GetbinClient::upload(const std::string& archivePath, std::string& outUrl, s
items.push_back({"metadata", metadata.dump(), "", "application/json"});
httplib::Headers headers = { {"Authorization", "Bearer " + token} };
//cli.enable_server_certificate_verification(false); // TEMPORARY
cli.set_ca_cert_path("/etc/ssl/certs/ca-certificates.crt");
auto res = cli.Put("/upload", headers, items);
if (!res) {
std::cerr << "[GetbinClient::upload] HTTP request failed (no response)." << std::endl;

Binary file not shown.